From 91cd66b8dc248ca82ed27e2fe35017d08ae9b52c Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Fri, 17 Oct 2025 18:03:07 -0700 Subject: [PATCH] UI new build --- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 .../static/chunks/1052-bdb89c881be4619e.js | 1 - .../static/chunks/1160-08491effeedbaae3.js | 2 +- .../static/chunks/1160-3efb81c958413447.js | 1 - .../static/chunks/1307-3d9ef20b529a0edc.js | 1 + .../static/chunks/1307-6bc3bb770f5b2b05.js | 1 - .../static/chunks/131-79aa7086799152a2.js | 1 - .../static/chunks/131-8304bcbbae03bc10.js | 1 + .../static/chunks/1529-130888c02463f3dd.js | 2 +- .../static/chunks/1529-e0933e3af843b646.js | 1 - .../static/chunks/2012-753dae634313855c.js | 1 - .../static/chunks/2012-8ba1526768e30ef5.js | 1 + .../static/chunks/2012-90188715a5858c8c.js | 1 - .../static/chunks/2284-4cbc9a7f33eb7c89.js | 1 - .../static/chunks/2284-6840f6cabd9dbd7e.js | 1 + ...738d6439ab.js => 2344-17c84cab77fa632a.js} | 2 +- ...4511237d25.js => 3250-f8c476289792167a.js} | 2 +- .../static/chunks/3298-0debe247d04c451b.js | 1 + .../static/chunks/3298-ad776747b5eff3ae.js | 1 - ...7ea3d68f19.js => 3603-dd19ac8e31e4bc25.js} | 2 +- ...b1e9c58f8a.js => 3669-6e17d59477ade8ac.js} | 2 +- .../static/chunks/4292-3e30cf0761abb900.js | 1 - .../static/chunks/4292-a1bc4327d9a3d829.js | 2 +- .../static/chunks/4292-c9a41dd3c8f6925a.js | 1 - ...2ec448789d.js => 5105-e9f08a6b3a1f2881.js} | 2 +- .../static/chunks/6494-7124dea6b90175e7.js | 1 - .../static/chunks/6494-938b4af798279e4a.js | 1 + .../static/chunks/6925-9e2db5c132fe9053.js | 1 - .../static/chunks/6925-b4f07277f285ca48.js | 1 + .../static/chunks/7155-56eb798322f1faf7.js | 1 + .../static/chunks/7155-95101d73b2137e92.js | 1 - .../static/chunks/7801-2b5492cdeacaedc4.js | 1 + .../static/chunks/7801-631ca879181868d8.js | 1 - .../static/chunks/8160-292eaad6e0da51a9.js | 1 + .../static/chunks/8160-978f9adc46a12a56.js | 1 - .../static/chunks/874-728ff7d42c7bffc9.js | 1 - .../static/chunks/874-e84ea35ec9a8042c.js | 1 + .../static/chunks/9681-49ea01accf85cac1.js | 1 + .../static/chunks/9883-85b2991f131b4416.js | 1 - .../api-reference/page-c04f26edd6161f83.js | 5 - .../api-reference/page-e1b30f2f59900b67.js | 1 + .../api-playground/page-2e10f494907c6a63.js | 1 - .../api-playground/page-9890fc550d55b49b.js | 2 +- ...7fbd844fd3.js => page-712ccbc9bd44a5ae.js} | 2 +- ...9a9fd51fe8.js => page-34cb1817eb6914a2.js} | 2 +- .../old-usage/page-755c4cefc4b9c65c.js | 1 - .../old-usage/page-dc75946e58de809e.js | 2 +- .../old-usage/page-f16a8ef298a13ef7.js | 1 - ...e98f982bcc.js => page-2608594fa934affa.js} | 2 +- .../tag-management/page-1da0c9dcc6fabf28.js | 5 - .../tag-management/page-30215d565ccd90ac.js | 1 + ...1139d5678e.js => page-229122aa339dc574.js} | 2 +- .../(dashboard)/layout-0374fe6c07ff896f.js | 1 - .../(dashboard)/layout-5326607dcd905fe4.js | 2 +- .../(dashboard)/logs/page-009011bc6f8bc171.js | 5 - .../page-5019bcc8a011ed8c.js} | 2 +- ...c7e128e2f2.js => page-28a4881b81368e36.js} | 2 +- .../page-50ce8c6bb2821738.js | 5 - .../page-5b4a740f9549ae1e.js | 1 + .../organizations/page-388c7d5731acf363.js | 1 + .../organizations/page-3f42c10932338e71.js | 5 - ...8bc569d74f.js => page-bf35b8b5ac73a485.js} | 2 +- .../page-4bba68ba957e2904.js | 1 + .../page-985e0bf863f7d9e2.js | 1 - ...97618b643c.js => page-bb2dff1be677bb71.js} | 2 +- ...301189ad65.js => page-74e4c4e7aa9329ea.js} | 2 +- .../teams/page-7a73148e728ec98a.js | 1 - .../teams/page-a69ee3fd18d83caf.js | 1 - .../teams/page-e8dfff543471e450.js | 2 +- .../test-key/page-1870641393210367.js | 1 + .../test-key/page-a89ea5aaed337567.js | 1 - .../mcp-servers/page-2fd597d070592ae4.js | 2 +- .../mcp-servers/page-91876f4e21ac7596.js | 1 - .../vector-stores/page-2c5e185717ef32c7.js | 2 +- .../usage/page-0087e951a6403a40.js | 5 - .../usage/page-af5d7ad6e47d0b01.js | 1 + ...4f9323e706.js => page-c5cc93238455fee0.js} | 2 +- .../virtual-keys/page-5f39dca6d04896e2.js | 1 - ...0fb324f811.js => page-a060a80d56f4f360.js} | 2 +- .../chunks/app/page-68c2ba55fce8629a.js | 1 - .../chunks/app/page-92ab3a1095e26dca.js | 2 +- .../chunks/app/page-d7c5dbe555bb16a5.js | 1 - .../_experimental/out/api-reference.html | 2 +- .../proxy/_experimental/out/api-reference.txt | 6 +- .../out/experimental/api-playground.html | 2 +- .../out/experimental/api-playground.txt | 6 +- .../out/experimental/budgets.html | 2 +- .../out/experimental/budgets.txt | 6 +- .../out/experimental/caching.html | 2 +- .../out/experimental/caching.txt | 6 +- .../out/experimental/old-usage.html | 2 +- .../out/experimental/old-usage.txt | 6 +- .../out/experimental/prompts.html | 2 +- .../out/experimental/prompts.txt | 6 +- .../out/experimental/tag-management.html | 2 +- .../out/experimental/tag-management.txt | 6 +- .../proxy/_experimental/out/guardrails.html | 6 +- .../proxy/_experimental/out/guardrails.txt | 6 +- litellm/proxy/_experimental/out/index.html | 2 +- litellm/proxy/_experimental/out/index.txt | 4 +- litellm/proxy/_experimental/out/logs.html | 2 +- litellm/proxy/_experimental/out/logs.txt | 6 +- .../proxy/_experimental/out/model-hub.html | 2 +- litellm/proxy/_experimental/out/model-hub.txt | 6 +- litellm/proxy/_experimental/out/model_hub.txt | 4 +- .../_experimental/out/model_hub_table.html | 2 +- .../_experimental/out/model_hub_table.txt | 4 +- .../out/models-and-endpoints.html | 2 +- .../out/models-and-endpoints.txt | 6 +- .../proxy/_experimental/out/onboarding.html | 2 +- .../proxy/_experimental/out/onboarding.txt | 4 +- .../_experimental/out/organizations.html | 2 +- .../proxy/_experimental/out/organizations.txt | 6 +- .../out/settings/admin-settings.html | 2 +- .../out/settings/admin-settings.txt | 6 +- .../out/settings/logging-and-alerts.html | 2 +- .../out/settings/logging-and-alerts.txt | 6 +- .../out/settings/router-settings.html | 2 +- .../out/settings/router-settings.txt | 6 +- .../_experimental/out/settings/ui-theme.html | 2 +- .../_experimental/out/settings/ui-theme.txt | 6 +- litellm/proxy/_experimental/out/teams.html | 2 +- litellm/proxy/_experimental/out/teams.txt | 6 +- litellm/proxy/_experimental/out/test-key.html | 2 +- litellm/proxy/_experimental/out/test-key.txt | 6 +- .../_experimental/out/tools/mcp-servers.html | 2 +- .../_experimental/out/tools/mcp-servers.txt | 6 +- .../out/tools/vector-stores.html | 2 +- .../_experimental/out/tools/vector-stores.txt | 6 +- litellm/proxy/_experimental/out/usage.html | 2 +- litellm/proxy/_experimental/out/usage.txt | 6 +- litellm/proxy/_experimental/out/users.html | 2 +- litellm/proxy/_experimental/out/users.txt | 6 +- .../proxy/_experimental/out/virtual-keys.html | 2 +- .../proxy/_experimental/out/virtual-keys.txt | 6 +- ui/litellm-dashboard/out/404.html | 1 - .../ZQ8CnOaEkWoWBRYVxXOow/_buildManifest.js | 1 - .../ZQ8CnOaEkWoWBRYVxXOow/_ssgManifest.js | 1 - .../static/chunks/1052-bdb89c881be4619e.js | 1 - .../static/chunks/1223-de5e7e4f043a5233.js | 1 - .../static/chunks/1264-2979d95e0b56a75c.js | 1 - .../static/chunks/1307-6bc3bb770f5b2b05.js | 1 - .../static/chunks/131-79aa7086799152a2.js | 1 - .../chunks/13b76428-e1bf383848c17260.js | 1 - .../static/chunks/1487-ada9ecf7dd9bca97.js | 1 - .../static/chunks/1491-8280340b5391aa11.js | 1 - .../static/chunks/1526-8e2976ed10cb2fa0.js | 1 - .../static/chunks/17-782feb91c41095ca.js | 1 - .../static/chunks/1739-f276f8d8fca7b189.js | 1 - .../static/chunks/1853-fa2eb7102429db88.js | 1 - .../static/chunks/2004-2c0ea663e63e0a2f.js | 1 - .../static/chunks/2012-753dae634313855c.js | 1 - .../static/chunks/2019-f91b853dc598350e.js | 1 - .../static/chunks/2052-68db39dea49a676f.js | 1 - .../static/chunks/2117-2da5ec8fad6a6c25.js | 2 - .../static/chunks/2162-70a154301fc81d42.js | 1 - .../static/chunks/2202-e8124587d6b0e623.js | 1 - .../static/chunks/226-81daaf8cff08ccfe.js | 1 - .../static/chunks/2273-0d0a74964599a0e2.js | 1 - .../static/chunks/2284-4cbc9a7f33eb7c89.js | 1 - .../static/chunks/2306-c9a553b697103491.js | 1 - .../static/chunks/2417-b28f330f82bf4a82.js | 1 - .../static/chunks/2525-13b137f40949dcf1.js | 4 - .../static/chunks/2662-51eb8b1bec576f6d.js | 1 - .../static/chunks/2926-b5dcad9f62f5e2b1.js | 1 - .../chunks/3014691f-702e24806fe9cec4.js | 1 - .../static/chunks/3250-3256164511237d25.js | 1 - .../static/chunks/3298-ad776747b5eff3ae.js | 1 - .../static/chunks/3603-b101c17ea3d68f19.js | 1 - .../static/chunks/3669-cbf664b1e9c58f8a.js | 1 - .../static/chunks/3709-b17db86e0ab325d2.js | 1 - .../static/chunks/3752-53808701995a5f10.js | 1 - .../static/chunks/3801-f50239dd6dee5df7.js | 1 - .../static/chunks/3866-e3419825a249263f.js | 1 - .../static/chunks/4696-2b10d95edaaa6de3.js | 1 - .../static/chunks/4851-fbdd7aec2937c09d.js | 1 - .../static/chunks/4924-e47559a81a4aa31c.js | 1 - .../static/chunks/5079-a43d5cc0d7429256.js | 1 - .../static/chunks/5105-eb18802ec448789d.js | 1 - .../static/chunks/5188-0e9d5e6db19ac9e6.js | 1 - .../static/chunks/527-d9b7316e990a0539.js | 1 - .../static/chunks/5319-43bd4ee5bb7e50d1.js | 1 - .../static/chunks/5809-1eb0022e0f1e4ee3.js | 1 - .../static/chunks/5830-47ce1a4897188f14.js | 1 - .../static/chunks/603-41b69f9ab68da547.js | 1 - .../static/chunks/6202-e6c424fe04dff54a.js | 1 - .../static/chunks/6204-0d389019484112ee.js | 1 - .../static/chunks/6433-c9b3a95c5de0b59f.js | 8 -- .../static/chunks/6494-7124dea6b90175e7.js | 1 - .../static/chunks/6836-e30124a71aafae62.js | 1 - .../static/chunks/6925-9e2db5c132fe9053.js | 1 - .../static/chunks/7155-95101d73b2137e92.js | 1 - .../static/chunks/7281-41cef56aa2b3df92.js | 1 - .../static/chunks/7640-0474293166ede97c.js | 1 - .../static/chunks/773-91425983f811b156.js | 1 - .../static/chunks/7801-631ca879181868d8.js | 1 - .../static/chunks/7908-07a76cfe29c543c9.js | 1 - .../static/chunks/8049-26a565b2b753c5e8.js | 1 - .../static/chunks/8050-901c2a1bce9028ed.js | 1 - .../static/chunks/8098-3da3212991542668.js | 1 - .../static/chunks/8143-ff425046805ff3d9.js | 1 - .../static/chunks/8160-978f9adc46a12a56.js | 1 - .../static/chunks/8347-0845abae9a2a5d9e.js | 1 - .../static/chunks/874-728ff7d42c7bffc9.js | 1 - .../static/chunks/8791-b95bd7fdd710a85d.js | 1 - .../static/chunks/8806-85c2bcba4ca300e2.js | 1 - .../static/chunks/901-34706ce91c6b582c.js | 1 - .../static/chunks/9011-0769cb78a6e5f233.js | 1 - .../static/chunks/9165-2a738a73d0d5f1d1.js | 1 - .../static/chunks/9429-2cac017dd355dcd2.js | 1 - .../static/chunks/9678-c633432ec1f8c65a.js | 1 - .../static/chunks/9775-ac7313139c5f089d.js | 1 - .../static/chunks/9820-b0722f821c1af1ee.js | 1 - .../static/chunks/9888-a0a2120c93674b5e.js | 5 - .../budgets/page-b913787fbd844fd3.js | 1 - .../caching/page-c24bfd9a9fd51fe8.js | 1 - .../prompts/page-61feb7e98f982bcc.js | 1 - .../guardrails/page-cba2ae1139d5678e.js | 1 - .../model-hub/page-f38983c7e128e2f2.js | 1 - .../admin-settings/page-e4fd0d8bc569d74f.js | 1 - .../page-985e0bf863f7d9e2.js | 1 - .../router-settings/page-1fc70b97618b643c.js | 1 - .../ui-theme/page-f379dd301189ad65.js | 1 - .../test-key/page-a89ea5aaed337567.js | 1 - .../users/page-5350004f9323e706.js | 1 - .../virtual-keys/page-8518bb0fb324f811.js | 1 - .../app/_not-found/page-8fcbb38fcc17683b.js | 1 - .../chunks/app/layout-b4b61d636c5d2baf.js | 1 - .../app/model_hub/page-72f15aece1cca2fe.js | 1 - .../model_hub_table/page-6f26e4d3c0a2deb0.js | 1 - .../app/onboarding/page-4aa59d8eb6dfee88.js | 1 - .../chunks/fd9d1056-64e84c4092e0c5d7.js | 1 - .../chunks/framework-08aa667e5202eed8.js | 1 - .../static/chunks/main-a93cf31c84027372.js | 1 - .../chunks/main-app-77a6ca3c04ee9adf.js | 1 - .../chunks/pages/_app-3c9ca398d360b709.js | 1 - .../chunks/pages/_error-cf5ca766ac8f493f.js | 1 - .../chunks/polyfills-42372ed130431b0a.js | 1 - .../static/chunks/webpack-db32e14ed3b4a921.js | 1 - .../out/_next/static/css/349654da14372cd9.css | 1 - .../out/_next/static/css/39bc5c75b4e5b054.css | 3 - .../static/media/19cfc7226ec3afaa-s.woff2 | Bin 19044 -> 0 bytes .../static/media/21350d82a1f187e9-s.woff2 | Bin 18744 -> 0 bytes .../static/media/8e9860b6e62d6359-s.woff2 | Bin 85272 -> 0 bytes .../static/media/ba9851c3c22cd980-s.woff2 | Bin 25844 -> 0 bytes .../static/media/c5fe6dc8356a8c31-s.woff2 | Bin 11272 -> 0 bytes .../static/media/df0a9ae256c0569c-s.woff2 | Bin 10280 -> 0 bytes .../static/media/e4af272ccee01ff0-s.p.woff2 | Bin 48432 -> 0 bytes ui/litellm-dashboard/out/api-reference.txt | 14 --- .../out/assets/audit-logs-preview.png | Bin 240654 -> 0 bytes .../out/assets/logos/aim_logo.jpeg | Bin 3754 -> 0 bytes .../out/assets/logos/aim_security.jpeg | Bin 3754 -> 0 bytes .../out/assets/logos/aiml_api.svg | 1 - .../out/assets/logos/anthropic.svg | 5 - .../out/assets/logos/aporia.png | Bin 2472 -> 0 bytes .../out/assets/logos/arize.png | Bin 14249 -> 0 bytes .../out/assets/logos/assemblyai_small.png | Bin 414 -> 0 bytes ui/litellm-dashboard/out/assets/logos/aws.svg | 34 ------- .../out/assets/logos/bedrock.svg | 1 - .../out/assets/logos/braintrust.png | Bin 10428 -> 0 bytes .../out/assets/logos/cerebras.svg | 89 ------------------ .../out/assets/logos/cohere.svg | 1 - .../out/assets/logos/databricks.svg | 1 - .../out/assets/logos/datadog.png | Bin 5213 -> 0 bytes .../out/assets/logos/deepgram.png | Bin 1224 -> 0 bytes .../out/assets/logos/deepinfra.png | Bin 7014 -> 0 bytes .../out/assets/logos/deepseek.svg | 25 ----- .../out/assets/logos/elevenlabs.png | Bin 35410 -> 0 bytes .../out/assets/logos/enkrypt_ai.avif | Bin 2908 -> 0 bytes .../out/assets/logos/fireworks.svg | 1 - .../out/assets/logos/google.svg | 2 - .../out/assets/logos/groq.svg | 3 - .../out/assets/logos/guardrails_ai.jpeg | Bin 9041 -> 0 bytes .../out/assets/logos/infinity.png | Bin 7377 -> 0 bytes .../out/assets/logos/javelin.png | Bin 1956 -> 0 bytes .../out/assets/logos/jina.png | Bin 2758 -> 0 bytes .../out/assets/logos/lago.svg | 11 --- .../out/assets/logos/lakeraai.jpeg | Bin 2617 -> 0 bytes .../out/assets/logos/langfuse.png | Bin 10860 -> 0 bytes .../out/assets/logos/langsmith.png | Bin 5495 -> 0 bytes .../out/assets/logos/lasso.png | Bin 4115 -> 0 bytes .../out/assets/logos/litellm.jpg | Bin 24694 -> 0 bytes .../out/assets/logos/llm_guard.png | Bin 48665 -> 0 bytes .../out/assets/logos/mcp_logo.png | Bin 3902 -> 0 bytes .../out/assets/logos/microsoft_azure.svg | 72 -------------- .../out/assets/logos/mistral.svg | 1 - .../out/assets/logos/noma_security.png | Bin 3163 -> 0 bytes .../out/assets/logos/nvidia_triton.png | Bin 5704 -> 0 bytes .../out/assets/logos/ollama.svg | 7 -- .../out/assets/logos/openai_small.svg | 5 - .../out/assets/logos/openmeter.png | Bin 1114 -> 0 bytes .../out/assets/logos/openrouter.svg | 39 -------- .../out/assets/logos/oracle.svg | 1 - .../out/assets/logos/otel.png | Bin 1949 -> 0 bytes .../out/assets/logos/palo_alto_networks.jpeg | Bin 5642 -> 0 bytes .../out/assets/logos/pangea.png | Bin 31102 -> 0 bytes .../out/assets/logos/perplexity-ai.svg | 16 ---- .../out/assets/logos/pillar.jpeg | Bin 2554 -> 0 bytes .../out/assets/logos/postgresql.svg | 1 - .../out/assets/logos/presidio.png | Bin 62523 -> 0 bytes .../out/assets/logos/qwen.png | Bin 49453 -> 0 bytes .../out/assets/logos/sambanova.svg | 42 --------- .../out/assets/logos/secret_detect.png | Bin 15590 -> 0 bytes .../out/assets/logos/snowflake.svg | 9 -- .../out/assets/logos/togetherai.svg | 14 --- .../out/assets/logos/vllm.png | Bin 1167 -> 0 bytes .../out/assets/logos/volcengine.png | Bin 36944 -> 0 bytes .../out/assets/logos/voyage.webp | Bin 2896 -> 0 bytes ui/litellm-dashboard/out/assets/logos/xai.svg | 28 ------ .../out/experimental/api-playground.html | 1 - .../out/experimental/api-playground.txt | 14 --- .../out/experimental/budgets.html | 1 - .../out/experimental/budgets.txt | 14 --- .../out/experimental/caching.html | 1 - .../out/experimental/caching.txt | 14 --- .../out/experimental/old-usage.html | 1 - .../out/experimental/old-usage.txt | 14 --- .../out/experimental/prompts.html | 1 - .../out/experimental/prompts.txt | 14 --- .../out/experimental/tag-management.html | 1 - .../out/experimental/tag-management.txt | 14 --- ui/litellm-dashboard/out/favicon.ico | Bin 15406 -> 0 bytes ui/litellm-dashboard/out/guardrails.txt | 14 --- ui/litellm-dashboard/out/index.html | 1 - ui/litellm-dashboard/out/index.txt | 8 -- ui/litellm-dashboard/out/logs.html | 1 - ui/litellm-dashboard/out/logs.txt | 14 --- ui/litellm-dashboard/out/model-hub.html | 1 - ui/litellm-dashboard/out/model-hub.txt | 14 --- ui/litellm-dashboard/out/model_hub.html | 1 - ui/litellm-dashboard/out/model_hub.txt | 8 -- ui/litellm-dashboard/out/model_hub_table.html | 1 - ui/litellm-dashboard/out/model_hub_table.txt | 8 -- .../out/models-and-endpoints.html | 1 - .../out/models-and-endpoints.txt | 14 --- ui/litellm-dashboard/out/next.svg | 1 - ui/litellm-dashboard/out/onboarding.html | 1 - ui/litellm-dashboard/out/onboarding.txt | 8 -- ui/litellm-dashboard/out/organizations.html | 1 - ui/litellm-dashboard/out/organizations.txt | 14 --- .../out/settings/admin-settings.html | 1 - .../out/settings/admin-settings.txt | 14 --- .../out/settings/logging-and-alerts.html | 1 - .../out/settings/logging-and-alerts.txt | 14 --- .../out/settings/router-settings.html | 1 - .../out/settings/router-settings.txt | 14 --- .../out/settings/ui-theme.html | 1 - .../out/settings/ui-theme.txt | 14 --- ui/litellm-dashboard/out/teams.html | 1 - ui/litellm-dashboard/out/teams.txt | 14 --- ui/litellm-dashboard/out/test-key.html | 1 - ui/litellm-dashboard/out/test-key.txt | 14 --- .../out/tools/mcp-servers.html | 1 - .../out/tools/mcp-servers.txt | 14 --- .../out/tools/vector-stores.html | 1 - .../out/tools/vector-stores.txt | 14 --- ui/litellm-dashboard/out/usage.html | 1 - ui/litellm-dashboard/out/usage.txt | 14 --- ui/litellm-dashboard/out/users.html | 1 - ui/litellm-dashboard/out/users.txt | 14 --- ui/litellm-dashboard/out/vercel.svg | 1 - ui/litellm-dashboard/out/virtual-keys.html | 1 - ui/litellm-dashboard/out/virtual-keys.txt | 14 --- 364 files changed, 148 insertions(+), 1106 deletions(-) rename litellm/proxy/_experimental/out/_next/static/{xJpMbkw-PrXOjhVmfa1qv => WgTo48b9igIhFqIpxzvPv}/_buildManifest.js (100%) rename litellm/proxy/_experimental/out/_next/static/{xJpMbkw-PrXOjhVmfa1qv => WgTo48b9igIhFqIpxzvPv}/_ssgManifest.js (100%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1052-bdb89c881be4619e.js rename ui/litellm-dashboard/out/_next/static/chunks/1160-3efb81c958413447.js => litellm/proxy/_experimental/out/_next/static/chunks/1160-08491effeedbaae3.js (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1160-3efb81c958413447.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1307-3d9ef20b529a0edc.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1307-6bc3bb770f5b2b05.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/131-79aa7086799152a2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/131-8304bcbbae03bc10.js rename ui/litellm-dashboard/out/_next/static/chunks/1529-e0933e3af843b646.js => litellm/proxy/_experimental/out/_next/static/chunks/1529-130888c02463f3dd.js (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1529-e0933e3af843b646.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2012-753dae634313855c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2012-8ba1526768e30ef5.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2012-90188715a5858c8c.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2284-4cbc9a7f33eb7c89.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2284-6840f6cabd9dbd7e.js rename litellm/proxy/_experimental/out/_next/static/chunks/{2344-169e12738d6439ab.js => 2344-17c84cab77fa632a.js} (99%) rename litellm/proxy/_experimental/out/_next/static/chunks/{3250-3256164511237d25.js => 3250-f8c476289792167a.js} (99%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3298-0debe247d04c451b.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3298-ad776747b5eff3ae.js rename litellm/proxy/_experimental/out/_next/static/chunks/{3603-b101c17ea3d68f19.js => 3603-dd19ac8e31e4bc25.js} (99%) rename litellm/proxy/_experimental/out/_next/static/chunks/{3669-cbf664b1e9c58f8a.js => 3669-6e17d59477ade8ac.js} (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4292-3e30cf0761abb900.js rename ui/litellm-dashboard/out/_next/static/chunks/4292-c9a41dd3c8f6925a.js => litellm/proxy/_experimental/out/_next/static/chunks/4292-a1bc4327d9a3d829.js (65%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4292-c9a41dd3c8f6925a.js rename litellm/proxy/_experimental/out/_next/static/chunks/{5105-eb18802ec448789d.js => 5105-e9f08a6b3a1f2881.js} (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6494-7124dea6b90175e7.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6494-938b4af798279e4a.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6925-9e2db5c132fe9053.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6925-b4f07277f285ca48.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7155-56eb798322f1faf7.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7155-95101d73b2137e92.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7801-2b5492cdeacaedc4.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7801-631ca879181868d8.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8160-292eaad6e0da51a9.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8160-978f9adc46a12a56.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/874-728ff7d42c7bffc9.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/874-e84ea35ec9a8042c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9681-49ea01accf85cac1.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9883-85b2991f131b4416.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-c04f26edd6161f83.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-e1b30f2f59900b67.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-2e10f494907c6a63.js rename ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-2e10f494907c6a63.js => litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-9890fc550d55b49b.js (98%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/{page-b913787fbd844fd3.js => page-712ccbc9bd44a5ae.js} (98%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/{page-c24bfd9a9fd51fe8.js => page-34cb1817eb6914a2.js} (96%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-755c4cefc4b9c65c.js rename ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-755c4cefc4b9c65c.js => litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-dc75946e58de809e.js (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-f16a8ef298a13ef7.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/{page-61feb7e98f982bcc.js => page-2608594fa934affa.js} (95%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-1da0c9dcc6fabf28.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-30215d565ccd90ac.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/{page-cba2ae1139d5678e.js => page-229122aa339dc574.js} (97%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js rename ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js => litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js (98%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-009011bc6f8bc171.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/{tools/vector-stores/page-6a747c73e6811499.js => logs/page-5019bcc8a011ed8c.js} (54%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/{page-f38983c7e128e2f2.js => page-28a4881b81368e36.js} (98%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-50ce8c6bb2821738.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-5b4a740f9549ae1e.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-388c7d5731acf363.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-3f42c10932338e71.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/{page-e4fd0d8bc569d74f.js => page-bf35b8b5ac73a485.js} (93%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-4bba68ba957e2904.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-985e0bf863f7d9e2.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/{page-1fc70b97618b643c.js => page-bb2dff1be677bb71.js} (95%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/{page-f379dd301189ad65.js => page-74e4c4e7aa9329ea.js} (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-7a73148e728ec98a.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-a69ee3fd18d83caf.js rename ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/teams/page-a69ee3fd18d83caf.js => litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-e8dfff543471e450.js (99%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-1870641393210367.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-a89ea5aaed337567.js rename ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-91876f4e21ac7596.js => litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-2fd597d070592ae4.js (98%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-91876f4e21ac7596.js rename ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-6a747c73e6811499.js => litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-2c5e185717ef32c7.js (98%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-0087e951a6403a40.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-af5d7ad6e47d0b01.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/{page-5350004f9323e706.js => page-c5cc93238455fee0.js} (98%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-5f39dca6d04896e2.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/{page-8518bb0fb324f811.js => page-a060a80d56f4f360.js} (97%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-68c2ba55fce8629a.js rename ui/litellm-dashboard/out/_next/static/chunks/app/page-8e346388fe8496be.js => litellm/proxy/_experimental/out/_next/static/chunks/app/page-92ab3a1095e26dca.js (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-d7c5dbe555bb16a5.js delete mode 100644 ui/litellm-dashboard/out/404.html delete mode 100644 ui/litellm-dashboard/out/_next/static/ZQ8CnOaEkWoWBRYVxXOow/_buildManifest.js delete mode 100644 ui/litellm-dashboard/out/_next/static/ZQ8CnOaEkWoWBRYVxXOow/_ssgManifest.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/1052-bdb89c881be4619e.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/1223-de5e7e4f043a5233.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/1264-2979d95e0b56a75c.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/1307-6bc3bb770f5b2b05.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/131-79aa7086799152a2.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/13b76428-e1bf383848c17260.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/1487-ada9ecf7dd9bca97.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/1491-8280340b5391aa11.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/1526-8e2976ed10cb2fa0.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/17-782feb91c41095ca.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/1739-f276f8d8fca7b189.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/1853-fa2eb7102429db88.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2004-2c0ea663e63e0a2f.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2012-753dae634313855c.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2019-f91b853dc598350e.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2052-68db39dea49a676f.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2117-2da5ec8fad6a6c25.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2162-70a154301fc81d42.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2202-e8124587d6b0e623.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/226-81daaf8cff08ccfe.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2273-0d0a74964599a0e2.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2284-4cbc9a7f33eb7c89.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2306-c9a553b697103491.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2417-b28f330f82bf4a82.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2525-13b137f40949dcf1.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2662-51eb8b1bec576f6d.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/2926-b5dcad9f62f5e2b1.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/3014691f-702e24806fe9cec4.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/3250-3256164511237d25.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/3298-ad776747b5eff3ae.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/3603-b101c17ea3d68f19.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/3669-cbf664b1e9c58f8a.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/3709-b17db86e0ab325d2.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/3752-53808701995a5f10.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/3801-f50239dd6dee5df7.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/3866-e3419825a249263f.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/4696-2b10d95edaaa6de3.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/4851-fbdd7aec2937c09d.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/4924-e47559a81a4aa31c.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/5079-a43d5cc0d7429256.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/5105-eb18802ec448789d.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/5188-0e9d5e6db19ac9e6.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/527-d9b7316e990a0539.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/5319-43bd4ee5bb7e50d1.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/5809-1eb0022e0f1e4ee3.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/5830-47ce1a4897188f14.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/603-41b69f9ab68da547.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/6202-e6c424fe04dff54a.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/6204-0d389019484112ee.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/6433-c9b3a95c5de0b59f.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/6494-7124dea6b90175e7.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/6836-e30124a71aafae62.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/6925-9e2db5c132fe9053.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/7155-95101d73b2137e92.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/7281-41cef56aa2b3df92.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/7640-0474293166ede97c.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/773-91425983f811b156.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/7801-631ca879181868d8.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/7908-07a76cfe29c543c9.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/8049-26a565b2b753c5e8.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/8050-901c2a1bce9028ed.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/8098-3da3212991542668.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/8143-ff425046805ff3d9.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/8160-978f9adc46a12a56.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/8347-0845abae9a2a5d9e.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/874-728ff7d42c7bffc9.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/8791-b95bd7fdd710a85d.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/8806-85c2bcba4ca300e2.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/901-34706ce91c6b582c.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/9011-0769cb78a6e5f233.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/9165-2a738a73d0d5f1d1.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/9429-2cac017dd355dcd2.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/9678-c633432ec1f8c65a.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/9775-ac7313139c5f089d.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/9820-b0722f821c1af1ee.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/9888-a0a2120c93674b5e.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/budgets/page-b913787fbd844fd3.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/caching/page-c24bfd9a9fd51fe8.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-61feb7e98f982bcc.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/guardrails/page-cba2ae1139d5678e.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/model-hub/page-f38983c7e128e2f2.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-e4fd0d8bc569d74f.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-985e0bf863f7d9e2.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/settings/router-settings/page-1fc70b97618b643c.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/page-f379dd301189ad65.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/test-key/page-a89ea5aaed337567.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/users/page-5350004f9323e706.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-8518bb0fb324f811.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/_not-found/page-8fcbb38fcc17683b.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/layout-b4b61d636c5d2baf.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/model_hub/page-72f15aece1cca2fe.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/model_hub_table/page-6f26e4d3c0a2deb0.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/app/onboarding/page-4aa59d8eb6dfee88.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/fd9d1056-64e84c4092e0c5d7.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/framework-08aa667e5202eed8.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/main-a93cf31c84027372.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/main-app-77a6ca3c04ee9adf.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/pages/_app-3c9ca398d360b709.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/polyfills-42372ed130431b0a.js delete mode 100644 ui/litellm-dashboard/out/_next/static/chunks/webpack-db32e14ed3b4a921.js delete mode 100644 ui/litellm-dashboard/out/_next/static/css/349654da14372cd9.css delete mode 100644 ui/litellm-dashboard/out/_next/static/css/39bc5c75b4e5b054.css delete mode 100644 ui/litellm-dashboard/out/_next/static/media/19cfc7226ec3afaa-s.woff2 delete mode 100644 ui/litellm-dashboard/out/_next/static/media/21350d82a1f187e9-s.woff2 delete mode 100644 ui/litellm-dashboard/out/_next/static/media/8e9860b6e62d6359-s.woff2 delete mode 100644 ui/litellm-dashboard/out/_next/static/media/ba9851c3c22cd980-s.woff2 delete mode 100644 ui/litellm-dashboard/out/_next/static/media/c5fe6dc8356a8c31-s.woff2 delete mode 100644 ui/litellm-dashboard/out/_next/static/media/df0a9ae256c0569c-s.woff2 delete mode 100644 ui/litellm-dashboard/out/_next/static/media/e4af272ccee01ff0-s.p.woff2 delete mode 100644 ui/litellm-dashboard/out/api-reference.txt delete mode 100644 ui/litellm-dashboard/out/assets/audit-logs-preview.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/aim_logo.jpeg delete mode 100644 ui/litellm-dashboard/out/assets/logos/aim_security.jpeg delete mode 100644 ui/litellm-dashboard/out/assets/logos/aiml_api.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/anthropic.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/aporia.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/arize.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/assemblyai_small.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/aws.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/bedrock.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/braintrust.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/cerebras.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/cohere.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/databricks.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/datadog.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/deepgram.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/deepinfra.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/deepseek.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/elevenlabs.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/enkrypt_ai.avif delete mode 100644 ui/litellm-dashboard/out/assets/logos/fireworks.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/google.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/groq.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/guardrails_ai.jpeg delete mode 100644 ui/litellm-dashboard/out/assets/logos/infinity.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/javelin.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/jina.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/lago.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/lakeraai.jpeg delete mode 100644 ui/litellm-dashboard/out/assets/logos/langfuse.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/langsmith.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/lasso.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/litellm.jpg delete mode 100644 ui/litellm-dashboard/out/assets/logos/llm_guard.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/mcp_logo.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/microsoft_azure.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/mistral.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/noma_security.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/nvidia_triton.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/ollama.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/openai_small.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/openmeter.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/openrouter.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/oracle.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/otel.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/palo_alto_networks.jpeg delete mode 100644 ui/litellm-dashboard/out/assets/logos/pangea.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/perplexity-ai.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/pillar.jpeg delete mode 100644 ui/litellm-dashboard/out/assets/logos/postgresql.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/presidio.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/qwen.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/sambanova.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/secret_detect.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/snowflake.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/togetherai.svg delete mode 100644 ui/litellm-dashboard/out/assets/logos/vllm.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/volcengine.png delete mode 100644 ui/litellm-dashboard/out/assets/logos/voyage.webp delete mode 100644 ui/litellm-dashboard/out/assets/logos/xai.svg delete mode 100644 ui/litellm-dashboard/out/experimental/api-playground.html delete mode 100644 ui/litellm-dashboard/out/experimental/api-playground.txt delete mode 100644 ui/litellm-dashboard/out/experimental/budgets.html delete mode 100644 ui/litellm-dashboard/out/experimental/budgets.txt delete mode 100644 ui/litellm-dashboard/out/experimental/caching.html delete mode 100644 ui/litellm-dashboard/out/experimental/caching.txt delete mode 100644 ui/litellm-dashboard/out/experimental/old-usage.html delete mode 100644 ui/litellm-dashboard/out/experimental/old-usage.txt delete mode 100644 ui/litellm-dashboard/out/experimental/prompts.html delete mode 100644 ui/litellm-dashboard/out/experimental/prompts.txt delete mode 100644 ui/litellm-dashboard/out/experimental/tag-management.html delete mode 100644 ui/litellm-dashboard/out/experimental/tag-management.txt delete mode 100644 ui/litellm-dashboard/out/favicon.ico delete mode 100644 ui/litellm-dashboard/out/guardrails.txt delete mode 100644 ui/litellm-dashboard/out/index.html delete mode 100644 ui/litellm-dashboard/out/index.txt delete mode 100644 ui/litellm-dashboard/out/logs.html delete mode 100644 ui/litellm-dashboard/out/logs.txt delete mode 100644 ui/litellm-dashboard/out/model-hub.html delete mode 100644 ui/litellm-dashboard/out/model-hub.txt delete mode 100644 ui/litellm-dashboard/out/model_hub.html delete mode 100644 ui/litellm-dashboard/out/model_hub.txt delete mode 100644 ui/litellm-dashboard/out/model_hub_table.html delete mode 100644 ui/litellm-dashboard/out/model_hub_table.txt delete mode 100644 ui/litellm-dashboard/out/models-and-endpoints.html delete mode 100644 ui/litellm-dashboard/out/models-and-endpoints.txt delete mode 100644 ui/litellm-dashboard/out/next.svg delete mode 100644 ui/litellm-dashboard/out/onboarding.html delete mode 100644 ui/litellm-dashboard/out/onboarding.txt delete mode 100644 ui/litellm-dashboard/out/organizations.html delete mode 100644 ui/litellm-dashboard/out/organizations.txt delete mode 100644 ui/litellm-dashboard/out/settings/admin-settings.html delete mode 100644 ui/litellm-dashboard/out/settings/admin-settings.txt delete mode 100644 ui/litellm-dashboard/out/settings/logging-and-alerts.html delete mode 100644 ui/litellm-dashboard/out/settings/logging-and-alerts.txt delete mode 100644 ui/litellm-dashboard/out/settings/router-settings.html delete mode 100644 ui/litellm-dashboard/out/settings/router-settings.txt delete mode 100644 ui/litellm-dashboard/out/settings/ui-theme.html delete mode 100644 ui/litellm-dashboard/out/settings/ui-theme.txt delete mode 100644 ui/litellm-dashboard/out/teams.html delete mode 100644 ui/litellm-dashboard/out/teams.txt delete mode 100644 ui/litellm-dashboard/out/test-key.html delete mode 100644 ui/litellm-dashboard/out/test-key.txt delete mode 100644 ui/litellm-dashboard/out/tools/mcp-servers.html delete mode 100644 ui/litellm-dashboard/out/tools/mcp-servers.txt delete mode 100644 ui/litellm-dashboard/out/tools/vector-stores.html delete mode 100644 ui/litellm-dashboard/out/tools/vector-stores.txt delete mode 100644 ui/litellm-dashboard/out/usage.html delete mode 100644 ui/litellm-dashboard/out/usage.txt delete mode 100644 ui/litellm-dashboard/out/users.html delete mode 100644 ui/litellm-dashboard/out/users.txt delete mode 100644 ui/litellm-dashboard/out/vercel.svg delete mode 100644 ui/litellm-dashboard/out/virtual-keys.html delete mode 100644 ui/litellm-dashboard/out/virtual-keys.txt diff --git a/litellm/proxy/_experimental/out/_next/static/xJpMbkw-PrXOjhVmfa1qv/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/WgTo48b9igIhFqIpxzvPv/_buildManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/xJpMbkw-PrXOjhVmfa1qv/_buildManifest.js rename to litellm/proxy/_experimental/out/_next/static/WgTo48b9igIhFqIpxzvPv/_buildManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/xJpMbkw-PrXOjhVmfa1qv/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/WgTo48b9igIhFqIpxzvPv/_ssgManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/xJpMbkw-PrXOjhVmfa1qv/_ssgManifest.js rename to litellm/proxy/_experimental/out/_next/static/WgTo48b9igIhFqIpxzvPv/_ssgManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1052-bdb89c881be4619e.js b/litellm/proxy/_experimental/out/_next/static/chunks/1052-bdb89c881be4619e.js deleted file mode 100644 index d760fa17b6..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1052-bdb89c881be4619e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1052],{19046:function(e,t,s){s.d(t,{Dx:function(){return r.Z},Zb:function(){return a.Z},oi:function(){return l.Z},xv:function(){return n.Z},zx:function(){return o.Z}});var o=s(20831),a=s(12514),n=s(84264),l=s(49566),r=s(96761)},31052:function(e,t,s){s.d(t,{Z:function(){return eA}});var o=s(57437),a=s(2265),n=s(243),l=s(19046),r=s(93837),i=s(64482),c=s(65319),d=s(93192),m=s(52787),g=s(89970),p=s(87908),u=s(82680),x=s(73002),h=s(26433),f=s(19250);async function b(e,t,s,o,a,n,l,r,i,c,d,m,g,p){console.log=function(){},console.log("isLocal:",!1);let u=(0,f.getProxyBaseUrl)(),x={};a&&a.length>0&&(x["x-litellm-tags"]=a.join(","));let b=new h.ZP.OpenAI({apiKey:o,baseURL:u,dangerouslyAllowBrowser:!0,defaultHeaders:x});try{let a;let x=Date.now(),h=!1,f=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(u,"/mcp"),require_approval:"never",allowed_tools:g,headers:{"x-litellm-api-key":"Bearer ".concat(o)}}]:void 0;for await(let o of(await b.chat.completions.create({model:s,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:c,messages:e,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...f?{tools:f,tool_choice:"auto"}:{}},{signal:n}))){var v,y,j,w,S,N,k,P;console.log("Stream chunk:",o);let e=null===(v=o.choices[0])||void 0===v?void 0:v.delta;if(console.log("Delta content:",null===(j=o.choices[0])||void 0===j?void 0:null===(y=j.delta)||void 0===y?void 0:y.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!h&&((null===(S=o.choices[0])||void 0===S?void 0:null===(w=S.delta)||void 0===w?void 0:w.content)||e&&e.reasoning_content)&&(h=!0,a=Date.now()-x,console.log("First token received! Time:",a,"ms"),r?(console.log("Calling onTimingData with:",a),r(a)):console.log("onTimingData callback is not defined!")),null===(k=o.choices[0])||void 0===k?void 0:null===(N=k.delta)||void 0===N?void 0:N.content){let e=o.choices[0].delta.content;t(e,o.model)}if(e&&e.image&&p&&(console.log("Image generated:",e.image),p(e.image.url,o.model)),e&&e.reasoning_content){let t=e.reasoning_content;l&&l(t)}if(o.usage&&i){console.log("Usage data found:",o.usage);let e={completionTokens:o.usage.completion_tokens,promptTokens:o.usage.prompt_tokens,totalTokens:o.usage.total_tokens};(null===(P=o.usage.completion_tokens_details)||void 0===P?void 0:P.reasoning_tokens)&&(e.reasoningTokens=o.usage.completion_tokens_details.reasoning_tokens),i(e)}}}catch(e){throw(null==n?void 0:n.aborted)&&console.log("Chat completion request was cancelled"),e}}var v=s(9114);async function y(e,t,s,o,a,n){console.log=function(){},console.log("isLocal:",!1);let l=(0,f.getProxyBaseUrl)(),r=new h.ZP.OpenAI({apiKey:o,baseURL:l,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{let o=await r.images.generate({model:s,prompt:e},{signal:n});if(console.log(o.data),o.data&&o.data[0]){if(o.data[0].url)t(o.data[0].url,s);else if(o.data[0].b64_json){let e=o.data[0].b64_json;t("data:image/png;base64,".concat(e),s)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==n?void 0:n.aborted)?console.log("Image generation request was cancelled"):v.Z.fromBackend("Error occurred while generating image. Please try again. Error: ".concat(e)),e}}async function j(e,t,s,o,a,n,l){console.log=function(){},console.log("isLocal:",!1);let r=(0,f.getProxyBaseUrl)(),i=new h.ZP.OpenAI({apiKey:a,baseURL:r,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let a=Array.isArray(e)?e:[e],n=[];for(let e=0;e1&&v.Z.success("Successfully processed ".concat(n.length," images"))}catch(e){if(console.error("Error making image edit request:",e),null==l?void 0:l.aborted)console.log("Image edits request was cancelled");else{var c;let t="Failed to edit image(s)";(null==e?void 0:null===(c=e.error)||void 0===c?void 0:c.message)?t=e.error.message:(null==e?void 0:e.message)&&(t=e.message),v.Z.fromBackend("Image edit failed: ".concat(t))}throw e}}async function w(e,t,s,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,r=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,g=arguments.length>12?arguments[12]:void 0,p=arguments.length>13?arguments[13]:void 0,u=arguments.length>14?arguments[14]:void 0,x=arguments.length>15?arguments[15]:void 0;if(!o)throw Error("API key is required");console.log=function(){};let b=(0,f.getProxyBaseUrl)(),y={};a&&a.length>0&&(y["x-litellm-tags"]=a.join(","));let j=new h.ZP.OpenAI({apiKey:o,baseURL:b,dangerouslyAllowBrowser:!0,defaultHeaders:y});try{let o=Date.now(),a=!1,h=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),f=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never",allowed_tools:g}]:void 0,b=await j.responses.create({model:s,input:h,stream:!0,litellm_trace_id:c,...p?{previous_response_id:p}:{},...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...f?{tools:f,tool_choice:"required"}:{}},{signal:n}),v="";for await(let e of b)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var w,S,N,k,P,C,I;if(((null===(w=e.type)||void 0===w?void 0:w.startsWith("response.mcp_"))||"response.output_item.done"===e.type&&((null===(S=e.item)||void 0===S?void 0:S.type)==="mcp_list_tools"||(null===(N=e.item)||void 0===N?void 0:N.type)==="mcp_call"))&&(console.log("MCP event received:",e),x)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||(null===(C=e.item)||void 0===C?void 0:C.id),item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};x(t)}if("response.output_item.done"===e.type&&(null===(k=e.item)||void 0===k?void 0:k.type)==="mcp_call"&&(null===(P=e.item)||void 0===P?void 0:P.name)&&(v=e.item.name,console.log("MCP tool used:",v)),"response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let n=e.delta;if(console.log("Text delta",n),n.trim().length>0&&(t("assistant",n,s),!a)){a=!0;let e=Date.now()-o;console.log("First token received! Time:",e,"ms"),r&&r(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&l&&l(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,s=t.usage;if(console.log("Usage data:",s),console.log("Response completed event:",t),t.id&&u&&(console.log("Response ID for session management:",t.id),u(t.id)),s&&i){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(I=s.completion_tokens_details)||void 0===I?void 0:I.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),i(e,v)}}}return b}catch(e){throw(null==n?void 0:n.aborted)?console.log("Responses API request was cancelled"):v.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var S=s(85498);async function N(e,t,s,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,r=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,g=arguments.length>12?arguments[12]:void 0;if(!o)throw Error("API key is required");console.log=function(){};let p=(0,f.getProxyBaseUrl)(),u={};a&&a.length>0&&(u["x-litellm-tags"]=a.join(","));let x=new S.ZP({apiKey:o,baseURL:p,dangerouslyAllowBrowser:!0,defaultHeaders:u});try{let a=Date.now(),u=!1,h=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(p,"/mcp"),require_approval:"never",allowed_tools:g,headers:{"x-litellm-api-key":"Bearer ".concat(o)}}]:void 0,f={model:s,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(f.vector_store_ids=d),m&&(f.guardrails=m),h&&(f.tools=h,f.tool_choice="auto"),x.messages.stream(f,{signal:n}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let o=e.delta;if(!u){u=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),r&&r(e)}"text_delta"===o.type?t("assistant",o.text,s):"reasoning_delta"===o.type&&l&&l(o.text)}if("message_delta"===e.type&&e.usage&&i){let t=e.usage;console.log("Usage data found:",t);let s={completionTokens:t.output_tokens,promptTokens:t.input_tokens,totalTokens:t.input_tokens+t.output_tokens};i(s)}}}catch(e){throw(null==n?void 0:n.aborted)?console.log("Anthropic messages request was cancelled"):v.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var k=s(51601);async function P(e){try{return(await (0,f.mcpToolsCall)(e)).tools||[]}catch(e){return console.error("Error fetching MCP tools:",e),[]}}var C=s(49817),I=s(17906),_=s(94263),T=s(92280),Z=e=>{let{endpointType:t,onEndpointChange:s,className:a}=e,n=[{value:C.KP.CHAT,label:"/v1/chat/completions"},{value:C.KP.RESPONSES,label:"/v1/responses"},{value:C.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:C.KP.IMAGE,label:"/v1/images/generations"},{value:C.KP.IMAGE_EDITS,label:"/v1/images/edits"}];return(0,o.jsxs)("div",{className:a,children:[(0,o.jsx)(T.x,{children:"Endpoint Type:"}),(0,o.jsx)(m.default,{showSearch:!0,value:t,style:{width:"100%"},onChange:s,options:n,className:"rounded-md"})]})},E=e=>{let{onChange:t,value:s,className:n,accessToken:l}=e,[r,i]=(0,a.useState)([]),[c,d]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{(async()=>{if(l)try{let e=await (0,f.tagListCall)(l);console.log("List tags response:",e),i(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}})()},[]),(0,o.jsx)(m.default,{mode:"multiple",placeholder:"Select tags",onChange:t,value:s,loading:c,className:n,options:r.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})},A=s(97415),U=s(67479),R=s(88658),L=s(83322),M=s(70464),D=s(77565),K=e=>{let{reasoningContent:t}=e,[s,l]=(0,a.useState)(!0);return t?(0,o.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,o.jsxs)(x.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>l(!s),icon:(0,o.jsx)(L.Z,{}),children:[s?"Hide reasoning":"Show reasoning",s?(0,o.jsx)(M.Z,{className:"ml-1"}):(0,o.jsx)(D.Z,{className:"ml-1"})]}),s&&(0,o.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,o.jsx)(n.U,{components:{code(e){let{node:t,inline:s,className:a,children:n,...l}=e,r=/language-(\w+)/.exec(a||"");return!s&&r?(0,o.jsx)(I.Z,{style:_.Z,language:r[1],PreTag:"div",className:"rounded-md my-2",...l,children:String(n).replace(/\n$/,"")}):(0,o.jsx)("code",{className:"".concat(a," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...l,children:n})}},children:t})})]}):null},z=s(5540),O=s(71282),F=s(11741),H=s(16601),B=s(58630),G=e=>{let{timeToFirstToken:t,usage:s,toolName:a}=e;return t||s?(0,o.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==t&&(0,o.jsx)(g.Z,{title:"Time to first token",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(z.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:[(t/1e3).toFixed(2),"s"]})]})}),(null==s?void 0:s.promptTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Prompt tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(O.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["In: ",s.promptTokens]})]})}),(null==s?void 0:s.completionTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Completion tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(F.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Out: ",s.completionTokens]})]})}),(null==s?void 0:s.reasoningTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Reasoning tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(L.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Reasoning: ",s.reasoningTokens]})]})}),(null==s?void 0:s.totalTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Total tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(H.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Total: ",s.totalTokens]})]})}),a&&(0,o.jsx)(g.Z,{title:"Tool used",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(B.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Tool: ",a]})]})})]}):null},q=s(53508);let{Dragger:J}=c.default;var W=e=>{let{responsesUploadedImage:t,responsesImagePreviewUrl:s,onImageUpload:a,onRemoveImage:n}=e;return(0,o.jsx)(o.Fragment,{children:!t&&(0,o.jsx)(J,{beforeUpload:a,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,o.jsx)(g.Z,{title:"Attach image or PDF",children:(0,o.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,o.jsx)(q.Z,{style:{fontSize:"16px"}})})})})})};let V=e=>new Promise((t,s)=>{let o=new FileReader;o.onload=()=>{t(o.result.split(",")[1])},o.onerror=s,o.readAsDataURL(e)}),Y=async(e,t)=>{let s=await V(t),o=t.type||(t.name.toLowerCase().endsWith(".pdf")?"application/pdf":"image/jpeg");return{role:"user",content:[{type:"input_text",text:e},{type:"input_image",image_url:"data:".concat(o,";base64,").concat(s)}]}},X=(e,t,s,o)=>{let a="";t&&o&&(a=o.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(a):e};return t&&s&&(n.imagePreviewUrl=s),n},$=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;var Q=s(50010),ee=e=>{let{message:t}=e;if(!$(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,o.jsx)("div",{className:"mb-2",children:s?(0,o.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,o.jsx)("img",{src:t.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})};let{Dragger:et}=c.default;var es=e=>{let{chatUploadedImage:t,chatImagePreviewUrl:s,onImageUpload:a,onRemoveImage:n}=e;return(0,o.jsx)(o.Fragment,{children:!t&&(0,o.jsx)(et,{beforeUpload:a,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,o.jsx)(g.Z,{title:"Attach image or PDF",children:(0,o.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,o.jsx)(q.Z,{style:{fontSize:"16px"}})})})})})};let eo=e=>new Promise((t,s)=>{let o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=s,o.readAsDataURL(e)}),ea=async(e,t)=>({role:"user",content:[{type:"text",text:e},{type:"image_url",image_url:{url:await eo(t)}}]}),en=(e,t,s,o)=>{let a="";t&&o&&(a=o.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(a):e};return t&&s&&(n.imagePreviewUrl=s),n},el=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;var er=e=>{let{message:t}=e;if(!el(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,o.jsx)("div",{className:"mb-2",children:s?(0,o.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,o.jsx)("img",{src:t.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})},ei=s(63709),ec=s(15424),ed=s(23639),em=e=>{let{endpointType:t,responsesSessionId:s,useApiSessionManagement:a,onToggleSessionManagement:n}=e;return t!==C.KP.RESPONSES?null:(0,o.jsxs)("div",{className:"mb-4",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Session Management"}),(0,o.jsx)(g.Z,{title:"Choose between LiteLLM API session management (using previous_response_id) or UI-based session management (using chat history)",children:(0,o.jsx)(ec.Z,{className:"text-gray-400",style:{fontSize:"12px"}})})]}),(0,o.jsx)(ei.Z,{checked:a,onChange:n,checkedChildren:"API",unCheckedChildren:"UI",size:"small"})]}),(0,o.jsxs)("div",{className:"text-xs p-2 rounded-md ".concat(s?"bg-green-50 text-green-700 border border-green-200":"bg-blue-50 text-blue-700 border border-blue-200"),children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)(ec.Z,{style:{fontSize:"12px"}}),(()=>{if(!s)return a?"API Session: Ready":"UI Session: Ready";let e=a?"Response ID":"UI Session",t=s.slice(0,10);return"".concat(e,": ").concat(t,"...")})()]}),s&&(0,o.jsx)(g.Z,{title:(0,o.jsxs)("div",{className:"text-xs",children:[(0,o.jsx)("div",{className:"mb-1",children:"Copy response ID to continue session:"}),(0,o.jsx)("div",{className:"bg-gray-800 text-gray-100 p-2 rounded font-mono text-xs whitespace-pre-wrap",children:'curl -X POST "your-proxy-url/v1/responses" \\\n -H "Authorization: Bearer your-api-key" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "model": "your-model",\n "input": [{"role": "user", "content": "your message", "type": "message"}],\n "previous_response_id": "'.concat(s,'",\n "stream": true\n }\'')})]}),overlayStyle:{maxWidth:"500px"},children:(0,o.jsx)("button",{onClick:()=>{s&&(navigator.clipboard.writeText(s),v.Z.success("Response ID copied to clipboard!"))},className:"ml-2 p-1 hover:bg-green-100 rounded transition-colors",children:(0,o.jsx)(ed.Z,{style:{fontSize:"12px"}})})})]}),(0,o.jsx)("div",{className:"text-xs opacity-75 mt-1",children:s?a?"LiteLLM API session active - context maintained server-side":"UI session active - context maintained client-side":a?"LiteLLM will manage session using previous_response_id":"UI will manage session using chat history"})]})]})},eg=s(29),ep=s.n(eg),eu=s(44851);let{Text:ex}=d.default,{Panel:eh}=eu.default;var ef=e=>{var t,s;let{events:a,className:n}=e;if(console.log("MCPEventsDisplay: Received events:",a),!a||0===a.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let l=a.find(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0}),r=a.filter(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_call"});return(console.log("MCPEventsDisplay: toolsEvent:",l),console.log("MCPEventsDisplay: mcpCallEvents:",r),l||0!==r.length)?(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac "+"mcp-events-display ".concat(n||""),children:[(0,o.jsx)(ep(),{id:"32b14b04f420f3ac",children:'.openai-mcp-tools.jsx-32b14b04f420f3ac{position:relative;margin:0;padding:0}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac{background:transparent!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{padding:0 0 0 20px!important;background:transparent!important;border:none!important;font-size:14px!important;color:#9ca3af!important;font-weight:400!important;line-height:20px!important;min-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{background:transparent!important;color:#6b7280!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{position:absolute!important;left:2px!important;top:2px!important;color:#9ca3af!important;font-size:10px!important;width:16px!important;height:16px!important;display:-webkit-box!important;display:-webkit-flex!important;display:-moz-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-webkit-align-items:center!important;-moz-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:center!important;-webkit-justify-content:center!important;-moz-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{position:absolute;left:9px;top:18px;bottom:0;width:.5px;background-color:#f3f4f6;opacity:.8}.tool-item.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:13px;color:#4b5563;line-height:18px;padding:0;margin:0;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac{margin-bottom:12px;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{font-size:13px;color:#6b7280;font-weight:500;margin-bottom:4px}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid#f3f4f6;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;color:#374151;margin:0;white-space:pre-wrap;word-wrap:break-word}.mcp-approved.jsx-32b14b04f420f3ac{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;color:#6b7280}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:bold}.mcp-response-content.jsx-32b14b04f420f3ac{font-size:13px;color:#374151;line-height:1.5;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace}'}),(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,o.jsxs)(eu.default,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:l?["list-tools"]:r.map((e,t)=>"mcp-call-".concat(t)),children:[l&&(0,o.jsx)(eh,{header:"List tools",children:(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:null===(s=l.item)||void 0===s?void 0:null===(t=s.tools)||void 0===t?void 0:t.map((e,t)=>(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},t))})},"list-tools"),r.map((e,t)=>{var s,a,n;return(0,o.jsx)(eh,{header:(null===(s=e.item)||void 0===s?void 0:s.name)||"Tool call",children:(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:(null===(a=e.item)||void 0===a?void 0:a.arguments)&&(0,o.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,o.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),(null===(n=e.item)||void 0===n?void 0:n.output)&&(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},"mcp-call-".concat(t))})]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)},eb=s(61935),ev=s(92403),ey=s(69993),ej=s(12660),ew=s(71891),eS=s(44625),eN=s(57400),ek=s(26430),eP=s(11894),eC=s(15883),eI=s(99890),e_=s(26349),eT=s(79276);let{TextArea:eZ}=i.default,{Dragger:eE}=c.default;var eA=e=>{let{accessToken:t,token:s,userRole:i,userID:c,disabledPersonalKeyCreation:h}=e,[f,S]=(0,a.useState)(!1),[T,L]=(0,a.useState)([]),[M,D]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedMCPTools");try{let t=e?JSON.parse(e):[];return Array.isArray(t)?t:t?[t]:[]}catch(e){return console.error("Error parsing selectedMCPTools from sessionStorage",e),[]}}),[z,O]=(0,a.useState)(!1),[F,H]=(0,a.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return h?"custom":"session"}),[q,J]=(0,a.useState)(()=>sessionStorage.getItem("apiKey")||""),[V,$]=(0,a.useState)(""),[et,eo]=(0,a.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[el,ei]=(0,a.useState)(()=>sessionStorage.getItem("selectedModel")||void 0),[ed,eg]=(0,a.useState)(!1),[ep,eu]=(0,a.useState)([]),ex=(0,a.useRef)(null),[eh,eA]=(0,a.useState)(()=>sessionStorage.getItem("endpointType")||C.KP.CHAT),[eU,eR]=(0,a.useState)(!1),eL=(0,a.useRef)(null),[eM,eD]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[eK,ez]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[eO,eF]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[eH,eB]=(0,a.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[eG,eq]=(0,a.useState)(()=>sessionStorage.getItem("responsesSessionId")||null),[eJ,eW]=(0,a.useState)(()=>{let e=sessionStorage.getItem("useApiSessionManagement");return!e||JSON.parse(e)}),[eV,eY]=(0,a.useState)([]),[eX,e$]=(0,a.useState)([]),[eQ,e0]=(0,a.useState)(null),[e1,e4]=(0,a.useState)(null),[e2,e3]=(0,a.useState)(null),[e6,e5]=(0,a.useState)(null),[e8,e7]=(0,a.useState)(!1),[e9,te]=(0,a.useState)(""),[tt,ts]=(0,a.useState)("openai"),[to,ta]=(0,a.useState)([]),tn=(0,a.useRef)(null),tl=async()=>{let e="session"===F?t:q;if(e){O(!0);try{let t=await P(e);L(t)}catch(e){console.error("Error fetching MCP tools:",e)}finally{O(!1)}}};(0,a.useEffect)(()=>{f&&tl()},[f,t,q,F]),(0,a.useEffect)(()=>{e8&&te((0,R.L)({apiKeySource:F,accessToken:t,apiKey:q,inputMessage:V,chatHistory:et,selectedTags:eM,selectedVectorStores:eK,selectedGuardrails:eO,selectedMCPTools:M,endpointType:eh,selectedModel:el,selectedSdk:tt}))},[e8,tt,F,t,q,V,et,eM,eK,eO,M,eh,el]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(et))},500);return()=>{clearTimeout(e)}},[et]),(0,a.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(F)),sessionStorage.setItem("apiKey",q),sessionStorage.setItem("endpointType",eh),sessionStorage.setItem("selectedTags",JSON.stringify(eM)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(eK)),sessionStorage.setItem("selectedGuardrails",JSON.stringify(eO)),sessionStorage.setItem("selectedMCPTools",JSON.stringify(M)),el?sessionStorage.setItem("selectedModel",el):sessionStorage.removeItem("selectedModel"),eH?sessionStorage.setItem("messageTraceId",eH):sessionStorage.removeItem("messageTraceId"),eG?sessionStorage.setItem("responsesSessionId",eG):sessionStorage.removeItem("responsesSessionId"),sessionStorage.setItem("useApiSessionManagement",JSON.stringify(eJ))},[F,q,el,eh,eM,eK,eO,eH,eG,eJ,M]),(0,a.useEffect)(()=>{let e="session"===F?t:q;if(!e||!s||!i||!c){console.log("userApiKey or token or userRole or userID is missing = ",e,s,i,c);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let t=await (0,k.p)(e);console.log("Fetched models:",t),eu(t);let s=t.some(e=>e.model_group===el);t.length?s||ei(t[0].model_group):ei(void 0)}catch(e){console.error("Error fetching model info:",e)}})(),tl()},[t,c,i,F,q,s]),(0,a.useEffect)(()=>{tn.current&&setTimeout(()=>{var e;null===(e=tn.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[et]);let tr=(e,t,s)=>{console.log("updateTextUI called with:",e,t,s),eo(o=>{let a=o[o.length-1];if(!a||a.role!==e||a.isImage)return[...o,{role:e,content:t,model:s}];{var n;let e={...a,content:a.content+t,model:null!==(n=a.model)&&void 0!==n?n:s};return[...o.slice(0,-1),e]}})},ti=e=>{eo(t=>{let s=t[t.length-1];return s&&"assistant"===s.role&&!s.isImage?[...t.slice(0,t.length-1),{...s,reasoningContent:(s.reasoningContent||"")+e}]:t.length>0&&"user"===t[t.length-1].role?[...t,{role:"assistant",content:"",reasoningContent:e}]:t})},tc=e=>{console.log("updateTimingData called with:",e),eo(t=>{let s=t[t.length-1];if(console.log("Current last message:",s),s&&"assistant"===s.role){console.log("Updating assistant message with timeToFirstToken:",e);let o=[...t.slice(0,t.length-1),{...s,timeToFirstToken:e}];return console.log("Updated chat history:",o),o}return s&&"user"===s.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...t,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),t)})},td=(e,t)=>{console.log("Received usage data:",e),eo(s=>{let o=s[s.length-1];if(o&&"assistant"===o.role){console.log("Updating message with usage data:",e);let a={...o,usage:e,toolName:t};return console.log("Updated message:",a),[...s.slice(0,s.length-1),a]}return s})},tm=e=>{console.log("Received response ID for session management:",e),eJ&&eq(e)},tg=e=>{console.log("ChatUI: Received MCP event:",e),ta(t=>{if(t.some(t=>t.item_id===e.item_id&&t.type===e.type&&t.sequence_number===e.sequence_number))return console.log("ChatUI: Duplicate MCP event, skipping"),t;let s=[...t,e];return console.log("ChatUI: Updated MCP events:",s),s})},tp=(e,t)=>{eo(s=>[...s,{role:"assistant",content:e,model:t,isImage:!0}])},tu=(e,t)=>{eo(s=>{let o=s[s.length-1];if(!o||"assistant"!==o.role||o.isImage)return[...s,{role:"assistant",content:"",model:t,image:{url:e,detail:"auto"}}];{var a;let n={...o,image:{url:e,detail:"auto"},model:null!==(a=o.model)&&void 0!==a?a:t};return[...s.slice(0,-1),n]}})},tx=e=>{eY(t=>[...t,e]);let t=URL.createObjectURL(e);return e$(e=>[...e,t]),!1},th=e=>{eX[e]&&URL.revokeObjectURL(eX[e]),eY(t=>t.filter((t,s)=>s!==e)),e$(t=>t.filter((t,s)=>s!==e))},tf=()=>{eX.forEach(e=>{URL.revokeObjectURL(e)}),eY([]),e$([])},tb=()=>{e1&&URL.revokeObjectURL(e1),e0(null),e4(null)},tv=()=>{e6&&URL.revokeObjectURL(e6),e3(null),e5(null)},ty=async()=>{let e;if(""===V.trim())return;if(eh===C.KP.IMAGE_EDITS&&0===eV.length){v.Z.fromBackend("Please upload at least one image for editing");return}if(!s||!i||!c)return;let o="session"===F?t:q;if(!o){v.Z.fromBackend("Please provide an API key or select Current UI Session");return}eL.current=new AbortController;let a=eL.current.signal;if(eh===C.KP.RESPONSES&&eQ)try{e=await Y(V,eQ)}catch(e){v.Z.fromBackend("Failed to process image. Please try again.");return}else if(eh===C.KP.CHAT&&e2)try{e=await ea(V,e2)}catch(e){v.Z.fromBackend("Failed to process image. Please try again.");return}else e={role:"user",content:V};let n=eH||(0,r.Z)();eH||eB(n),eo([...et,eh===C.KP.RESPONSES&&eQ?X(V,!0,e1||void 0,eQ.name):eh===C.KP.CHAT&&e2?en(V,!0,e6||void 0,e2.name):X(V,!1)]),ta([]),eR(!0);try{if(el){if(eh===C.KP.CHAT){let t=[...et.filter(e=>!e.isImage).map(e=>{let{role:t,content:s}=e;return{role:t,content:"string"==typeof s?s:""}}),e];await b(t,(e,t)=>tr("assistant",e,t),el,o,eM,a,ti,tc,td,n,eK.length>0?eK:void 0,eO.length>0?eO:void 0,M,tu)}else if(eh===C.KP.IMAGE)await y(V,(e,t)=>tp(e,t),el,o,eM,a);else if(eh===C.KP.IMAGE_EDITS)eV.length>0&&await j(1===eV.length?eV[0]:eV,V,(e,t)=>tp(e,t),el,o,eM,a);else if(eh===C.KP.RESPONSES){let t;t=eJ&&eG?[e]:[...et.filter(e=>!e.isImage).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e],await w(t,(e,t,s)=>tr(e,t,s),el,o,eM,a,ti,tc,td,n,eK.length>0?eK:void 0,eO.length>0?eO:void 0,M,eJ?eG:null,tm,tg)}else if(eh===C.KP.ANTHROPIC_MESSAGES){let t=[...et.filter(e=>!e.isImage).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e];await N(t,(e,t,s)=>tr(e,t,s),el,o,eM,a,ti,tc,td,n,eK.length>0?eK:void 0,eO.length>0?eO:void 0,M)}}}catch(e){a.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),tr("assistant","Error fetching response:"+e))}finally{eR(!1),eL.current=null,eh===C.KP.IMAGE_EDITS&&tf(),eh===C.KP.RESPONSES&&eQ&&tb(),eh===C.KP.CHAT&&e2&&tv()}$("")};if(i&&"Admin Viewer"===i){let{Title:e,Paragraph:t}=d.default;return(0,o.jsxs)("div",{children:[(0,o.jsx)(e,{level:1,children:"Access Denied"}),(0,o.jsx)(t,{children:"Ask your proxy admin for access to test models"})]})}let tj=(0,o.jsx)(eb.Z,{style:{fontSize:24},spin:!0});return(0,o.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,o.jsx)(l.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,o.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,o.jsx)(l.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ev.Z,{className:"mr-2"})," API Key Source"]}),(0,o.jsx)(m.default,{disabled:h,value:F,style:{width:"100%"},onChange:e=>{H(e)},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===F&&(0,o.jsx)(l.oi,{className:"mt-2",placeholder:"Enter custom API key",type:"password",onValueChange:J,value:q,icon:ev.Z})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ey.Z,{className:"mr-2"})," Select Model"]}),(0,o.jsx)(m.default,{value:el,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),ei(e),eg("custom"===e)},options:[...Array.from(new Set(ep.map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%"},showSearch:!0,className:"rounded-md"}),ed&&(0,o.jsx)(l.oi,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{ex.current&&clearTimeout(ex.current),ex.current=setTimeout(()=>{ei(e)},500)}})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ej.Z,{className:"mr-2"})," Endpoint Type"]}),(0,o.jsx)(Z,{endpointType:eh,onEndpointChange:e=>{eA(e)},className:"mb-4"}),(0,o.jsx)(em,{endpointType:eh,responsesSessionId:eG,useApiSessionManagement:eJ,onToggleSessionManagement:e=>{eW(e),e||eq(null)}})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ew.Z,{className:"mr-2"})," Tags"]}),(0,o.jsx)(E,{value:eM,onChange:eD,className:"mb-4",accessToken:t||""})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(B.Z,{className:"mr-2"})," MCP Tool",(0,o.jsx)(g.Z,{className:"ml-1",title:"Select MCP tools to use in your conversation, only available for /v1/responses endpoint",children:(0,o.jsx)(ec.Z,{})})]}),(0,o.jsx)(m.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:M,onChange:e=>D(e),loading:z,className:"mb-4",allowClear:!0,optionLabelProp:"label",disabled:eh!==C.KP.RESPONSES,maxTagCount:"responsive",children:Array.isArray(T)&&T.map(e=>(0,o.jsx)(m.default.Option,{value:e.name,label:(0,o.jsx)("div",{className:"font-medium",children:e.name}),children:(0,o.jsxs)("div",{className:"flex flex-col py-1",children:[(0,o.jsx)("span",{className:"font-medium",children:e.name}),(0,o.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(eS.Z,{className:"mr-2"})," Vector Store",(0,o.jsx)(g.Z,{className:"ml-1",title:(0,o.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store"," ",(0,o.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,o.jsx)(ec.Z,{})})]}),(0,o.jsx)(A.Z,{value:eK,onChange:ez,className:"mb-4",accessToken:t||""})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(eN.Z,{className:"mr-2"})," Guardrails",(0,o.jsx)(g.Z,{className:"ml-1",title:(0,o.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails"," ",(0,o.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,o.jsx)(ec.Z,{})})]}),(0,o.jsx)(U.Z,{value:eO,onChange:eF,className:"mb-4",accessToken:t||""})]})]})]}),(0,o.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,o.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,o.jsx)(l.Dx,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsx)(l.zx,{onClick:()=>{eo([]),eB(null),eq(null),ta([]),tf(),tb(),tv(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),sessionStorage.removeItem("responsesSessionId"),v.Z.success("Chat history cleared.")},className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:ek.Z,children:"Clear Chat"}),(0,o.jsx)(l.zx,{onClick:()=>e7(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:eP.Z,children:"Get Code"})]})]}),(0,o.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===et.length&&(0,o.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,o.jsx)(ey.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,o.jsx)(l.xv,{children:"Start a conversation or generate an image"})]}),et.map((e,t)=>(0,o.jsx)("div",{children:(0,o.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,o.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,o.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,o.jsx)(eC.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,o.jsx)(ey.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,o.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,o.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,o.jsx)(K,{reasoningContent:e.reasoningContent}),"assistant"===e.role&&t===et.length-1&&to.length>0&&eh===C.KP.RESPONSES&&(0,o.jsx)("div",{className:"mb-3",children:(0,o.jsx)(ef,{events:to})}),(0,o.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,o.jsx)("img",{src:"string"==typeof e.content?e.content:"",alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):(0,o.jsxs)(o.Fragment,{children:[eh===C.KP.RESPONSES&&(0,o.jsx)(ee,{message:e}),eh===C.KP.CHAT&&(0,o.jsx)(er,{message:e}),(0,o.jsx)(n.U,{components:{code(e){let{node:t,inline:s,className:a,children:n,...l}=e,r=/language-(\w+)/.exec(a||"");return!s&&r?(0,o.jsx)(I.Z,{style:_.Z,language:r[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...l,children:String(n).replace(/\n$/,"")}):(0,o.jsx)("code",{className:"".concat(a," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...l,children:n})},pre:e=>{let{node:t,...s}=e;return(0,o.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})}},children:"string"==typeof e.content?e.content:""}),e.image&&(0,o.jsx)("div",{className:"mt-3",children:(0,o.jsx)("img",{src:e.image.url,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}})})]}),"assistant"===e.role&&(e.timeToFirstToken||e.usage)&&(0,o.jsx)(G,{timeToFirstToken:e.timeToFirstToken,usage:e.usage,toolName:e.toolName})]})]})})},t)),eU&&to.length>0&&eh===C.KP.RESPONSES&&et.length>0&&"user"===et[et.length-1].role&&(0,o.jsx)("div",{className:"text-left mb-4",children:(0,o.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"#ffffff",border:"1px solid #f0f0f0",textAlign:"left"},children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,o.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"#f5f5f5"},children:(0,o.jsx)(ey.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,o.jsx)("strong",{className:"text-sm capitalize",children:"Assistant"})]}),(0,o.jsx)(ef,{events:to})]})}),eU&&(0,o.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,o.jsx)(p.Z,{indicator:tj})}),(0,o.jsx)("div",{ref:tn,style:{height:"1px"}})]}),(0,o.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[eh===C.KP.IMAGE_EDITS&&(0,o.jsx)("div",{className:"mb-4",children:0===eV.length?(0,o.jsxs)(eE,{beforeUpload:tx,accept:"image/*",showUploadList:!1,className:"border-dashed border-2 border-gray-300 rounded-lg p-4",children:[(0,o.jsx)("p",{className:"ant-upload-drag-icon",children:(0,o.jsx)(eI.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,o.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag images to upload"}),(0,o.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats. Multiple images supported."})]}):(0,o.jsxs)("div",{className:"flex flex-wrap gap-2",children:[eV.map((e,t)=>(0,o.jsxs)("div",{className:"relative inline-block",children:[(0,o.jsx)("img",{src:eX[t]||"",alt:"Upload preview ".concat(t+1),className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,o.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:()=>th(t),children:(0,o.jsx)(e_.Z,{})})]},t)),(0,o.jsxs)("div",{className:"flex items-center justify-center w-32 h-32 border-2 border-dashed border-gray-300 rounded-md hover:border-gray-400 cursor-pointer",onClick:()=>{var e;return null===(e=document.getElementById("additional-image-upload"))||void 0===e?void 0:e.click()},children:[(0,o.jsxs)("div",{className:"text-center",children:[(0,o.jsx)(eI.Z,{style:{fontSize:"24px",color:"#666"}}),(0,o.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Add more"})]}),(0,o.jsx)("input",{id:"additional-image-upload",type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:e=>{Array.from(e.target.files||[]).forEach(e=>tx(e))}})]})]})}),eh===C.KP.RESPONSES&&eQ&&(0,o.jsx)("div",{className:"mb-2",children:(0,o.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,o.jsx)("div",{className:"relative inline-block",children:eQ.name.toLowerCase().endsWith(".pdf")?(0,o.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"16px",color:"white"}})}):(0,o.jsx)("img",{src:e1||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:eQ.name}),(0,o.jsx)("div",{className:"text-xs text-gray-500",children:eQ.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,o.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:tb,children:(0,o.jsx)(e_.Z,{style:{fontSize:"12px"}})})]})}),eh===C.KP.CHAT&&e2&&(0,o.jsx)("div",{className:"mb-2",children:(0,o.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,o.jsx)("div",{className:"relative inline-block",children:e2.name.toLowerCase().endsWith(".pdf")?(0,o.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"16px",color:"white"}})}):(0,o.jsx)("img",{src:e6||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:e2.name}),(0,o.jsx)("div",{className:"text-xs text-gray-500",children:e2.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,o.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:tv,children:(0,o.jsx)(e_.Z,{style:{fontSize:"12px"}})})]})}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,o.jsxs)("div",{className:"flex-shrink-0 mr-2",children:[eh===C.KP.RESPONSES&&!eQ&&(0,o.jsx)(W,{responsesUploadedImage:eQ,responsesImagePreviewUrl:e1,onImageUpload:e=>(e0(e),e4(URL.createObjectURL(e)),!1),onRemoveImage:tb}),eh===C.KP.CHAT&&!e2&&(0,o.jsx)(es,{chatUploadedImage:e2,chatImagePreviewUrl:e6,onImageUpload:e=>(e3(e),e5(URL.createObjectURL(e)),!1),onRemoveImage:tv})]}),(0,o.jsx)(eZ,{value:V,onChange:e=>$(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),ty())},placeholder:eh===C.KP.CHAT||eh===C.KP.RESPONSES||eh===C.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":eh===C.KP.IMAGE_EDITS?"Describe how you want to edit the image...":"Describe the image you want to generate...",disabled:eU,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,o.jsx)(l.zx,{onClick:ty,disabled:eU||!V.trim(),className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,o.jsx)(eT.Z,{style:{fontSize:"14px"}})})]}),eU&&(0,o.jsx)(l.zx,{onClick:()=>{eL.current&&(eL.current.abort(),eL.current=null,eR(!1),v.Z.info("Request cancelled"))},className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:e_.Z,children:"Cancel"})]})]})]})]})}),(0,o.jsxs)(u.Z,{title:"Generated Code",visible:e8,onCancel:()=>e7(!1),footer:null,width:800,children:[(0,o.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(l.xv,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,o.jsx)(m.default,{value:tt,onChange:e=>ts(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,o.jsx)(x.ZP,{onClick:()=>{navigator.clipboard.writeText(e9),v.Z.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,o.jsx)(I.Z,{language:"python",style:_.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:e9})]}),"custom"===F&&(0,o.jsx)(u.Z,{title:"Select MCP Tool",visible:f,onCancel:()=>S(!1),onOk:()=>{S(!1),v.Z.success("MCP tool selection updated")},width:800,children:z?(0,o.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,o.jsx)(p.Z,{indicator:(0,o.jsx)(eb.Z,{style:{fontSize:24},spin:!0})})}):(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsx)(l.xv,{className:"text-gray-600 block mb-4",children:"Select the MCP tools you want to use in your conversation."}),(0,o.jsx)(m.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:M,onChange:e=>D(e),optionLabelProp:"label",allowClear:!0,maxTagCount:"responsive",children:T.map(e=>(0,o.jsx)(m.default.Option,{value:e.name,label:(0,o.jsx)("div",{className:"font-medium",children:e.name}),children:(0,o.jsxs)("div",{className:"flex flex-col py-1",children:[(0,o.jsx)("span",{className:"font-medium",children:e.name}),(0,o.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]})})]})}}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/1160-3efb81c958413447.js b/litellm/proxy/_experimental/out/_next/static/chunks/1160-08491effeedbaae3.js similarity index 99% rename from ui/litellm-dashboard/out/_next/static/chunks/1160-3efb81c958413447.js rename to litellm/proxy/_experimental/out/_next/static/chunks/1160-08491effeedbaae3.js index 2a26d9fe08..192f36bba2 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/1160-3efb81c958413447.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1160-08491effeedbaae3.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1160],{69993:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},a=n(55015),c=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return eM}});var r=n(5853),o=n(7084),i=n(26898),a=n(97324),c=n(1153),l=n(2265),s=n(60474),u=n(47625),p=n(93765),f=n(86757),d=n.n(f),y=n(9841),m=n(81889),h=n(87602),v=n(82944),b=["points","className","baseLinePoints","connectNulls"];function g(){return(g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){x(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),x(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},j=function(e,t){var n=k(e);t&&(n=[n.reduce(function(e,t){return[].concat(A(e),A(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},w=function(e,t,n){var r=j(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(j(t.reverse(),n).slice(1))},P=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,b);if(!t||!t.length)return null;var a=(0,h.Z)("recharts-polygon",n);if(r&&r.length){var c=i.stroke&&"none"!==i.stroke,s=w(t,r,o);return l.createElement("g",{className:a},l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"Z"===s.slice(-1)?i.fill:"none",stroke:"none",d:s})),c?l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"none",d:j(t,o)})):null,c?l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"none",d:j(r,o)})):null)}var u=j(t,o);return l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"Z"===u.slice(-1)?i.fill:"none",className:a,d:u}))},E=n(58811),S=n(41637),T=n(39206);function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L(){return(L=Object.assign?Object.assign.bind():function(e){for(var t=1;t1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,i=e.axisLineType,a=I(I({},(0,v.L6)(this.props,!1)),{},{fill:"none"},(0,v.L6)(o,!1));if("circle"===i)return l.createElement(m.o,L({className:"recharts-polar-angle-axis-line"},a,{cx:t,cy:n,r:r}));var c=this.props.ticks.map(function(e){return(0,T.op)(t,n,r,e.coordinate)});return l.createElement(P,L({className:"recharts-polar-angle-axis-line"},a,{points:c}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.tickLine,a=t.tickFormatter,c=t.stroke,s=(0,v.L6)(this.props,!1),u=(0,v.L6)(r,!1),p=I(I({},s),{},{fill:"none"},(0,v.L6)(o,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),d=I(I(I({textAnchor:e.getTickTextAnchor(t)},s),{},{stroke:"none",fill:c},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return l.createElement(y.m,L({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(t.coordinate)},(0,S.bw)(e.props,t,n)),o&&l.createElement("line",L({className:"recharts-polar-angle-axis-tick-line"},p,f)),r&&i.renderTickItem(r,d,a?a(t.value,n):t.value))});return l.createElement(y.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?l.createElement(y.m,{className:"recharts-polar-angle-axis"},r&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return l.isValidElement(e)?l.cloneElement(e,t):d()(e)?e(t):l.createElement(E.x,L({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],n&&C(i.prototype,n),r&&C(i,r),Object.defineProperty(i,"prototype",{writable:!1}),i}(l.PureComponent);_(B,"displayName","PolarAngleAxis"),_(B,"axisType","angleAxis"),_(B,"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 K=n(35802),V=n.n(K),z=n(37891),$=n.n(z),H=n(26680),q=["cx","cy","angle","ticks","axisLine"],G=["ticks","tick","angle","tickFormatter","stroke"];function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U(){return(U=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Q(e,t){for(var n=0;n0?ec()(e,"paddingAngle",0):0;if(n){var c=(0,eh.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),l=ek(ek({},e),{},{startAngle:i+a,endAngle:i+c(r)+a});o.push(l),i=l.endAngle}else{var s=e.endAngle,p=e.startAngle,f=(0,eh.k4)(0,s-p)(r),d=ek(ek({},e),{},{startAngle:i+a,endAngle:i+f+a});o.push(d),i=d.endAngle}}),l.createElement(y.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!es()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,i=t.label,a=t.cx,c=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eh.hj)(a)||!(0,eh.hj)(c)||!(0,eh.hj)(s)||!(0,eh.hj)(u))return null;var d=(0,h.Z)("recharts-pie",o);return l.createElement(y.m,{tabIndex:this.props.rootTabIndex,className:d,ref:function(t){e.pieRef=t}},this.renderSectors(),i&&this.renderLabels(r),H._.renderCallByParent(this.props,null,!1),(!p||f)&&ed.e.renderCallByParent(this.props,r,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e=360?A:A-1)*u,x=i.reduce(function(e,t){var n=(0,ev.F$)(t,g,0);return e+((0,eh.hj)(n)?n:0)},0);return x>0&&(t=i.map(function(e,t){var r,o=(0,ev.F$)(e,g,0),i=(0,ev.F$)(e,f,t),a=((0,eh.hj)(o)?o:0)/x,s=(r=t?n.endAngle+(0,eh.uY)(v)*u*(0!==o?1:0):l)+(0,eh.uY)(v)*((0!==o?m:0)+a*O),p=(r+s)/2,d=(h.innerRadius+h.outerRadius)/2,b=[{name:i,value:o,payload:e,dataKey:g,type:y}],A=(0,T.op)(h.cx,h.cy,d,p);return n=ek(ek(ek({percent:a,cornerRadius:c,name:i,tooltipPayload:b,midAngle:p,middleRadius:d,tooltipPosition:A},e),h),{},{value:(0,ev.F$)(e,g),startAngle:r,endAngle:s,payload:e,paddingAngle:(0,eh.uY)(v)*u})})),ek(ek({},h),{},{sectors:t,data:i})});var eL=(0,p.z)({chartName:"PieChart",GraphicalChild:eR,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:B},{axisType:"radiusAxis",AxisComp:eo}],formatAxisMap:T.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eN=n(8147),eI=n(69448),eC=n(98593);let eD=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return l.createElement(eC.$B,null,l.createElement("div",{className:(0,a.q)("px-4 py-2")},l.createElement(eC.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eF=(e,t)=>e.map((e,n)=>{let r=ne||t((0,c.vP)(n.map(e=>e[r]))),eZ=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c}=e;return l.createElement("g",null,l.createElement(s.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c,fill:"",opacity:.3,style:{outline:"none"}}))},eM=l.forwardRef((e,t)=>{let{data:n=[],category:s="value",index:p="name",colors:f=i.s,variant:d="donut",valueFormatter:y=c.Cj,label:m,showLabel:h=!0,animationDuration:v=900,showAnimation:b=!1,showTooltip:g=!0,noDataText:A,onValueChange:O,customTooltip:x,className:k}=e,j=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),w="donut"==d,P=e_(m,y,n,s),[E,S]=l.useState(void 0),T=!!O;return(0,l.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[E]),l.createElement("div",Object.assign({ref:t,className:(0,a.q)("w-full h-40",k)},j),l.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?l.createElement(eL,{onClick:T&&E?()=>{S(void 0),null==O||O(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},h&&w?l.createElement("text",{className:(0,a.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},P):null,l.createElement(eR,{className:(0,a.q)("stroke-tremor-background dark:stroke-dark-tremor-background",O?"cursor-pointer":"cursor-default"),data:eF(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:w?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:s,nameKey:p,isAnimationActive:b,animationDuration:v,onClick:function(e,t,n){n.stopPropagation(),T&&(E===t?(S(void 0),null==O||O(null)):(S(t),null==O||O(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:E,inactiveShape:eZ,style:{outline:"none"}}),l.createElement(eN.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:g?e=>{var t;let{active:n,payload:r}=e;return x?l.createElement(x,{payload:null==r?void 0:r.map(e=>{var t,n,i;return Object.assign(Object.assign({},e),{color:null!==(i=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==i?i:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):l.createElement(eD,{active:n,payload:r,valueFormatter:y})}:l.createElement(l.Fragment,null)})):l.createElement(eI.Z,{noDataText:A})))});eM.displayName="DonutChart"},7366:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(41154),o=n(25721),i=n(55463),a=n(99735),c=n(7656),l=n(47869);function s(e,t){if((0,c.Z)(2,arguments),!t||"object"!==(0,r.Z)(t))return new Date(NaN);var n=t.years?(0,l.Z)(t.years):0,s=t.months?(0,l.Z)(t.months):0,u=t.weeks?(0,l.Z)(t.weeks):0,p=t.days?(0,l.Z)(t.days):0,f=t.hours?(0,l.Z)(t.hours):0,d=t.minutes?(0,l.Z)(t.minutes):0,y=t.seconds?(0,l.Z)(t.seconds):0,m=(0,a.Z)(e),h=s||n?(0,i.Z)(m,s+12*n):m;return new Date((p||u?(0,o.Z)(h,p+7*u):h).getTime()+1e3*(y+60*(d+60*f)))}},35802:function(e,t,n){var r=n(67646),o=n(58905),i=n(88157);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),i=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),i):void 0}},58710:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o}}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1160],{69993:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},a=n(55015),c=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return eM}});var r=n(5853),o=n(7084),i=n(26898),a=n(97324),c=n(1153),l=n(2265),s=n(60474),u=n(47625),p=n(93765),f=n(86757),d=n.n(f),y=n(9841),m=n(81889),h=n(61994),v=n(82944),b=["points","className","baseLinePoints","connectNulls"];function g(){return(g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){x(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),x(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},j=function(e,t){var n=k(e);t&&(n=[n.reduce(function(e,t){return[].concat(A(e),A(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},w=function(e,t,n){var r=j(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(j(t.reverse(),n).slice(1))},P=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,b);if(!t||!t.length)return null;var a=(0,h.Z)("recharts-polygon",n);if(r&&r.length){var c=i.stroke&&"none"!==i.stroke,s=w(t,r,o);return l.createElement("g",{className:a},l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"Z"===s.slice(-1)?i.fill:"none",stroke:"none",d:s})),c?l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"none",d:j(t,o)})):null,c?l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"none",d:j(r,o)})):null)}var u=j(t,o);return l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"Z"===u.slice(-1)?i.fill:"none",className:a,d:u}))},E=n(58811),S=n(41637),T=n(39206);function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L(){return(L=Object.assign?Object.assign.bind():function(e){for(var t=1;t1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,i=e.axisLineType,a=I(I({},(0,v.L6)(this.props,!1)),{},{fill:"none"},(0,v.L6)(o,!1));if("circle"===i)return l.createElement(m.o,L({className:"recharts-polar-angle-axis-line"},a,{cx:t,cy:n,r:r}));var c=this.props.ticks.map(function(e){return(0,T.op)(t,n,r,e.coordinate)});return l.createElement(P,L({className:"recharts-polar-angle-axis-line"},a,{points:c}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.tickLine,a=t.tickFormatter,c=t.stroke,s=(0,v.L6)(this.props,!1),u=(0,v.L6)(r,!1),p=I(I({},s),{},{fill:"none"},(0,v.L6)(o,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),d=I(I(I({textAnchor:e.getTickTextAnchor(t)},s),{},{stroke:"none",fill:c},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return l.createElement(y.m,L({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(t.coordinate)},(0,S.bw)(e.props,t,n)),o&&l.createElement("line",L({className:"recharts-polar-angle-axis-tick-line"},p,f)),r&&i.renderTickItem(r,d,a?a(t.value,n):t.value))});return l.createElement(y.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?l.createElement(y.m,{className:"recharts-polar-angle-axis"},r&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return l.isValidElement(e)?l.cloneElement(e,t):d()(e)?e(t):l.createElement(E.x,L({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],n&&C(i.prototype,n),r&&C(i,r),Object.defineProperty(i,"prototype",{writable:!1}),i}(l.PureComponent);_(B,"displayName","PolarAngleAxis"),_(B,"axisType","angleAxis"),_(B,"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 K=n(35802),V=n.n(K),z=n(37891),$=n.n(z),H=n(26680),q=["cx","cy","angle","ticks","axisLine"],G=["ticks","tick","angle","tickFormatter","stroke"];function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U(){return(U=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Q(e,t){for(var n=0;n0?ec()(e,"paddingAngle",0):0;if(n){var c=(0,eh.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),l=ek(ek({},e),{},{startAngle:i+a,endAngle:i+c(r)+a});o.push(l),i=l.endAngle}else{var s=e.endAngle,p=e.startAngle,f=(0,eh.k4)(0,s-p)(r),d=ek(ek({},e),{},{startAngle:i+a,endAngle:i+f+a});o.push(d),i=d.endAngle}}),l.createElement(y.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!es()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,i=t.label,a=t.cx,c=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eh.hj)(a)||!(0,eh.hj)(c)||!(0,eh.hj)(s)||!(0,eh.hj)(u))return null;var d=(0,h.Z)("recharts-pie",o);return l.createElement(y.m,{tabIndex:this.props.rootTabIndex,className:d,ref:function(t){e.pieRef=t}},this.renderSectors(),i&&this.renderLabels(r),H._.renderCallByParent(this.props,null,!1),(!p||f)&&ed.e.renderCallByParent(this.props,r,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e=360?A:A-1)*u,x=i.reduce(function(e,t){var n=(0,ev.F$)(t,g,0);return e+((0,eh.hj)(n)?n:0)},0);return x>0&&(t=i.map(function(e,t){var r,o=(0,ev.F$)(e,g,0),i=(0,ev.F$)(e,f,t),a=((0,eh.hj)(o)?o:0)/x,s=(r=t?n.endAngle+(0,eh.uY)(v)*u*(0!==o?1:0):l)+(0,eh.uY)(v)*((0!==o?m:0)+a*O),p=(r+s)/2,d=(h.innerRadius+h.outerRadius)/2,b=[{name:i,value:o,payload:e,dataKey:g,type:y}],A=(0,T.op)(h.cx,h.cy,d,p);return n=ek(ek(ek({percent:a,cornerRadius:c,name:i,tooltipPayload:b,midAngle:p,middleRadius:d,tooltipPosition:A},e),h),{},{value:(0,ev.F$)(e,g),startAngle:r,endAngle:s,payload:e,paddingAngle:(0,eh.uY)(v)*u})})),ek(ek({},h),{},{sectors:t,data:i})});var eL=(0,p.z)({chartName:"PieChart",GraphicalChild:eR,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:B},{axisType:"radiusAxis",AxisComp:eo}],formatAxisMap:T.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eN=n(8147),eI=n(69448),eC=n(98593);let eD=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return l.createElement(eC.$B,null,l.createElement("div",{className:(0,a.q)("px-4 py-2")},l.createElement(eC.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eF=(e,t)=>e.map((e,n)=>{let r=ne||t((0,c.vP)(n.map(e=>e[r]))),eZ=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c}=e;return l.createElement("g",null,l.createElement(s.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c,fill:"",opacity:.3,style:{outline:"none"}}))},eM=l.forwardRef((e,t)=>{let{data:n=[],category:s="value",index:p="name",colors:f=i.s,variant:d="donut",valueFormatter:y=c.Cj,label:m,showLabel:h=!0,animationDuration:v=900,showAnimation:b=!1,showTooltip:g=!0,noDataText:A,onValueChange:O,customTooltip:x,className:k}=e,j=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),w="donut"==d,P=e_(m,y,n,s),[E,S]=l.useState(void 0),T=!!O;return(0,l.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[E]),l.createElement("div",Object.assign({ref:t,className:(0,a.q)("w-full h-40",k)},j),l.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?l.createElement(eL,{onClick:T&&E?()=>{S(void 0),null==O||O(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},h&&w?l.createElement("text",{className:(0,a.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},P):null,l.createElement(eR,{className:(0,a.q)("stroke-tremor-background dark:stroke-dark-tremor-background",O?"cursor-pointer":"cursor-default"),data:eF(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:w?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:s,nameKey:p,isAnimationActive:b,animationDuration:v,onClick:function(e,t,n){n.stopPropagation(),T&&(E===t?(S(void 0),null==O||O(null)):(S(t),null==O||O(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:E,inactiveShape:eZ,style:{outline:"none"}}),l.createElement(eN.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:g?e=>{var t;let{active:n,payload:r}=e;return x?l.createElement(x,{payload:null==r?void 0:r.map(e=>{var t,n,i;return Object.assign(Object.assign({},e),{color:null!==(i=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==i?i:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):l.createElement(eD,{active:n,payload:r,valueFormatter:y})}:l.createElement(l.Fragment,null)})):l.createElement(eI.Z,{noDataText:A})))});eM.displayName="DonutChart"},7366:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(41154),o=n(25721),i=n(55463),a=n(99735),c=n(7656),l=n(47869);function s(e,t){if((0,c.Z)(2,arguments),!t||"object"!==(0,r.Z)(t))return new Date(NaN);var n=t.years?(0,l.Z)(t.years):0,s=t.months?(0,l.Z)(t.months):0,u=t.weeks?(0,l.Z)(t.weeks):0,p=t.days?(0,l.Z)(t.days):0,f=t.hours?(0,l.Z)(t.hours):0,d=t.minutes?(0,l.Z)(t.minutes):0,y=t.seconds?(0,l.Z)(t.seconds):0,m=(0,a.Z)(e),h=s||n?(0,i.Z)(m,s+12*n):m;return new Date((p||u?(0,o.Z)(h,p+7*u):h).getTime()+1e3*(y+60*(d+60*f)))}},35802:function(e,t,n){var r=n(67646),o=n(58905),i=n(88157);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),i=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),i):void 0}},58710:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1160-3efb81c958413447.js b/litellm/proxy/_experimental/out/_next/static/chunks/1160-3efb81c958413447.js deleted file mode 100644 index 2a26d9fe08..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1160-3efb81c958413447.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1160],{69993:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},a=n(55015),c=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return eM}});var r=n(5853),o=n(7084),i=n(26898),a=n(97324),c=n(1153),l=n(2265),s=n(60474),u=n(47625),p=n(93765),f=n(86757),d=n.n(f),y=n(9841),m=n(81889),h=n(87602),v=n(82944),b=["points","className","baseLinePoints","connectNulls"];function g(){return(g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){x(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),x(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},j=function(e,t){var n=k(e);t&&(n=[n.reduce(function(e,t){return[].concat(A(e),A(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},w=function(e,t,n){var r=j(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(j(t.reverse(),n).slice(1))},P=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,b);if(!t||!t.length)return null;var a=(0,h.Z)("recharts-polygon",n);if(r&&r.length){var c=i.stroke&&"none"!==i.stroke,s=w(t,r,o);return l.createElement("g",{className:a},l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"Z"===s.slice(-1)?i.fill:"none",stroke:"none",d:s})),c?l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"none",d:j(t,o)})):null,c?l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"none",d:j(r,o)})):null)}var u=j(t,o);return l.createElement("path",g({},(0,v.L6)(i,!0),{fill:"Z"===u.slice(-1)?i.fill:"none",className:a,d:u}))},E=n(58811),S=n(41637),T=n(39206);function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L(){return(L=Object.assign?Object.assign.bind():function(e){for(var t=1;t1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,i=e.axisLineType,a=I(I({},(0,v.L6)(this.props,!1)),{},{fill:"none"},(0,v.L6)(o,!1));if("circle"===i)return l.createElement(m.o,L({className:"recharts-polar-angle-axis-line"},a,{cx:t,cy:n,r:r}));var c=this.props.ticks.map(function(e){return(0,T.op)(t,n,r,e.coordinate)});return l.createElement(P,L({className:"recharts-polar-angle-axis-line"},a,{points:c}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.tickLine,a=t.tickFormatter,c=t.stroke,s=(0,v.L6)(this.props,!1),u=(0,v.L6)(r,!1),p=I(I({},s),{},{fill:"none"},(0,v.L6)(o,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),d=I(I(I({textAnchor:e.getTickTextAnchor(t)},s),{},{stroke:"none",fill:c},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return l.createElement(y.m,L({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(t.coordinate)},(0,S.bw)(e.props,t,n)),o&&l.createElement("line",L({className:"recharts-polar-angle-axis-tick-line"},p,f)),r&&i.renderTickItem(r,d,a?a(t.value,n):t.value))});return l.createElement(y.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?l.createElement(y.m,{className:"recharts-polar-angle-axis"},r&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return l.isValidElement(e)?l.cloneElement(e,t):d()(e)?e(t):l.createElement(E.x,L({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],n&&C(i.prototype,n),r&&C(i,r),Object.defineProperty(i,"prototype",{writable:!1}),i}(l.PureComponent);_(B,"displayName","PolarAngleAxis"),_(B,"axisType","angleAxis"),_(B,"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 K=n(35802),V=n.n(K),z=n(37891),$=n.n(z),H=n(26680),q=["cx","cy","angle","ticks","axisLine"],G=["ticks","tick","angle","tickFormatter","stroke"];function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U(){return(U=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Q(e,t){for(var n=0;n0?ec()(e,"paddingAngle",0):0;if(n){var c=(0,eh.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),l=ek(ek({},e),{},{startAngle:i+a,endAngle:i+c(r)+a});o.push(l),i=l.endAngle}else{var s=e.endAngle,p=e.startAngle,f=(0,eh.k4)(0,s-p)(r),d=ek(ek({},e),{},{startAngle:i+a,endAngle:i+f+a});o.push(d),i=d.endAngle}}),l.createElement(y.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!es()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,i=t.label,a=t.cx,c=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eh.hj)(a)||!(0,eh.hj)(c)||!(0,eh.hj)(s)||!(0,eh.hj)(u))return null;var d=(0,h.Z)("recharts-pie",o);return l.createElement(y.m,{tabIndex:this.props.rootTabIndex,className:d,ref:function(t){e.pieRef=t}},this.renderSectors(),i&&this.renderLabels(r),H._.renderCallByParent(this.props,null,!1),(!p||f)&&ed.e.renderCallByParent(this.props,r,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e=360?A:A-1)*u,x=i.reduce(function(e,t){var n=(0,ev.F$)(t,g,0);return e+((0,eh.hj)(n)?n:0)},0);return x>0&&(t=i.map(function(e,t){var r,o=(0,ev.F$)(e,g,0),i=(0,ev.F$)(e,f,t),a=((0,eh.hj)(o)?o:0)/x,s=(r=t?n.endAngle+(0,eh.uY)(v)*u*(0!==o?1:0):l)+(0,eh.uY)(v)*((0!==o?m:0)+a*O),p=(r+s)/2,d=(h.innerRadius+h.outerRadius)/2,b=[{name:i,value:o,payload:e,dataKey:g,type:y}],A=(0,T.op)(h.cx,h.cy,d,p);return n=ek(ek(ek({percent:a,cornerRadius:c,name:i,tooltipPayload:b,midAngle:p,middleRadius:d,tooltipPosition:A},e),h),{},{value:(0,ev.F$)(e,g),startAngle:r,endAngle:s,payload:e,paddingAngle:(0,eh.uY)(v)*u})})),ek(ek({},h),{},{sectors:t,data:i})});var eL=(0,p.z)({chartName:"PieChart",GraphicalChild:eR,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:B},{axisType:"radiusAxis",AxisComp:eo}],formatAxisMap:T.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eN=n(8147),eI=n(69448),eC=n(98593);let eD=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return l.createElement(eC.$B,null,l.createElement("div",{className:(0,a.q)("px-4 py-2")},l.createElement(eC.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eF=(e,t)=>e.map((e,n)=>{let r=ne||t((0,c.vP)(n.map(e=>e[r]))),eZ=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c}=e;return l.createElement("g",null,l.createElement(s.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c,fill:"",opacity:.3,style:{outline:"none"}}))},eM=l.forwardRef((e,t)=>{let{data:n=[],category:s="value",index:p="name",colors:f=i.s,variant:d="donut",valueFormatter:y=c.Cj,label:m,showLabel:h=!0,animationDuration:v=900,showAnimation:b=!1,showTooltip:g=!0,noDataText:A,onValueChange:O,customTooltip:x,className:k}=e,j=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),w="donut"==d,P=e_(m,y,n,s),[E,S]=l.useState(void 0),T=!!O;return(0,l.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[E]),l.createElement("div",Object.assign({ref:t,className:(0,a.q)("w-full h-40",k)},j),l.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?l.createElement(eL,{onClick:T&&E?()=>{S(void 0),null==O||O(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},h&&w?l.createElement("text",{className:(0,a.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},P):null,l.createElement(eR,{className:(0,a.q)("stroke-tremor-background dark:stroke-dark-tremor-background",O?"cursor-pointer":"cursor-default"),data:eF(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:w?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:s,nameKey:p,isAnimationActive:b,animationDuration:v,onClick:function(e,t,n){n.stopPropagation(),T&&(E===t?(S(void 0),null==O||O(null)):(S(t),null==O||O(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:E,inactiveShape:eZ,style:{outline:"none"}}),l.createElement(eN.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:g?e=>{var t;let{active:n,payload:r}=e;return x?l.createElement(x,{payload:null==r?void 0:r.map(e=>{var t,n,i;return Object.assign(Object.assign({},e),{color:null!==(i=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==i?i:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):l.createElement(eD,{active:n,payload:r,valueFormatter:y})}:l.createElement(l.Fragment,null)})):l.createElement(eI.Z,{noDataText:A})))});eM.displayName="DonutChart"},7366:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(41154),o=n(25721),i=n(55463),a=n(99735),c=n(7656),l=n(47869);function s(e,t){if((0,c.Z)(2,arguments),!t||"object"!==(0,r.Z)(t))return new Date(NaN);var n=t.years?(0,l.Z)(t.years):0,s=t.months?(0,l.Z)(t.months):0,u=t.weeks?(0,l.Z)(t.weeks):0,p=t.days?(0,l.Z)(t.days):0,f=t.hours?(0,l.Z)(t.hours):0,d=t.minutes?(0,l.Z)(t.minutes):0,y=t.seconds?(0,l.Z)(t.seconds):0,m=(0,a.Z)(e),h=s||n?(0,i.Z)(m,s+12*n):m;return new Date((p||u?(0,o.Z)(h,p+7*u):h).getTime()+1e3*(y+60*(d+60*f)))}},35802:function(e,t,n){var r=n(67646),o=n(58905),i=n(88157);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),i=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),i):void 0}},58710:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1307-3d9ef20b529a0edc.js b/litellm/proxy/_experimental/out/_next/static/chunks/1307-3d9ef20b529a0edc.js new file mode 100644 index 0000000000..6b4b8a03a4 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1307-3d9ef20b529a0edc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1307],{21307:function(e,s,r){r.d(s,{d:function(){return eR},o:function(){return eY}});var l=r(57437),t=r(2265),a=r(16593),n=r(52787),i=r(82680),o=r(89970),c=r(20831),d=r(12485),m=r(18135),x=r(35242),u=r(29706),h=r(77991),p=r(49804),j=r(67101),g=r(84264),v=r(96761),f=r(12322),b=r(47323),y=r(53410),N=r(74998);let _=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let r=e.split("/mcp/");if(2!==r.length)return{token:null,baseUrl:e};let l=r[0]+"/mcp/",t=r[1];if(!t)return{token:null,baseUrl:e};return{token:t,baseUrl:l}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},Z=e=>{let{token:s,baseUrl:r}=_(e);return s?r+"...":e},w=e=>{let{token:s}=_(e);return{maskedUrl:Z(e),hasToken:!!s}},C=e=>e?/^https?:\/\/[^\s/$.?#].[^\s]*$/i.test(e)?Promise.resolve():Promise.reject("Please enter a valid URL (e.g., http://service-name.domain:1234/path or https://example.com)"):Promise.resolve(),S=e=>e&&e.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve(),k=(e,s,r,t)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:r}=e;return(0,l.jsxs)("button",{onClick:()=>s(r.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[r.original.server_id.slice(0,7),"..."]})}},{accessorKey:"server_name",header:"Name"},{accessorKey:"alias",header:"Alias"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:r}=w(s.original.url);return(0,l.jsx)("span",{className:"font-mono text-sm",children:r})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,l.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,l.jsx)("span",{children:s()||"none"})}},{id:"health_status",header:"Health Status",cell:e=>{let{row:s}=e,r=s.original,t=r.status||"unknown",a=r.last_health_check,n=r.health_check_error,i=(0,l.jsxs)("div",{className:"max-w-xs",children:[(0,l.jsxs)("div",{className:"font-semibold mb-1",children:["Health Status: ",t]}),a&&(0,l.jsxs)("div",{className:"text-xs mb-1",children:["Last Check: ",new Date(a).toLocaleString()]}),n&&(0,l.jsxs)("div",{className:"text-xs",children:[(0,l.jsx)("div",{className:"font-medium text-red-400 mb-1",children:"Error:"}),(0,l.jsx)("div",{className:"break-words",children:n})]}),!a&&!n&&(0,l.jsx)("div",{className:"text-xs text-gray-400",children:"No health check data available"})]});return(0,l.jsx)(o.Z,{title:i,placement:"top",children:(0,l.jsxs)("button",{className:"font-mono text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[10ch] ".concat((e=>{switch(e){case"healthy":return"text-green-500 bg-green-50 hover:bg-green-100";case"unhealthy":return"text-red-500 bg-red-50 hover:bg-red-100";default:return"text-gray-500 bg-gray-50 hover:bg-gray-100"}})(t)),children:[(0,l.jsx)("span",{className:"mr-1",children:"●"}),t.charAt(0).toUpperCase()+t.slice(1)]})})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,r=s.original.mcp_access_groups;if(Array.isArray(r)&&r.length>0&&"string"==typeof r[0]){let e=r.join(", ");return(0,l.jsx)(o.Z,{title:e,children:(0,l.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,l.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,l.jsx)("span",{className:"text-xs",children:r.created_at?new Date(r.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,l.jsx)("span",{className:"text-xs",children:r.updated_at?new Date(r.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(b.Z,{icon:y.Z,size:"sm",onClick:()=>r(s.original.server_id),className:"cursor-pointer"}),(0,l.jsx)(b.Z,{icon:N.Z,size:"sm",onClick:()=>t(s.original.server_id),className:"cursor-pointer"})]})}}];var P=r(19250),A=r(20347),L=r(10900),M=r(82376),T=r(71437),I=r(12514);let E={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic"},z={SSE:"sse"},q=e=>(console.log(e),null==e)?z.SSE:e,O=e=>null==e?E.NONE:e,R=e=>O(e)!==E.NONE;var U=r(13634),F=r(73002),B=r(49566),K=r(20577),V=r(44851),D=r(33866),H=r(62670),G=r(15424),Y=r(58630),J=e=>{let{value:s={},onChange:r,tools:t=[],disabled:a=!1}=e,n=(e,l)=>{let t={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:l}};null==r||r(t)};return(0,l.jsx)(I.Z,{children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,l.jsx)(H.Z,{className:"text-green-600"}),(0,l.jsx)(v.Z,{children:"Cost Configuration"}),(0,l.jsx)(o.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,l.jsx)(G.Z,{className:"text-gray-400"})})]}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,l.jsx)(o.Z,{title:"Default cost charged for each tool call to this server.",children:(0,l.jsx)(G.Z,{className:"ml-1 text-gray-400"})})]}),(0,l.jsx)(K.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let l={...s,default_cost_per_query:e};null==r||r(l)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,l.jsx)(g.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),t.length>0&&(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,l.jsx)(o.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,l.jsx)(G.Z,{className:"ml-1 text-gray-400"})})]}),(0,l.jsx)(V.default,{items:[{key:"1",label:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(Y.Z,{className:"mr-2 text-blue-500"}),(0,l.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,l.jsx)(D.Z,{count:t.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,l.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:t.map((e,r)=>{var t;return(0,l.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)(g.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,l.jsx)(g.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,l.jsx)("div",{className:"ml-4",children:(0,l.jsx)(K.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(t=s.tool_name_to_cost_per_query)||void 0===t?void 0:t[e.name],onChange:s=>n(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},r)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,l.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,l.jsx)(g.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,l.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,l.jsxs)(g.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,l.jsxs)(g.Z,{className:"text-blue-700",children:["• ",s,": $",r.toFixed(4)," per query"]},s)})]})]})]})})};let{Panel:$}=V.default;var W=e=>{let{availableAccessGroups:s,mcpServer:r,searchValue:a,setSearchValue:i,getAccessGroupOptions:c}=e,d=U.Z.useFormInstance();return(0,t.useEffect)(()=>{r&&r.extra_headers&&d.setFieldValue("extra_headers",r.extra_headers)},[r,d]),(0,l.jsx)(V.default,{className:"bg-gray-50 border border-gray-200 rounded-lg",expandIconPosition:"end",ghost:!1,children:(0,l.jsx)($,{header:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Permission Management / Access Control"})]}),(0,l.jsx)("p",{className:"text-sm text-gray-600 ml-4",children:"Configure access permissions and security settings (Optional)"})]}),className:"border-0",children:(0,l.jsxs)("div",{className:"space-y-6 pt-4",children:[(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,l.jsx)(o.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,l.jsx)(n.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var r;return(null!==(r=null==s?void 0:s.value)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>i(e),tokenSeparators:[","],options:c(),maxTagCount:"responsive",allowClear:!0})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Extra Headers",(0,l.jsx)(o.Z,{title:"Forward custom headers from incoming requests to this MCP server (e.g., Authorization, X-Custom-Header, User-Agent)",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})}),(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0&&(0,l.jsxs)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:[r.extra_headers.length," configured"]})]}),name:"extra_headers",children:(0,l.jsx)(n.default,{mode:"tags",placeholder:(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0?"Currently: ".concat(r.extra_headers.join(", ")):"Enter header names (e.g., Authorization, X-Custom-Header)",className:"rounded-lg",size:"large",tokenSeparators:[","],allowClear:!0})})]})},"permissions")})},Q=r(83669),X=r(87908),ee=r(4156);let es=e=>{let{accessToken:s,formValues:r,enabled:l=!0}=e,[a,n]=(0,t.useState)([]),[i,o]=(0,t.useState)(!1),[c,d]=(0,t.useState)(null),[m,x]=(0,t.useState)(!1),u=!!(r.url&&r.transport&&r.auth_type&&s),h=async()=>{if(s&&r.url){o(!0),d(null);try{let e={server_id:r.server_id||"",server_name:r.server_name||"",url:r.url,transport:r.transport,auth_type:r.auth_type,mcp_info:r.mcp_info},l=await (0,P.testMCPToolsListRequest)(s,e);if(l.tools&&!l.error)n(l.tools),d(null),l.tools.length>0&&!m&&x(!0);else{let e=l.message||"Failed to retrieve tools list";d(e),n([]),x(!1)}}catch(e){console.error("Tools fetch error:",e),d(e instanceof Error?e.message:String(e)),n([]),x(!1)}finally{o(!1)}}},p=()=>{n([]),d(null),x(!1)};return(0,t.useEffect)(()=>{l&&(u?h():p())},[r.url,r.transport,r.auth_type,s,l,u]),{tools:a,isLoadingTools:i,toolsError:c,hasShownSuccessMessage:m,canFetchTools:u,fetchTools:h,clearTools:p}};var er=e=>{let{accessToken:s,formValues:r,allowedTools:a,existingAllowedTools:n,onAllowedToolsChange:i}=e,o=(0,t.useRef)(0),{tools:c,isLoadingTools:d,toolsError:m,canFetchTools:x}=es({accessToken:s,formValues:r,enabled:!0});(0,t.useEffect)(()=>{if(c.length>0&&c.length!==o.current&&0===a.length){if(n&&n.length>0){let e=c.map(e=>e.name);i(n.filter(s=>e.includes(s)))}else i(c.map(e=>e.name))}o.current=c.length},[c,a.length,n,i]);let u=e=>{a.includes(e)?i(a.filter(s=>s!==e)):i([...a,e])};return x||r.url?(0,l.jsx)(I.Z,{children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("div",{className:"flex items-center justify-between",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Y.Z,{className:"text-blue-600"}),(0,l.jsx)(v.Z,{children:"Tool Configuration"}),c.length>0&&(0,l.jsx)(D.Z,{count:c.length,style:{backgroundColor:"#52c41a"}})]})}),(0,l.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,l.jsxs)(g.Z,{className:"text-blue-800 text-sm",children:[(0,l.jsx)("strong",{children:"Select which tools users can call:"})," Only checked tools will be available for users to invoke. Unchecked tools will be blocked from execution."]})}),d&&(0,l.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,l.jsx)(X.Z,{size:"large"}),(0,l.jsx)(g.Z,{className:"ml-3",children:"Loading tools..."})]}),m&&!d&&(0,l.jsxs)("div",{className:"text-center py-6 text-red-500 border rounded-lg border-dashed border-red-300 bg-red-50",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm text-red-500",children:m})]}),!d&&!m&&0===c.length&&x&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{children:"No tools available for configuration"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm",children:"Connect to an MCP server with tools to configure them"})]}),!x&&r.url&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{children:"Complete required fields to configure tools"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to load available tools"})]}),!d&&!m&&c.length>0&&(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-50 rounded-lg border border-green-200 flex-1",children:[(0,l.jsx)(Q.Z,{className:"text-green-600"}),(0,l.jsxs)(g.Z,{className:"text-green-700 font-medium",children:[a.length," of ",c.length," ",1===c.length?"tool":"tools"," enabled for user access"]})]}),(0,l.jsxs)("div",{className:"flex gap-2 ml-3",children:[(0,l.jsx)("button",{type:"button",onClick:()=>{i(c.map(e=>e.name))},className:"px-3 py-1.5 text-sm text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-md transition-colors",children:"Enable All"}),(0,l.jsx)("button",{type:"button",onClick:()=>{i([])},className:"px-3 py-1.5 text-sm text-gray-600 hover:text-gray-700 hover:bg-gray-100 rounded-md transition-colors",children:"Disable All"})]})]}),(0,l.jsx)("div",{className:"space-y-2",children:c.map((e,s)=>(0,l.jsx)("div",{className:"p-4 rounded-lg border transition-colors cursor-pointer ".concat(a.includes(e.name)?"bg-blue-50 border-blue-300 hover:border-blue-400":"bg-gray-50 border-gray-200 hover:border-gray-300"),onClick:()=>u(e.name),children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)(ee.Z,{checked:a.includes(e.name),onChange:()=>u(e.name)}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(g.Z,{className:"font-medium text-gray-900",children:e.name}),(0,l.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full font-medium ".concat(a.includes(e.name)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:a.includes(e.name)?"Enabled":"Disabled"})]}),e.description&&(0,l.jsx)(g.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description}),(0,l.jsx)(g.Z,{className:"text-gray-400 text-xs block mt-1",children:a.includes(e.name)?"✓ Users can call this tool":"✗ Users cannot call this tool"})]})]})},s))})]})]})}):null},el=r(9114),et=e=>{let{mcpServer:s,accessToken:r,onCancel:a,onSuccess:i,availableAccessGroups:o}=e,[p]=U.Z.useForm(),[j,g]=(0,t.useState)({}),[v,f]=(0,t.useState)([]),[b,y]=(0,t.useState)(!1),[N,_]=(0,t.useState)(""),[Z,w]=(0,t.useState)(!1),[k,A]=(0,t.useState)([]);(0,t.useEffect)(()=>{var e;(null===(e=s.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&g(s.mcp_info.mcp_server_cost_info)},[s]),(0,t.useEffect)(()=>{s.allowed_tools&&A(s.allowed_tools)},[s]),(0,t.useEffect)(()=>{if(s.mcp_access_groups){let e=s.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));p.setFieldValue("mcp_access_groups",e)}},[s]),(0,t.useEffect)(()=>{L()},[s,r]);let L=async()=>{if(r&&s.url){y(!0);try{let e={server_id:s.server_id,server_name:s.server_name,url:s.url,transport:s.transport,auth_type:s.auth_type,mcp_info:s.mcp_info},l=await (0,P.testMCPToolsListRequest)(r,e);l.tools&&!l.error?f(l.tools):(console.error("Failed to fetch tools:",l.message),f([]))}catch(e){console.error("Tools fetch error:",e),f([])}finally{y(!1)}}},M=async e=>{if(r)try{let l=(e.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),t={...e,server_id:s.server_id,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(j).length>0?j:null},mcp_access_groups:l,alias:e.alias,extra_headers:e.extra_headers||[],allowed_tools:k.length>0?k:null,disallowed_tools:e.disallowed_tools||[]},a=await (0,P.updateMCPServer)(r,t);el.Z.success("MCP Server updated successfully"),i(a)}catch(e){el.Z.fromBackend("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,l.jsxs)(m.Z,{children:[(0,l.jsxs)(x.Z,{className:"grid w-full grid-cols-2",children:[(0,l.jsx)(d.Z,{children:"Server Configuration"}),(0,l.jsx)(d.Z,{children:"Cost Configuration"})]}),(0,l.jsxs)(h.Z,{className:"mt-6",children:[(0,l.jsx)(u.Z,{children:(0,l.jsxs)(U.Z,{form:p,onFinish:M,initialValues:s,layout:"vertical",children:[(0,l.jsx)(U.Z.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,s)=>S(s)}],children:(0,l.jsx)(B.Z,{})}),(0,l.jsx)(U.Z.Item,{label:"Alias",name:"alias",rules:[{validator:(e,s)=>S(s)}],children:(0,l.jsx)(B.Z,{onChange:()=>w(!0)})}),(0,l.jsx)(U.Z.Item,{label:"Description",name:"description",children:(0,l.jsx)(B.Z,{})}),(0,l.jsx)(U.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>C(s)}],children:(0,l.jsx)(B.Z,{})}),(0,l.jsx)(U.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,l.jsxs)(n.default,{children:[(0,l.jsx)(n.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,l.jsx)(n.default.Option,{value:"http",children:"HTTP"})]})}),(0,l.jsx)(U.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,l.jsxs)(n.default,{children:[(0,l.jsx)(n.default.Option,{value:"none",children:"None"}),(0,l.jsx)(n.default.Option,{value:"api_key",children:"API Key"}),(0,l.jsx)(n.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,l.jsx)(n.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(W,{availableAccessGroups:o,mcpServer:s,searchValue:N,setSearchValue:_,getAccessGroupOptions:()=>{let e=o.map(e=>({value:e,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e})]})}));return N&&!o.some(e=>e.toLowerCase().includes(N.toLowerCase()))&&e.push({value:N,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:N}),(0,l.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(er,{accessToken:r,formValues:{server_id:s.server_id,server_name:s.server_name,url:s.url,transport:s.transport,auth_type:s.auth_type,mcp_info:s.mcp_info},allowedTools:k,existingAllowedTools:s.allowed_tools||null,onAllowedToolsChange:A})}),(0,l.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,l.jsx)(F.ZP,{onClick:a,children:"Cancel"}),(0,l.jsx)(c.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,l.jsx)(u.Z,{children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(J,{value:j,onChange:g,tools:v,disabled:b}),(0,l.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,l.jsx)(F.ZP,{onClick:a,children:"Cancel"}),(0,l.jsx)(c.Z,{onClick:()=>p.submit(),children:"Save Changes"})]})]})})]})]})},ea=r(92280),en=e=>{let{costConfig:s}=e,r=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,t=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return r||t?(0,l.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,l.jsxs)("div",{className:"space-y-4",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,l.jsxs)("div",{children:[(0,l.jsx)(ea.x,{className:"font-medium",children:"Default Cost per Query"}),(0,l.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),t&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,l.jsxs)("div",{children:[(0,l.jsx)(ea.x,{className:"font-medium",children:"Tool-Specific Costs"}),(0,l.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,l.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,l.jsx)(ea.x,{className:"font-medium",children:s}),(0,l.jsxs)(ea.x,{className:"text-green-600 font-mono",children:["$",r.toFixed(4)," per query"]})]},s)})})]}),(0,l.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,l.jsx)(ea.x,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,l.jsxs)("div",{className:"mt-2 space-y-1",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,l.jsxs)(ea.x,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),t&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,l.jsxs)(ea.x,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,l.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,l.jsx)("div",{className:"space-y-4",children:(0,l.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,l.jsx)(ea.x,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})},ei=r(59872),eo=r(30401),ec=r(78867);let ed=e=>{var s,r,a,n,i;let{mcpServer:o,onBack:p,isEditing:f,isProxyAdmin:y,accessToken:N,userRole:_,userID:Z,availableAccessGroups:C}=e,[S,k]=(0,t.useState)(f),[P,A]=(0,t.useState)(!1),[E,z]=(0,t.useState)({}),{maskedUrl:R,hasToken:U}=w(o.url),B=(e,s)=>U?s?e:R:e,K=async(e,s)=>{await (0,ei.vQ)(e)&&(z(e=>({...e,[s]:!0})),setTimeout(()=>{z(e=>({...e,[s]:!1}))},2e3))};return(0,l.jsxs)("div",{className:"p-4 max-w-full",children:[(0,l.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Z,{icon:L.Z,variant:"light",className:"mb-4",onClick:p,children:"Back to All Servers"}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(v.Z,{children:o.server_name}),(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:E["mcp-server_name"]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>K(o.server_name,"mcp-server_name"),className:"left-2 z-10 transition-all duration-200 ".concat(E["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),o.alias&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"ml-4 text-gray-500",children:"Alias:"}),(0,l.jsx)("span",{className:"ml-1 font-mono text-blue-600",children:o.alias}),(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:E["mcp-alias"]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>K(o.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(E["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(g.Z,{className:"text-gray-500 font-mono",children:o.server_id}),(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:E["mcp-server-id"]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>K(o.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(E["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,l.jsxs)(m.Z,{defaultIndex:S?2:0,children:[(0,l.jsx)(x.Z,{className:"mb-4",children:[(0,l.jsx)(d.Z,{children:"Overview"},"overview"),(0,l.jsx)(d.Z,{children:"MCP Tools"},"tools"),...y?[(0,l.jsx)(d.Z,{children:"Settings"},"settings")]:[]]}),(0,l.jsxs)(h.Z,{children:[(0,l.jsxs)(u.Z,{children:[(0,l.jsxs)(j.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,l.jsxs)(I.Z,{children:[(0,l.jsx)(g.Z,{children:"Transport"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(v.Z,{children:q(null!==(n=o.transport)&&void 0!==n?n:void 0)})})]}),(0,l.jsxs)(I.Z,{children:[(0,l.jsx)(g.Z,{children:"Auth Type"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(g.Z,{children:O(null!==(i=o.auth_type)&&void 0!==i?i:void 0)})})]}),(0,l.jsxs)(I.Z,{children:[(0,l.jsx)(g.Z,{children:"Host Url"}),(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,l.jsx)(g.Z,{className:"break-all overflow-wrap-anywhere",children:B(o.url,P)}),U&&(0,l.jsx)("button",{onClick:()=>A(!P),className:"p-1 hover:bg-gray-100 rounded",children:(0,l.jsx)(b.Z,{icon:P?M.Z:T.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,l.jsxs)(I.Z,{className:"mt-2",children:[(0,l.jsx)(v.Z,{children:"Cost Configuration"}),(0,l.jsx)(en,{costConfig:null===(s=o.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,l.jsx)(u.Z,{children:(0,l.jsx)(eY,{serverId:o.server_id,accessToken:N,auth_type:o.auth_type,userRole:_,userID:Z,serverAlias:o.alias})}),(0,l.jsx)(u.Z,{children:(0,l.jsxs)(I.Z,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(v.Z,{children:"MCP Server Settings"}),S?null:(0,l.jsx)(c.Z,{variant:"light",onClick:()=>k(!0),children:"Edit Settings"})]}),S?(0,l.jsx)(et,{mcpServer:o,accessToken:N,onCancel:()=>k(!1),onSuccess:e=>{k(!1),p()},availableAccessGroups:C}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Server Name"}),(0,l.jsx)("div",{children:o.server_name})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Alias"}),(0,l.jsx)("div",{children:o.alias})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Description"}),(0,l.jsx)("div",{children:o.description})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"URL"}),(0,l.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[B(o.url,P),U&&(0,l.jsx)("button",{onClick:()=>A(!P),className:"p-1 hover:bg-gray-100 rounded",children:(0,l.jsx)(b.Z,{icon:P?M.Z:T.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Transport"}),(0,l.jsx)("div",{children:q(o.transport)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Extra Headers"}),(0,l.jsx)("div",{children:null===(r=o.extra_headers)||void 0===r?void 0:r.join(", ")})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Auth Type"}),(0,l.jsx)("div",{children:O(o.auth_type)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Access Groups"}),(0,l.jsx)("div",{children:o.mcp_access_groups&&o.mcp_access_groups.length>0?(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:o.mcp_access_groups.map((e,s)=>{var r;return(0,l.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(r=null==e?void 0:e.name)&&void 0!==r?r:""},s)})}):(0,l.jsx)(g.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Allowed Tools"}),(0,l.jsx)("div",{children:o.allowed_tools&&o.allowed_tools.length>0?(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:o.allowed_tools.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-50 border border-blue-200 rounded-md text-sm",children:e},s))}):(0,l.jsx)(g.Z,{className:"text-gray-500",children:"All tools enabled"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Cost Configuration"}),(0,l.jsx)(en,{costConfig:null===(a=o.mcp_info)||void 0===a?void 0:a.mcp_server_cost_info})]})]})]})})]})]})]})};var em=r(64504),ex=r(61778),eu=r(29271),eh=r(89245),ep=e=>{let{accessToken:s,formValues:r,onToolsLoaded:a}=e,{tools:n,isLoadingTools:i,toolsError:o,canFetchTools:c,fetchTools:d}=es({accessToken:s,formValues:r,enabled:!0});return((0,t.useEffect)(()=>{null==a||a(n)},[n,a]),c||r.url)?(0,l.jsx)(I.Z,{children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Q.Z,{className:"text-blue-600"}),(0,l.jsx)(v.Z,{children:"Connection Status"})]}),!c&&r.url&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{children:"Complete required fields to test connection"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),c&&(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":n.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,l.jsx)("br",{}),(0,l.jsxs)(g.Z,{className:"text-gray-500 text-sm",children:["Server: ",r.url]})]}),i&&(0,l.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,l.jsx)(X.Z,{size:"small",className:"mr-2"}),(0,l.jsx)(g.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&n.length>0&&(0,l.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,l.jsx)(Q.Z,{className:"mr-1"}),(0,l.jsx)(g.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,l.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,l.jsx)(eu.Z,{className:"mr-1"}),(0,l.jsx)(g.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,l.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,l.jsx)(X.Z,{size:"large"}),(0,l.jsx)(g.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,l.jsx)(ex.Z,{message:"Connection Failed",description:o,type:"error",showIcon:!0,action:(0,l.jsx)(F.ZP,{icon:(0,l.jsx)(eh.Z,{}),onClick:d,size:"small",children:"Retry"})}),!i&&0===n.length&&!o&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,l.jsx)(Q.Z,{className:"text-2xl mb-2 text-green-500"}),(0,l.jsx)(g.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},ej=r(64482),eg=e=>{let{isVisible:s}=e;return s?(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,l.jsx)(o.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,l.jsx)(ej.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null};let ev="".concat("../ui/assets/logos/","mcp_logo.png");var ef=e=>{let{userRole:s,accessToken:r,onCreateSuccess:a,isModalVisible:c,setModalVisible:d,availableAccessGroups:m}=e,[x]=U.Z.useForm(),[u,h]=(0,t.useState)(!1),[p,j]=(0,t.useState)({}),[g,v]=(0,t.useState)({}),[f,b]=(0,t.useState)(!1),[y,N]=(0,t.useState)([]),[_,Z]=(0,t.useState)([]),[w,k]=(0,t.useState)(""),[L,M]=(0,t.useState)(""),[T,I]=(0,t.useState)(""),E=(e,s)=>{if(!e){I("");return}"sse"!==s||e.endsWith("/sse")?"http"!==s||e.endsWith("/mcp")?I(""):I("Typically MCP HTTP URLs end with /mcp. You can add this url but this is a warning."):I("Typically MCP SSE URLs end with /sse. You can add this url but this is a warning.")},z=async e=>{h(!0);try{let s=e.mcp_access_groups,l={};if(e.stdio_config&&"stdio"===w)try{let s=JSON.parse(e.stdio_config),r=s;if(s.mcpServers&&"object"==typeof s.mcpServers){let l=Object.keys(s.mcpServers);if(l.length>0){let t=l[0];r=s.mcpServers[t],e.server_name||(e.server_name=t.replace(/-/g,"_"))}}l={command:r.command,args:r.args,env:r.env},console.log("Parsed stdio config:",l)}catch(e){el.Z.fromBackend("Invalid JSON in stdio configuration");return}let t={...e,...l,stdio_config:void 0,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(p).length>0?p:null},mcp_access_groups:s,alias:e.alias,allowed_tools:_.length>0?_:null};if(console.log("Payload: ".concat(JSON.stringify(t))),null!=r){let e=await (0,P.createMCPServer)(r,t);el.Z.success("MCP Server created successfully"),x.resetFields(),j({}),N([]),Z([]),I(""),b(!1),d(!1),a(e)}}catch(e){el.Z.fromBackend("Error creating MCP Server: "+e)}finally{h(!1)}},q=()=>{x.resetFields(),j({}),N([]),Z([]),I(""),b(!1),d(!1)};return(t.useEffect(()=>{if(!f&&g.server_name){let e=g.server_name.replace(/\s+/g,"_");x.setFieldsValue({alias:e}),v(s=>({...s,alias:e}))}},[g.server_name]),t.useEffect(()=>{c||v({})},[c]),(0,A.tY)(s))?(0,l.jsx)(i.Z,{title:(0,l.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,l.jsx)("img",{src:ev,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:c,width:1e3,onCancel:q,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsxs)(U.Z,{form:x,onFinish:z,onValuesChange:(e,s)=>v(s),layout:"vertical",className:"space-y-6",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,l.jsx)(o.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>S(s)}],children:(0,l.jsx)(em.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,l.jsx)(o.Z,{title:"A short, unique identifier for this server. Defaults to the server name with spaces replaced by underscores.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,l.jsx)(em.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>b(!0)})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description!!!!!!!!!"}],children:(0,l.jsx)(em.o,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,l.jsxs)(n.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{if(k(e),"stdio"===e)x.setFieldsValue({url:void 0,auth_type:void 0}),I("");else{x.setFieldsValue({command:void 0,args:void 0,env:void 0});let s=x.getFieldValue("url");s&&E(s,e)}},value:w,children:[(0,l.jsx)(n.default.Option,{value:"http",children:"HTTP"}),(0,l.jsx)(n.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,l.jsx)(n.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==w&&(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>C(s)}],children:(0,l.jsxs)("div",{children:[(0,l.jsx)(em.o,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:e=>E(e.target.value,w)}),T&&(0,l.jsx)("div",{className:"mt-1 text-red-500 text-sm font-medium",children:T})]})}),"stdio"!==w&&(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,l.jsxs)(n.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,l.jsx)(n.default.Option,{value:"none",children:"None"}),(0,l.jsx)(n.default.Option,{value:"api_key",children:"API Key"}),(0,l.jsx)(n.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,l.jsx)(n.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,l.jsx)(eg,{isVisible:"stdio"===w})]}),(0,l.jsx)("div",{className:"mt-8",children:(0,l.jsx)(W,{availableAccessGroups:m,mcpServer:null,searchValue:L,setSearchValue:M,getAccessGroupOptions:()=>{let e=m.map(e=>({value:e,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e})]})}));return L&&!m.some(e=>e.toLowerCase().includes(L.toLowerCase()))&&e.push({value:L,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:L}),(0,l.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,l.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,l.jsx)(ep,{accessToken:r,formValues:g,onToolsLoaded:N})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(er,{accessToken:r,formValues:g,allowedTools:_,existingAllowedTools:null,onAllowedToolsChange:Z})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(J,{value:p,onChange:j,tools:y.filter(e=>_.includes(e.name)),disabled:!1})}),(0,l.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,l.jsx)(em.z,{variant:"secondary",onClick:q,children:"Cancel"}),(0,l.jsx)(em.z,{variant:"primary",loading:u,children:u?"Creating...":"Add MCP Server"})]})]})})}):null},eb=r(93192),ey=r(67960),eN=r(63709),e_=r(93142),eZ=r(64935),ew=r(11239),eC=r(54001),eS=r(96137),ek=r(96362),eP=r(80221),eA=r(29202);let{Title:eL,Text:eM}=eb.default,{Panel:eT}=V.default,eI=e=>{let{icon:s,title:r,description:a,children:n,serverName:i,accessGroups:o=["dev"]}=e,[c,d]=(0,t.useState)(!1),m=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(c&&i){let s=[i.replace(/\s+/g,"_"),...o].join(",");e["x-mcp-servers"]=[s]}return e};return(0,l.jsxs)(ey.Z,{className:"border border-gray-200",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eL,{level:5,className:"mb-0",children:r}),(0,l.jsx)(eM,{className:"text-gray-600",children:a})]})]}),i&&("Implementation Example"===r||"Configuration"===r)&&(0,l.jsxs)(U.Z.Item,{className:"mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,l.jsx)(eN.Z,{size:"small",checked:c,onChange:d}),(0,l.jsxs)(eM,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,l.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),c&&(0,l.jsx)(ex.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{children:[(0,l.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,l.jsxs)("code",{children:['["',i.replace(/\s+/g,"_"),'"]']})]}),(0,l.jsxs)("p",{children:[(0,l.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,l.jsx)("code",{children:'["dev-group"]'})]}),(0,l.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,l.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),t.Children.map(n,e=>{if(t.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return t.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(m(),null,8)))})}return e})]})};var eE=e=>{let{currentServerAccessGroups:s=[]}=e,r=(0,P.getProxyBaseUrl)(),[a,n]=(0,t.useState)({}),[i,o]=(0,t.useState)({openai:[],litellm:[],cursor:[],http:[]}),[c]=(0,t.useState)("Zapier_MCP"),p=async(e,s)=>{await (0,ei.vQ)(e)&&(n(e=>({...e,[s]:!0})),setTimeout(()=>{n(e=>({...e,[s]:!1}))},2e3))},j=e=>{let{code:s,copyKey:r,title:t,className:n=""}=e;return(0,l.jsxs)("div",{className:"relative group",children:[t&&(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,l.jsx)(eZ.Z,{size:16,className:"text-blue-600"}),(0,l.jsx)(eM,{strong:!0,className:"text-gray-700",children:t})]}),(0,l.jsxs)(ey.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(n),children:[(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:a[r]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>p(s,r),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(a[r]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,l.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},f=e=>{let{step:s,title:r,children:t}=e;return(0,l.jsxs)("div",{className:"flex gap-4",children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)(eM,{strong:!0,className:"text-gray-800 block mb-2",children:r}),t]})]})};return(0,l.jsx)("div",{children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(v.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,l.jsx)(g.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,l.jsxs)(m.Z,{className:"w-full",children:[(0,l.jsx)(x.Z,{className:"flex justify-start mt-8 mb-6",children:(0,l.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(eZ.Z,{size:18}),"OpenAI API"]})}),(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(ew.Z,{size:18}),"LiteLLM Proxy"]})}),(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(eP.Z,{size:18}),"Cursor"]})}),(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(eA.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,l.jsxs)(h.Z,{children:[(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(eZ.Z,{className:"text-blue-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,l.jsx)(eM,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsx)(eI,{icon:(0,l.jsx)(eC.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,l.jsx)("div",{children:(0,l.jsxs)(eM,{children:["Get your API key from the"," ",(0,l.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,l.jsx)(ek.Z,{size:12})]})]})}),(0,l.jsx)(j,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eS.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,l.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"openai-server-url"})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eZ.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,l.jsx)(j,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(ew.Z,{className:"text-emerald-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,l.jsx)(eM,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsx)(eI,{icon:(0,l.jsx)(eC.Z,{className:"text-emerald-600",size:16}),title:"API Key Setup",description:"Configure your LiteLLM Proxy API key for authentication",children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,l.jsx)("div",{children:(0,l.jsx)(eM,{children:"Get your API key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,l.jsx)(j,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eS.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,l.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"litellm-server-url"})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eZ.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:c,accessGroups:["dev"],children:(0,l.jsx)(j,{code:"curl --location '".concat(r,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_API_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(eP.Z,{className:"text-purple-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,l.jsx)(eM,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,l.jsxs)(ey.Z,{className:"border border-gray-200",children:[(0,l.jsx)(eL,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsx)(f,{step:1,title:"Open Cursor Settings",children:(0,l.jsxs)(eM,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or"," ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,l.jsx)(f,{step:2,title:"Navigate to MCP Tools",children:(0,l.jsx)(eM,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,l.jsxs)(f,{step:3,title:"Add Configuration",children:[(0,l.jsxs)(eM,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with"," ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or"," ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eZ.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,l.jsx)(j,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "server_url": "'.concat(r,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(eA.Z,{className:"text-green-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,l.jsx)(eM,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eA.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,l.jsx)("div",{children:(0,l.jsx)(eM,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,l.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"http-server-url"}),(0,l.jsx)(j,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(F.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,l.jsx)(ek.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},ez=r(67187);let{Option:eq}=n.default,eO=e=>{let{isModalOpen:s,title:r,confirmDelete:t,cancelDelete:a}=e;return s?(0,l.jsx)(i.Z,{open:s,onOk:t,okType:"danger",onCancel:a,children:(0,l.jsxs)(j.Z,{numItems:1,className:"gap-2 w-full",children:[(0,l.jsx)(v.Z,{children:r}),(0,l.jsx)(p.Z,{numColSpan:1,children:(0,l.jsx)("p",{children:"Are you sure you want to delete this MCP Server?"})})]})}):null};var eR=e=>{let{accessToken:s,userRole:r,userID:i}=e,{data:p,isLoading:j,refetch:b,dataUpdatedAt:y}=(0,a.a)({queryKey:["mcpServers"],queryFn:()=>{if(!s)throw Error("Access Token required");return(0,P.fetchMCPServers)(s)},enabled:!!s});t.useEffect(()=>{p&&(console.log("MCP Servers fetched:",p),p.forEach(e=>{console.log("Server: ".concat(e.server_name||e.server_id)),console.log(" allowed_tools:",e.allowed_tools)}))},[p]);let[N,_]=(0,t.useState)(null),[Z,w]=(0,t.useState)(!1),[C,S]=(0,t.useState)(null),[L,M]=(0,t.useState)(!1),[T,I]=(0,t.useState)("all"),[E,z]=(0,t.useState)("all"),[q,O]=(0,t.useState)([]),[R,U]=(0,t.useState)(!1),F="Internal User"===r,B=t.useMemo(()=>{if(!p)return[];let e=new Set,s=[];return p.forEach(r=>{r.teams&&r.teams.forEach(r=>{let l=r.team_id;e.has(l)||(e.add(l),s.push(r))})}),s},[p]),K=t.useMemo(()=>p?Array.from(new Set(p.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[p]),V=e=>{I(e),H(e,E)},D=e=>{z(e),H(T,e)},H=(e,s)=>{if(!p)return O([]);let r=p;if("personal"===e){O([]);return}"all"!==e&&(r=r.filter(s=>{var r;return null===(r=s.teams)||void 0===r?void 0:r.some(s=>s.team_id===e)})),"all"!==s&&(r=r.filter(e=>{var r;return null===(r=e.mcp_access_groups)||void 0===r?void 0:r.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),O(r)};(0,t.useEffect)(()=>{H(T,E)},[y]);let G=t.useMemo(()=>k(null!=r?r:"",e=>{S(e),M(!1)},e=>{S(e),M(!0)},Y),[r]);function Y(e){_(e),w(!0)}let J=async()=>{if(null!=N&&null!=s){try{await (0,P.deleteMCPServer)(s,N),el.Z.success("Deleted MCP Server successfully"),b()}catch(e){console.error("Error deleting the mcp server:",e)}w(!1),_(null)}};return s&&r&&i?(0,l.jsxs)("div",{className:"w-full h-full p-6",children:[(0,l.jsx)(eO,{isModalOpen:Z,title:"Delete MCP Server",confirmDelete:J,cancelDelete:()=>{w(!1),_(null)}}),(0,l.jsx)(ef,{userRole:r,accessToken:s,onCreateSuccess:e=>{O(s=>[...s,e]),U(!1)},isModalVisible:R,setModalVisible:U,availableAccessGroups:K}),(0,l.jsx)(v.Z,{children:"MCP Servers"}),(0,l.jsx)(g.Z,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,A.tY)(r)&&(0,l.jsx)(c.Z,{className:"mt-4 mb-4",onClick:()=>U(!0),children:"+ Add New MCP Server"}),(0,l.jsxs)(m.Z,{className:"w-full h-full",children:[(0,l.jsx)(x.Z,{className:"flex justify-between mt-2 w-full items-center",children:(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(d.Z,{children:"All Servers"}),(0,l.jsx)(d.Z,{children:"Connect"})]})}),(0,l.jsxs)(h.Z,{children:[(0,l.jsx)(u.Z,{children:(0,l.jsx)(()=>C?(0,l.jsx)(ed,{mcpServer:q.find(e=>e.server_id===C)||{server_id:"",server_name:"",alias:"",url:"",transport:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{M(!1),S(null),b()},isProxyAdmin:(0,A.tY)(r),isEditing:L,accessToken:s,userID:i,userRole:r,availableAccessGroups:K}):(0,l.jsxs)("div",{className:"w-full h-full",children:[(0,l.jsx)("div",{className:"w-full px-6",children:(0,l.jsx)("div",{className:"flex flex-col space-y-4",children:(0,l.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)(g.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,l.jsxs)(n.default,{value:T,onChange:V,style:{width:300},children:[(0,l.jsx)(eq,{value:"all",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:F?"All Available Servers":"All Servers"})]})}),(0,l.jsx)(eq,{value:"personal",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:"Personal"})]})}),B.map(e=>(0,l.jsx)(eq,{value:e.team_id,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,l.jsxs)(g.Z,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,l.jsx)(o.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,l.jsx)(ez.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,l.jsxs)(n.default,{value:E,onChange:D,style:{width:300},children:[(0,l.jsx)(eq,{value:"all",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),K.map(e=>(0,l.jsx)(eq,{value:e,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,l.jsx)("div",{className:"w-full px-6 mt-6",children:(0,l.jsx)(f.w,{data:q,columns:G,renderSubComponent:()=>(0,l.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:j,noDataMessage:"No MCP servers configured"})})]}),{})}),(0,l.jsx)(u.Z,{children:(0,l.jsx)(eE,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:r,userID:i}),(0,l.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},eU=r(21770);function eF(e){let{tool:s,needsAuth:r,authValue:a,onSubmit:n,isLoading:i,result:c,error:d,onClose:m}=e,[x]=U.Z.useForm(),[u,h]=t.useState("formatted"),[p,j]=t.useState(null),[g,v]=t.useState(null),f=t.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),b=t.useMemo(()=>f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{type:"object",properties:f.properties.params.properties,required:f.properties.params.required||[]}:f,[f]);t.useEffect(()=>{p&&(c||d)&&v(Date.now()-p)},[c,d,p]);let y=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let r=document.execCommand("copy");if(document.body.removeChild(s),!r)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},N=async()=>{await y(JSON.stringify(c,null,2))?el.Z.success("Result copied to clipboard"):el.Z.fromBackend("Failed to copy result")},_=async()=>{await y(s.name)?el.Z.success("Tool name copied to clipboard"):el.Z.fromBackend("Failed to copy tool name")};return(0,l.jsxs)("div",{className:"space-y-4 h-full",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,l.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,l.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:_,title:"Click to copy tool name",children:[(0,l.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,l.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,l.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,l.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,l.jsx)(em.z,{onClick:m,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,l.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,l.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,l.jsx)(o.Z,{title:"Configure the input parameters for this tool call",children:(0,l.jsx)(G.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,l.jsx)("div",{className:"p-4",children:(0,l.jsxs)(U.Z,{form:x,onFinish:e=>{j(Date.now()),v(null);let s={};Object.entries(e).forEach(e=>{var r;let[l,t]=e,a=null===(r=b.properties)||void 0===r?void 0:r[l];if(a&&null!=t&&""!==t)switch(a.type){case"boolean":s[l]="true"===t||!0===t;break;case"number":s[l]=Number(t);break;case"string":s[l]=String(t);break;default:s[l]=t}else null!=t&&""!==t&&(s[l]=t)}),n(f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,l.jsx)("div",{className:"space-y-3",children:(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,l.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,l.jsx)(em.o,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===b.properties?(0,l.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,l.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,l.jsx)("div",{className:"space-y-3",children:Object.entries(b.properties).map(e=>{var s,r,t,a,n;let[i,c]=e;return(0,l.jsxs)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(s=b.required)||void 0===s?void 0:s.includes(i))&&(0,l.jsx)("span",{className:"text-red-500",children:"*"}),c.description&&(0,l.jsx)(o.Z,{title:c.description,children:(0,l.jsx)(G.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,rules:[{required:null===(r=b.required)||void 0===r?void 0:r.includes(i),message:"Please enter ".concat(i)}],className:"mb-3",children:["string"===c.type&&c.enum&&(0,l.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:c.default,children:[!(null===(t=b.required)||void 0===t?void 0:t.includes(i))&&(0,l.jsxs)("option",{value:"",children:["Select ",i]}),c.enum.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]}),"string"===c.type&&!c.enum&&(0,l.jsx)(em.o,{placeholder:c.description||"Enter ".concat(i),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),"number"===c.type&&(0,l.jsx)("input",{type:"number",placeholder:c.description||"Enter ".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===c.type&&(0,l.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null===(a=c.default)||void 0===a?void 0:a.toString())||"",children:[!(null===(n=b.required)||void 0===n?void 0:n.includes(i))&&(0,l.jsxs)("option",{value:"",children:["Select ",i]}),(0,l.jsx)("option",{value:"true",children:"True"}),(0,l.jsx)("option",{value:"false",children:"False"})]})]},i)})}),(0,l.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,l.jsx)(em.z,{onClick:()=>x.submit(),disabled:i,variant:"primary",className:"w-full",loading:i,children:i?"Calling Tool...":c||d?"Call Again":"Call Tool"})})]})})]}),(0,l.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,l.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,l.jsx)("div",{className:"p-4",children:c||d||i?(0,l.jsxs)("div",{className:"space-y-3",children:[c&&!i&&!d&&(0,l.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,l.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==g&&(0,l.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,l.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,l.jsx)("button",{onClick:()=>h("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,l.jsx)("button",{onClick:()=>h("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,l.jsx)("button",{onClick:N,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,l.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,l.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[i&&(0,l.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,l.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,l.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),d&&(0,l.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==g&&(0,l.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,l.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,l.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:d.message})})]})]})}),c&&!i&&!d&&(0,l.jsx)("div",{className:"space-y-3",children:"formatted"===u?c.map((e,s)=>(0,l.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,l.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,l.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let r=e.replace(/^#+\s/,"");return(0,l.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:r})},s)}let r=/(https?:\/\/[^\s\)]+)/g;if(r.test(e)){let t=e.split(r);return(0,l.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,l.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:t.map((e,s)=>r.test(e)?(0,l.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,l.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,l.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,l.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,l.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,l.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,l.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,l.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,l.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,l.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,l.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,l.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,l.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,l.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,l.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(c,null,2)})})})})]})]}):(0,l.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,l.jsxs)("div",{className:"text-center max-w-sm",children:[(0,l.jsx)("div",{className:"mb-3",children:(0,l.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,l.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var eB=r(29488),eK=r(36724),eV=r(57400),eD=r(69993);let eH=e=>{let s,{visible:r,onOk:t,onCancel:a,authType:n}=e,[o]=U.Z.useForm();if(n===E.API_KEY||n===E.BEARER_TOKEN){let e=n===E.API_KEY?"API Key":"Bearer Token";s=(0,l.jsx)(U.Z.Item,{name:"authValue",label:e,rules:[{required:!0,message:"Please input your ".concat(e)}],children:(0,l.jsx)(ej.default.Password,{})})}else n===E.BASIC&&(s=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(U.Z.Item,{name:"username",label:"Username",rules:[{required:!0,message:"Please input your username"}],children:(0,l.jsx)(ej.default,{})}),(0,l.jsx)(U.Z.Item,{name:"password",label:"Password",rules:[{required:!0,message:"Please input your password"}],children:(0,l.jsx)(ej.default.Password,{})})]}));return(0,l.jsx)(i.Z,{open:r,title:"Authentication",onOk:()=>{o.validateFields().then(e=>{n===E.BASIC?t("".concat(e.username.trim(),":").concat(e.password.trim())):t(e.authValue.trim())})},onCancel:a,destroyOnClose:!0,children:(0,l.jsx)(U.Z,{form:o,layout:"vertical",children:s})})},eG=e=>{let{authType:s,onAuthSubmit:r,onClearAuth:a,hasAuth:n}=e,[i,o]=(0,t.useState)(!1);return(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)(eK.xv,{className:"text-sm font-medium text-gray-700",children:["Authentication ",n?"✓":""]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[n&&(0,l.jsx)(eK.zx,{onClick:()=>{a()},size:"sm",variant:"secondary",className:"text-xs text-red-600 hover:text-red-700",children:"Clear"}),(0,l.jsx)(eK.zx,{onClick:()=>o(!0),size:"sm",variant:"secondary",className:"text-xs",children:n?"Update":"Add Auth"})]})]}),(0,l.jsx)(eK.xv,{className:"text-xs text-gray-500",children:n?"Authentication configured and saved locally":"Some tools may require authentication"}),(0,l.jsx)(eH,{visible:i,onOk:e=>{r(e),o(!1)},onCancel:()=>o(!1),authType:s})]})};var eY=e=>{let{serverId:s,accessToken:r,auth_type:n,userRole:i,userID:o,serverAlias:c}=e,[d,m]=(0,t.useState)(""),[x,u]=(0,t.useState)(null),[h,p]=(0,t.useState)(null),[j,g]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(R(n)){let e=(0,eB.Ui)(s,c||void 0);e&&m(e)}},[s,c,n]);let v=e=>{m(e),e&&R(n)&&((0,eB.Hc)(s,e,n||"none",c||void 0),el.Z.success("Authentication token saved locally"))},f=()=>{m(""),(0,eB.e4)(s),el.Z.info("Authentication token cleared")},{data:b,isLoading:y,error:N}=(0,a.a)({queryKey:["mcpTools",s,d,c],queryFn:()=>{if(!r)throw Error("Access Token required");return(0,P.listMCPTools)(r,s,d,c||void 0)},enabled:!!r,staleTime:3e4}),{mutate:_,isPending:Z}=(0,eU.D)({mutationFn:async e=>{if(!r)throw Error("Access Token required");try{return await (0,P.callMCPTool)(r,e.tool.name,e.arguments,e.authValue,c||void 0)}catch(e){throw e}},onSuccess:e=>{p(e),g(null)},onError:e=>{g(e),p(null)}}),w=(null==b?void 0:b.tools)||[],C=""!==d;return(0,l.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,l.jsx)(eK.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,l.jsxs)("div",{className:"flex h-auto w-full gap-4",children:[(0,l.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,l.jsx)(eK.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,l.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,l.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,l.jsxs)(eK.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,l.jsx)(Y.Z,{className:"mr-2"})," Available Tools",w.length>0&&(0,l.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:w.length})]}),y&&(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,l.jsxs)("div",{className:"relative mb-3",children:[(0,l.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,l.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,l.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==b?void 0:b.error)&&!y&&!w.length&&(0,l.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,l.jsxs)("p",{className:"font-medium",children:["Error: ",b.message]})}),!y&&!(null==b?void 0:b.error)&&(!w||0===w.length)&&(0,l.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,l.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,l.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!y&&!(null==b?void 0:b.error)&&w.length>0&&(0,l.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto min-h-0 mcp-tools-scrollable",style:{maxHeight:"400px",scrollbarWidth:"auto",scrollbarColor:"#cbd5e0 #f7fafc"},children:w.map(e=>(0,l.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==x?void 0:x.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{u(e),p(null),g(null)},children:[(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,l.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,l.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,l.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==x?void 0:x.name)===e.name&&(0,l.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,l.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,l.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]}),R(n)&&(0,l.jsx)("div",{className:"pt-4 border-t border-gray-200 flex-shrink-0 mt-6",children:C?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(eK.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,l.jsx)(eV.Z,{className:"mr-2"})," Authentication"]}),(0,l.jsx)(eG,{authType:n,onAuthSubmit:v,onClearAuth:f,hasAuth:C})]}):(0,l.jsxs)("div",{className:"p-4 bg-gradient-to-r from-orange-50 to-red-50 border border-orange-200 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-center mb-3",children:[(0,l.jsx)(eV.Z,{className:"mr-2 text-orange-600 text-lg"}),(0,l.jsx)(eK.xv,{className:"font-semibold text-orange-800",children:"Authentication Required"})]}),(0,l.jsx)(eK.xv,{className:"text-sm text-orange-700 mb-4",children:"This MCP server requires authentication. You must add your credentials below to access the tools."}),(0,l.jsx)(eG,{authType:n,onAuthSubmit:v,onClearAuth:f,hasAuth:C})]})})]})]}),(0,l.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,l.jsx)(eK.Dx,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto p-4",children:x?(0,l.jsx)("div",{className:"h-full",children:(0,l.jsx)(eF,{tool:x,needsAuth:R(n),authValue:d,onSubmit:e=>{_({tool:x,arguments:e,authValue:d})},result:h,error:j,isLoading:Z,onClose:()=>u(null)})}):(0,l.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsx)(eD.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,l.jsx)(eK.xv,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,l.jsx)(eK.xv,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1307-6bc3bb770f5b2b05.js b/litellm/proxy/_experimental/out/_next/static/chunks/1307-6bc3bb770f5b2b05.js deleted file mode 100644 index 40149428ca..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1307-6bc3bb770f5b2b05.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1307],{21307:function(e,s,r){r.d(s,{d:function(){return eR},o:function(){return eY}});var l=r(57437),t=r(2265),a=r(16593),n=r(52787),i=r(82680),o=r(89970),c=r(20831),d=r(12485),m=r(18135),x=r(35242),u=r(29706),h=r(77991),p=r(49804),j=r(67101),g=r(84264),v=r(96761),f=r(12322),b=r(47323),y=r(53410),N=r(74998);let _=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let r=e.split("/mcp/");if(2!==r.length)return{token:null,baseUrl:e};let l=r[0]+"/mcp/",t=r[1];if(!t)return{token:null,baseUrl:e};return{token:t,baseUrl:l}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},Z=e=>{let{token:s,baseUrl:r}=_(e);return s?r+"...":e},w=e=>{let{token:s}=_(e);return{maskedUrl:Z(e),hasToken:!!s}},C=e=>e?/^https?:\/\/[^\s/$.?#].[^\s]*$/i.test(e)?Promise.resolve():Promise.reject("Please enter a valid URL (e.g., http://service-name.domain:1234/path or https://example.com)"):Promise.resolve(),S=e=>e&&e.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve(),k=(e,s,r,t)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:r}=e;return(0,l.jsxs)("button",{onClick:()=>s(r.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[r.original.server_id.slice(0,7),"..."]})}},{accessorKey:"server_name",header:"Name"},{accessorKey:"alias",header:"Alias"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:r}=w(s.original.url);return(0,l.jsx)("span",{className:"font-mono text-sm",children:r})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,l.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,l.jsx)("span",{children:s()||"none"})}},{id:"health_status",header:"Health Status",cell:e=>{let{row:s}=e,r=s.original,t=r.status||"unknown",a=r.last_health_check,n=r.health_check_error,i=(0,l.jsxs)("div",{className:"max-w-xs",children:[(0,l.jsxs)("div",{className:"font-semibold mb-1",children:["Health Status: ",t]}),a&&(0,l.jsxs)("div",{className:"text-xs mb-1",children:["Last Check: ",new Date(a).toLocaleString()]}),n&&(0,l.jsxs)("div",{className:"text-xs",children:[(0,l.jsx)("div",{className:"font-medium text-red-400 mb-1",children:"Error:"}),(0,l.jsx)("div",{className:"break-words",children:n})]}),!a&&!n&&(0,l.jsx)("div",{className:"text-xs text-gray-400",children:"No health check data available"})]});return(0,l.jsx)(o.Z,{title:i,placement:"top",children:(0,l.jsxs)("button",{className:"font-mono text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[10ch] ".concat((e=>{switch(e){case"healthy":return"text-green-500 bg-green-50 hover:bg-green-100";case"unhealthy":return"text-red-500 bg-red-50 hover:bg-red-100";default:return"text-gray-500 bg-gray-50 hover:bg-gray-100"}})(t)),children:[(0,l.jsx)("span",{className:"mr-1",children:"●"}),t.charAt(0).toUpperCase()+t.slice(1)]})})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,r=s.original.mcp_access_groups;if(Array.isArray(r)&&r.length>0&&"string"==typeof r[0]){let e=r.join(", ");return(0,l.jsx)(o.Z,{title:e,children:(0,l.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,l.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,l.jsx)("span",{className:"text-xs",children:r.created_at?new Date(r.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,l.jsx)("span",{className:"text-xs",children:r.updated_at?new Date(r.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(b.Z,{icon:y.Z,size:"sm",onClick:()=>r(s.original.server_id),className:"cursor-pointer"}),(0,l.jsx)(b.Z,{icon:N.Z,size:"sm",onClick:()=>t(s.original.server_id),className:"cursor-pointer"})]})}}];var P=r(19250),A=r(20347),L=r(10900),M=r(82376),T=r(71437),I=r(12514);let E={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic"},z={SSE:"sse"},q=e=>(console.log(e),null==e)?z.SSE:e,O=e=>null==e?E.NONE:e,R=e=>O(e)!==E.NONE;var U=r(13634),F=r(73002),B=r(49566),K=r(20577),V=r(44851),D=r(33866),H=r(62670),G=r(15424),Y=r(58630),J=e=>{let{value:s={},onChange:r,tools:t=[],disabled:a=!1}=e,n=(e,l)=>{let t={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:l}};null==r||r(t)};return(0,l.jsx)(I.Z,{children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,l.jsx)(H.Z,{className:"text-green-600"}),(0,l.jsx)(v.Z,{children:"Cost Configuration"}),(0,l.jsx)(o.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,l.jsx)(G.Z,{className:"text-gray-400"})})]}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,l.jsx)(o.Z,{title:"Default cost charged for each tool call to this server.",children:(0,l.jsx)(G.Z,{className:"ml-1 text-gray-400"})})]}),(0,l.jsx)(K.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let l={...s,default_cost_per_query:e};null==r||r(l)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,l.jsx)(g.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),t.length>0&&(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,l.jsx)(o.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,l.jsx)(G.Z,{className:"ml-1 text-gray-400"})})]}),(0,l.jsx)(V.default,{items:[{key:"1",label:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(Y.Z,{className:"mr-2 text-blue-500"}),(0,l.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,l.jsx)(D.Z,{count:t.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,l.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:t.map((e,r)=>{var t;return(0,l.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)(g.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,l.jsx)(g.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,l.jsx)("div",{className:"ml-4",children:(0,l.jsx)(K.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(t=s.tool_name_to_cost_per_query)||void 0===t?void 0:t[e.name],onChange:s=>n(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},r)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,l.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,l.jsx)(g.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,l.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,l.jsxs)(g.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,l.jsxs)(g.Z,{className:"text-blue-700",children:["• ",s,": $",r.toFixed(4)," per query"]},s)})]})]})]})})};let{Panel:$}=V.default;var W=e=>{let{availableAccessGroups:s,mcpServer:r,searchValue:a,setSearchValue:i,getAccessGroupOptions:c}=e,d=U.Z.useFormInstance();return(0,t.useEffect)(()=>{r&&r.extra_headers&&d.setFieldValue("extra_headers",r.extra_headers)},[r,d]),(0,l.jsx)(V.default,{className:"bg-gray-50 border border-gray-200 rounded-lg",expandIconPosition:"end",ghost:!1,children:(0,l.jsx)($,{header:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Permission Management / Access Control"})]}),(0,l.jsx)("p",{className:"text-sm text-gray-600 ml-4",children:"Configure access permissions and security settings (Optional)"})]}),className:"border-0",children:(0,l.jsxs)("div",{className:"space-y-6 pt-4",children:[(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,l.jsx)(o.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,l.jsx)(n.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var r;return(null!==(r=null==s?void 0:s.value)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>i(e),tokenSeparators:[","],options:c(),maxTagCount:"responsive",allowClear:!0})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Extra Headers",(0,l.jsx)(o.Z,{title:"Forward custom headers from incoming requests to this MCP server (e.g., Authorization, X-Custom-Header, User-Agent)",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})}),(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0&&(0,l.jsxs)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:[r.extra_headers.length," configured"]})]}),name:"extra_headers",children:(0,l.jsx)(n.default,{mode:"tags",placeholder:(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0?"Currently: ".concat(r.extra_headers.join(", ")):"Enter header names (e.g., Authorization, X-Custom-Header)",className:"rounded-lg",size:"large",tokenSeparators:[","],allowClear:!0})})]})},"permissions")})},Q=r(83669),X=r(87908),ee=r(61994);let es=e=>{let{accessToken:s,formValues:r,enabled:l=!0}=e,[a,n]=(0,t.useState)([]),[i,o]=(0,t.useState)(!1),[c,d]=(0,t.useState)(null),[m,x]=(0,t.useState)(!1),u=!!(r.url&&r.transport&&r.auth_type&&s),h=async()=>{if(s&&r.url){o(!0),d(null);try{let e={server_id:r.server_id||"",server_name:r.server_name||"",url:r.url,transport:r.transport,auth_type:r.auth_type,mcp_info:r.mcp_info},l=await (0,P.testMCPToolsListRequest)(s,e);if(l.tools&&!l.error)n(l.tools),d(null),l.tools.length>0&&!m&&x(!0);else{let e=l.message||"Failed to retrieve tools list";d(e),n([]),x(!1)}}catch(e){console.error("Tools fetch error:",e),d(e instanceof Error?e.message:String(e)),n([]),x(!1)}finally{o(!1)}}},p=()=>{n([]),d(null),x(!1)};return(0,t.useEffect)(()=>{l&&(u?h():p())},[r.url,r.transport,r.auth_type,s,l,u]),{tools:a,isLoadingTools:i,toolsError:c,hasShownSuccessMessage:m,canFetchTools:u,fetchTools:h,clearTools:p}};var er=e=>{let{accessToken:s,formValues:r,allowedTools:a,existingAllowedTools:n,onAllowedToolsChange:i}=e,o=(0,t.useRef)(0),{tools:c,isLoadingTools:d,toolsError:m,canFetchTools:x}=es({accessToken:s,formValues:r,enabled:!0});(0,t.useEffect)(()=>{if(c.length>0&&c.length!==o.current&&0===a.length){if(n&&n.length>0){let e=c.map(e=>e.name);i(n.filter(s=>e.includes(s)))}else i(c.map(e=>e.name))}o.current=c.length},[c,a.length,n,i]);let u=e=>{a.includes(e)?i(a.filter(s=>s!==e)):i([...a,e])};return x||r.url?(0,l.jsx)(I.Z,{children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("div",{className:"flex items-center justify-between",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Y.Z,{className:"text-blue-600"}),(0,l.jsx)(v.Z,{children:"Tool Configuration"}),c.length>0&&(0,l.jsx)(D.Z,{count:c.length,style:{backgroundColor:"#52c41a"}})]})}),(0,l.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,l.jsxs)(g.Z,{className:"text-blue-800 text-sm",children:[(0,l.jsx)("strong",{children:"Select which tools users can call:"})," Only checked tools will be available for users to invoke. Unchecked tools will be blocked from execution."]})}),d&&(0,l.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,l.jsx)(X.Z,{size:"large"}),(0,l.jsx)(g.Z,{className:"ml-3",children:"Loading tools..."})]}),m&&!d&&(0,l.jsxs)("div",{className:"text-center py-6 text-red-500 border rounded-lg border-dashed border-red-300 bg-red-50",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm text-red-500",children:m})]}),!d&&!m&&0===c.length&&x&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{children:"No tools available for configuration"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm",children:"Connect to an MCP server with tools to configure them"})]}),!x&&r.url&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{children:"Complete required fields to configure tools"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to load available tools"})]}),!d&&!m&&c.length>0&&(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-50 rounded-lg border border-green-200 flex-1",children:[(0,l.jsx)(Q.Z,{className:"text-green-600"}),(0,l.jsxs)(g.Z,{className:"text-green-700 font-medium",children:[a.length," of ",c.length," ",1===c.length?"tool":"tools"," enabled for user access"]})]}),(0,l.jsxs)("div",{className:"flex gap-2 ml-3",children:[(0,l.jsx)("button",{type:"button",onClick:()=>{i(c.map(e=>e.name))},className:"px-3 py-1.5 text-sm text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-md transition-colors",children:"Enable All"}),(0,l.jsx)("button",{type:"button",onClick:()=>{i([])},className:"px-3 py-1.5 text-sm text-gray-600 hover:text-gray-700 hover:bg-gray-100 rounded-md transition-colors",children:"Disable All"})]})]}),(0,l.jsx)("div",{className:"space-y-2",children:c.map((e,s)=>(0,l.jsx)("div",{className:"p-4 rounded-lg border transition-colors cursor-pointer ".concat(a.includes(e.name)?"bg-blue-50 border-blue-300 hover:border-blue-400":"bg-gray-50 border-gray-200 hover:border-gray-300"),onClick:()=>u(e.name),children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)(ee.Z,{checked:a.includes(e.name),onChange:()=>u(e.name)}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(g.Z,{className:"font-medium text-gray-900",children:e.name}),(0,l.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full font-medium ".concat(a.includes(e.name)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:a.includes(e.name)?"Enabled":"Disabled"})]}),e.description&&(0,l.jsx)(g.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description}),(0,l.jsx)(g.Z,{className:"text-gray-400 text-xs block mt-1",children:a.includes(e.name)?"✓ Users can call this tool":"✗ Users cannot call this tool"})]})]})},s))})]})]})}):null},el=r(9114),et=e=>{let{mcpServer:s,accessToken:r,onCancel:a,onSuccess:i,availableAccessGroups:o}=e,[p]=U.Z.useForm(),[j,g]=(0,t.useState)({}),[v,f]=(0,t.useState)([]),[b,y]=(0,t.useState)(!1),[N,_]=(0,t.useState)(""),[Z,w]=(0,t.useState)(!1),[k,A]=(0,t.useState)([]);(0,t.useEffect)(()=>{var e;(null===(e=s.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&g(s.mcp_info.mcp_server_cost_info)},[s]),(0,t.useEffect)(()=>{s.allowed_tools&&A(s.allowed_tools)},[s]),(0,t.useEffect)(()=>{if(s.mcp_access_groups){let e=s.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));p.setFieldValue("mcp_access_groups",e)}},[s]),(0,t.useEffect)(()=>{L()},[s,r]);let L=async()=>{if(r&&s.url){y(!0);try{let e={server_id:s.server_id,server_name:s.server_name,url:s.url,transport:s.transport,auth_type:s.auth_type,mcp_info:s.mcp_info},l=await (0,P.testMCPToolsListRequest)(r,e);l.tools&&!l.error?f(l.tools):(console.error("Failed to fetch tools:",l.message),f([]))}catch(e){console.error("Tools fetch error:",e),f([])}finally{y(!1)}}},M=async e=>{if(r)try{let l=(e.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),t={...e,server_id:s.server_id,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(j).length>0?j:null},mcp_access_groups:l,alias:e.alias,extra_headers:e.extra_headers||[],allowed_tools:k.length>0?k:null,disallowed_tools:e.disallowed_tools||[]},a=await (0,P.updateMCPServer)(r,t);el.Z.success("MCP Server updated successfully"),i(a)}catch(e){el.Z.fromBackend("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,l.jsxs)(m.Z,{children:[(0,l.jsxs)(x.Z,{className:"grid w-full grid-cols-2",children:[(0,l.jsx)(d.Z,{children:"Server Configuration"}),(0,l.jsx)(d.Z,{children:"Cost Configuration"})]}),(0,l.jsxs)(h.Z,{className:"mt-6",children:[(0,l.jsx)(u.Z,{children:(0,l.jsxs)(U.Z,{form:p,onFinish:M,initialValues:s,layout:"vertical",children:[(0,l.jsx)(U.Z.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,s)=>S(s)}],children:(0,l.jsx)(B.Z,{})}),(0,l.jsx)(U.Z.Item,{label:"Alias",name:"alias",rules:[{validator:(e,s)=>S(s)}],children:(0,l.jsx)(B.Z,{onChange:()=>w(!0)})}),(0,l.jsx)(U.Z.Item,{label:"Description",name:"description",children:(0,l.jsx)(B.Z,{})}),(0,l.jsx)(U.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>C(s)}],children:(0,l.jsx)(B.Z,{})}),(0,l.jsx)(U.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,l.jsxs)(n.default,{children:[(0,l.jsx)(n.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,l.jsx)(n.default.Option,{value:"http",children:"HTTP"})]})}),(0,l.jsx)(U.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,l.jsxs)(n.default,{children:[(0,l.jsx)(n.default.Option,{value:"none",children:"None"}),(0,l.jsx)(n.default.Option,{value:"api_key",children:"API Key"}),(0,l.jsx)(n.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,l.jsx)(n.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(W,{availableAccessGroups:o,mcpServer:s,searchValue:N,setSearchValue:_,getAccessGroupOptions:()=>{let e=o.map(e=>({value:e,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e})]})}));return N&&!o.some(e=>e.toLowerCase().includes(N.toLowerCase()))&&e.push({value:N,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:N}),(0,l.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(er,{accessToken:r,formValues:{server_id:s.server_id,server_name:s.server_name,url:s.url,transport:s.transport,auth_type:s.auth_type,mcp_info:s.mcp_info},allowedTools:k,existingAllowedTools:s.allowed_tools||null,onAllowedToolsChange:A})}),(0,l.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,l.jsx)(F.ZP,{onClick:a,children:"Cancel"}),(0,l.jsx)(c.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,l.jsx)(u.Z,{children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(J,{value:j,onChange:g,tools:v,disabled:b}),(0,l.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,l.jsx)(F.ZP,{onClick:a,children:"Cancel"}),(0,l.jsx)(c.Z,{onClick:()=>p.submit(),children:"Save Changes"})]})]})})]})]})},ea=r(92280),en=e=>{let{costConfig:s}=e,r=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,t=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return r||t?(0,l.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,l.jsxs)("div",{className:"space-y-4",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,l.jsxs)("div",{children:[(0,l.jsx)(ea.x,{className:"font-medium",children:"Default Cost per Query"}),(0,l.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),t&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,l.jsxs)("div",{children:[(0,l.jsx)(ea.x,{className:"font-medium",children:"Tool-Specific Costs"}),(0,l.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,l.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,l.jsx)(ea.x,{className:"font-medium",children:s}),(0,l.jsxs)(ea.x,{className:"text-green-600 font-mono",children:["$",r.toFixed(4)," per query"]})]},s)})})]}),(0,l.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,l.jsx)(ea.x,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,l.jsxs)("div",{className:"mt-2 space-y-1",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,l.jsxs)(ea.x,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),t&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,l.jsxs)(ea.x,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,l.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,l.jsx)("div",{className:"space-y-4",children:(0,l.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,l.jsx)(ea.x,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})},ei=r(59872),eo=r(30401),ec=r(78867);let ed=e=>{var s,r,a,n,i;let{mcpServer:o,onBack:p,isEditing:f,isProxyAdmin:y,accessToken:N,userRole:_,userID:Z,availableAccessGroups:C}=e,[S,k]=(0,t.useState)(f),[P,A]=(0,t.useState)(!1),[E,z]=(0,t.useState)({}),{maskedUrl:R,hasToken:U}=w(o.url),B=(e,s)=>U?s?e:R:e,K=async(e,s)=>{await (0,ei.vQ)(e)&&(z(e=>({...e,[s]:!0})),setTimeout(()=>{z(e=>({...e,[s]:!1}))},2e3))};return(0,l.jsxs)("div",{className:"p-4 max-w-full",children:[(0,l.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Z,{icon:L.Z,variant:"light",className:"mb-4",onClick:p,children:"Back to All Servers"}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(v.Z,{children:o.server_name}),(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:E["mcp-server_name"]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>K(o.server_name,"mcp-server_name"),className:"left-2 z-10 transition-all duration-200 ".concat(E["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),o.alias&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"ml-4 text-gray-500",children:"Alias:"}),(0,l.jsx)("span",{className:"ml-1 font-mono text-blue-600",children:o.alias}),(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:E["mcp-alias"]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>K(o.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(E["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(g.Z,{className:"text-gray-500 font-mono",children:o.server_id}),(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:E["mcp-server-id"]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>K(o.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(E["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,l.jsxs)(m.Z,{defaultIndex:S?2:0,children:[(0,l.jsx)(x.Z,{className:"mb-4",children:[(0,l.jsx)(d.Z,{children:"Overview"},"overview"),(0,l.jsx)(d.Z,{children:"MCP Tools"},"tools"),...y?[(0,l.jsx)(d.Z,{children:"Settings"},"settings")]:[]]}),(0,l.jsxs)(h.Z,{children:[(0,l.jsxs)(u.Z,{children:[(0,l.jsxs)(j.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,l.jsxs)(I.Z,{children:[(0,l.jsx)(g.Z,{children:"Transport"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(v.Z,{children:q(null!==(n=o.transport)&&void 0!==n?n:void 0)})})]}),(0,l.jsxs)(I.Z,{children:[(0,l.jsx)(g.Z,{children:"Auth Type"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(g.Z,{children:O(null!==(i=o.auth_type)&&void 0!==i?i:void 0)})})]}),(0,l.jsxs)(I.Z,{children:[(0,l.jsx)(g.Z,{children:"Host Url"}),(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,l.jsx)(g.Z,{className:"break-all overflow-wrap-anywhere",children:B(o.url,P)}),U&&(0,l.jsx)("button",{onClick:()=>A(!P),className:"p-1 hover:bg-gray-100 rounded",children:(0,l.jsx)(b.Z,{icon:P?M.Z:T.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,l.jsxs)(I.Z,{className:"mt-2",children:[(0,l.jsx)(v.Z,{children:"Cost Configuration"}),(0,l.jsx)(en,{costConfig:null===(s=o.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,l.jsx)(u.Z,{children:(0,l.jsx)(eY,{serverId:o.server_id,accessToken:N,auth_type:o.auth_type,userRole:_,userID:Z,serverAlias:o.alias})}),(0,l.jsx)(u.Z,{children:(0,l.jsxs)(I.Z,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(v.Z,{children:"MCP Server Settings"}),S?null:(0,l.jsx)(c.Z,{variant:"light",onClick:()=>k(!0),children:"Edit Settings"})]}),S?(0,l.jsx)(et,{mcpServer:o,accessToken:N,onCancel:()=>k(!1),onSuccess:e=>{k(!1),p()},availableAccessGroups:C}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Server Name"}),(0,l.jsx)("div",{children:o.server_name})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Alias"}),(0,l.jsx)("div",{children:o.alias})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Description"}),(0,l.jsx)("div",{children:o.description})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"URL"}),(0,l.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[B(o.url,P),U&&(0,l.jsx)("button",{onClick:()=>A(!P),className:"p-1 hover:bg-gray-100 rounded",children:(0,l.jsx)(b.Z,{icon:P?M.Z:T.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Transport"}),(0,l.jsx)("div",{children:q(o.transport)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Extra Headers"}),(0,l.jsx)("div",{children:null===(r=o.extra_headers)||void 0===r?void 0:r.join(", ")})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Auth Type"}),(0,l.jsx)("div",{children:O(o.auth_type)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Access Groups"}),(0,l.jsx)("div",{children:o.mcp_access_groups&&o.mcp_access_groups.length>0?(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:o.mcp_access_groups.map((e,s)=>{var r;return(0,l.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(r=null==e?void 0:e.name)&&void 0!==r?r:""},s)})}):(0,l.jsx)(g.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Allowed Tools"}),(0,l.jsx)("div",{children:o.allowed_tools&&o.allowed_tools.length>0?(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:o.allowed_tools.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-50 border border-blue-200 rounded-md text-sm",children:e},s))}):(0,l.jsx)(g.Z,{className:"text-gray-500",children:"All tools enabled"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Cost Configuration"}),(0,l.jsx)(en,{costConfig:null===(a=o.mcp_info)||void 0===a?void 0:a.mcp_server_cost_info})]})]})]})})]})]})]})};var em=r(64504),ex=r(61778),eu=r(29271),eh=r(89245),ep=e=>{let{accessToken:s,formValues:r,onToolsLoaded:a}=e,{tools:n,isLoadingTools:i,toolsError:o,canFetchTools:c,fetchTools:d}=es({accessToken:s,formValues:r,enabled:!0});return((0,t.useEffect)(()=>{null==a||a(n)},[n,a]),c||r.url)?(0,l.jsx)(I.Z,{children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Q.Z,{className:"text-blue-600"}),(0,l.jsx)(v.Z,{children:"Connection Status"})]}),!c&&r.url&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{children:"Complete required fields to test connection"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),c&&(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":n.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,l.jsx)("br",{}),(0,l.jsxs)(g.Z,{className:"text-gray-500 text-sm",children:["Server: ",r.url]})]}),i&&(0,l.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,l.jsx)(X.Z,{size:"small",className:"mr-2"}),(0,l.jsx)(g.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&n.length>0&&(0,l.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,l.jsx)(Q.Z,{className:"mr-1"}),(0,l.jsx)(g.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,l.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,l.jsx)(eu.Z,{className:"mr-1"}),(0,l.jsx)(g.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,l.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,l.jsx)(X.Z,{size:"large"}),(0,l.jsx)(g.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,l.jsx)(ex.Z,{message:"Connection Failed",description:o,type:"error",showIcon:!0,action:(0,l.jsx)(F.ZP,{icon:(0,l.jsx)(eh.Z,{}),onClick:d,size:"small",children:"Retry"})}),!i&&0===n.length&&!o&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,l.jsx)(Q.Z,{className:"text-2xl mb-2 text-green-500"}),(0,l.jsx)(g.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},ej=r(64482),eg=e=>{let{isVisible:s}=e;return s?(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,l.jsx)(o.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,l.jsx)(ej.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null};let ev="".concat("../ui/assets/logos/","mcp_logo.png");var ef=e=>{let{userRole:s,accessToken:r,onCreateSuccess:a,isModalVisible:c,setModalVisible:d,availableAccessGroups:m}=e,[x]=U.Z.useForm(),[u,h]=(0,t.useState)(!1),[p,j]=(0,t.useState)({}),[g,v]=(0,t.useState)({}),[f,b]=(0,t.useState)(!1),[y,N]=(0,t.useState)([]),[_,Z]=(0,t.useState)([]),[w,k]=(0,t.useState)(""),[L,M]=(0,t.useState)(""),[T,I]=(0,t.useState)(""),E=(e,s)=>{if(!e){I("");return}"sse"!==s||e.endsWith("/sse")?"http"!==s||e.endsWith("/mcp")?I(""):I("Typically MCP HTTP URLs end with /mcp. You can add this url but this is a warning."):I("Typically MCP SSE URLs end with /sse. You can add this url but this is a warning.")},z=async e=>{h(!0);try{let s=e.mcp_access_groups,l={};if(e.stdio_config&&"stdio"===w)try{let s=JSON.parse(e.stdio_config),r=s;if(s.mcpServers&&"object"==typeof s.mcpServers){let l=Object.keys(s.mcpServers);if(l.length>0){let t=l[0];r=s.mcpServers[t],e.server_name||(e.server_name=t.replace(/-/g,"_"))}}l={command:r.command,args:r.args,env:r.env},console.log("Parsed stdio config:",l)}catch(e){el.Z.fromBackend("Invalid JSON in stdio configuration");return}let t={...e,...l,stdio_config:void 0,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(p).length>0?p:null},mcp_access_groups:s,alias:e.alias,allowed_tools:_.length>0?_:null};if(console.log("Payload: ".concat(JSON.stringify(t))),null!=r){let e=await (0,P.createMCPServer)(r,t);el.Z.success("MCP Server created successfully"),x.resetFields(),j({}),N([]),Z([]),I(""),b(!1),d(!1),a(e)}}catch(e){el.Z.fromBackend("Error creating MCP Server: "+e)}finally{h(!1)}},q=()=>{x.resetFields(),j({}),N([]),Z([]),I(""),b(!1),d(!1)};return(t.useEffect(()=>{if(!f&&g.server_name){let e=g.server_name.replace(/\s+/g,"_");x.setFieldsValue({alias:e}),v(s=>({...s,alias:e}))}},[g.server_name]),t.useEffect(()=>{c||v({})},[c]),(0,A.tY)(s))?(0,l.jsx)(i.Z,{title:(0,l.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,l.jsx)("img",{src:ev,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:c,width:1e3,onCancel:q,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsxs)(U.Z,{form:x,onFinish:z,onValuesChange:(e,s)=>v(s),layout:"vertical",className:"space-y-6",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,l.jsx)(o.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>S(s)}],children:(0,l.jsx)(em.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,l.jsx)(o.Z,{title:"A short, unique identifier for this server. Defaults to the server name with spaces replaced by underscores.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,l.jsx)(em.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>b(!0)})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description!!!!!!!!!"}],children:(0,l.jsx)(em.o,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,l.jsxs)(n.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{if(k(e),"stdio"===e)x.setFieldsValue({url:void 0,auth_type:void 0}),I("");else{x.setFieldsValue({command:void 0,args:void 0,env:void 0});let s=x.getFieldValue("url");s&&E(s,e)}},value:w,children:[(0,l.jsx)(n.default.Option,{value:"http",children:"HTTP"}),(0,l.jsx)(n.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,l.jsx)(n.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==w&&(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>C(s)}],children:(0,l.jsxs)("div",{children:[(0,l.jsx)(em.o,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:e=>E(e.target.value,w)}),T&&(0,l.jsx)("div",{className:"mt-1 text-red-500 text-sm font-medium",children:T})]})}),"stdio"!==w&&(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,l.jsxs)(n.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,l.jsx)(n.default.Option,{value:"none",children:"None"}),(0,l.jsx)(n.default.Option,{value:"api_key",children:"API Key"}),(0,l.jsx)(n.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,l.jsx)(n.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,l.jsx)(eg,{isVisible:"stdio"===w})]}),(0,l.jsx)("div",{className:"mt-8",children:(0,l.jsx)(W,{availableAccessGroups:m,mcpServer:null,searchValue:L,setSearchValue:M,getAccessGroupOptions:()=>{let e=m.map(e=>({value:e,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e})]})}));return L&&!m.some(e=>e.toLowerCase().includes(L.toLowerCase()))&&e.push({value:L,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:L}),(0,l.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,l.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,l.jsx)(ep,{accessToken:r,formValues:g,onToolsLoaded:N})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(er,{accessToken:r,formValues:g,allowedTools:_,existingAllowedTools:null,onAllowedToolsChange:Z})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(J,{value:p,onChange:j,tools:y.filter(e=>_.includes(e.name)),disabled:!1})}),(0,l.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,l.jsx)(em.z,{variant:"secondary",onClick:q,children:"Cancel"}),(0,l.jsx)(em.z,{variant:"primary",loading:u,children:u?"Creating...":"Add MCP Server"})]})]})})}):null},eb=r(93192),ey=r(67960),eN=r(63709),e_=r(93142),eZ=r(64935),ew=r(11239),eC=r(54001),eS=r(96137),ek=r(96362),eP=r(80221),eA=r(29202);let{Title:eL,Text:eM}=eb.default,{Panel:eT}=V.default,eI=e=>{let{icon:s,title:r,description:a,children:n,serverName:i,accessGroups:o=["dev"]}=e,[c,d]=(0,t.useState)(!1),m=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(c&&i){let s=[i.replace(/\s+/g,"_"),...o].join(",");e["x-mcp-servers"]=[s]}return e};return(0,l.jsxs)(ey.Z,{className:"border border-gray-200",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eL,{level:5,className:"mb-0",children:r}),(0,l.jsx)(eM,{className:"text-gray-600",children:a})]})]}),i&&("Implementation Example"===r||"Configuration"===r)&&(0,l.jsxs)(U.Z.Item,{className:"mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,l.jsx)(eN.Z,{size:"small",checked:c,onChange:d}),(0,l.jsxs)(eM,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,l.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),c&&(0,l.jsx)(ex.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{children:[(0,l.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,l.jsxs)("code",{children:['["',i.replace(/\s+/g,"_"),'"]']})]}),(0,l.jsxs)("p",{children:[(0,l.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,l.jsx)("code",{children:'["dev-group"]'})]}),(0,l.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,l.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),t.Children.map(n,e=>{if(t.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return t.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(m(),null,8)))})}return e})]})};var eE=e=>{let{currentServerAccessGroups:s=[]}=e,r=(0,P.getProxyBaseUrl)(),[a,n]=(0,t.useState)({}),[i,o]=(0,t.useState)({openai:[],litellm:[],cursor:[],http:[]}),[c]=(0,t.useState)("Zapier_MCP"),p=async(e,s)=>{await (0,ei.vQ)(e)&&(n(e=>({...e,[s]:!0})),setTimeout(()=>{n(e=>({...e,[s]:!1}))},2e3))},j=e=>{let{code:s,copyKey:r,title:t,className:n=""}=e;return(0,l.jsxs)("div",{className:"relative group",children:[t&&(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,l.jsx)(eZ.Z,{size:16,className:"text-blue-600"}),(0,l.jsx)(eM,{strong:!0,className:"text-gray-700",children:t})]}),(0,l.jsxs)(ey.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(n),children:[(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:a[r]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>p(s,r),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(a[r]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,l.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},f=e=>{let{step:s,title:r,children:t}=e;return(0,l.jsxs)("div",{className:"flex gap-4",children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)(eM,{strong:!0,className:"text-gray-800 block mb-2",children:r}),t]})]})};return(0,l.jsx)("div",{children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(v.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,l.jsx)(g.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,l.jsxs)(m.Z,{className:"w-full",children:[(0,l.jsx)(x.Z,{className:"flex justify-start mt-8 mb-6",children:(0,l.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(eZ.Z,{size:18}),"OpenAI API"]})}),(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(ew.Z,{size:18}),"LiteLLM Proxy"]})}),(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(eP.Z,{size:18}),"Cursor"]})}),(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(eA.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,l.jsxs)(h.Z,{children:[(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(eZ.Z,{className:"text-blue-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,l.jsx)(eM,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsx)(eI,{icon:(0,l.jsx)(eC.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,l.jsx)("div",{children:(0,l.jsxs)(eM,{children:["Get your API key from the"," ",(0,l.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,l.jsx)(ek.Z,{size:12})]})]})}),(0,l.jsx)(j,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eS.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,l.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"openai-server-url"})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eZ.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,l.jsx)(j,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(ew.Z,{className:"text-emerald-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,l.jsx)(eM,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsx)(eI,{icon:(0,l.jsx)(eC.Z,{className:"text-emerald-600",size:16}),title:"API Key Setup",description:"Configure your LiteLLM Proxy API key for authentication",children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,l.jsx)("div",{children:(0,l.jsx)(eM,{children:"Get your API key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,l.jsx)(j,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eS.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,l.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"litellm-server-url"})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eZ.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:c,accessGroups:["dev"],children:(0,l.jsx)(j,{code:"curl --location '".concat(r,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_API_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(eP.Z,{className:"text-purple-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,l.jsx)(eM,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,l.jsxs)(ey.Z,{className:"border border-gray-200",children:[(0,l.jsx)(eL,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsx)(f,{step:1,title:"Open Cursor Settings",children:(0,l.jsxs)(eM,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or"," ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,l.jsx)(f,{step:2,title:"Navigate to MCP Tools",children:(0,l.jsx)(eM,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,l.jsxs)(f,{step:3,title:"Add Configuration",children:[(0,l.jsxs)(eM,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with"," ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or"," ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eZ.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,l.jsx)(j,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "server_url": "'.concat(r,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(eA.Z,{className:"text-green-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,l.jsx)(eM,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eA.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,l.jsx)("div",{children:(0,l.jsx)(eM,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,l.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"http-server-url"}),(0,l.jsx)(j,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(F.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,l.jsx)(ek.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},ez=r(67187);let{Option:eq}=n.default,eO=e=>{let{isModalOpen:s,title:r,confirmDelete:t,cancelDelete:a}=e;return s?(0,l.jsx)(i.Z,{open:s,onOk:t,okType:"danger",onCancel:a,children:(0,l.jsxs)(j.Z,{numItems:1,className:"gap-2 w-full",children:[(0,l.jsx)(v.Z,{children:r}),(0,l.jsx)(p.Z,{numColSpan:1,children:(0,l.jsx)("p",{children:"Are you sure you want to delete this MCP Server?"})})]})}):null};var eR=e=>{let{accessToken:s,userRole:r,userID:i}=e,{data:p,isLoading:j,refetch:b,dataUpdatedAt:y}=(0,a.a)({queryKey:["mcpServers"],queryFn:()=>{if(!s)throw Error("Access Token required");return(0,P.fetchMCPServers)(s)},enabled:!!s});t.useEffect(()=>{p&&(console.log("MCP Servers fetched:",p),p.forEach(e=>{console.log("Server: ".concat(e.server_name||e.server_id)),console.log(" allowed_tools:",e.allowed_tools)}))},[p]);let[N,_]=(0,t.useState)(null),[Z,w]=(0,t.useState)(!1),[C,S]=(0,t.useState)(null),[L,M]=(0,t.useState)(!1),[T,I]=(0,t.useState)("all"),[E,z]=(0,t.useState)("all"),[q,O]=(0,t.useState)([]),[R,U]=(0,t.useState)(!1),F="Internal User"===r,B=t.useMemo(()=>{if(!p)return[];let e=new Set,s=[];return p.forEach(r=>{r.teams&&r.teams.forEach(r=>{let l=r.team_id;e.has(l)||(e.add(l),s.push(r))})}),s},[p]),K=t.useMemo(()=>p?Array.from(new Set(p.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[p]),V=e=>{I(e),H(e,E)},D=e=>{z(e),H(T,e)},H=(e,s)=>{if(!p)return O([]);let r=p;if("personal"===e){O([]);return}"all"!==e&&(r=r.filter(s=>{var r;return null===(r=s.teams)||void 0===r?void 0:r.some(s=>s.team_id===e)})),"all"!==s&&(r=r.filter(e=>{var r;return null===(r=e.mcp_access_groups)||void 0===r?void 0:r.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),O(r)};(0,t.useEffect)(()=>{H(T,E)},[y]);let G=t.useMemo(()=>k(null!=r?r:"",e=>{S(e),M(!1)},e=>{S(e),M(!0)},Y),[r]);function Y(e){_(e),w(!0)}let J=async()=>{if(null!=N&&null!=s){try{await (0,P.deleteMCPServer)(s,N),el.Z.success("Deleted MCP Server successfully"),b()}catch(e){console.error("Error deleting the mcp server:",e)}w(!1),_(null)}};return s&&r&&i?(0,l.jsxs)("div",{className:"w-full h-full p-6",children:[(0,l.jsx)(eO,{isModalOpen:Z,title:"Delete MCP Server",confirmDelete:J,cancelDelete:()=>{w(!1),_(null)}}),(0,l.jsx)(ef,{userRole:r,accessToken:s,onCreateSuccess:e=>{O(s=>[...s,e]),U(!1)},isModalVisible:R,setModalVisible:U,availableAccessGroups:K}),(0,l.jsx)(v.Z,{children:"MCP Servers"}),(0,l.jsx)(g.Z,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,A.tY)(r)&&(0,l.jsx)(c.Z,{className:"mt-4 mb-4",onClick:()=>U(!0),children:"+ Add New MCP Server"}),(0,l.jsxs)(m.Z,{className:"w-full h-full",children:[(0,l.jsx)(x.Z,{className:"flex justify-between mt-2 w-full items-center",children:(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(d.Z,{children:"All Servers"}),(0,l.jsx)(d.Z,{children:"Connect"})]})}),(0,l.jsxs)(h.Z,{children:[(0,l.jsx)(u.Z,{children:(0,l.jsx)(()=>C?(0,l.jsx)(ed,{mcpServer:q.find(e=>e.server_id===C)||{server_id:"",server_name:"",alias:"",url:"",transport:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{M(!1),S(null),b()},isProxyAdmin:(0,A.tY)(r),isEditing:L,accessToken:s,userID:i,userRole:r,availableAccessGroups:K}):(0,l.jsxs)("div",{className:"w-full h-full",children:[(0,l.jsx)("div",{className:"w-full px-6",children:(0,l.jsx)("div",{className:"flex flex-col space-y-4",children:(0,l.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)(g.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,l.jsxs)(n.default,{value:T,onChange:V,style:{width:300},children:[(0,l.jsx)(eq,{value:"all",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:F?"All Available Servers":"All Servers"})]})}),(0,l.jsx)(eq,{value:"personal",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:"Personal"})]})}),B.map(e=>(0,l.jsx)(eq,{value:e.team_id,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,l.jsxs)(g.Z,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,l.jsx)(o.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,l.jsx)(ez.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,l.jsxs)(n.default,{value:E,onChange:D,style:{width:300},children:[(0,l.jsx)(eq,{value:"all",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),K.map(e=>(0,l.jsx)(eq,{value:e,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,l.jsx)("div",{className:"w-full px-6 mt-6",children:(0,l.jsx)(f.w,{data:q,columns:G,renderSubComponent:()=>(0,l.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:j,noDataMessage:"No MCP servers configured"})})]}),{})}),(0,l.jsx)(u.Z,{children:(0,l.jsx)(eE,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:r,userID:i}),(0,l.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},eU=r(21770);function eF(e){let{tool:s,needsAuth:r,authValue:a,onSubmit:n,isLoading:i,result:c,error:d,onClose:m}=e,[x]=U.Z.useForm(),[u,h]=t.useState("formatted"),[p,j]=t.useState(null),[g,v]=t.useState(null),f=t.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),b=t.useMemo(()=>f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{type:"object",properties:f.properties.params.properties,required:f.properties.params.required||[]}:f,[f]);t.useEffect(()=>{p&&(c||d)&&v(Date.now()-p)},[c,d,p]);let y=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let r=document.execCommand("copy");if(document.body.removeChild(s),!r)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},N=async()=>{await y(JSON.stringify(c,null,2))?el.Z.success("Result copied to clipboard"):el.Z.fromBackend("Failed to copy result")},_=async()=>{await y(s.name)?el.Z.success("Tool name copied to clipboard"):el.Z.fromBackend("Failed to copy tool name")};return(0,l.jsxs)("div",{className:"space-y-4 h-full",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,l.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,l.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:_,title:"Click to copy tool name",children:[(0,l.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,l.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,l.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,l.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,l.jsx)(em.z,{onClick:m,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,l.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,l.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,l.jsx)(o.Z,{title:"Configure the input parameters for this tool call",children:(0,l.jsx)(G.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,l.jsx)("div",{className:"p-4",children:(0,l.jsxs)(U.Z,{form:x,onFinish:e=>{j(Date.now()),v(null);let s={};Object.entries(e).forEach(e=>{var r;let[l,t]=e,a=null===(r=b.properties)||void 0===r?void 0:r[l];if(a&&null!=t&&""!==t)switch(a.type){case"boolean":s[l]="true"===t||!0===t;break;case"number":s[l]=Number(t);break;case"string":s[l]=String(t);break;default:s[l]=t}else null!=t&&""!==t&&(s[l]=t)}),n(f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,l.jsx)("div",{className:"space-y-3",children:(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,l.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,l.jsx)(em.o,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===b.properties?(0,l.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,l.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,l.jsx)("div",{className:"space-y-3",children:Object.entries(b.properties).map(e=>{var s,r,t,a,n;let[i,c]=e;return(0,l.jsxs)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(s=b.required)||void 0===s?void 0:s.includes(i))&&(0,l.jsx)("span",{className:"text-red-500",children:"*"}),c.description&&(0,l.jsx)(o.Z,{title:c.description,children:(0,l.jsx)(G.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,rules:[{required:null===(r=b.required)||void 0===r?void 0:r.includes(i),message:"Please enter ".concat(i)}],className:"mb-3",children:["string"===c.type&&c.enum&&(0,l.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:c.default,children:[!(null===(t=b.required)||void 0===t?void 0:t.includes(i))&&(0,l.jsxs)("option",{value:"",children:["Select ",i]}),c.enum.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]}),"string"===c.type&&!c.enum&&(0,l.jsx)(em.o,{placeholder:c.description||"Enter ".concat(i),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),"number"===c.type&&(0,l.jsx)("input",{type:"number",placeholder:c.description||"Enter ".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===c.type&&(0,l.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null===(a=c.default)||void 0===a?void 0:a.toString())||"",children:[!(null===(n=b.required)||void 0===n?void 0:n.includes(i))&&(0,l.jsxs)("option",{value:"",children:["Select ",i]}),(0,l.jsx)("option",{value:"true",children:"True"}),(0,l.jsx)("option",{value:"false",children:"False"})]})]},i)})}),(0,l.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,l.jsx)(em.z,{onClick:()=>x.submit(),disabled:i,variant:"primary",className:"w-full",loading:i,children:i?"Calling Tool...":c||d?"Call Again":"Call Tool"})})]})})]}),(0,l.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,l.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,l.jsx)("div",{className:"p-4",children:c||d||i?(0,l.jsxs)("div",{className:"space-y-3",children:[c&&!i&&!d&&(0,l.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,l.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==g&&(0,l.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,l.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,l.jsx)("button",{onClick:()=>h("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,l.jsx)("button",{onClick:()=>h("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,l.jsx)("button",{onClick:N,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,l.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,l.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[i&&(0,l.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,l.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,l.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),d&&(0,l.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==g&&(0,l.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,l.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,l.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:d.message})})]})]})}),c&&!i&&!d&&(0,l.jsx)("div",{className:"space-y-3",children:"formatted"===u?c.map((e,s)=>(0,l.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,l.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,l.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let r=e.replace(/^#+\s/,"");return(0,l.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:r})},s)}let r=/(https?:\/\/[^\s\)]+)/g;if(r.test(e)){let t=e.split(r);return(0,l.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,l.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:t.map((e,s)=>r.test(e)?(0,l.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,l.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,l.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,l.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,l.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,l.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,l.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,l.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,l.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,l.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,l.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,l.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,l.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,l.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,l.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(c,null,2)})})})})]})]}):(0,l.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,l.jsxs)("div",{className:"text-center max-w-sm",children:[(0,l.jsx)("div",{className:"mb-3",children:(0,l.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,l.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var eB=r(29488),eK=r(36724),eV=r(57400),eD=r(69993);let eH=e=>{let s,{visible:r,onOk:t,onCancel:a,authType:n}=e,[o]=U.Z.useForm();if(n===E.API_KEY||n===E.BEARER_TOKEN){let e=n===E.API_KEY?"API Key":"Bearer Token";s=(0,l.jsx)(U.Z.Item,{name:"authValue",label:e,rules:[{required:!0,message:"Please input your ".concat(e)}],children:(0,l.jsx)(ej.default.Password,{})})}else n===E.BASIC&&(s=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(U.Z.Item,{name:"username",label:"Username",rules:[{required:!0,message:"Please input your username"}],children:(0,l.jsx)(ej.default,{})}),(0,l.jsx)(U.Z.Item,{name:"password",label:"Password",rules:[{required:!0,message:"Please input your password"}],children:(0,l.jsx)(ej.default.Password,{})})]}));return(0,l.jsx)(i.Z,{open:r,title:"Authentication",onOk:()=>{o.validateFields().then(e=>{n===E.BASIC?t("".concat(e.username.trim(),":").concat(e.password.trim())):t(e.authValue.trim())})},onCancel:a,destroyOnClose:!0,children:(0,l.jsx)(U.Z,{form:o,layout:"vertical",children:s})})},eG=e=>{let{authType:s,onAuthSubmit:r,onClearAuth:a,hasAuth:n}=e,[i,o]=(0,t.useState)(!1);return(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)(eK.xv,{className:"text-sm font-medium text-gray-700",children:["Authentication ",n?"✓":""]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[n&&(0,l.jsx)(eK.zx,{onClick:()=>{a()},size:"sm",variant:"secondary",className:"text-xs text-red-600 hover:text-red-700",children:"Clear"}),(0,l.jsx)(eK.zx,{onClick:()=>o(!0),size:"sm",variant:"secondary",className:"text-xs",children:n?"Update":"Add Auth"})]})]}),(0,l.jsx)(eK.xv,{className:"text-xs text-gray-500",children:n?"Authentication configured and saved locally":"Some tools may require authentication"}),(0,l.jsx)(eH,{visible:i,onOk:e=>{r(e),o(!1)},onCancel:()=>o(!1),authType:s})]})};var eY=e=>{let{serverId:s,accessToken:r,auth_type:n,userRole:i,userID:o,serverAlias:c}=e,[d,m]=(0,t.useState)(""),[x,u]=(0,t.useState)(null),[h,p]=(0,t.useState)(null),[j,g]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(R(n)){let e=(0,eB.Ui)(s,c||void 0);e&&m(e)}},[s,c,n]);let v=e=>{m(e),e&&R(n)&&((0,eB.Hc)(s,e,n||"none",c||void 0),el.Z.success("Authentication token saved locally"))},f=()=>{m(""),(0,eB.e4)(s),el.Z.info("Authentication token cleared")},{data:b,isLoading:y,error:N}=(0,a.a)({queryKey:["mcpTools",s,d,c],queryFn:()=>{if(!r)throw Error("Access Token required");return(0,P.listMCPTools)(r,s,d,c||void 0)},enabled:!!r,staleTime:3e4}),{mutate:_,isPending:Z}=(0,eU.D)({mutationFn:async e=>{if(!r)throw Error("Access Token required");try{return await (0,P.callMCPTool)(r,e.tool.name,e.arguments,e.authValue,c||void 0)}catch(e){throw e}},onSuccess:e=>{p(e),g(null)},onError:e=>{g(e),p(null)}}),w=(null==b?void 0:b.tools)||[],C=""!==d;return(0,l.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,l.jsx)(eK.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,l.jsxs)("div",{className:"flex h-auto w-full gap-4",children:[(0,l.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,l.jsx)(eK.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,l.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,l.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,l.jsxs)(eK.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,l.jsx)(Y.Z,{className:"mr-2"})," Available Tools",w.length>0&&(0,l.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:w.length})]}),y&&(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,l.jsxs)("div",{className:"relative mb-3",children:[(0,l.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,l.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,l.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==b?void 0:b.error)&&!y&&!w.length&&(0,l.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,l.jsxs)("p",{className:"font-medium",children:["Error: ",b.message]})}),!y&&!(null==b?void 0:b.error)&&(!w||0===w.length)&&(0,l.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,l.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,l.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!y&&!(null==b?void 0:b.error)&&w.length>0&&(0,l.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto min-h-0 mcp-tools-scrollable",style:{maxHeight:"400px",scrollbarWidth:"auto",scrollbarColor:"#cbd5e0 #f7fafc"},children:w.map(e=>(0,l.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==x?void 0:x.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{u(e),p(null),g(null)},children:[(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,l.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,l.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,l.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==x?void 0:x.name)===e.name&&(0,l.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,l.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,l.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]}),R(n)&&(0,l.jsx)("div",{className:"pt-4 border-t border-gray-200 flex-shrink-0 mt-6",children:C?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(eK.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,l.jsx)(eV.Z,{className:"mr-2"})," Authentication"]}),(0,l.jsx)(eG,{authType:n,onAuthSubmit:v,onClearAuth:f,hasAuth:C})]}):(0,l.jsxs)("div",{className:"p-4 bg-gradient-to-r from-orange-50 to-red-50 border border-orange-200 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-center mb-3",children:[(0,l.jsx)(eV.Z,{className:"mr-2 text-orange-600 text-lg"}),(0,l.jsx)(eK.xv,{className:"font-semibold text-orange-800",children:"Authentication Required"})]}),(0,l.jsx)(eK.xv,{className:"text-sm text-orange-700 mb-4",children:"This MCP server requires authentication. You must add your credentials below to access the tools."}),(0,l.jsx)(eG,{authType:n,onAuthSubmit:v,onClearAuth:f,hasAuth:C})]})})]})]}),(0,l.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,l.jsx)(eK.Dx,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto p-4",children:x?(0,l.jsx)("div",{className:"h-full",children:(0,l.jsx)(eF,{tool:x,needsAuth:R(n),authValue:d,onSubmit:e=>{_({tool:x,arguments:e,authValue:d})},result:h,error:j,isLoading:Z,onClose:()=>u(null)})}):(0,l.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsx)(eD.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,l.jsx)(eK.xv,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,l.jsx)(eK.xv,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/131-79aa7086799152a2.js b/litellm/proxy/_experimental/out/_next/static/chunks/131-79aa7086799152a2.js deleted file mode 100644 index 950eb17f93..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/131-79aa7086799152a2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[131],{95704:function(e,t,r){r.d(t,{Dx:function(){return u.Z},RM:function(){return n.Z},SC:function(){return c.Z},Zb:function(){return a.Z},iA:function(){return s.Z},pj:function(){return l.Z},ss:function(){return i.Z},xs:function(){return o.Z},xv:function(){return d.Z}});var a=r(12514),s=r(21626),n=r(97214),l=r(28241),i=r(58834),o=r(69552),c=r(71876),d=r(84264),u=r(96761)},92280:function(e,t,r){r.d(t,{x:function(){return a.Z}});var a=r(84264)},56522:function(e,t,r){r.d(t,{o:function(){return s.Z},x:function(){return a.Z}});var a=r(84264),s=r(49566)},39760:function(e,t,r){var a=r(2265),s=r(99376),n=r(14474),l=r(3914);t.Z=()=>{var e,t,r,i,o,c,d;let u=(0,s.useRouter)(),m="undefined"!=typeof document?(0,l.e)("token"):null;(0,a.useEffect)(()=>{m||u.replace("/sso/key/generate")},[m,u]);let g=(0,a.useMemo)(()=>{if(!m)return null;try{return(0,n.o)(m)}catch(e){return(0,l.b)(),u.replace("/sso/key/generate"),null}},[m,u]);return{token:m,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(t=null==g?void 0:g.user_id)&&void 0!==t?t:null,userEmail:null!==(r=null==g?void 0:g.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(i=null==g?void 0:g.user_role)&&void 0!==i?i:null),premiumUser:null!==(o=null==g?void 0:g.premium_user)&&void 0!==o?o:null,disabledPersonalKeyCreation:null!==(c=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},97434:function(e,t,r){var a,s;r.d(t,{Dg:function(){return d},Lo:function(){return n},PA:function(){return i},RD:function(){return l},Y5:function(){return a},Z3:function(){return o}}),(s=a||(a={})).Braintrust="Braintrust",s.CustomCallbackAPI="Custom Callback API",s.Datadog="Datadog",s.Langfuse="Langfuse",s.LangfuseOtel="LangfuseOtel",s.LangSmith="LangSmith",s.Lago="Lago",s.OpenMeter="OpenMeter",s.OTel="Open Telemetry",s.S3="S3",s.Arize="Arize";let n={Braintrust:"braintrust",CustomCallbackAPI:"custom_callback_api",Datadog:"datadog",Langfuse:"langfuse",LangfuseOtel:"langfuse_otel",LangSmith:"langsmith",Lago:"lago",OpenMeter:"openmeter",OTel:"otel",S3:"s3",Arize:"arize"},l=Object.fromEntries(Object.entries(n).map(e=>{let[t,r]=e;return[r,t]})),i=e=>e.map(e=>l[e]||e),o=e=>e.map(e=>n[e]||e),c="/ui/assets/logos/",d={Langfuse:{logo:"".concat(c,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v2 Logging Integration"},LangfuseOtel:{logo:"".concat(c,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v3 OTEL Logging Integration"},Arize:{logo:"".concat(c,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"text"},description:"Arize Logging Integration"},LangSmith:{logo:"".concat(c,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text",langsmith_sampling_rate:"number"},description:"Langsmith Logging Integration"},Braintrust:{logo:"".concat(c,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{},description:"Braintrust Logging Integration"},"Custom Callback API":{logo:"".concat(c,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{},description:"Custom Callback API Logging Integration"},Datadog:{logo:"".concat(c,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{},description:"Datadog Logging Integration"},Lago:{logo:"".concat(c,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{},description:"Lago Billing Logging Integration"},OpenMeter:{logo:"".concat(c,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{},description:"OpenMeter Logging Integration"},"Open Telemetry":{logo:"".concat(c,"otel.png"),supports_key_team_logging:!1,dynamic_params:{},description:"OpenTelemetry Logging Integration"},S3:{logo:"".concat(c,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{},description:"S3 Bucket (AWS) Logging Integration"}}},51601:function(e,t,r){r.d(t,{p:function(){return s}});var a=r(19250);let s=async e=>{try{let t=await (0,a.modelHubCall)(e);if(console.log("model_info:",t),(null==t?void 0:t.data.length)>0){let e=t.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}}},95096:function(e,t,r){var a=r(57437),s=r(2265),n=r(52787),l=r(19250);t.Z=e=>{let{onChange:t,value:r,className:i,accessToken:o,placeholder:c="Select pass through routes",disabled:d=!1,teamId:u}=e,[m,g]=(0,s.useState)([]),[p,x]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(o){x(!0);try{let e=await (0,l.getPassThroughEndpointsCall)(o,u);if(e.endpoints){let t=e.endpoints.map(e=>e.path);g(t)}}catch(e){console.error("Error fetching pass through routes:",e)}finally{x(!1)}}})()},[o,u]),(0,a.jsx)(n.default,{mode:"tags",placeholder:c,onChange:t,value:r,loading:p,className:i,options:m.map(e=>({label:e,value:e})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})}},46468:function(e,t,r){r.d(t,{K2:function(){return s},Ob:function(){return l},W0:function(){return n}});var a=r(19250);let s=async(e,t,r)=>{try{if(null===e||null===t)return;if(null!==r){let s=(await (0,a.modelAvailableCall)(r,e,t,!0,null,!0)).data.map(e=>e.id),n=[],l=[];return s.forEach(e=>{e.endsWith("/*")?n.push(e):l.push(e)}),[...n,...l]}}catch(e){console.error("Error fetching user models:",e)}},n=e=>{if(e.endsWith("/*")){let t=e.replace("/*","");return"All ".concat(t," models")}return e},l=(e,t)=>{let r=[],a=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let s=e.replace("/*",""),n=t.filter(e=>e.startsWith(s+"/"));a.push(...n),r.push(e)}else a.push(e)}),[...r,...a].filter((e,t,r)=>r.indexOf(e)===t)}},95920:function(e,t,r){var a=r(57437),s=r(2265),n=r(52787),l=r(19250);t.Z=e=>{let{onChange:t,value:r,className:i,accessToken:o,placeholder:c="Select MCP servers",disabled:d=!1}=e,[u,m]=(0,s.useState)([]),[g,p]=(0,s.useState)([]),[x,h]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(async()=>{if(o){h(!0);try{let[e,t]=await Promise.all([(0,l.fetchMCPServers)(o),(0,l.fetchMCPAccessGroups)(o)]),r=Array.isArray(e)?e:e.data||[],a=Array.isArray(t)?t:t.data||[];m(r),p(a)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[o]);let f=[...g.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...u.map(e=>({label:"".concat(e.server_name||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.server_name||e.server_id," ").concat(e.server_id," MCP Server")}))],v=[...(null==r?void 0:r.servers)||[],...(null==r?void 0:r.accessGroups)||[]];return(0,a.jsx)("div",{children:(0,a.jsx)(n.default,{mode:"multiple",placeholder:c,onChange:e=>{t({servers:e.filter(e=>!g.includes(e)),accessGroups:e.filter(e=>g.includes(e))})},value:v,loading:x,className:i,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>{var r;return((null===(r=f.find(e=>e.value===(null==t?void 0:t.value)))||void 0===r?void 0:r.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:f.map(e=>(0,a.jsx)(n.default.Option,{value:e.value,label:e.label,children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,a.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,a.jsx)("span",{style:{flex:1},children:e.label}),(0,a.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})}},68473:function(e,t,r){var a=r(57437),s=r(2265),n=r(19250),l=r(92280),i=r(87908),o=r(61994),c=r(32489);t.Z=e=>{let{accessToken:t,selectedServers:r,toolPermissions:d,onChange:u,disabled:m=!1}=e,[g,p]=(0,s.useState)([]),[x,h]=(0,s.useState)({}),[f,v]=(0,s.useState)({}),[b,y]=(0,s.useState)({});(0,s.useEffect)(()=>{(async()=>{if(0===r.length){p([]);return}try{let e=await (0,n.fetchMCPServers)(t),a=(Array.isArray(e)?e:e.data||[]).filter(e=>r.includes(e.server_id));p(a)}catch(e){console.error("Error fetching MCP servers:",e),p([])}})()},[r,t]);let _=async e=>{v(t=>({...t,[e]:!0})),y(t=>({...t,[e]:""}));try{let r=await (0,n.listMCPTools)(t,e);r.error?(y(t=>({...t,[e]:r.message||"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))):h(t=>({...t,[e]:r.tools||[]}))}catch(t){console.error("Error fetching tools for server ".concat(e,":"),t),y(t=>({...t,[e]:"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))}finally{v(t=>({...t,[e]:!1}))}};(0,s.useEffect)(()=>{g.forEach(e=>{x[e.server_id]||f[e.server_id]||_(e.server_id)})},[g]);let j=(e,t)=>{let r=d[e]||[],a=r.includes(t)?r.filter(e=>e!==t):[...r,t];u({...d,[e]:a})},N=e=>{let t=x[e]||[];u({...d,[e]:t.map(e=>e.name)})},w=e=>{u({...d,[e]:[]})};return 0===r.length?null:(0,a.jsx)("div",{className:"space-y-4",children:g.map(e=>{let t=e.server_name||e.alias||e.server_id,r=x[e.server_id]||[],s=d[e.server_id]||[],n=f[e.server_id],u=b[e.server_id];return(0,a.jsxs)("div",{className:"border rounded-lg bg-gray-50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 border-b bg-white rounded-t-lg",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:t}),e.description&&(0,a.jsx)(l.x,{className:"text-sm text-gray-500",children:e.description})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>N(e.server_id),disabled:m||n,children:"Select All"}),(0,a.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>w(e.server_id),disabled:m||n,children:"Deselect All"}),(0,a.jsx)("button",{className:"text-gray-400 hover:text-gray-600",onClick:()=>{},children:(0,a.jsx)(c.Z,{className:"w-4 h-4"})})]})]}),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(l.x,{className:"text-sm font-medium text-gray-700 mb-3",children:"Available Tools"}),n&&(0,a.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,a.jsx)(i.Z,{size:"large"}),(0,a.jsx)(l.x,{className:"ml-3 text-gray-500",children:"Loading tools..."})]}),u&&!n&&(0,a.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-center",children:[(0,a.jsx)(l.x,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,a.jsx)(l.x,{className:"text-sm text-red-500 mt-1",children:u})]}),!n&&!u&&r.length>0&&(0,a.jsx)("div",{className:"space-y-2",children:r.map(t=>{let r=s.includes(t.name);return(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(o.Z,{checked:r,onChange:()=>j(e.server_id,t.name),disabled:m}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.x,{className:"font-medium text-gray-900",children:t.name}),(0,a.jsxs)(l.x,{className:"text-sm text-gray-500",children:["- ",t.description||"No description"]})]})})]},t.name)})}),!n&&!u&&0===r.length&&(0,a.jsx)("div",{className:"text-center py-6",children:(0,a.jsx)(l.x,{className:"text-gray-500",children:"No tools available"})})]})]},e.server_id)})})}},24199:function(e,t,r){r.d(t,{Z:function(){return n}});var a=r(57437);r(2265);var s=r(30150),n=e=>{let{step:t=.01,style:r={width:"100%"},placeholder:n="Enter a numerical value",min:l,max:i,onChange:o,...c}=e;return(0,a.jsx)(s.Z,{onWheel:e=>e.currentTarget.blur(),step:t,style:r,placeholder:n,min:l,max:i,onChange:o,...c})}},54507:function(e,t,r){r.d(t,{Z:function(){return v}});var a=r(57437);r(2265);var s=r(52787),n=r(89970),l=r(23496),i=r(15424),o=r(20831),c=r(12514),d=r(49566),u=r(91777),m=r(82182),g=r(22452),p=r(74998),x=r(97434),h=r(24199);let{Option:f}=s.default;var v=e=>{let{value:t=[],onChange:r,disabledCallbacks:v=[],onDisabledCallbacksChange:b}=e,y=Object.entries(x.Dg).filter(e=>{let[t,r]=e;return r.supports_key_team_logging}).map(e=>{let[t,r]=e;return t}),_=Object.keys(x.Dg),j=e=>{null==r||r(e)},N=e=>{j(t.filter((t,r)=>r!==e))},w=(e,r,a)=>{let s=[...t];if("callback_name"===r){let t=x.Lo[a]||a;s[e]={...s[e],[r]:t,callback_vars:{}}}else s[e]={...s[e],[r]:a};j(s)},k=(e,r,a)=>{let s=[...t];s[e]={...s[e],callback_vars:{...s[e].callback_vars,[r]:a}},j(s)},C=(e,t)=>{var r,s;if(!e.callback_name)return null;let l=null===(r=Object.entries(x.Lo).find(t=>{let[r,a]=t;return a===e.callback_name}))||void 0===r?void 0:r[0];if(!l)return null;let o=(null===(s=x.Dg[l])||void 0===s?void 0:s.dynamic_params)||{};return 0===Object.keys(o).length?null:(0,a.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,a.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(o).map(r=>{let[s,l]=r;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,a.jsx)("span",{children:s.replace(/_/g," ")}),(0,a.jsx)(n.Z,{title:"Environment variable reference recommended: os.environ/".concat(s.toUpperCase()),children:(0,a.jsx)(i.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===l&&(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"}),"number"===l&&(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Number"})]}),"number"===l&&(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"Value must be between 0 and 1"}),"number"===l?(0,a.jsx)(h.Z,{step:.01,width:400,placeholder:"os.environ/".concat(s.toUpperCase()),value:e.callback_vars[s]||"",onChange:e=>k(t,s,e.target.value)}):(0,a.jsx)(d.Z,{type:"password"===l?"password":"text",placeholder:"os.environ/".concat(s.toUpperCase()),value:e.callback_vars[s]||"",onChange:e=>k(t,s,e.target.value)})]},s)})})]})};return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"w-5 h-5 text-red-500"}),(0,a.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,a.jsx)(n.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,a.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,a.jsx)(s.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:v,onChange:e=>{let t=(0,x.Z3)(e);null==b||b(t)},style:{width:"100%"},optionLabelProp:"label",children:_.map(e=>{var t,r;let s=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,l=null===(r=x.Dg[e])||void 0===r?void 0:r.description;return(0,a.jsx)(f,{value:e,label:e,children:(0,a.jsx)(n.Z,{title:l,placement:"right",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,a.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let r=t.target,a=r.parentElement;if(a){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),a.replaceChild(t,r)}}}),(0,a.jsx)("span",{children:e})]})})},e)})}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,a.jsx)(l.Z,{}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(m.Z,{className:"w-5 h-5 text-blue-500"}),(0,a.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,a.jsx)(n.Z,{title:"Configure callback logging integrations for this team.",children:(0,a.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,a.jsx)(o.Z,{variant:"secondary",onClick:()=>{j([...t,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:g.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,a.jsx)("div",{className:"space-y-4",children:t.map((e,t)=>{var r,l;let i=e.callback_name?null===(r=Object.entries(x.Lo).find(t=>{let[r,a]=t;return a===e.callback_name}))||void 0===r?void 0:r[0]:void 0,d=i?null===(l=x.Dg[i])||void 0===l?void 0:l.logo:null;return(0,a.jsxs)(c.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[d&&(0,a.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}),(0,a.jsxs)("span",{className:"text-sm font-medium",children:[i||"New Integration"," Configuration"]})]}),(0,a.jsx)(o.Z,{variant:"light",onClick:()=>N(t),icon:p.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,a.jsx)(s.default,{value:i,placeholder:"Select integration",onChange:e=>w(t,"callback_name",e),className:"w-full",optionLabelProp:"label",children:y.map(e=>{var t,r;let s=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,l=null===(r=x.Dg[e])||void 0===r?void 0:r.description;return(0,a.jsx)(f,{value:e,label:e,children:(0,a.jsx)(n.Z,{title:l,placement:"right",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,a.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let r=t.target,a=r.parentElement;if(a){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),a.replaceChild(t,r)}}}),(0,a.jsx)("span",{children:e})]})})},e)})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,a.jsxs)(s.default,{value:e.callback_type,onChange:e=>w(t,"callback_type",e),className:"w-full",children:[(0,a.jsx)(f,{value:"success",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,a.jsx)("span",{children:"Success Only"})]})}),(0,a.jsx)(f,{value:"failure",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,a.jsx)("span",{children:"Failure Only"})]})}),(0,a.jsx)(f,{value:"success_and_failure",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,a.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),C(e,t)]})]},t)})}),0===t.length&&(0,a.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,a.jsx)(m.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,a.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,a.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})}},97415:function(e,t,r){var a=r(57437),s=r(2265),n=r(52787),l=r(19250);t.Z=e=>{let{onChange:t,value:r,className:i,accessToken:o,placeholder:c="Select vector stores",disabled:d=!1}=e,[u,m]=(0,s.useState)([]),[g,p]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(o){p(!0);try{let e=await (0,l.vectorStoreListCall)(o);e.data&&m(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{p(!1)}}})()},[o]),(0,a.jsx)("div",{children:(0,a.jsx)(n.default,{mode:"multiple",placeholder:c,onChange:t,value:r,loading:g,className:i,options:u.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})})}},59872:function(e,t,r){r.d(t,{nl:function(){return s},pw:function(){return n},vQ:function(){return l}});var a=r(9114);function s(e,t){let r=structuredClone(e);for(let[e,a]of Object.entries(t))e in r&&(r[e]=a);return r}let n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let a={minimumFractionDigits:t,maximumFractionDigits:t};if(!r)return e.toLocaleString("en-US",a);let s=Math.abs(e),n=s,l="";return s>=1e6?(n=s/1e6,l="M"):s>=1e3&&(n=s/1e3,l="K"),"".concat(e<0?"-":"").concat(n.toLocaleString("en-US",a)).concat(l)},l=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return i(e,t);try{return await navigator.clipboard.writeText(e),a.Z.success(t),!0}catch(r){return console.error("Clipboard API failed: ",r),i(e,t)}},i=(e,t)=>{try{let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.left="-999999px",r.style.top="-999999px",r.setAttribute("readonly",""),document.body.appendChild(r),r.focus(),r.select();let s=document.execCommand("copy");if(document.body.removeChild(r),s)return a.Z.success(t),!0;throw Error("execCommand failed")}catch(e){return a.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,t,r){r.d(t,{LQ:function(){return n},ZL:function(){return a},lo:function(){return s},tY:function(){return l}});let a=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],s=["Internal User","Internal Viewer"],n=["Internal User","Admin","proxy_admin"],l=e=>a.includes(e)}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/131-8304bcbbae03bc10.js b/litellm/proxy/_experimental/out/_next/static/chunks/131-8304bcbbae03bc10.js new file mode 100644 index 0000000000..7abd49e0cc --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/131-8304bcbbae03bc10.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[131],{95704:function(e,t,a){a.d(t,{Dx:function(){return u.Z},RM:function(){return l.Z},SC:function(){return c.Z},Zb:function(){return s.Z},iA:function(){return r.Z},pj:function(){return n.Z},ss:function(){return i.Z},xs:function(){return o.Z},xv:function(){return d.Z}});var s=a(12514),r=a(21626),l=a(97214),n=a(28241),i=a(58834),o=a(69552),c=a(71876),d=a(84264),u=a(96761)},92280:function(e,t,a){a.d(t,{x:function(){return s.Z}});var s=a(84264)},56522:function(e,t,a){a.d(t,{o:function(){return r.Z},x:function(){return s.Z}});var s=a(84264),r=a(49566)},80443:function(e,t,a){var s=a(2265),r=a(99376),l=a(14474),n=a(3914);t.Z=()=>{var e,t,a,i,o,c,d;let u=(0,r.useRouter)(),m="undefined"!=typeof document?(0,n.e)("token"):null;(0,s.useEffect)(()=>{m||u.replace("/sso/key/generate")},[m,u]);let g=(0,s.useMemo)(()=>{if(!m)return null;try{return(0,l.o)(m)}catch(e){return(0,n.b)(),u.replace("/sso/key/generate"),null}},[m,u]);return{token:m,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(t=null==g?void 0:g.user_id)&&void 0!==t?t:null,userEmail:null!==(a=null==g?void 0:g.user_email)&&void 0!==a?a:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(i=null==g?void 0:g.user_role)&&void 0!==i?i:null),premiumUser:null!==(o=null==g?void 0:g.premium_user)&&void 0!==o?o:null,disabledPersonalKeyCreation:null!==(c=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},97434:function(e,t,a){a.d(t,{Dg:function(){return l},Lo:function(){return n},O0:function(){return r},PA:function(){return c},RD:function(){return i},Z3:function(){return o},_3:function(){return d}});let s="/ui/assets/logos/",r=[{id:"arize",displayName:"Arize",logo:"".concat(s,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_key:"password"},description:"Arize Logging Integration"},{id:"braintrust",displayName:"Braintrust",logo:"".concat(s,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{braintrust_api_key:"password",braintrust_project_name:"text"},description:"Braintrust Logging Integration"},{id:"custom_callback_api",displayName:"Custom Callback API",logo:"".concat(s,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{custom_callback_api_url:"text",custom_callback_api_headers:"text"},description:"Custom Callback API Logging Integration"},{id:"datadog",displayName:"Datadog",logo:"".concat(s,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{dd_api_key:"password",dd_site:"text"},description:"Datadog Logging Integration"},{id:"lago",displayName:"Lago",logo:"".concat(s,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{lago_api_url:"text",lago_api_key:"password"},description:"Lago Billing Logging Integration"},{id:"langfuse",displayName:"Langfuse",logo:"".concat(s,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v2 Logging Integration"},{id:"langfuse_otel",displayName:"Langfuse OTEL",logo:"".concat(s,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v3 OTEL Logging Integration"},{id:"langsmith",displayName:"LangSmith",logo:"".concat(s,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text",langsmith_sampling_rate:"number"},description:"Langsmith Logging Integration"},{id:"openmeter",displayName:"OpenMeter",logo:"".concat(s,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{openmeter_api_key:"password",openmeter_base_url:"text"},description:"OpenMeter Logging Integration"},{id:"otel",displayName:"Open Telemetry",logo:"".concat(s,"otel.png"),supports_key_team_logging:!1,dynamic_params:{otel_endpoint:"text",otel_headers:"text"},description:"OpenTelemetry Logging Integration"},{id:"s3",displayName:"S3",logo:"".concat(s,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{s3_bucket_name:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"S3 Bucket (AWS) Logging Integration"}],l=r.reduce((e,t)=>(e[t.displayName]=t,e),{}),n=r.reduce((e,t)=>(e[t.displayName]=t.id,e),{}),i=r.reduce((e,t)=>(e[t.id]=t.displayName,e),{}),o=e=>e.map(e=>n[e]||e),c=e=>e.map(e=>i[e]||e),d=e=>r.find(t=>t.id===e)},51601:function(e,t,a){a.d(t,{p:function(){return r}});var s=a(19250);let r=async e=>{try{let t=await (0,s.modelHubCall)(e);if(console.log("model_info:",t),(null==t?void 0:t.data.length)>0){let e=t.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}}},95096:function(e,t,a){var s=a(57437),r=a(2265),l=a(52787),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select pass through routes",disabled:d=!1,teamId:u}=e,[m,g]=(0,r.useState)([]),[p,x]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(o){x(!0);try{let e=await (0,n.getPassThroughEndpointsCall)(o,u);if(e.endpoints){let t=e.endpoints.map(e=>e.path);g(t)}}catch(e){console.error("Error fetching pass through routes:",e)}finally{x(!1)}}})()},[o,u]),(0,s.jsx)(l.default,{mode:"tags",placeholder:c,onChange:t,value:a,loading:p,className:i,options:m.map(e=>({label:e,value:e})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})}},46468:function(e,t,a){a.d(t,{K2:function(){return r},Ob:function(){return n},W0:function(){return l}});var s=a(19250);let r=async(e,t,a)=>{try{if(null===e||null===t)return;if(null!==a){let r=(await (0,s.modelAvailableCall)(a,e,t,!0,null,!0)).data.map(e=>e.id),l=[],n=[];return r.forEach(e=>{e.endsWith("/*")?l.push(e):n.push(e)}),[...l,...n]}}catch(e){console.error("Error fetching user models:",e)}},l=e=>{if(e.endsWith("/*")){let t=e.replace("/*","");return"All ".concat(t," models")}return e},n=(e,t)=>{let a=[],s=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let r=e.replace("/*",""),l=t.filter(e=>e.startsWith(r+"/"));s.push(...l),a.push(e)}else s.push(e)}),[...a,...s].filter((e,t,a)=>a.indexOf(e)===t)}},95920:function(e,t,a){var s=a(57437),r=a(2265),l=a(52787),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select MCP servers",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[g,p]=(0,r.useState)([]),[x,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{if(o){h(!0);try{let[e,t]=await Promise.all([(0,n.fetchMCPServers)(o),(0,n.fetchMCPAccessGroups)(o)]),a=Array.isArray(e)?e:e.data||[],s=Array.isArray(t)?t:t.data||[];m(a),p(s)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[o]);let f=[...g.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...u.map(e=>({label:"".concat(e.server_name||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.server_name||e.server_id," ").concat(e.server_id," MCP Server")}))],v=[...(null==a?void 0:a.servers)||[],...(null==a?void 0:a.accessGroups)||[]];return(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:c,onChange:e=>{t({servers:e.filter(e=>!g.includes(e)),accessGroups:e.filter(e=>g.includes(e))})},value:v,loading:x,className:i,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>{var a;return((null===(a=f.find(e=>e.value===(null==t?void 0:t.value)))||void 0===a?void 0:a.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:f.map(e=>(0,s.jsx)(l.default.Option,{value:e.value,label:e.label,children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,s.jsx)("span",{style:{flex:1},children:e.label}),(0,s.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})}},68473:function(e,t,a){var s=a(57437),r=a(2265),l=a(19250),n=a(92280),i=a(87908),o=a(4156),c=a(32489);t.Z=e=>{let{accessToken:t,selectedServers:a,toolPermissions:d,onChange:u,disabled:m=!1}=e,[g,p]=(0,r.useState)([]),[x,h]=(0,r.useState)({}),[f,v]=(0,r.useState)({}),[_,y]=(0,r.useState)({});(0,r.useEffect)(()=>{(async()=>{if(0===a.length){p([]);return}try{let e=await (0,l.fetchMCPServers)(t),s=(Array.isArray(e)?e:e.data||[]).filter(e=>a.includes(e.server_id));p(s)}catch(e){console.error("Error fetching MCP servers:",e),p([])}})()},[a,t]);let b=async e=>{v(t=>({...t,[e]:!0})),y(t=>({...t,[e]:""}));try{let a=await (0,l.listMCPTools)(t,e);a.error?(y(t=>({...t,[e]:a.message||"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))):h(t=>({...t,[e]:a.tools||[]}))}catch(t){console.error("Error fetching tools for server ".concat(e,":"),t),y(t=>({...t,[e]:"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))}finally{v(t=>({...t,[e]:!1}))}};(0,r.useEffect)(()=>{g.forEach(e=>{x[e.server_id]||f[e.server_id]||b(e.server_id)})},[g]);let j=(e,t)=>{let a=d[e]||[],s=a.includes(t)?a.filter(e=>e!==t):[...a,t];u({...d,[e]:s})},N=e=>{let t=x[e]||[];u({...d,[e]:t.map(e=>e.name)})},w=e=>{u({...d,[e]:[]})};return 0===a.length?null:(0,s.jsx)("div",{className:"space-y-4",children:g.map(e=>{let t=e.server_name||e.alias||e.server_id,a=x[e.server_id]||[],r=d[e.server_id]||[],l=f[e.server_id],u=_[e.server_id];return(0,s.jsxs)("div",{className:"border rounded-lg bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 border-b bg-white rounded-t-lg",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.x,{className:"font-semibold text-gray-900",children:t}),e.description&&(0,s.jsx)(n.x,{className:"text-sm text-gray-500",children:e.description})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>N(e.server_id),disabled:m||l,children:"Select All"}),(0,s.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>w(e.server_id),disabled:m||l,children:"Deselect All"}),(0,s.jsx)("button",{className:"text-gray-400 hover:text-gray-600",onClick:()=>{},children:(0,s.jsx)(c.Z,{className:"w-4 h-4"})})]})]}),(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(n.x,{className:"text-sm font-medium text-gray-700 mb-3",children:"Available Tools"}),l&&(0,s.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,s.jsx)(i.Z,{size:"large"}),(0,s.jsx)(n.x,{className:"ml-3 text-gray-500",children:"Loading tools..."})]}),u&&!l&&(0,s.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-center",children:[(0,s.jsx)(n.x,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,s.jsx)(n.x,{className:"text-sm text-red-500 mt-1",children:u})]}),!l&&!u&&a.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:a.map(t=>{let a=r.includes(t.name);return(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(o.Z,{checked:a,onChange:()=>j(e.server_id,t.name),disabled:m}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.x,{className:"font-medium text-gray-900",children:t.name}),(0,s.jsxs)(n.x,{className:"text-sm text-gray-500",children:["- ",t.description||"No description"]})]})})]},t.name)})}),!l&&!u&&0===a.length&&(0,s.jsx)("div",{className:"text-center py-6",children:(0,s.jsx)(n.x,{className:"text-gray-500",children:"No tools available"})})]})]},e.server_id)})})}},24199:function(e,t,a){a.d(t,{Z:function(){return l}});var s=a(57437);a(2265);var r=a(30150),l=e=>{let{step:t=.01,style:a={width:"100%"},placeholder:l="Enter a numerical value",min:n,max:i,onChange:o,...c}=e;return(0,s.jsx)(r.Z,{onWheel:e=>e.currentTarget.blur(),step:t,style:a,placeholder:l,min:n,max:i,onChange:o,...c})}},54507:function(e,t,a){a.d(t,{Z:function(){return v}});var s=a(57437);a(2265);var r=a(52787),l=a(89970),n=a(23496),i=a(15424),o=a(20831),c=a(12514),d=a(49566),u=a(91777),m=a(82182),g=a(22452),p=a(74998),x=a(97434),h=a(24199);let{Option:f}=r.default;var v=e=>{let{value:t=[],onChange:a,disabledCallbacks:v=[],onDisabledCallbacksChange:_}=e,y=Object.entries(x.Dg).filter(e=>{let[t,a]=e;return a.supports_key_team_logging}).map(e=>{let[t,a]=e;return t}),b=Object.keys(x.Dg),j=e=>{null==a||a(e)},N=e=>{j(t.filter((t,a)=>a!==e))},w=(e,a,s)=>{let r=[...t];if("callback_name"===a){let t=x.Lo[s]||s;r[e]={...r[e],[a]:t,callback_vars:{}}}else r[e]={...r[e],[a]:s};j(r)},k=(e,a,s)=>{let r=[...t];r[e]={...r[e],callback_vars:{...r[e].callback_vars,[a]:s}},j(r)},C=(e,t)=>{var a,r;if(!e.callback_name)return null;let n=null===(a=Object.entries(x.Lo).find(t=>{let[a,s]=t;return s===e.callback_name}))||void 0===a?void 0:a[0];if(!n)return null;let o=(null===(r=x.Dg[n])||void 0===r?void 0:r.dynamic_params)||{};return 0===Object.keys(o).length?null:(0,s.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,s.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(o).map(a=>{let[r,n]=a;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,s.jsx)("span",{children:r.replace(/_/g," ")}),(0,s.jsx)(l.Z,{title:"Environment variable reference recommended: os.environ/".concat(r.toUpperCase()),children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===n&&(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"}),"number"===n&&(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Number"})]}),"number"===n&&(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"Value must be between 0 and 1"}),"number"===n?(0,s.jsx)(h.Z,{step:.01,width:400,placeholder:"os.environ/".concat(r.toUpperCase()),value:e.callback_vars[r]||"",onChange:e=>k(t,r,e.target.value)}):(0,s.jsx)(d.Z,{type:"password"===n?"password":"text",placeholder:"os.environ/".concat(r.toUpperCase()),value:e.callback_vars[r]||"",onChange:e=>k(t,r,e.target.value)})]},r)})})]})};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(u.Z,{className:"w-5 h-5 text-red-500"}),(0,s.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,s.jsx)(l.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,s.jsx)(r.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:v,onChange:e=>{let t=(0,x.Z3)(e);null==_||_(t)},style:{width:"100%"},optionLabelProp:"label",children:b.map(e=>{var t,a;let r=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,n=null===(a=x.Dg[e])||void 0===a?void 0:a.description;return(0,s.jsx)(f,{value:e,label:e,children:(0,s.jsx)(l.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,s.jsx)("img",{src:r,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let a=t.target,s=a.parentElement;if(s){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),s.replaceChild(t,a)}}}),(0,s.jsx)("span",{children:e})]})})},e)})}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,s.jsx)(n.Z,{}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(m.Z,{className:"w-5 h-5 text-blue-500"}),(0,s.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,s.jsx)(l.Z,{title:"Configure callback logging integrations for this team.",children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,s.jsx)(o.Z,{variant:"secondary",onClick:()=>{j([...t,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:g.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,s.jsx)("div",{className:"space-y-4",children:t.map((e,t)=>{var a,n;let i=e.callback_name?null===(a=Object.entries(x.Lo).find(t=>{let[a,s]=t;return s===e.callback_name}))||void 0===a?void 0:a[0]:void 0,d=i?null===(n=x.Dg[i])||void 0===n?void 0:n.logo:null;return(0,s.jsxs)(c.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[d&&(0,s.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}),(0,s.jsxs)("span",{className:"text-sm font-medium",children:[i||"New Integration"," Configuration"]})]}),(0,s.jsx)(o.Z,{variant:"light",onClick:()=>N(t),icon:p.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,s.jsx)(r.default,{value:i,placeholder:"Select integration",onChange:e=>w(t,"callback_name",e),className:"w-full",optionLabelProp:"label",children:y.map(e=>{var t,a;let r=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,n=null===(a=x.Dg[e])||void 0===a?void 0:a.description;return(0,s.jsx)(f,{value:e,label:e,children:(0,s.jsx)(l.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,s.jsx)("img",{src:r,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let a=t.target,s=a.parentElement;if(s){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),s.replaceChild(t,a)}}}),(0,s.jsx)("span",{children:e})]})})},e)})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,s.jsxs)(r.default,{value:e.callback_type,onChange:e=>w(t,"callback_type",e),className:"w-full",children:[(0,s.jsx)(f,{value:"success",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,s.jsx)("span",{children:"Success Only"})]})}),(0,s.jsx)(f,{value:"failure",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,s.jsx)("span",{children:"Failure Only"})]})}),(0,s.jsx)(f,{value:"success_and_failure",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),C(e,t)]})]},t)})}),0===t.length&&(0,s.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,s.jsx)(m.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,s.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,s.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})}},97415:function(e,t,a){var s=a(57437),r=a(2265),l=a(52787),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select vector stores",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[g,p]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(o){p(!0);try{let e=await (0,n.vectorStoreListCall)(o);e.data&&m(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{p(!1)}}})()},[o]),(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:c,onChange:t,value:a,loading:g,className:i,options:u.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})})}},59872:function(e,t,a){a.d(t,{nl:function(){return r},pw:function(){return l},vQ:function(){return n}});var s=a(9114);function r(e,t){let a=structuredClone(e);for(let[e,s]of Object.entries(t))e in a&&(a[e]=s);return a}let l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let s={minimumFractionDigits:t,maximumFractionDigits:t};if(!a)return e.toLocaleString("en-US",s);let r=Math.abs(e),l=r,n="";return r>=1e6?(l=r/1e6,n="M"):r>=1e3&&(l=r/1e3,n="K"),"".concat(e<0?"-":"").concat(l.toLocaleString("en-US",s)).concat(n)},n=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return i(e,t);try{return await navigator.clipboard.writeText(e),s.Z.success(t),!0}catch(a){return console.error("Clipboard API failed: ",a),i(e,t)}},i=(e,t)=>{try{let a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.left="-999999px",a.style.top="-999999px",a.setAttribute("readonly",""),document.body.appendChild(a),a.focus(),a.select();let r=document.execCommand("copy");if(document.body.removeChild(a),r)return s.Z.success(t),!0;throw Error("execCommand failed")}catch(e){return s.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,t,a){a.d(t,{LQ:function(){return l},ZL:function(){return s},lo:function(){return r},tY:function(){return n}});let s=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],r=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],n=e=>s.includes(e)}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/1529-e0933e3af843b646.js b/litellm/proxy/_experimental/out/_next/static/chunks/1529-130888c02463f3dd.js similarity index 99% rename from ui/litellm-dashboard/out/_next/static/chunks/1529-e0933e3af843b646.js rename to litellm/proxy/_experimental/out/_next/static/chunks/1529-130888c02463f3dd.js index 37fef532b2..5437eb2582 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/1529-e0933e3af843b646.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1529-130888c02463f3dd.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1529],{60440:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},l=t(55015),u=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},77565:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},l=t(55015),u=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},71030:function(e,n,t){t.d(n,{Z:function(){return C}});var r=t(1119),o=t(11993),i=t(26365),l=t(6989),u=t(97821),a=t(36760),c=t.n(a),s=t(28791),f=t(2265),d=t(95814),v=t(53346),p=d.Z.ESC,m=d.Z.TAB,b=(0,f.forwardRef)(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,i=(0,f.useMemo)(function(){return"function"==typeof t?t():t},[t]),l=(0,s.sQ)(n,null==i?void 0:i.ref);return f.createElement(f.Fragment,null,r&&f.createElement("div",{className:"".concat(o,"-arrow")}),f.cloneElement(i,{ref:(0,s.Yr)(i)?l:void 0}))}),h={adjustX:1,adjustY:1},y=[0,0],g={topLeft:{points:["bl","tl"],overflow:h,offset:[0,-4],targetOffset:y},top:{points:["bc","tc"],overflow:h,offset:[0,-4],targetOffset:y},topRight:{points:["br","tr"],overflow:h,offset:[0,-4],targetOffset:y},bottomLeft:{points:["tl","bl"],overflow:h,offset:[0,4],targetOffset:y},bottom:{points:["tc","bc"],overflow:h,offset:[0,4],targetOffset:y},bottomRight:{points:["tr","br"],overflow:h,offset:[0,4],targetOffset:y}},Z=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"],C=f.forwardRef(function(e,n){var t,a,d,h,y,C,E,w,k,M,R,N,x,P,S=e.arrow,I=void 0!==S&&S,K=e.prefixCls,A=void 0===K?"rc-dropdown":K,O=e.transitionName,T=e.animation,L=e.align,D=e.placement,_=e.placements,V=e.getPopupContainer,z=e.showAction,F=e.hideAction,j=e.overlayClassName,B=e.overlayStyle,W=e.visible,H=e.trigger,Y=void 0===H?["hover"]:H,q=e.autoFocus,X=e.overlay,G=e.children,Q=e.onVisibleChange,U=(0,l.Z)(e,Z),J=f.useState(),$=(0,i.Z)(J,2),ee=$[0],en=$[1],et="visible"in e?W:ee,er=f.useRef(null),eo=f.useRef(null),ei=f.useRef(null);f.useImperativeHandle(n,function(){return er.current});var el=function(e){en(e),null==Q||Q(e)};a=(t={visible:et,triggerRef:ei,onVisibleChange:el,autoFocus:q,overlayRef:eo}).visible,d=t.triggerRef,h=t.onVisibleChange,y=t.autoFocus,C=t.overlayRef,E=f.useRef(!1),w=function(){if(a){var e,n;null===(e=d.current)||void 0===e||null===(n=e.focus)||void 0===n||n.call(e),null==h||h(!1)}},k=function(){var e;return null!==(e=C.current)&&void 0!==e&&!!e.focus&&(C.current.focus(),E.current=!0,!0)},M=function(e){switch(e.keyCode){case p:w();break;case m:var n=!1;E.current||(n=k()),n?e.preventDefault():w()}},f.useEffect(function(){return a?(window.addEventListener("keydown",M),y&&(0,v.Z)(k,3),function(){window.removeEventListener("keydown",M),E.current=!1}):function(){E.current=!1}},[a]);var eu=function(){return f.createElement(b,{ref:eo,overlay:X,prefixCls:A,arrow:I})},ea=f.cloneElement(G,{className:c()(null===(P=G.props)||void 0===P?void 0:P.className,et&&(void 0!==(R=e.openClassName)?R:"".concat(A,"-open"))),ref:(0,s.Yr)(G)?(0,s.sQ)(ei,G.ref):void 0}),ec=F;return ec||-1===Y.indexOf("contextMenu")||(ec=["click"]),f.createElement(u.Z,(0,r.Z)({builtinPlacements:void 0===_?g:_},U,{prefixCls:A,ref:er,popupClassName:c()(j,(0,o.Z)({},"".concat(A,"-show-arrow"),I)),popupStyle:B,action:Y,showAction:z,hideAction:ec,popupPlacement:void 0===D?"bottomLeft":D,popupAlign:L,popupTransitionName:O,popupAnimation:T,popupVisible:et,stretch:(N=e.minOverlayWidthMatchTrigger,x=e.alignPoint,"minOverlayWidthMatchTrigger"in e?N:!x)?"minWidth":"",popup:"function"==typeof X?eu:eu(),onPopupVisibleChange:el,onPopupClick:function(n){var t=e.onOverlayClick;en(!1),t&&t(n)},getPopupContainer:V}),ea)})},33082:function(e,n,t){t.d(n,{iz:function(){return eD},ck:function(){return ep},BW:function(){return eL},sN:function(){return ep},Wd:function(){return eI},ZP:function(){return ej},Xl:function(){return N}});var r=t(1119),o=t(11993),i=t(31686),l=t(83145),u=t(26365),a=t(6989),c=t(36760),s=t.n(c),f=t(1699),d=t(50506),v=t(16671),p=t(32559),m=t(2265),b=t(54887),h=m.createContext(null);function y(e,n){return void 0===e?null:"".concat(e,"-").concat(n)}function g(e){return y(m.useContext(h),e)}var Z=t(6397),C=["children","locked"],E=m.createContext(null);function w(e){var n=e.children,t=e.locked,r=(0,a.Z)(e,C),o=m.useContext(E),l=(0,Z.Z)(function(){var e;return e=(0,i.Z)({},o),Object.keys(r).forEach(function(n){var t=r[n];void 0!==t&&(e[n]=t)}),e},[o,r],function(e,n){return!t&&(e[0]!==n[0]||!(0,v.Z)(e[1],n[1],!0))});return m.createElement(E.Provider,{value:l},n)}var k=m.createContext(null);function M(){return m.useContext(k)}var R=m.createContext([]);function N(e){var n=m.useContext(R);return m.useMemo(function(){return void 0!==e?[].concat((0,l.Z)(n),[e]):n},[n,e])}var x=m.createContext(null),P=m.createContext({}),S=t(2857);function I(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,S.Z)(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||"a"===t&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),l=null;return o&&!Number.isNaN(i)?l=i:r&&null===l&&(l=0),r&&e.disabled&&(l=null),null!==l&&(l>=0||n&&l<0)}return!1}var K=t(95814),A=t(53346),O=K.Z.LEFT,T=K.Z.RIGHT,L=K.Z.UP,D=K.Z.DOWN,_=K.Z.ENTER,V=K.Z.ESC,z=K.Z.HOME,F=K.Z.END,j=[L,D,O,T];function B(e,n){return(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(0,l.Z)(e.querySelectorAll("*")).filter(function(e){return I(e,n)});return I(e,n)&&t.unshift(e),t})(e,!0).filter(function(e){return n.has(e)})}function W(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var o=B(e,n),i=o.length,l=o.findIndex(function(e){return t===e});return r<0?-1===l?l=i-1:l-=1:r>0&&(l+=1),o[l=(l+i)%i]}var H=function(e,n){var t=new Set,r=new Map,o=new Map;return e.forEach(function(e){var i=document.querySelector("[data-menu-id='".concat(y(n,e),"']"));i&&(t.add(i),o.set(i,e),r.set(e,i))}),{elements:t,key2element:r,element2key:o}},Y="__RC_UTIL_PATH_SPLIT__",q=function(e){return e.join(Y)},X="rc-menu-more";function G(e){var n=m.useRef(e);n.current=e;var t=m.useCallback(function(){for(var e,t=arguments.length,r=Array(t),o=0;o1&&(k.motionAppear=!1);var M=k.onVisibleChanged;return(k.onVisibleChanged=function(e){return b.current||e||Z(!0),null==M?void 0:M(e)},g)?null:m.createElement(w,{mode:a,locked:!b.current},m.createElement(eR.ZP,(0,r.Z)({visible:C},k,{forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(e){var t=e.className,r=e.style;return m.createElement(eb,{id:n,className:t,style:r},l)}))}var ex=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],eP=["active"],eS=function(e){var n,t=e.style,l=e.className,c=e.title,d=e.eventKey,v=(e.warnKey,e.disabled),p=e.internalPopupClose,b=e.children,h=e.itemIcon,y=e.expandIcon,Z=e.popupClassName,C=e.popupOffset,k=e.popupStyle,M=e.onClick,R=e.onMouseEnter,S=e.onMouseLeave,I=e.onTitleClick,K=e.onTitleMouseEnter,A=e.onTitleMouseLeave,O=(0,a.Z)(e,ex),T=g(d),L=m.useContext(E),D=L.prefixCls,_=L.mode,V=L.openKeys,z=L.disabled,F=L.overflowDisabled,j=L.activeKey,B=L.selectedKeys,W=L.itemIcon,H=L.expandIcon,Y=L.onItemClick,q=L.onOpenChange,X=L.onActive,Q=m.useContext(P)._internalRenderSubMenuItem,U=m.useContext(x).isSubPathKey,J=N(),$="".concat(D,"-submenu"),ee=z||v,en=m.useRef(),et=m.useRef(),er=null!=y?y:H,eu=V.includes(d),ec=!F&&eu,es=U(B,d),ef=eo(d,ee,K,A),ed=ef.active,ev=(0,a.Z)(ef,eP),ep=m.useState(!1),em=(0,u.Z)(ep,2),eh=em[0],ey=em[1],eg=function(e){ee||ey(e)},eZ=m.useMemo(function(){return ed||"inline"!==_&&(eh||U([j],d))},[_,ed,j,eh,d,U]),eC=ei(J.length),eE=G(function(e){null==M||M(ea(e)),Y(e)}),ew=T&&"".concat(T,"-popup"),ek=m.createElement("div",(0,r.Z)({role:"menuitem",style:eC,className:"".concat($,"-title"),tabIndex:ee?null:-1,ref:en,title:"string"==typeof c?c:null,"data-menu-id":F&&T?null:T,"aria-expanded":ec,"aria-haspopup":!0,"aria-controls":ew,"aria-disabled":ee,onClick:function(e){ee||(null==I||I({key:d,domEvent:e}),"inline"===_&&q(d,!eu))},onFocus:function(){X(d)}},ev),c,m.createElement(el,{icon:"horizontal"!==_?er:void 0,props:(0,i.Z)((0,i.Z)({},e),{},{isOpen:ec,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))),eR=m.useRef(_);if("inline"!==_&&J.length>1?eR.current="vertical":eR.current=_,!F){var eS=eR.current;ek=m.createElement(eM,{mode:eS,prefixCls:$,visible:!p&&ec&&"inline"!==_,popupClassName:Z,popupOffset:C,popupStyle:k,popup:m.createElement(w,{mode:"horizontal"===eS?"vertical":eS},m.createElement(eb,{id:ew,ref:et},b)),disabled:ee,onVisibleChange:function(e){"inline"!==_&&q(d,e)}},ek)}var eI=m.createElement(f.Z.Item,(0,r.Z)({role:"none"},O,{component:"li",style:t,className:s()($,"".concat($,"-").concat(_),l,(n={},(0,o.Z)(n,"".concat($,"-open"),ec),(0,o.Z)(n,"".concat($,"-active"),eZ),(0,o.Z)(n,"".concat($,"-selected"),es),(0,o.Z)(n,"".concat($,"-disabled"),ee),n)),onMouseEnter:function(e){eg(!0),null==R||R({key:d,domEvent:e})},onMouseLeave:function(e){eg(!1),null==S||S({key:d,domEvent:e})}}),ek,!F&&m.createElement(eN,{id:ew,open:ec,keyPath:J},b));return Q&&(eI=Q(eI,e,{selected:es,active:eZ,open:ec,disabled:ee})),m.createElement(w,{onItemClick:eE,mode:"horizontal"===_?"vertical":_,itemIcon:null!=h?h:W,expandIcon:er},eI)};function eI(e){var n,t=e.eventKey,r=e.children,o=N(t),i=ey(r,o),l=M();return m.useEffect(function(){if(l)return l.registerPath(t,o),function(){l.unregisterPath(t,o)}},[o]),n=l?i:m.createElement(eS,e,i),m.createElement(R.Provider,{value:o},n)}var eK=t(41154),eA=["className","title","eventKey","children"],eO=["children"],eT=function(e){var n=e.className,t=e.title,o=(e.eventKey,e.children),i=(0,a.Z)(e,eA),l=m.useContext(E).prefixCls,u="".concat(l,"-item-group");return m.createElement("li",(0,r.Z)({role:"presentation"},i,{onClick:function(e){return e.stopPropagation()},className:s()(u,n)}),m.createElement("div",{role:"presentation",className:"".concat(u,"-title"),title:"string"==typeof t?t:void 0},t),m.createElement("ul",{role:"group",className:"".concat(u,"-list")},o))};function eL(e){var n=e.children,t=(0,a.Z)(e,eO),r=ey(n,N(t.eventKey));return M()?r:m.createElement(eT,(0,et.Z)(t,["warnKey"]),r)}function eD(e){var n=e.className,t=e.style,r=m.useContext(E).prefixCls;return M()?null:m.createElement("li",{role:"separator",className:s()("".concat(r,"-item-divider"),n),style:t})}var e_=["label","children","key","type"],eV=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],ez=[],eF=m.forwardRef(function(e,n){var t,c,p,y,g,Z,C,E,M,R,N,S,I,K,J,$,ee,en,et,er,eo,ei,el,eu,ec,es,ef,ed=e.prefixCls,ev=void 0===ed?"rc-menu":ed,em=e.rootClassName,eb=e.style,eh=e.className,eg=e.tabIndex,eZ=e.items,eC=e.children,eE=e.direction,ew=e.id,ek=e.mode,eM=void 0===ek?"vertical":ek,eR=e.inlineCollapsed,eN=e.disabled,ex=e.disabledOverflow,eP=e.subMenuOpenDelay,eS=e.subMenuCloseDelay,eA=e.forceSubMenuRender,eO=e.defaultOpenKeys,eT=e.openKeys,eF=e.activeKey,ej=e.defaultActiveFirst,eB=e.selectable,eW=void 0===eB||eB,eH=e.multiple,eY=void 0!==eH&&eH,eq=e.defaultSelectedKeys,eX=e.selectedKeys,eG=e.onSelect,eQ=e.onDeselect,eU=e.inlineIndent,eJ=e.motion,e$=e.defaultMotions,e0=e.triggerSubMenuAction,e1=e.builtinPlacements,e6=e.itemIcon,e2=e.expandIcon,e5=e.overflowedIndicator,e9=void 0===e5?"...":e5,e3=e.overflowedIndicatorPopupClassName,e4=e.getPopupContainer,e7=e.onClick,e8=e.onOpenChange,ne=e.onKeyDown,nn=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),nt=e._internalRenderSubMenuItem,nr=(0,a.Z)(e,eV),no=m.useMemo(function(){var e;return e=eC,eZ&&(e=function e(n){return(n||[]).map(function(n,t){if(n&&"object"===(0,eK.Z)(n)){var o=n.label,i=n.children,l=n.key,u=n.type,c=(0,a.Z)(n,e_),s=null!=l?l:"tmp-".concat(t);return i||"group"===u?"group"===u?m.createElement(eL,(0,r.Z)({key:s},c,{title:o}),e(i)):m.createElement(eI,(0,r.Z)({key:s},c,{title:o}),e(i)):"divider"===u?m.createElement(eD,(0,r.Z)({key:s},c)):m.createElement(ep,(0,r.Z)({key:s},c),o)}return null}).filter(function(e){return e})}(eZ)),ey(e,ez)},[eC,eZ]),ni=m.useState(!1),nl=(0,u.Z)(ni,2),nu=nl[0],na=nl[1],nc=m.useRef(),ns=(t=(0,d.Z)(ew,{value:ew}),p=(c=(0,u.Z)(t,2))[0],y=c[1],m.useEffect(function(){U+=1;var e="".concat(Q,"-").concat(U);y("rc-menu-uuid-".concat(e))},[]),p),nf="rtl"===eE,nd=(0,d.Z)(eO,{value:eT,postState:function(e){return e||ez}}),nv=(0,u.Z)(nd,2),np=nv[0],nm=nv[1],nb=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function t(){nm(e),null==e8||e8(e)}n?(0,b.flushSync)(t):t()},nh=m.useState(np),ny=(0,u.Z)(nh,2),ng=ny[0],nZ=ny[1],nC=m.useRef(!1),nE=m.useMemo(function(){return("inline"===eM||"vertical"===eM)&&eR?["vertical",eR]:[eM,!1]},[eM,eR]),nw=(0,u.Z)(nE,2),nk=nw[0],nM=nw[1],nR="inline"===nk,nN=m.useState(nk),nx=(0,u.Z)(nN,2),nP=nx[0],nS=nx[1],nI=m.useState(nM),nK=(0,u.Z)(nI,2),nA=nK[0],nO=nK[1];m.useEffect(function(){nS(nk),nO(nM),nC.current&&(nR?nm(ng):nb(ez))},[nk,nM]);var nT=m.useState(0),nL=(0,u.Z)(nT,2),nD=nL[0],n_=nL[1],nV=nD>=no.length-1||"horizontal"!==nP||ex;m.useEffect(function(){nR&&nZ(np)},[np]),m.useEffect(function(){return nC.current=!0,function(){nC.current=!1}},[]);var nz=(g=m.useState({}),Z=(0,u.Z)(g,2)[1],C=(0,m.useRef)(new Map),E=(0,m.useRef)(new Map),M=m.useState([]),N=(R=(0,u.Z)(M,2))[0],S=R[1],I=(0,m.useRef)(0),K=(0,m.useRef)(!1),J=function(){K.current||Z({})},$=(0,m.useCallback)(function(e,n){var t,r=q(n);E.current.set(r,e),C.current.set(e,r),I.current+=1;var o=I.current;t=function(){o===I.current&&J()},Promise.resolve().then(t)},[]),ee=(0,m.useCallback)(function(e,n){var t=q(n);E.current.delete(t),C.current.delete(e)},[]),en=(0,m.useCallback)(function(e){S(e)},[]),et=(0,m.useCallback)(function(e,n){var t=(C.current.get(e)||"").split(Y);return n&&N.includes(t[0])&&t.unshift(X),t},[N]),er=(0,m.useCallback)(function(e,n){return e.some(function(e){return et(e,!0).includes(n)})},[et]),eo=(0,m.useCallback)(function(e){var n="".concat(C.current.get(e)).concat(Y),t=new Set;return(0,l.Z)(E.current.keys()).forEach(function(e){e.startsWith(n)&&t.add(E.current.get(e))}),t},[]),m.useEffect(function(){return function(){K.current=!0}},[]),{registerPath:$,unregisterPath:ee,refreshOverflowKeys:en,isSubPathKey:er,getKeyPath:et,getKeys:function(){var e=(0,l.Z)(C.current.keys());return N.length&&e.push(X),e},getSubPathKeys:eo}),nF=nz.registerPath,nj=nz.unregisterPath,nB=nz.refreshOverflowKeys,nW=nz.isSubPathKey,nH=nz.getKeyPath,nY=nz.getKeys,nq=nz.getSubPathKeys,nX=m.useMemo(function(){return{registerPath:nF,unregisterPath:nj}},[nF,nj]),nG=m.useMemo(function(){return{isSubPathKey:nW}},[nW]);m.useEffect(function(){nB(nV?ez:no.slice(nD+1).map(function(e){return e.key}))},[nD,nV]);var nQ=(0,d.Z)(eF||ej&&(null===(es=no[0])||void 0===es?void 0:es.key),{value:eF}),nU=(0,u.Z)(nQ,2),nJ=nU[0],n$=nU[1],n0=G(function(e){n$(e)}),n1=G(function(){n$(void 0)});(0,m.useImperativeHandle)(n,function(){return{list:nc.current,focus:function(e){var n,t,r=H(nY(),ns),o=r.elements,i=r.key2element,l=r.element2key,u=B(nc.current,o),a=null!=nJ?nJ:u[0]?l.get(u[0]):null===(n=no.find(function(e){return!e.props.disabled}))||void 0===n?void 0:n.key,c=i.get(a);a&&c&&(null==c||null===(t=c.focus)||void 0===t||t.call(c,e))}}});var n6=(0,d.Z)(eq||[],{value:eX,postState:function(e){return Array.isArray(e)?e:null==e?ez:[e]}}),n2=(0,u.Z)(n6,2),n5=n2[0],n9=n2[1],n3=function(e){if(eW){var n,t=e.key,r=n5.includes(t);n9(n=eY?r?n5.filter(function(e){return e!==t}):[].concat((0,l.Z)(n5),[t]):[t]);var o=(0,i.Z)((0,i.Z)({},e),{},{selectedKeys:n});r?null==eQ||eQ(o):null==eG||eG(o)}!eY&&np.length&&"inline"!==nP&&nb(ez)},n4=G(function(e){null==e7||e7(ea(e)),n3(e)}),n7=G(function(e,n){var t=np.filter(function(n){return n!==e});if(n)t.push(e);else if("inline"!==nP){var r=nq(e);t=t.filter(function(e){return!r.has(e)})}(0,v.Z)(np,t,!0)||nb(t,!0)}),n8=(ei=function(e,n){var t=null!=n?n:!np.includes(e);n7(e,t)},el=m.useRef(),(eu=m.useRef()).current=nJ,ec=function(){A.Z.cancel(el.current)},m.useEffect(function(){return function(){ec()}},[]),function(e){var n=e.which;if([].concat(j,[_,V,z,F]).includes(n)){var t=nY(),r=H(t,ns),i=r,l=i.elements,u=i.key2element,a=i.element2key,c=function(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}(u.get(nJ),l),s=a.get(c),f=function(e,n,t,r){var i,l,u,a,c="prev",s="next",f="children",d="parent";if("inline"===e&&r===_)return{inlineTrigger:!0};var v=(i={},(0,o.Z)(i,L,c),(0,o.Z)(i,D,s),i),p=(l={},(0,o.Z)(l,O,t?s:c),(0,o.Z)(l,T,t?c:s),(0,o.Z)(l,D,f),(0,o.Z)(l,_,f),l),m=(u={},(0,o.Z)(u,L,c),(0,o.Z)(u,D,s),(0,o.Z)(u,_,f),(0,o.Z)(u,V,d),(0,o.Z)(u,O,t?f:d),(0,o.Z)(u,T,t?d:f),u);switch(null===(a=({inline:v,horizontal:p,vertical:m,inlineSub:v,horizontalSub:m,verticalSub:m})["".concat(e).concat(n?"":"Sub")])||void 0===a?void 0:a[r]){case c:return{offset:-1,sibling:!0};case s:return{offset:1,sibling:!0};case d:return{offset:-1,sibling:!1};case f:return{offset:1,sibling:!1};default:return null}}(nP,1===nH(s,!0).length,nf,n);if(!f&&n!==z&&n!==F)return;(j.includes(n)||[z,F].includes(n))&&e.preventDefault();var d=function(e){if(e){var n=e,t=e.querySelector("a");null!=t&&t.getAttribute("href")&&(n=t);var r=a.get(e);n$(r),ec(),el.current=(0,A.Z)(function(){eu.current===r&&n.focus()})}};if([z,F].includes(n)||f.sibling||!c){var v,p=B(v=c&&"inline"!==nP?function(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}(c):nc.current,l);d(n===z?p[0]:n===F?p[p.length-1]:W(v,l,c,f.offset))}else if(f.inlineTrigger)ei(s);else if(f.offset>0)ei(s,!0),ec(),el.current=(0,A.Z)(function(){r=H(t,ns);var e=c.getAttribute("aria-controls");d(W(document.getElementById(e),r.elements))},5);else if(f.offset<0){var m=nH(s,!0),b=m[m.length-2],h=u.get(b);ei(b,!1),d(h)}}null==ne||ne(e)});m.useEffect(function(){na(!0)},[]);var te=m.useMemo(function(){return{_internalRenderMenuItem:nn,_internalRenderSubMenuItem:nt}},[nn,nt]),tn="horizontal"!==nP||ex?no:no.map(function(e,n){return m.createElement(w,{key:e.key,overflowDisabled:n>nD},e)}),tt=m.createElement(f.Z,(0,r.Z)({id:ew,ref:nc,prefixCls:"".concat(ev,"-overflow"),component:"ul",itemComponent:ep,className:s()(ev,"".concat(ev,"-root"),"".concat(ev,"-").concat(nP),eh,(ef={},(0,o.Z)(ef,"".concat(ev,"-inline-collapsed"),nA),(0,o.Z)(ef,"".concat(ev,"-rtl"),nf),ef),em),dir:eE,style:eb,role:"menu",tabIndex:void 0===eg?0:eg,data:tn,renderRawItem:function(e){return e},renderRawRest:function(e){var n=e.length,t=n?no.slice(-n):null;return m.createElement(eI,{eventKey:X,title:e9,disabled:nV,internalPopupClose:0===n,popupClassName:e3},t)},maxCount:"horizontal"!==nP||ex?f.Z.INVALIDATE:f.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){n_(e)},onKeyDown:n8},nr));return m.createElement(P.Provider,{value:te},m.createElement(h.Provider,{value:ns},m.createElement(w,{prefixCls:ev,rootClassName:em,mode:nP,openKeys:np,rtl:nf,disabled:eN,motion:nu?eJ:null,defaultMotions:nu?e$:null,activeKey:nJ,onActive:n0,onInactive:n1,selectedKeys:n5,inlineIndent:void 0===eU?24:eU,subMenuOpenDelay:void 0===eP?.1:eP,subMenuCloseDelay:void 0===eS?.1:eS,forceSubMenuRender:eA,builtinPlacements:e1,triggerSubMenuAction:void 0===e0?"hover":e0,getPopupContainer:e4,itemIcon:e6,expandIcon:e2,onItemClick:n4,onOpenChange:n7},m.createElement(x.Provider,{value:nG},tt),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(k.Provider,{value:nX},no)))))});eF.Item=ep,eF.SubMenu=eI,eF.ItemGroup=eL,eF.Divider=eD;var ej=eF}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1529],{39760:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},l=t(55015),u=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},77565:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},l=t(55015),u=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},71030:function(e,n,t){t.d(n,{Z:function(){return C}});var r=t(1119),o=t(11993),i=t(26365),l=t(6989),u=t(97821),a=t(36760),c=t.n(a),s=t(28791),f=t(2265),d=t(95814),v=t(53346),p=d.Z.ESC,m=d.Z.TAB,b=(0,f.forwardRef)(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,i=(0,f.useMemo)(function(){return"function"==typeof t?t():t},[t]),l=(0,s.sQ)(n,null==i?void 0:i.ref);return f.createElement(f.Fragment,null,r&&f.createElement("div",{className:"".concat(o,"-arrow")}),f.cloneElement(i,{ref:(0,s.Yr)(i)?l:void 0}))}),h={adjustX:1,adjustY:1},y=[0,0],g={topLeft:{points:["bl","tl"],overflow:h,offset:[0,-4],targetOffset:y},top:{points:["bc","tc"],overflow:h,offset:[0,-4],targetOffset:y},topRight:{points:["br","tr"],overflow:h,offset:[0,-4],targetOffset:y},bottomLeft:{points:["tl","bl"],overflow:h,offset:[0,4],targetOffset:y},bottom:{points:["tc","bc"],overflow:h,offset:[0,4],targetOffset:y},bottomRight:{points:["tr","br"],overflow:h,offset:[0,4],targetOffset:y}},Z=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"],C=f.forwardRef(function(e,n){var t,a,d,h,y,C,E,w,k,M,R,N,x,P,S=e.arrow,I=void 0!==S&&S,K=e.prefixCls,A=void 0===K?"rc-dropdown":K,O=e.transitionName,T=e.animation,L=e.align,D=e.placement,_=e.placements,V=e.getPopupContainer,z=e.showAction,F=e.hideAction,j=e.overlayClassName,B=e.overlayStyle,W=e.visible,H=e.trigger,Y=void 0===H?["hover"]:H,q=e.autoFocus,X=e.overlay,G=e.children,Q=e.onVisibleChange,U=(0,l.Z)(e,Z),J=f.useState(),$=(0,i.Z)(J,2),ee=$[0],en=$[1],et="visible"in e?W:ee,er=f.useRef(null),eo=f.useRef(null),ei=f.useRef(null);f.useImperativeHandle(n,function(){return er.current});var el=function(e){en(e),null==Q||Q(e)};a=(t={visible:et,triggerRef:ei,onVisibleChange:el,autoFocus:q,overlayRef:eo}).visible,d=t.triggerRef,h=t.onVisibleChange,y=t.autoFocus,C=t.overlayRef,E=f.useRef(!1),w=function(){if(a){var e,n;null===(e=d.current)||void 0===e||null===(n=e.focus)||void 0===n||n.call(e),null==h||h(!1)}},k=function(){var e;return null!==(e=C.current)&&void 0!==e&&!!e.focus&&(C.current.focus(),E.current=!0,!0)},M=function(e){switch(e.keyCode){case p:w();break;case m:var n=!1;E.current||(n=k()),n?e.preventDefault():w()}},f.useEffect(function(){return a?(window.addEventListener("keydown",M),y&&(0,v.Z)(k,3),function(){window.removeEventListener("keydown",M),E.current=!1}):function(){E.current=!1}},[a]);var eu=function(){return f.createElement(b,{ref:eo,overlay:X,prefixCls:A,arrow:I})},ea=f.cloneElement(G,{className:c()(null===(P=G.props)||void 0===P?void 0:P.className,et&&(void 0!==(R=e.openClassName)?R:"".concat(A,"-open"))),ref:(0,s.Yr)(G)?(0,s.sQ)(ei,G.ref):void 0}),ec=F;return ec||-1===Y.indexOf("contextMenu")||(ec=["click"]),f.createElement(u.Z,(0,r.Z)({builtinPlacements:void 0===_?g:_},U,{prefixCls:A,ref:er,popupClassName:c()(j,(0,o.Z)({},"".concat(A,"-show-arrow"),I)),popupStyle:B,action:Y,showAction:z,hideAction:ec,popupPlacement:void 0===D?"bottomLeft":D,popupAlign:L,popupTransitionName:O,popupAnimation:T,popupVisible:et,stretch:(N=e.minOverlayWidthMatchTrigger,x=e.alignPoint,"minOverlayWidthMatchTrigger"in e?N:!x)?"minWidth":"",popup:"function"==typeof X?eu:eu(),onPopupVisibleChange:el,onPopupClick:function(n){var t=e.onOverlayClick;en(!1),t&&t(n)},getPopupContainer:V}),ea)})},33082:function(e,n,t){t.d(n,{iz:function(){return eD},ck:function(){return ep},BW:function(){return eL},sN:function(){return ep},Wd:function(){return eI},ZP:function(){return ej},Xl:function(){return N}});var r=t(1119),o=t(11993),i=t(31686),l=t(83145),u=t(26365),a=t(6989),c=t(36760),s=t.n(c),f=t(1699),d=t(50506),v=t(16671),p=t(32559),m=t(2265),b=t(54887),h=m.createContext(null);function y(e,n){return void 0===e?null:"".concat(e,"-").concat(n)}function g(e){return y(m.useContext(h),e)}var Z=t(6397),C=["children","locked"],E=m.createContext(null);function w(e){var n=e.children,t=e.locked,r=(0,a.Z)(e,C),o=m.useContext(E),l=(0,Z.Z)(function(){var e;return e=(0,i.Z)({},o),Object.keys(r).forEach(function(n){var t=r[n];void 0!==t&&(e[n]=t)}),e},[o,r],function(e,n){return!t&&(e[0]!==n[0]||!(0,v.Z)(e[1],n[1],!0))});return m.createElement(E.Provider,{value:l},n)}var k=m.createContext(null);function M(){return m.useContext(k)}var R=m.createContext([]);function N(e){var n=m.useContext(R);return m.useMemo(function(){return void 0!==e?[].concat((0,l.Z)(n),[e]):n},[n,e])}var x=m.createContext(null),P=m.createContext({}),S=t(2857);function I(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,S.Z)(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||"a"===t&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),l=null;return o&&!Number.isNaN(i)?l=i:r&&null===l&&(l=0),r&&e.disabled&&(l=null),null!==l&&(l>=0||n&&l<0)}return!1}var K=t(95814),A=t(53346),O=K.Z.LEFT,T=K.Z.RIGHT,L=K.Z.UP,D=K.Z.DOWN,_=K.Z.ENTER,V=K.Z.ESC,z=K.Z.HOME,F=K.Z.END,j=[L,D,O,T];function B(e,n){return(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(0,l.Z)(e.querySelectorAll("*")).filter(function(e){return I(e,n)});return I(e,n)&&t.unshift(e),t})(e,!0).filter(function(e){return n.has(e)})}function W(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var o=B(e,n),i=o.length,l=o.findIndex(function(e){return t===e});return r<0?-1===l?l=i-1:l-=1:r>0&&(l+=1),o[l=(l+i)%i]}var H=function(e,n){var t=new Set,r=new Map,o=new Map;return e.forEach(function(e){var i=document.querySelector("[data-menu-id='".concat(y(n,e),"']"));i&&(t.add(i),o.set(i,e),r.set(e,i))}),{elements:t,key2element:r,element2key:o}},Y="__RC_UTIL_PATH_SPLIT__",q=function(e){return e.join(Y)},X="rc-menu-more";function G(e){var n=m.useRef(e);n.current=e;var t=m.useCallback(function(){for(var e,t=arguments.length,r=Array(t),o=0;o1&&(k.motionAppear=!1);var M=k.onVisibleChanged;return(k.onVisibleChanged=function(e){return b.current||e||Z(!0),null==M?void 0:M(e)},g)?null:m.createElement(w,{mode:a,locked:!b.current},m.createElement(eR.ZP,(0,r.Z)({visible:C},k,{forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(e){var t=e.className,r=e.style;return m.createElement(eb,{id:n,className:t,style:r},l)}))}var ex=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],eP=["active"],eS=function(e){var n,t=e.style,l=e.className,c=e.title,d=e.eventKey,v=(e.warnKey,e.disabled),p=e.internalPopupClose,b=e.children,h=e.itemIcon,y=e.expandIcon,Z=e.popupClassName,C=e.popupOffset,k=e.popupStyle,M=e.onClick,R=e.onMouseEnter,S=e.onMouseLeave,I=e.onTitleClick,K=e.onTitleMouseEnter,A=e.onTitleMouseLeave,O=(0,a.Z)(e,ex),T=g(d),L=m.useContext(E),D=L.prefixCls,_=L.mode,V=L.openKeys,z=L.disabled,F=L.overflowDisabled,j=L.activeKey,B=L.selectedKeys,W=L.itemIcon,H=L.expandIcon,Y=L.onItemClick,q=L.onOpenChange,X=L.onActive,Q=m.useContext(P)._internalRenderSubMenuItem,U=m.useContext(x).isSubPathKey,J=N(),$="".concat(D,"-submenu"),ee=z||v,en=m.useRef(),et=m.useRef(),er=null!=y?y:H,eu=V.includes(d),ec=!F&&eu,es=U(B,d),ef=eo(d,ee,K,A),ed=ef.active,ev=(0,a.Z)(ef,eP),ep=m.useState(!1),em=(0,u.Z)(ep,2),eh=em[0],ey=em[1],eg=function(e){ee||ey(e)},eZ=m.useMemo(function(){return ed||"inline"!==_&&(eh||U([j],d))},[_,ed,j,eh,d,U]),eC=ei(J.length),eE=G(function(e){null==M||M(ea(e)),Y(e)}),ew=T&&"".concat(T,"-popup"),ek=m.createElement("div",(0,r.Z)({role:"menuitem",style:eC,className:"".concat($,"-title"),tabIndex:ee?null:-1,ref:en,title:"string"==typeof c?c:null,"data-menu-id":F&&T?null:T,"aria-expanded":ec,"aria-haspopup":!0,"aria-controls":ew,"aria-disabled":ee,onClick:function(e){ee||(null==I||I({key:d,domEvent:e}),"inline"===_&&q(d,!eu))},onFocus:function(){X(d)}},ev),c,m.createElement(el,{icon:"horizontal"!==_?er:void 0,props:(0,i.Z)((0,i.Z)({},e),{},{isOpen:ec,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))),eR=m.useRef(_);if("inline"!==_&&J.length>1?eR.current="vertical":eR.current=_,!F){var eS=eR.current;ek=m.createElement(eM,{mode:eS,prefixCls:$,visible:!p&&ec&&"inline"!==_,popupClassName:Z,popupOffset:C,popupStyle:k,popup:m.createElement(w,{mode:"horizontal"===eS?"vertical":eS},m.createElement(eb,{id:ew,ref:et},b)),disabled:ee,onVisibleChange:function(e){"inline"!==_&&q(d,e)}},ek)}var eI=m.createElement(f.Z.Item,(0,r.Z)({role:"none"},O,{component:"li",style:t,className:s()($,"".concat($,"-").concat(_),l,(n={},(0,o.Z)(n,"".concat($,"-open"),ec),(0,o.Z)(n,"".concat($,"-active"),eZ),(0,o.Z)(n,"".concat($,"-selected"),es),(0,o.Z)(n,"".concat($,"-disabled"),ee),n)),onMouseEnter:function(e){eg(!0),null==R||R({key:d,domEvent:e})},onMouseLeave:function(e){eg(!1),null==S||S({key:d,domEvent:e})}}),ek,!F&&m.createElement(eN,{id:ew,open:ec,keyPath:J},b));return Q&&(eI=Q(eI,e,{selected:es,active:eZ,open:ec,disabled:ee})),m.createElement(w,{onItemClick:eE,mode:"horizontal"===_?"vertical":_,itemIcon:null!=h?h:W,expandIcon:er},eI)};function eI(e){var n,t=e.eventKey,r=e.children,o=N(t),i=ey(r,o),l=M();return m.useEffect(function(){if(l)return l.registerPath(t,o),function(){l.unregisterPath(t,o)}},[o]),n=l?i:m.createElement(eS,e,i),m.createElement(R.Provider,{value:o},n)}var eK=t(41154),eA=["className","title","eventKey","children"],eO=["children"],eT=function(e){var n=e.className,t=e.title,o=(e.eventKey,e.children),i=(0,a.Z)(e,eA),l=m.useContext(E).prefixCls,u="".concat(l,"-item-group");return m.createElement("li",(0,r.Z)({role:"presentation"},i,{onClick:function(e){return e.stopPropagation()},className:s()(u,n)}),m.createElement("div",{role:"presentation",className:"".concat(u,"-title"),title:"string"==typeof t?t:void 0},t),m.createElement("ul",{role:"group",className:"".concat(u,"-list")},o))};function eL(e){var n=e.children,t=(0,a.Z)(e,eO),r=ey(n,N(t.eventKey));return M()?r:m.createElement(eT,(0,et.Z)(t,["warnKey"]),r)}function eD(e){var n=e.className,t=e.style,r=m.useContext(E).prefixCls;return M()?null:m.createElement("li",{role:"separator",className:s()("".concat(r,"-item-divider"),n),style:t})}var e_=["label","children","key","type"],eV=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],ez=[],eF=m.forwardRef(function(e,n){var t,c,p,y,g,Z,C,E,M,R,N,S,I,K,J,$,ee,en,et,er,eo,ei,el,eu,ec,es,ef,ed=e.prefixCls,ev=void 0===ed?"rc-menu":ed,em=e.rootClassName,eb=e.style,eh=e.className,eg=e.tabIndex,eZ=e.items,eC=e.children,eE=e.direction,ew=e.id,ek=e.mode,eM=void 0===ek?"vertical":ek,eR=e.inlineCollapsed,eN=e.disabled,ex=e.disabledOverflow,eP=e.subMenuOpenDelay,eS=e.subMenuCloseDelay,eA=e.forceSubMenuRender,eO=e.defaultOpenKeys,eT=e.openKeys,eF=e.activeKey,ej=e.defaultActiveFirst,eB=e.selectable,eW=void 0===eB||eB,eH=e.multiple,eY=void 0!==eH&&eH,eq=e.defaultSelectedKeys,eX=e.selectedKeys,eG=e.onSelect,eQ=e.onDeselect,eU=e.inlineIndent,eJ=e.motion,e$=e.defaultMotions,e0=e.triggerSubMenuAction,e1=e.builtinPlacements,e6=e.itemIcon,e2=e.expandIcon,e5=e.overflowedIndicator,e9=void 0===e5?"...":e5,e3=e.overflowedIndicatorPopupClassName,e4=e.getPopupContainer,e7=e.onClick,e8=e.onOpenChange,ne=e.onKeyDown,nn=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),nt=e._internalRenderSubMenuItem,nr=(0,a.Z)(e,eV),no=m.useMemo(function(){var e;return e=eC,eZ&&(e=function e(n){return(n||[]).map(function(n,t){if(n&&"object"===(0,eK.Z)(n)){var o=n.label,i=n.children,l=n.key,u=n.type,c=(0,a.Z)(n,e_),s=null!=l?l:"tmp-".concat(t);return i||"group"===u?"group"===u?m.createElement(eL,(0,r.Z)({key:s},c,{title:o}),e(i)):m.createElement(eI,(0,r.Z)({key:s},c,{title:o}),e(i)):"divider"===u?m.createElement(eD,(0,r.Z)({key:s},c)):m.createElement(ep,(0,r.Z)({key:s},c),o)}return null}).filter(function(e){return e})}(eZ)),ey(e,ez)},[eC,eZ]),ni=m.useState(!1),nl=(0,u.Z)(ni,2),nu=nl[0],na=nl[1],nc=m.useRef(),ns=(t=(0,d.Z)(ew,{value:ew}),p=(c=(0,u.Z)(t,2))[0],y=c[1],m.useEffect(function(){U+=1;var e="".concat(Q,"-").concat(U);y("rc-menu-uuid-".concat(e))},[]),p),nf="rtl"===eE,nd=(0,d.Z)(eO,{value:eT,postState:function(e){return e||ez}}),nv=(0,u.Z)(nd,2),np=nv[0],nm=nv[1],nb=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function t(){nm(e),null==e8||e8(e)}n?(0,b.flushSync)(t):t()},nh=m.useState(np),ny=(0,u.Z)(nh,2),ng=ny[0],nZ=ny[1],nC=m.useRef(!1),nE=m.useMemo(function(){return("inline"===eM||"vertical"===eM)&&eR?["vertical",eR]:[eM,!1]},[eM,eR]),nw=(0,u.Z)(nE,2),nk=nw[0],nM=nw[1],nR="inline"===nk,nN=m.useState(nk),nx=(0,u.Z)(nN,2),nP=nx[0],nS=nx[1],nI=m.useState(nM),nK=(0,u.Z)(nI,2),nA=nK[0],nO=nK[1];m.useEffect(function(){nS(nk),nO(nM),nC.current&&(nR?nm(ng):nb(ez))},[nk,nM]);var nT=m.useState(0),nL=(0,u.Z)(nT,2),nD=nL[0],n_=nL[1],nV=nD>=no.length-1||"horizontal"!==nP||ex;m.useEffect(function(){nR&&nZ(np)},[np]),m.useEffect(function(){return nC.current=!0,function(){nC.current=!1}},[]);var nz=(g=m.useState({}),Z=(0,u.Z)(g,2)[1],C=(0,m.useRef)(new Map),E=(0,m.useRef)(new Map),M=m.useState([]),N=(R=(0,u.Z)(M,2))[0],S=R[1],I=(0,m.useRef)(0),K=(0,m.useRef)(!1),J=function(){K.current||Z({})},$=(0,m.useCallback)(function(e,n){var t,r=q(n);E.current.set(r,e),C.current.set(e,r),I.current+=1;var o=I.current;t=function(){o===I.current&&J()},Promise.resolve().then(t)},[]),ee=(0,m.useCallback)(function(e,n){var t=q(n);E.current.delete(t),C.current.delete(e)},[]),en=(0,m.useCallback)(function(e){S(e)},[]),et=(0,m.useCallback)(function(e,n){var t=(C.current.get(e)||"").split(Y);return n&&N.includes(t[0])&&t.unshift(X),t},[N]),er=(0,m.useCallback)(function(e,n){return e.some(function(e){return et(e,!0).includes(n)})},[et]),eo=(0,m.useCallback)(function(e){var n="".concat(C.current.get(e)).concat(Y),t=new Set;return(0,l.Z)(E.current.keys()).forEach(function(e){e.startsWith(n)&&t.add(E.current.get(e))}),t},[]),m.useEffect(function(){return function(){K.current=!0}},[]),{registerPath:$,unregisterPath:ee,refreshOverflowKeys:en,isSubPathKey:er,getKeyPath:et,getKeys:function(){var e=(0,l.Z)(C.current.keys());return N.length&&e.push(X),e},getSubPathKeys:eo}),nF=nz.registerPath,nj=nz.unregisterPath,nB=nz.refreshOverflowKeys,nW=nz.isSubPathKey,nH=nz.getKeyPath,nY=nz.getKeys,nq=nz.getSubPathKeys,nX=m.useMemo(function(){return{registerPath:nF,unregisterPath:nj}},[nF,nj]),nG=m.useMemo(function(){return{isSubPathKey:nW}},[nW]);m.useEffect(function(){nB(nV?ez:no.slice(nD+1).map(function(e){return e.key}))},[nD,nV]);var nQ=(0,d.Z)(eF||ej&&(null===(es=no[0])||void 0===es?void 0:es.key),{value:eF}),nU=(0,u.Z)(nQ,2),nJ=nU[0],n$=nU[1],n0=G(function(e){n$(e)}),n1=G(function(){n$(void 0)});(0,m.useImperativeHandle)(n,function(){return{list:nc.current,focus:function(e){var n,t,r=H(nY(),ns),o=r.elements,i=r.key2element,l=r.element2key,u=B(nc.current,o),a=null!=nJ?nJ:u[0]?l.get(u[0]):null===(n=no.find(function(e){return!e.props.disabled}))||void 0===n?void 0:n.key,c=i.get(a);a&&c&&(null==c||null===(t=c.focus)||void 0===t||t.call(c,e))}}});var n6=(0,d.Z)(eq||[],{value:eX,postState:function(e){return Array.isArray(e)?e:null==e?ez:[e]}}),n2=(0,u.Z)(n6,2),n5=n2[0],n9=n2[1],n3=function(e){if(eW){var n,t=e.key,r=n5.includes(t);n9(n=eY?r?n5.filter(function(e){return e!==t}):[].concat((0,l.Z)(n5),[t]):[t]);var o=(0,i.Z)((0,i.Z)({},e),{},{selectedKeys:n});r?null==eQ||eQ(o):null==eG||eG(o)}!eY&&np.length&&"inline"!==nP&&nb(ez)},n4=G(function(e){null==e7||e7(ea(e)),n3(e)}),n7=G(function(e,n){var t=np.filter(function(n){return n!==e});if(n)t.push(e);else if("inline"!==nP){var r=nq(e);t=t.filter(function(e){return!r.has(e)})}(0,v.Z)(np,t,!0)||nb(t,!0)}),n8=(ei=function(e,n){var t=null!=n?n:!np.includes(e);n7(e,t)},el=m.useRef(),(eu=m.useRef()).current=nJ,ec=function(){A.Z.cancel(el.current)},m.useEffect(function(){return function(){ec()}},[]),function(e){var n=e.which;if([].concat(j,[_,V,z,F]).includes(n)){var t=nY(),r=H(t,ns),i=r,l=i.elements,u=i.key2element,a=i.element2key,c=function(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}(u.get(nJ),l),s=a.get(c),f=function(e,n,t,r){var i,l,u,a,c="prev",s="next",f="children",d="parent";if("inline"===e&&r===_)return{inlineTrigger:!0};var v=(i={},(0,o.Z)(i,L,c),(0,o.Z)(i,D,s),i),p=(l={},(0,o.Z)(l,O,t?s:c),(0,o.Z)(l,T,t?c:s),(0,o.Z)(l,D,f),(0,o.Z)(l,_,f),l),m=(u={},(0,o.Z)(u,L,c),(0,o.Z)(u,D,s),(0,o.Z)(u,_,f),(0,o.Z)(u,V,d),(0,o.Z)(u,O,t?f:d),(0,o.Z)(u,T,t?d:f),u);switch(null===(a=({inline:v,horizontal:p,vertical:m,inlineSub:v,horizontalSub:m,verticalSub:m})["".concat(e).concat(n?"":"Sub")])||void 0===a?void 0:a[r]){case c:return{offset:-1,sibling:!0};case s:return{offset:1,sibling:!0};case d:return{offset:-1,sibling:!1};case f:return{offset:1,sibling:!1};default:return null}}(nP,1===nH(s,!0).length,nf,n);if(!f&&n!==z&&n!==F)return;(j.includes(n)||[z,F].includes(n))&&e.preventDefault();var d=function(e){if(e){var n=e,t=e.querySelector("a");null!=t&&t.getAttribute("href")&&(n=t);var r=a.get(e);n$(r),ec(),el.current=(0,A.Z)(function(){eu.current===r&&n.focus()})}};if([z,F].includes(n)||f.sibling||!c){var v,p=B(v=c&&"inline"!==nP?function(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}(c):nc.current,l);d(n===z?p[0]:n===F?p[p.length-1]:W(v,l,c,f.offset))}else if(f.inlineTrigger)ei(s);else if(f.offset>0)ei(s,!0),ec(),el.current=(0,A.Z)(function(){r=H(t,ns);var e=c.getAttribute("aria-controls");d(W(document.getElementById(e),r.elements))},5);else if(f.offset<0){var m=nH(s,!0),b=m[m.length-2],h=u.get(b);ei(b,!1),d(h)}}null==ne||ne(e)});m.useEffect(function(){na(!0)},[]);var te=m.useMemo(function(){return{_internalRenderMenuItem:nn,_internalRenderSubMenuItem:nt}},[nn,nt]),tn="horizontal"!==nP||ex?no:no.map(function(e,n){return m.createElement(w,{key:e.key,overflowDisabled:n>nD},e)}),tt=m.createElement(f.Z,(0,r.Z)({id:ew,ref:nc,prefixCls:"".concat(ev,"-overflow"),component:"ul",itemComponent:ep,className:s()(ev,"".concat(ev,"-root"),"".concat(ev,"-").concat(nP),eh,(ef={},(0,o.Z)(ef,"".concat(ev,"-inline-collapsed"),nA),(0,o.Z)(ef,"".concat(ev,"-rtl"),nf),ef),em),dir:eE,style:eb,role:"menu",tabIndex:void 0===eg?0:eg,data:tn,renderRawItem:function(e){return e},renderRawRest:function(e){var n=e.length,t=n?no.slice(-n):null;return m.createElement(eI,{eventKey:X,title:e9,disabled:nV,internalPopupClose:0===n,popupClassName:e3},t)},maxCount:"horizontal"!==nP||ex?f.Z.INVALIDATE:f.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){n_(e)},onKeyDown:n8},nr));return m.createElement(P.Provider,{value:te},m.createElement(h.Provider,{value:ns},m.createElement(w,{prefixCls:ev,rootClassName:em,mode:nP,openKeys:np,rtl:nf,disabled:eN,motion:nu?eJ:null,defaultMotions:nu?e$:null,activeKey:nJ,onActive:n0,onInactive:n1,selectedKeys:n5,inlineIndent:void 0===eU?24:eU,subMenuOpenDelay:void 0===eP?.1:eP,subMenuCloseDelay:void 0===eS?.1:eS,forceSubMenuRender:eA,builtinPlacements:e1,triggerSubMenuAction:void 0===e0?"hover":e0,getPopupContainer:e4,itemIcon:e6,expandIcon:e2,onItemClick:n4,onOpenChange:n7},m.createElement(x.Provider,{value:nG},tt),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(k.Provider,{value:nX},no)))))});eF.Item=ep,eF.SubMenu=eI,eF.ItemGroup=eL,eF.Divider=eD;var ej=eF}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1529-e0933e3af843b646.js b/litellm/proxy/_experimental/out/_next/static/chunks/1529-e0933e3af843b646.js deleted file mode 100644 index 37fef532b2..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1529-e0933e3af843b646.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1529],{60440:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},l=t(55015),u=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},77565:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},l=t(55015),u=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},71030:function(e,n,t){t.d(n,{Z:function(){return C}});var r=t(1119),o=t(11993),i=t(26365),l=t(6989),u=t(97821),a=t(36760),c=t.n(a),s=t(28791),f=t(2265),d=t(95814),v=t(53346),p=d.Z.ESC,m=d.Z.TAB,b=(0,f.forwardRef)(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,i=(0,f.useMemo)(function(){return"function"==typeof t?t():t},[t]),l=(0,s.sQ)(n,null==i?void 0:i.ref);return f.createElement(f.Fragment,null,r&&f.createElement("div",{className:"".concat(o,"-arrow")}),f.cloneElement(i,{ref:(0,s.Yr)(i)?l:void 0}))}),h={adjustX:1,adjustY:1},y=[0,0],g={topLeft:{points:["bl","tl"],overflow:h,offset:[0,-4],targetOffset:y},top:{points:["bc","tc"],overflow:h,offset:[0,-4],targetOffset:y},topRight:{points:["br","tr"],overflow:h,offset:[0,-4],targetOffset:y},bottomLeft:{points:["tl","bl"],overflow:h,offset:[0,4],targetOffset:y},bottom:{points:["tc","bc"],overflow:h,offset:[0,4],targetOffset:y},bottomRight:{points:["tr","br"],overflow:h,offset:[0,4],targetOffset:y}},Z=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"],C=f.forwardRef(function(e,n){var t,a,d,h,y,C,E,w,k,M,R,N,x,P,S=e.arrow,I=void 0!==S&&S,K=e.prefixCls,A=void 0===K?"rc-dropdown":K,O=e.transitionName,T=e.animation,L=e.align,D=e.placement,_=e.placements,V=e.getPopupContainer,z=e.showAction,F=e.hideAction,j=e.overlayClassName,B=e.overlayStyle,W=e.visible,H=e.trigger,Y=void 0===H?["hover"]:H,q=e.autoFocus,X=e.overlay,G=e.children,Q=e.onVisibleChange,U=(0,l.Z)(e,Z),J=f.useState(),$=(0,i.Z)(J,2),ee=$[0],en=$[1],et="visible"in e?W:ee,er=f.useRef(null),eo=f.useRef(null),ei=f.useRef(null);f.useImperativeHandle(n,function(){return er.current});var el=function(e){en(e),null==Q||Q(e)};a=(t={visible:et,triggerRef:ei,onVisibleChange:el,autoFocus:q,overlayRef:eo}).visible,d=t.triggerRef,h=t.onVisibleChange,y=t.autoFocus,C=t.overlayRef,E=f.useRef(!1),w=function(){if(a){var e,n;null===(e=d.current)||void 0===e||null===(n=e.focus)||void 0===n||n.call(e),null==h||h(!1)}},k=function(){var e;return null!==(e=C.current)&&void 0!==e&&!!e.focus&&(C.current.focus(),E.current=!0,!0)},M=function(e){switch(e.keyCode){case p:w();break;case m:var n=!1;E.current||(n=k()),n?e.preventDefault():w()}},f.useEffect(function(){return a?(window.addEventListener("keydown",M),y&&(0,v.Z)(k,3),function(){window.removeEventListener("keydown",M),E.current=!1}):function(){E.current=!1}},[a]);var eu=function(){return f.createElement(b,{ref:eo,overlay:X,prefixCls:A,arrow:I})},ea=f.cloneElement(G,{className:c()(null===(P=G.props)||void 0===P?void 0:P.className,et&&(void 0!==(R=e.openClassName)?R:"".concat(A,"-open"))),ref:(0,s.Yr)(G)?(0,s.sQ)(ei,G.ref):void 0}),ec=F;return ec||-1===Y.indexOf("contextMenu")||(ec=["click"]),f.createElement(u.Z,(0,r.Z)({builtinPlacements:void 0===_?g:_},U,{prefixCls:A,ref:er,popupClassName:c()(j,(0,o.Z)({},"".concat(A,"-show-arrow"),I)),popupStyle:B,action:Y,showAction:z,hideAction:ec,popupPlacement:void 0===D?"bottomLeft":D,popupAlign:L,popupTransitionName:O,popupAnimation:T,popupVisible:et,stretch:(N=e.minOverlayWidthMatchTrigger,x=e.alignPoint,"minOverlayWidthMatchTrigger"in e?N:!x)?"minWidth":"",popup:"function"==typeof X?eu:eu(),onPopupVisibleChange:el,onPopupClick:function(n){var t=e.onOverlayClick;en(!1),t&&t(n)},getPopupContainer:V}),ea)})},33082:function(e,n,t){t.d(n,{iz:function(){return eD},ck:function(){return ep},BW:function(){return eL},sN:function(){return ep},Wd:function(){return eI},ZP:function(){return ej},Xl:function(){return N}});var r=t(1119),o=t(11993),i=t(31686),l=t(83145),u=t(26365),a=t(6989),c=t(36760),s=t.n(c),f=t(1699),d=t(50506),v=t(16671),p=t(32559),m=t(2265),b=t(54887),h=m.createContext(null);function y(e,n){return void 0===e?null:"".concat(e,"-").concat(n)}function g(e){return y(m.useContext(h),e)}var Z=t(6397),C=["children","locked"],E=m.createContext(null);function w(e){var n=e.children,t=e.locked,r=(0,a.Z)(e,C),o=m.useContext(E),l=(0,Z.Z)(function(){var e;return e=(0,i.Z)({},o),Object.keys(r).forEach(function(n){var t=r[n];void 0!==t&&(e[n]=t)}),e},[o,r],function(e,n){return!t&&(e[0]!==n[0]||!(0,v.Z)(e[1],n[1],!0))});return m.createElement(E.Provider,{value:l},n)}var k=m.createContext(null);function M(){return m.useContext(k)}var R=m.createContext([]);function N(e){var n=m.useContext(R);return m.useMemo(function(){return void 0!==e?[].concat((0,l.Z)(n),[e]):n},[n,e])}var x=m.createContext(null),P=m.createContext({}),S=t(2857);function I(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,S.Z)(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||"a"===t&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),l=null;return o&&!Number.isNaN(i)?l=i:r&&null===l&&(l=0),r&&e.disabled&&(l=null),null!==l&&(l>=0||n&&l<0)}return!1}var K=t(95814),A=t(53346),O=K.Z.LEFT,T=K.Z.RIGHT,L=K.Z.UP,D=K.Z.DOWN,_=K.Z.ENTER,V=K.Z.ESC,z=K.Z.HOME,F=K.Z.END,j=[L,D,O,T];function B(e,n){return(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(0,l.Z)(e.querySelectorAll("*")).filter(function(e){return I(e,n)});return I(e,n)&&t.unshift(e),t})(e,!0).filter(function(e){return n.has(e)})}function W(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var o=B(e,n),i=o.length,l=o.findIndex(function(e){return t===e});return r<0?-1===l?l=i-1:l-=1:r>0&&(l+=1),o[l=(l+i)%i]}var H=function(e,n){var t=new Set,r=new Map,o=new Map;return e.forEach(function(e){var i=document.querySelector("[data-menu-id='".concat(y(n,e),"']"));i&&(t.add(i),o.set(i,e),r.set(e,i))}),{elements:t,key2element:r,element2key:o}},Y="__RC_UTIL_PATH_SPLIT__",q=function(e){return e.join(Y)},X="rc-menu-more";function G(e){var n=m.useRef(e);n.current=e;var t=m.useCallback(function(){for(var e,t=arguments.length,r=Array(t),o=0;o1&&(k.motionAppear=!1);var M=k.onVisibleChanged;return(k.onVisibleChanged=function(e){return b.current||e||Z(!0),null==M?void 0:M(e)},g)?null:m.createElement(w,{mode:a,locked:!b.current},m.createElement(eR.ZP,(0,r.Z)({visible:C},k,{forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(e){var t=e.className,r=e.style;return m.createElement(eb,{id:n,className:t,style:r},l)}))}var ex=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],eP=["active"],eS=function(e){var n,t=e.style,l=e.className,c=e.title,d=e.eventKey,v=(e.warnKey,e.disabled),p=e.internalPopupClose,b=e.children,h=e.itemIcon,y=e.expandIcon,Z=e.popupClassName,C=e.popupOffset,k=e.popupStyle,M=e.onClick,R=e.onMouseEnter,S=e.onMouseLeave,I=e.onTitleClick,K=e.onTitleMouseEnter,A=e.onTitleMouseLeave,O=(0,a.Z)(e,ex),T=g(d),L=m.useContext(E),D=L.prefixCls,_=L.mode,V=L.openKeys,z=L.disabled,F=L.overflowDisabled,j=L.activeKey,B=L.selectedKeys,W=L.itemIcon,H=L.expandIcon,Y=L.onItemClick,q=L.onOpenChange,X=L.onActive,Q=m.useContext(P)._internalRenderSubMenuItem,U=m.useContext(x).isSubPathKey,J=N(),$="".concat(D,"-submenu"),ee=z||v,en=m.useRef(),et=m.useRef(),er=null!=y?y:H,eu=V.includes(d),ec=!F&&eu,es=U(B,d),ef=eo(d,ee,K,A),ed=ef.active,ev=(0,a.Z)(ef,eP),ep=m.useState(!1),em=(0,u.Z)(ep,2),eh=em[0],ey=em[1],eg=function(e){ee||ey(e)},eZ=m.useMemo(function(){return ed||"inline"!==_&&(eh||U([j],d))},[_,ed,j,eh,d,U]),eC=ei(J.length),eE=G(function(e){null==M||M(ea(e)),Y(e)}),ew=T&&"".concat(T,"-popup"),ek=m.createElement("div",(0,r.Z)({role:"menuitem",style:eC,className:"".concat($,"-title"),tabIndex:ee?null:-1,ref:en,title:"string"==typeof c?c:null,"data-menu-id":F&&T?null:T,"aria-expanded":ec,"aria-haspopup":!0,"aria-controls":ew,"aria-disabled":ee,onClick:function(e){ee||(null==I||I({key:d,domEvent:e}),"inline"===_&&q(d,!eu))},onFocus:function(){X(d)}},ev),c,m.createElement(el,{icon:"horizontal"!==_?er:void 0,props:(0,i.Z)((0,i.Z)({},e),{},{isOpen:ec,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))),eR=m.useRef(_);if("inline"!==_&&J.length>1?eR.current="vertical":eR.current=_,!F){var eS=eR.current;ek=m.createElement(eM,{mode:eS,prefixCls:$,visible:!p&&ec&&"inline"!==_,popupClassName:Z,popupOffset:C,popupStyle:k,popup:m.createElement(w,{mode:"horizontal"===eS?"vertical":eS},m.createElement(eb,{id:ew,ref:et},b)),disabled:ee,onVisibleChange:function(e){"inline"!==_&&q(d,e)}},ek)}var eI=m.createElement(f.Z.Item,(0,r.Z)({role:"none"},O,{component:"li",style:t,className:s()($,"".concat($,"-").concat(_),l,(n={},(0,o.Z)(n,"".concat($,"-open"),ec),(0,o.Z)(n,"".concat($,"-active"),eZ),(0,o.Z)(n,"".concat($,"-selected"),es),(0,o.Z)(n,"".concat($,"-disabled"),ee),n)),onMouseEnter:function(e){eg(!0),null==R||R({key:d,domEvent:e})},onMouseLeave:function(e){eg(!1),null==S||S({key:d,domEvent:e})}}),ek,!F&&m.createElement(eN,{id:ew,open:ec,keyPath:J},b));return Q&&(eI=Q(eI,e,{selected:es,active:eZ,open:ec,disabled:ee})),m.createElement(w,{onItemClick:eE,mode:"horizontal"===_?"vertical":_,itemIcon:null!=h?h:W,expandIcon:er},eI)};function eI(e){var n,t=e.eventKey,r=e.children,o=N(t),i=ey(r,o),l=M();return m.useEffect(function(){if(l)return l.registerPath(t,o),function(){l.unregisterPath(t,o)}},[o]),n=l?i:m.createElement(eS,e,i),m.createElement(R.Provider,{value:o},n)}var eK=t(41154),eA=["className","title","eventKey","children"],eO=["children"],eT=function(e){var n=e.className,t=e.title,o=(e.eventKey,e.children),i=(0,a.Z)(e,eA),l=m.useContext(E).prefixCls,u="".concat(l,"-item-group");return m.createElement("li",(0,r.Z)({role:"presentation"},i,{onClick:function(e){return e.stopPropagation()},className:s()(u,n)}),m.createElement("div",{role:"presentation",className:"".concat(u,"-title"),title:"string"==typeof t?t:void 0},t),m.createElement("ul",{role:"group",className:"".concat(u,"-list")},o))};function eL(e){var n=e.children,t=(0,a.Z)(e,eO),r=ey(n,N(t.eventKey));return M()?r:m.createElement(eT,(0,et.Z)(t,["warnKey"]),r)}function eD(e){var n=e.className,t=e.style,r=m.useContext(E).prefixCls;return M()?null:m.createElement("li",{role:"separator",className:s()("".concat(r,"-item-divider"),n),style:t})}var e_=["label","children","key","type"],eV=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],ez=[],eF=m.forwardRef(function(e,n){var t,c,p,y,g,Z,C,E,M,R,N,S,I,K,J,$,ee,en,et,er,eo,ei,el,eu,ec,es,ef,ed=e.prefixCls,ev=void 0===ed?"rc-menu":ed,em=e.rootClassName,eb=e.style,eh=e.className,eg=e.tabIndex,eZ=e.items,eC=e.children,eE=e.direction,ew=e.id,ek=e.mode,eM=void 0===ek?"vertical":ek,eR=e.inlineCollapsed,eN=e.disabled,ex=e.disabledOverflow,eP=e.subMenuOpenDelay,eS=e.subMenuCloseDelay,eA=e.forceSubMenuRender,eO=e.defaultOpenKeys,eT=e.openKeys,eF=e.activeKey,ej=e.defaultActiveFirst,eB=e.selectable,eW=void 0===eB||eB,eH=e.multiple,eY=void 0!==eH&&eH,eq=e.defaultSelectedKeys,eX=e.selectedKeys,eG=e.onSelect,eQ=e.onDeselect,eU=e.inlineIndent,eJ=e.motion,e$=e.defaultMotions,e0=e.triggerSubMenuAction,e1=e.builtinPlacements,e6=e.itemIcon,e2=e.expandIcon,e5=e.overflowedIndicator,e9=void 0===e5?"...":e5,e3=e.overflowedIndicatorPopupClassName,e4=e.getPopupContainer,e7=e.onClick,e8=e.onOpenChange,ne=e.onKeyDown,nn=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),nt=e._internalRenderSubMenuItem,nr=(0,a.Z)(e,eV),no=m.useMemo(function(){var e;return e=eC,eZ&&(e=function e(n){return(n||[]).map(function(n,t){if(n&&"object"===(0,eK.Z)(n)){var o=n.label,i=n.children,l=n.key,u=n.type,c=(0,a.Z)(n,e_),s=null!=l?l:"tmp-".concat(t);return i||"group"===u?"group"===u?m.createElement(eL,(0,r.Z)({key:s},c,{title:o}),e(i)):m.createElement(eI,(0,r.Z)({key:s},c,{title:o}),e(i)):"divider"===u?m.createElement(eD,(0,r.Z)({key:s},c)):m.createElement(ep,(0,r.Z)({key:s},c),o)}return null}).filter(function(e){return e})}(eZ)),ey(e,ez)},[eC,eZ]),ni=m.useState(!1),nl=(0,u.Z)(ni,2),nu=nl[0],na=nl[1],nc=m.useRef(),ns=(t=(0,d.Z)(ew,{value:ew}),p=(c=(0,u.Z)(t,2))[0],y=c[1],m.useEffect(function(){U+=1;var e="".concat(Q,"-").concat(U);y("rc-menu-uuid-".concat(e))},[]),p),nf="rtl"===eE,nd=(0,d.Z)(eO,{value:eT,postState:function(e){return e||ez}}),nv=(0,u.Z)(nd,2),np=nv[0],nm=nv[1],nb=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function t(){nm(e),null==e8||e8(e)}n?(0,b.flushSync)(t):t()},nh=m.useState(np),ny=(0,u.Z)(nh,2),ng=ny[0],nZ=ny[1],nC=m.useRef(!1),nE=m.useMemo(function(){return("inline"===eM||"vertical"===eM)&&eR?["vertical",eR]:[eM,!1]},[eM,eR]),nw=(0,u.Z)(nE,2),nk=nw[0],nM=nw[1],nR="inline"===nk,nN=m.useState(nk),nx=(0,u.Z)(nN,2),nP=nx[0],nS=nx[1],nI=m.useState(nM),nK=(0,u.Z)(nI,2),nA=nK[0],nO=nK[1];m.useEffect(function(){nS(nk),nO(nM),nC.current&&(nR?nm(ng):nb(ez))},[nk,nM]);var nT=m.useState(0),nL=(0,u.Z)(nT,2),nD=nL[0],n_=nL[1],nV=nD>=no.length-1||"horizontal"!==nP||ex;m.useEffect(function(){nR&&nZ(np)},[np]),m.useEffect(function(){return nC.current=!0,function(){nC.current=!1}},[]);var nz=(g=m.useState({}),Z=(0,u.Z)(g,2)[1],C=(0,m.useRef)(new Map),E=(0,m.useRef)(new Map),M=m.useState([]),N=(R=(0,u.Z)(M,2))[0],S=R[1],I=(0,m.useRef)(0),K=(0,m.useRef)(!1),J=function(){K.current||Z({})},$=(0,m.useCallback)(function(e,n){var t,r=q(n);E.current.set(r,e),C.current.set(e,r),I.current+=1;var o=I.current;t=function(){o===I.current&&J()},Promise.resolve().then(t)},[]),ee=(0,m.useCallback)(function(e,n){var t=q(n);E.current.delete(t),C.current.delete(e)},[]),en=(0,m.useCallback)(function(e){S(e)},[]),et=(0,m.useCallback)(function(e,n){var t=(C.current.get(e)||"").split(Y);return n&&N.includes(t[0])&&t.unshift(X),t},[N]),er=(0,m.useCallback)(function(e,n){return e.some(function(e){return et(e,!0).includes(n)})},[et]),eo=(0,m.useCallback)(function(e){var n="".concat(C.current.get(e)).concat(Y),t=new Set;return(0,l.Z)(E.current.keys()).forEach(function(e){e.startsWith(n)&&t.add(E.current.get(e))}),t},[]),m.useEffect(function(){return function(){K.current=!0}},[]),{registerPath:$,unregisterPath:ee,refreshOverflowKeys:en,isSubPathKey:er,getKeyPath:et,getKeys:function(){var e=(0,l.Z)(C.current.keys());return N.length&&e.push(X),e},getSubPathKeys:eo}),nF=nz.registerPath,nj=nz.unregisterPath,nB=nz.refreshOverflowKeys,nW=nz.isSubPathKey,nH=nz.getKeyPath,nY=nz.getKeys,nq=nz.getSubPathKeys,nX=m.useMemo(function(){return{registerPath:nF,unregisterPath:nj}},[nF,nj]),nG=m.useMemo(function(){return{isSubPathKey:nW}},[nW]);m.useEffect(function(){nB(nV?ez:no.slice(nD+1).map(function(e){return e.key}))},[nD,nV]);var nQ=(0,d.Z)(eF||ej&&(null===(es=no[0])||void 0===es?void 0:es.key),{value:eF}),nU=(0,u.Z)(nQ,2),nJ=nU[0],n$=nU[1],n0=G(function(e){n$(e)}),n1=G(function(){n$(void 0)});(0,m.useImperativeHandle)(n,function(){return{list:nc.current,focus:function(e){var n,t,r=H(nY(),ns),o=r.elements,i=r.key2element,l=r.element2key,u=B(nc.current,o),a=null!=nJ?nJ:u[0]?l.get(u[0]):null===(n=no.find(function(e){return!e.props.disabled}))||void 0===n?void 0:n.key,c=i.get(a);a&&c&&(null==c||null===(t=c.focus)||void 0===t||t.call(c,e))}}});var n6=(0,d.Z)(eq||[],{value:eX,postState:function(e){return Array.isArray(e)?e:null==e?ez:[e]}}),n2=(0,u.Z)(n6,2),n5=n2[0],n9=n2[1],n3=function(e){if(eW){var n,t=e.key,r=n5.includes(t);n9(n=eY?r?n5.filter(function(e){return e!==t}):[].concat((0,l.Z)(n5),[t]):[t]);var o=(0,i.Z)((0,i.Z)({},e),{},{selectedKeys:n});r?null==eQ||eQ(o):null==eG||eG(o)}!eY&&np.length&&"inline"!==nP&&nb(ez)},n4=G(function(e){null==e7||e7(ea(e)),n3(e)}),n7=G(function(e,n){var t=np.filter(function(n){return n!==e});if(n)t.push(e);else if("inline"!==nP){var r=nq(e);t=t.filter(function(e){return!r.has(e)})}(0,v.Z)(np,t,!0)||nb(t,!0)}),n8=(ei=function(e,n){var t=null!=n?n:!np.includes(e);n7(e,t)},el=m.useRef(),(eu=m.useRef()).current=nJ,ec=function(){A.Z.cancel(el.current)},m.useEffect(function(){return function(){ec()}},[]),function(e){var n=e.which;if([].concat(j,[_,V,z,F]).includes(n)){var t=nY(),r=H(t,ns),i=r,l=i.elements,u=i.key2element,a=i.element2key,c=function(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}(u.get(nJ),l),s=a.get(c),f=function(e,n,t,r){var i,l,u,a,c="prev",s="next",f="children",d="parent";if("inline"===e&&r===_)return{inlineTrigger:!0};var v=(i={},(0,o.Z)(i,L,c),(0,o.Z)(i,D,s),i),p=(l={},(0,o.Z)(l,O,t?s:c),(0,o.Z)(l,T,t?c:s),(0,o.Z)(l,D,f),(0,o.Z)(l,_,f),l),m=(u={},(0,o.Z)(u,L,c),(0,o.Z)(u,D,s),(0,o.Z)(u,_,f),(0,o.Z)(u,V,d),(0,o.Z)(u,O,t?f:d),(0,o.Z)(u,T,t?d:f),u);switch(null===(a=({inline:v,horizontal:p,vertical:m,inlineSub:v,horizontalSub:m,verticalSub:m})["".concat(e).concat(n?"":"Sub")])||void 0===a?void 0:a[r]){case c:return{offset:-1,sibling:!0};case s:return{offset:1,sibling:!0};case d:return{offset:-1,sibling:!1};case f:return{offset:1,sibling:!1};default:return null}}(nP,1===nH(s,!0).length,nf,n);if(!f&&n!==z&&n!==F)return;(j.includes(n)||[z,F].includes(n))&&e.preventDefault();var d=function(e){if(e){var n=e,t=e.querySelector("a");null!=t&&t.getAttribute("href")&&(n=t);var r=a.get(e);n$(r),ec(),el.current=(0,A.Z)(function(){eu.current===r&&n.focus()})}};if([z,F].includes(n)||f.sibling||!c){var v,p=B(v=c&&"inline"!==nP?function(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}(c):nc.current,l);d(n===z?p[0]:n===F?p[p.length-1]:W(v,l,c,f.offset))}else if(f.inlineTrigger)ei(s);else if(f.offset>0)ei(s,!0),ec(),el.current=(0,A.Z)(function(){r=H(t,ns);var e=c.getAttribute("aria-controls");d(W(document.getElementById(e),r.elements))},5);else if(f.offset<0){var m=nH(s,!0),b=m[m.length-2],h=u.get(b);ei(b,!1),d(h)}}null==ne||ne(e)});m.useEffect(function(){na(!0)},[]);var te=m.useMemo(function(){return{_internalRenderMenuItem:nn,_internalRenderSubMenuItem:nt}},[nn,nt]),tn="horizontal"!==nP||ex?no:no.map(function(e,n){return m.createElement(w,{key:e.key,overflowDisabled:n>nD},e)}),tt=m.createElement(f.Z,(0,r.Z)({id:ew,ref:nc,prefixCls:"".concat(ev,"-overflow"),component:"ul",itemComponent:ep,className:s()(ev,"".concat(ev,"-root"),"".concat(ev,"-").concat(nP),eh,(ef={},(0,o.Z)(ef,"".concat(ev,"-inline-collapsed"),nA),(0,o.Z)(ef,"".concat(ev,"-rtl"),nf),ef),em),dir:eE,style:eb,role:"menu",tabIndex:void 0===eg?0:eg,data:tn,renderRawItem:function(e){return e},renderRawRest:function(e){var n=e.length,t=n?no.slice(-n):null;return m.createElement(eI,{eventKey:X,title:e9,disabled:nV,internalPopupClose:0===n,popupClassName:e3},t)},maxCount:"horizontal"!==nP||ex?f.Z.INVALIDATE:f.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){n_(e)},onKeyDown:n8},nr));return m.createElement(P.Provider,{value:te},m.createElement(h.Provider,{value:ns},m.createElement(w,{prefixCls:ev,rootClassName:em,mode:nP,openKeys:np,rtl:nf,disabled:eN,motion:nu?eJ:null,defaultMotions:nu?e$:null,activeKey:nJ,onActive:n0,onInactive:n1,selectedKeys:n5,inlineIndent:void 0===eU?24:eU,subMenuOpenDelay:void 0===eP?.1:eP,subMenuCloseDelay:void 0===eS?.1:eS,forceSubMenuRender:eA,builtinPlacements:e1,triggerSubMenuAction:void 0===e0?"hover":e0,getPopupContainer:e4,itemIcon:e6,expandIcon:e2,onItemClick:n4,onOpenChange:n7},m.createElement(x.Provider,{value:nG},tt),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(k.Provider,{value:nX},no)))))});eF.Item=ep,eF.SubMenu=eI,eF.ItemGroup=eL,eF.Divider=eD;var ej=eF}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2012-753dae634313855c.js b/litellm/proxy/_experimental/out/_next/static/chunks/2012-753dae634313855c.js deleted file mode 100644 index 63df4a96c5..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2012-753dae634313855c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2012],{26210:function(e,t,i){i.d(t,{UQ:function(){return s.Z},X1:function(){return l.Z},_m:function(){return r.Z},oi:function(){return n.Z},xv:function(){return a.Z}});var s=i(87452),l=i(88829),r=i(72208),a=i(84264),n=i(49566)},30078:function(e,t,i){i.d(t,{Ct:function(){return s.Z},Dx:function(){return h.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return c.Z},oi:function(){return x.Z},rj:function(){return a.Z},td:function(){return d.Z},v0:function(){return m.Z},x4:function(){return o.Z},xv:function(){return u.Z},zx:function(){return l.Z}});var s=i(41649),l=i(20831),r=i(12514),a=i(67101),n=i(12485),m=i(18135),d=i(35242),o=i(29706),c=i(77991),u=i(84264),x=i(49566),h=i(96761)},62490:function(e,t,i){i.d(t,{Ct:function(){return s.Z},RM:function(){return n.Z},SC:function(){return c.Z},Zb:function(){return r.Z},iA:function(){return a.Z},pj:function(){return m.Z},ss:function(){return d.Z},xs:function(){return o.Z},xv:function(){return u.Z},zx:function(){return l.Z}});var s=i(41649),l=i(20831),r=i(12514),a=i(21626),n=i(97214),m=i(28241),d=i(58834),o=i(69552),c=i(71876),u=i(84264)},11318:function(e,t,i){i.d(t,{Z:function(){return n}});var s=i(2265),l=i(39760),r=i(19250);let a=async(e,t,i,s)=>"Admin"!=i&&"Admin Viewer"!=i?await (0,r.teamListCall)(e,(null==s?void 0:s.organization_id)||null,t):await (0,r.teamListCall)(e,(null==s?void 0:s.organization_id)||null);var n=()=>{let[e,t]=(0,s.useState)([]),{accessToken:i,userId:r,userRole:n}=(0,l.Z)();return(0,s.useEffect)(()=>{(async()=>{t(await a(i,r,n,null))})()},[i,r,n]),{teams:e,setTeams:t}}},33293:function(e,t,i){i.d(t,{Z:function(){return H}});var s=i(57437),l=i(2265),r=i(24199),a=i(30078),n=i(20831),m=i(12514),d=i(47323),o=i(21626),c=i(97214),u=i(28241),x=i(58834),h=i(69552),_=i(71876),g=i(84264),p=i(15424),b=i(89970),v=i(53410),j=i(74998),f=i(59872),Z=e=>{let{teamData:t,canEditTeam:i,handleMemberDelete:l,setSelectedEditMember:r,setIsEditMemberModalVisible:a,setIsAddMemberModalVisible:Z}=e,y=e=>{if(null==e)return"0";if("number"==typeof e){let t=Number(e);return t===Math.floor(t)?t.toString():(0,f.pw)(t,8).replace(/\.?0+$/,"")}return"0"},N=e=>{if(!e)return 0;let i=t.team_memberships.find(t=>t.user_id===e);return(null==i?void 0:i.spend)||0},k=e=>{var i;if(!e)return null;let s=t.team_memberships.find(t=>t.user_id===e);console.log("membership=".concat(s));let l=null==s?void 0:null===(i=s.litellm_budget_table)||void 0===i?void 0:i.max_budget;return null==l?null:y(l)},w=e=>{var i,s;if(!e)return"No Limits";let l=t.team_memberships.find(t=>t.user_id===e),r=null==l?void 0:null===(i=l.litellm_budget_table)||void 0===i?void 0:i.rpm_limit,a=null==l?void 0:null===(s=l.litellm_budget_table)||void 0===s?void 0:s.tpm_limit,n=[r?"".concat(y(r)," RPM"):null,a?"".concat(y(a)," TPM"):null].filter(Boolean);return n.length>0?n.join(" / "):"No Limits"};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(m.Z,{className:"w-full mx-auto flex-auto overflow-auto max-h-[50vh]",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(o.Z,{className:"min-w-full",children:[(0,s.jsx)(x.Z,{children:(0,s.jsxs)(_.Z,{children:[(0,s.jsx)(h.Z,{children:"User ID"}),(0,s.jsx)(h.Z,{children:"User Email"}),(0,s.jsx)(h.Z,{children:"Role"}),(0,s.jsxs)(h.Z,{children:["Team Member Spend (USD)"," ",(0,s.jsx)(b.Z,{title:"This is the amount spent by a user in the team.",children:(0,s.jsx)(p.Z,{})})]}),(0,s.jsx)(h.Z,{children:"Team Member Budget (USD)"}),(0,s.jsxs)(h.Z,{children:["Team Member Rate Limits"," ",(0,s.jsx)(b.Z,{title:"Rate limits for this member's usage within this team.",children:(0,s.jsx)(p.Z,{})})]}),(0,s.jsx)(h.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:"Actions"})]})}),(0,s.jsx)(c.Z,{children:t.team_info.members_with_roles.map((e,n)=>(0,s.jsxs)(_.Z,{children:[(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:e.user_id})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:e.role})}),(0,s.jsx)(u.Z,{children:(0,s.jsxs)(g.Z,{className:"font-mono",children:["$",(0,f.pw)(N(e.user_id),4)]})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:k(e.user_id)?"$".concat((0,f.pw)(Number(k(e.user_id)),4)):"No Limit"})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:w(e.user_id)})}),(0,s.jsx)(u.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:i&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Z,{icon:v.Z,size:"sm",onClick:()=>{var i,s,l;let n=t.team_memberships.find(t=>t.user_id===e.user_id);r({...e,max_budget_in_team:(null==n?void 0:null===(i=n.litellm_budget_table)||void 0===i?void 0:i.max_budget)||null,tpm_limit:(null==n?void 0:null===(s=n.litellm_budget_table)||void 0===s?void 0:s.tpm_limit)||null,rpm_limit:(null==n?void 0:null===(l=n.litellm_budget_table)||void 0===l?void 0:l.rpm_limit)||null}),a(!0)},className:"cursor-pointer hover:text-blue-600"}),(0,s.jsx)(d.Z,{icon:j.Z,size:"sm",onClick:()=>l(e),className:"cursor-pointer hover:text-red-600"})]})})]},n))})]})})}),(0,s.jsx)(n.Z,{onClick:()=>Z(!0),children:"Add Member"})]})},y=i(96761),N=i(73002),k=i(61994),w=i(85180),M=i(89245),T=i(78355),S=i(19250);let C={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team"},P=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",L=e=>{let t=P(e),i=C[e];if(!i){for(let[t,s]of Object.entries(C))if(e.includes(t)){i=s;break}}return i||(i="Access ".concat(e)),{method:t,endpoint:e,description:i,route:e}};var I=i(9114),E=e=>{let{teamId:t,accessToken:i,canEditTeam:r}=e,[a,d]=(0,l.useState)([]),[p,b]=(0,l.useState)([]),[v,j]=(0,l.useState)(!0),[f,Z]=(0,l.useState)(!1),[C,P]=(0,l.useState)(!1),E=async()=>{try{if(j(!0),!i)return;let e=await (0,S.getTeamPermissionsCall)(i,t),s=e.all_available_permissions||[];d(s);let l=e.team_member_permissions||[];b(l),P(!1)}catch(e){I.Z.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{j(!1)}};(0,l.useEffect)(()=>{E()},[t,i]);let z=(e,t)=>{b(t?[...p,e]:p.filter(t=>t!==e)),P(!0)},A=async()=>{try{if(!i)return;Z(!0),await (0,S.teamPermissionsUpdateCall)(i,t,p),I.Z.success("Permissions updated successfully"),P(!1)}catch(e){I.Z.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{Z(!1)}};if(v)return(0,s.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let D=a.length>0;return(0,s.jsxs)(m.Z,{className:"bg-white shadow-md rounded-md p-6",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,s.jsx)(y.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),r&&C&&(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)(N.ZP,{icon:(0,s.jsx)(M.Z,{}),onClick:()=>{E()},children:"Reset"}),(0,s.jsxs)(n.Z,{onClick:A,loading:f,className:"flex items-center gap-2",children:[(0,s.jsx)(T.Z,{})," Save Changes"]})]})]}),(0,s.jsx)(g.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),D?(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(o.Z,{className:" min-w-full",children:[(0,s.jsx)(x.Z,{children:(0,s.jsxs)(_.Z,{children:[(0,s.jsx)(h.Z,{children:"Method"}),(0,s.jsx)(h.Z,{children:"Endpoint"}),(0,s.jsx)(h.Z,{children:"Description"}),(0,s.jsx)(h.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:"Allow Access"})]})}),(0,s.jsx)(c.Z,{children:a.map(e=>{let t=L(e);return(0,s.jsxs)(_.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,s.jsx)(u.Z,{children:(0,s.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===t.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:t.method})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)("span",{className:"font-mono text-sm text-gray-800",children:t.endpoint})}),(0,s.jsx)(u.Z,{className:"text-gray-700",children:t.description}),(0,s.jsx)(u.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,s.jsx)(k.Z,{checked:p.includes(e),onChange:t=>z(e,t.target.checked),disabled:!r})})]},e)})})]})}):(0,s.jsx)("div",{className:"py-12",children:(0,s.jsx)(w.Z,{description:"No permissions available"})})]})},z=i(13634),A=i(42264),D=i(64482),F=i(52787),B=i(10900),R=i(10901),U=i(33860),O=i(46468),V=i(98015),q=i(97415),K=i(95920),G=i(68473),$=i(21425),J=i(27799),Q=i(30401),W=i(78867),X=i(95096),H=e=>{var t,i,n,m,d,o,c,u,x,h,_,g,v,j,y,k;let{teamId:w,onClose:M,accessToken:T,is_team_admin:C,is_proxy_admin:P,userModels:L,editTeam:H,premiumUser:Y=!1,onUpdate:ee}=e,[et,ei]=(0,l.useState)(null),[es,el]=(0,l.useState)(!0),[er,ea]=(0,l.useState)(!1),[en]=z.Z.useForm(),[em,ed]=(0,l.useState)(!1),[eo,ec]=(0,l.useState)(null),[eu,ex]=(0,l.useState)(!1),[eh,e_]=(0,l.useState)([]),[eg,ep]=(0,l.useState)(!1),[eb,ev]=(0,l.useState)({}),[ej,ef]=(0,l.useState)([]);console.log("userModels in team info",L);let eZ=C||P,ey=async()=>{try{if(el(!0),!T)return;let e=await (0,S.teamInfoCall)(T,w);ei(e)}catch(e){I.Z.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{el(!1)}};(0,l.useEffect)(()=>{ey()},[w,T]),(0,l.useEffect)(()=>{(async()=>{try{if(!T)return;let e=(await (0,S.getGuardrailsList)(T)).guardrails.map(e=>e.guardrail_name);ef(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[T]);let eN=async e=>{try{if(null==T)return;let t={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,S.teamMemberAddCall)(T,w,t),I.Z.success("Team member added successfully"),ea(!1),en.resetFields();let i=await (0,S.teamInfoCall)(T,w);ei(i),ee(i)}catch(l){var t,i,s;let e="Failed to add team member";(null==l?void 0:null===(s=l.raw)||void 0===s?void 0:null===(i=s.detail)||void 0===i?void 0:null===(t=i.error)||void 0===t?void 0:t.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==l?void 0:l.message)&&(e=l.message),I.Z.fromBackend(e),console.error("Error adding team member:",l)}},ek=async e=>{try{if(null==T)return;let t={user_email:e.user_email,user_id:e.user_id,role:e.role,max_budget_in_team:e.max_budget_in_team,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit};console.log("Updating member with values:",t),A.ZP.destroy(),await (0,S.teamMemberUpdateCall)(T,w,t),I.Z.success("Team member updated successfully"),ed(!1);let i=await (0,S.teamInfoCall)(T,w);ei(i),ee(i)}catch(s){var t,i;let e="Failed to update team member";(null==s?void 0:null===(i=s.raw)||void 0===i?void 0:null===(t=i.detail)||void 0===t?void 0:t.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==s?void 0:s.message)&&(e=s.message),ed(!1),A.ZP.destroy(),I.Z.fromBackend(e),console.error("Error updating team member:",s)}},ew=async e=>{try{if(null==T)return;await (0,S.teamMemberDeleteCall)(T,w,e),I.Z.success("Team member removed successfully");let t=await (0,S.teamInfoCall)(T,w);ei(t),ee(t)}catch(e){I.Z.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}},eM=async e=>{try{if(!T)return;let t={};try{t=e.metadata?JSON.parse(e.metadata):{}}catch(e){I.Z.fromBackend("Invalid JSON in metadata field");return}let i=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,s={team_id:w,team_alias:e.team_alias,models:e.models,tpm_limit:i(e.tpm_limit),rpm_limit:i(e.rpm_limit),max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...t,guardrails:e.guardrails||[],logging:e.logging_settings||[]},organization_id:e.organization_id};void 0!==e.team_member_budget&&(s.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(s.team_member_key_duration=e.team_member_key_duration),(void 0!==e.team_member_tpm_limit||void 0!==e.team_member_rpm_limit)&&(s.team_member_tpm_limit=i(e.team_member_tpm_limit),s.team_member_rpm_limit=i(e.team_member_rpm_limit));let{servers:l,accessGroups:r}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]},a=e.mcp_tool_permissions||{};(l&&l.length>0||r&&r.length>0||Object.keys(a).length>0)&&(s.object_permission={},l&&l.length>0&&(s.object_permission.mcp_servers=l),r&&r.length>0&&(s.object_permission.mcp_access_groups=r),Object.keys(a).length>0&&(s.object_permission.mcp_tool_permissions=a)),delete e.mcp_servers_and_groups,delete e.mcp_tool_permissions,await (0,S.teamUpdateCall)(T,s),I.Z.success("Team settings updated successfully"),ex(!1),ey()}catch(e){console.error("Error updating team:",e)}};if(es)return(0,s.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==et?void 0:et.team_info))return(0,s.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:eT}=et,eS=async(e,t)=>{await (0,f.vQ)(e)&&(ev(e=>({...e,[t]:!0})),setTimeout(()=>{ev(e=>({...e,[t]:!1}))},2e3))};return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(a.zx,{icon:B.Z,variant:"light",onClick:M,className:"mb-4",children:"Back to Teams"}),(0,s.jsx)(a.Dx,{children:eT.team_alias}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsx)(a.xv,{className:"text-gray-500 font-mono",children:eT.team_id}),(0,s.jsx)(N.ZP,{type:"text",size:"small",icon:eb["team-id"]?(0,s.jsx)(Q.Z,{size:12}):(0,s.jsx)(W.Z,{size:12}),onClick:()=>eS(eT.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eb["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,s.jsxs)(a.v0,{defaultIndex:H?3:0,children:[(0,s.jsx)(a.td,{className:"mb-4",children:[(0,s.jsx)(a.OK,{children:"Overview"},"overview"),...eZ?[(0,s.jsx)(a.OK,{children:"Members"},"members"),(0,s.jsx)(a.OK,{children:"Member Permissions"},"member-permissions"),(0,s.jsx)(a.OK,{children:"Settings"},"settings")]:[]]}),(0,s.jsxs)(a.nP,{children:[(0,s.jsx)(a.x4,{children:(0,s.jsxs)(a.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(a.Zb,{children:[(0,s.jsx)(a.xv,{children:"Budget Status"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(a.Dx,{children:["$",(0,f.pw)(eT.spend,4)]}),(0,s.jsxs)(a.xv,{children:["of ",null===eT.max_budget?"Unlimited":"$".concat((0,f.pw)(eT.max_budget,4))]}),eT.budget_duration&&(0,s.jsxs)(a.xv,{className:"text-gray-500",children:["Reset: ",eT.budget_duration]}),(0,s.jsx)("br",{}),eT.team_member_budget_table&&(0,s.jsxs)(a.xv,{className:"text-gray-500",children:["Team Member Budget: $",(0,f.pw)(eT.team_member_budget_table.max_budget,4)]})]})]}),(0,s.jsxs)(a.Zb,{children:[(0,s.jsx)(a.xv,{children:"Rate Limits"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(a.xv,{children:["TPM: ",eT.tpm_limit||"Unlimited"]}),(0,s.jsxs)(a.xv,{children:["RPM: ",eT.rpm_limit||"Unlimited"]}),eT.max_parallel_requests&&(0,s.jsxs)(a.xv,{children:["Max Parallel Requests: ",eT.max_parallel_requests]})]})]}),(0,s.jsxs)(a.Zb,{children:[(0,s.jsx)(a.xv,{children:"Models"}),(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===eT.models.length?(0,s.jsx)(a.Ct,{color:"red",children:"All proxy models"}):eT.models.map((e,t)=>(0,s.jsx)(a.Ct,{color:"red",children:e},t))})]}),(0,s.jsxs)(a.Zb,{children:[(0,s.jsx)(a.xv,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(a.xv,{children:["User Keys: ",et.keys.filter(e=>e.user_id).length]}),(0,s.jsxs)(a.xv,{children:["Service Account Keys: ",et.keys.filter(e=>!e.user_id).length]}),(0,s.jsxs)(a.xv,{className:"text-gray-500",children:["Total: ",et.keys.length]})]})]}),(0,s.jsx)(V.Z,{objectPermission:eT.object_permission,variant:"card",accessToken:T}),(0,s.jsx)(J.Z,{loggingConfigs:(null===(t=eT.metadata)||void 0===t?void 0:t.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,s.jsx)(a.x4,{children:(0,s.jsx)(Z,{teamData:et,canEditTeam:eZ,handleMemberDelete:ew,setSelectedEditMember:ec,setIsEditMemberModalVisible:ed,setIsAddMemberModalVisible:ea})}),eZ&&(0,s.jsx)(a.x4,{children:(0,s.jsx)(E,{teamId:w,accessToken:T,canEditTeam:eZ})}),(0,s.jsx)(a.x4,{children:(0,s.jsxs)(a.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(a.Dx,{children:"Team Settings"}),eZ&&!eu&&(0,s.jsx)(a.zx,{onClick:()=>ex(!0),children:"Edit Settings"})]}),eu?(0,s.jsxs)(z.Z,{form:en,onFinish:eM,initialValues:{...eT,team_alias:eT.team_alias,models:eT.models,tpm_limit:eT.tpm_limit,rpm_limit:eT.rpm_limit,max_budget:eT.max_budget,budget_duration:eT.budget_duration,team_member_tpm_limit:null===(i=eT.team_member_budget_table)||void 0===i?void 0:i.tpm_limit,team_member_rpm_limit:null===(n=eT.team_member_budget_table)||void 0===n?void 0:n.rpm_limit,guardrails:(null===(m=eT.metadata)||void 0===m?void 0:m.guardrails)||[],metadata:eT.metadata?JSON.stringify((e=>{let{logging:t,...i}=e;return i})(eT.metadata),null,2):"",logging_settings:(null===(d=eT.metadata)||void 0===d?void 0:d.logging)||[],organization_id:eT.organization_id,vector_stores:(null===(o=eT.object_permission)||void 0===o?void 0:o.vector_stores)||[],mcp_servers:(null===(c=eT.object_permission)||void 0===c?void 0:c.mcp_servers)||[],mcp_access_groups:(null===(u=eT.object_permission)||void 0===u?void 0:u.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(x=eT.object_permission)||void 0===x?void 0:x.mcp_servers)||[],accessGroups:(null===(h=eT.object_permission)||void 0===h?void 0:h.mcp_access_groups)||[]},mcp_tool_permissions:(null===(_=eT.object_permission)||void 0===_?void 0:_.mcp_tool_permissions)||{}},layout:"vertical",children:[(0,s.jsx)(z.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,s.jsx)(D.default,{type:""})}),(0,s.jsx)(z.Z.Item,{label:"Models",name:"models",children:(0,s.jsxs)(F.default,{mode:"multiple",placeholder:"Select models",children:[(0,s.jsx)(F.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Array.from(new Set(L)).map((e,t)=>(0,s.jsx)(F.default.Option,{value:e,children:(0,O.W0)(e)},t))]})}),(0,s.jsx)(z.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,s.jsx)(r.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,s.jsx)(r.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,s.jsx)(a.oi,{placeholder:"e.g., 30d"})}),(0,s.jsx)(z.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"Default tokens per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,s.jsx)(r.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,s.jsx)(z.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"Default requests per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,s.jsx)(r.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})}),(0,s.jsx)(z.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,s.jsxs)(F.default,{placeholder:"n/a",children:[(0,s.jsx)(F.default.Option,{value:"24h",children:"daily"}),(0,s.jsx)(F.default.Option,{value:"7d",children:"weekly"}),(0,s.jsx)(F.default.Option,{value:"30d",children:"monthly"})]})}),(0,s.jsx)(z.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,s.jsx)(r.Z,{step:1,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,s.jsx)(r.Z,{step:1,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(b.Z,{title:"Setup your first guardrail",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,s.jsx)(F.default,{mode:"tags",placeholder:"Select or enter guardrails",options:ej.map(e=>({value:e,label:e}))})}),(0,s.jsx)(z.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,s.jsx)(q.Z,{onChange:e=>en.setFieldValue("vector_stores",e),value:en.getFieldValue("vector_stores"),accessToken:T||"",placeholder:"Select vector stores"})}),(0,s.jsx)(z.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,s.jsx)(X.Z,{onChange:e=>en.setFieldValue("allowed_passthrough_routes",e),value:en.getFieldValue("allowed_passthrough_routes"),accessToken:T||"",placeholder:"Select pass through routes"})}),(0,s.jsx)(z.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,s.jsx)(K.Z,{onChange:e=>en.setFieldValue("mcp_servers_and_groups",e),value:en.getFieldValue("mcp_servers_and_groups"),accessToken:T||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,s.jsx)(z.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,s.jsx)(D.default,{type:"hidden"})}),(0,s.jsx)(z.Z.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.mcp_servers_and_groups!==t.mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>{var e;return(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsx)(G.Z,{accessToken:T||"",selectedServers:(null===(e=en.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:en.getFieldValue("mcp_tool_permissions")||{},onChange:e=>en.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,s.jsx)(z.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,s.jsx)(D.default,{type:""})}),(0,s.jsx)(z.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,s.jsx)($.Z,{value:en.getFieldValue("logging_settings"),onChange:e=>en.setFieldValue("logging_settings",e)})}),(0,s.jsx)(z.Z.Item,{label:"Metadata",name:"metadata",children:(0,s.jsx)(D.default.TextArea,{rows:10})}),(0,s.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,s.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,s.jsx)(N.ZP,{htmlType:"button",onClick:()=>ex(!1),children:"Cancel"}),(0,s.jsx)(a.zx,{type:"submit",children:"Save Changes"})]})})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Team Name"}),(0,s.jsx)("div",{children:eT.team_alias})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"font-mono",children:eT.team_id})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Created At"}),(0,s.jsx)("div",{children:new Date(eT.created_at).toLocaleString()})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Models"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:eT.models.map((e,t)=>(0,s.jsx)(a.Ct,{color:"red",children:e},t))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Rate Limits"}),(0,s.jsxs)("div",{children:["TPM: ",eT.tpm_limit||"Unlimited"]}),(0,s.jsxs)("div",{children:["RPM: ",eT.rpm_limit||"Unlimited"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Team Budget"}),(0,s.jsxs)("div",{children:["Max Budget:"," ",null!==eT.max_budget?"$".concat((0,f.pw)(eT.max_budget,4)):"No Limit"]}),(0,s.jsxs)("div",{children:["Budget Reset: ",eT.budget_duration||"Never"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(a.xv,{className:"font-medium",children:["Team Member Settings"," ",(0,s.jsx)(b.Z,{title:"These are limits on individual team members",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),(0,s.jsxs)("div",{children:["Max Budget: ",(null===(g=eT.team_member_budget_table)||void 0===g?void 0:g.max_budget)||"No Limit"]}),(0,s.jsxs)("div",{children:["Key Duration: ",(null===(v=eT.metadata)||void 0===v?void 0:v.team_member_key_duration)||"No Limit"]}),(0,s.jsxs)("div",{children:["TPM Limit: ",(null===(j=eT.team_member_budget_table)||void 0===j?void 0:j.tpm_limit)||"No Limit"]}),(0,s.jsxs)("div",{children:["RPM Limit: ",(null===(y=eT.team_member_budget_table)||void 0===y?void 0:y.rpm_limit)||"No Limit"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Organization ID"}),(0,s.jsx)("div",{children:eT.organization_id})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Status"}),(0,s.jsx)(a.Ct,{color:eT.blocked?"red":"green",children:eT.blocked?"Blocked":"Active"})]}),(0,s.jsx)(V.Z,{objectPermission:eT.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:T}),(0,s.jsx)(J.Z,{loggingConfigs:(null===(k=eT.metadata)||void 0===k?void 0:k.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,s.jsx)(R.Z,{visible:em,onCancel:()=>ed(!1),onSubmit:ek,initialData:eo,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}],additionalFields:[{name:"max_budget_in_team",label:(0,s.jsxs)("span",{children:["Team Member Budget (USD)"," ",(0,s.jsx)(b.Z,{title:"Maximum amount in USD this member can spend within this team. This is separate from any global user budget limits",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:.01,min:0,placeholder:"Budget limit for this member within this team"},{name:"tpm_limit",label:(0,s.jsxs)("span",{children:["Team Member TPM Limit"," ",(0,s.jsx)(b.Z,{title:"Maximum tokens per minute this member can use within this team. This is separate from any global user TPM limit",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Tokens per minute limit for this member in this team"},{name:"rpm_limit",label:(0,s.jsxs)("span",{children:["Team Member RPM Limit"," ",(0,s.jsx)(b.Z,{title:"Maximum requests per minute this member can make within this team. This is separate from any global user RPM limit",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"}]}}),(0,s.jsx)(U.Z,{isVisible:er,onCancel:()=>ea(!1),onSubmit:eN,accessToken:T})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2012-8ba1526768e30ef5.js b/litellm/proxy/_experimental/out/_next/static/chunks/2012-8ba1526768e30ef5.js new file mode 100644 index 0000000000..6b075dd000 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2012-8ba1526768e30ef5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2012],{26210:function(e,t,i){i.d(t,{UQ:function(){return s.Z},X1:function(){return l.Z},_m:function(){return a.Z},oi:function(){return n.Z},xv:function(){return r.Z}});var s=i(87452),l=i(88829),a=i(72208),r=i(84264),n=i(49566)},30078:function(e,t,i){i.d(t,{Ct:function(){return s.Z},Dx:function(){return h.Z},OK:function(){return n.Z},Zb:function(){return a.Z},nP:function(){return c.Z},oi:function(){return x.Z},rj:function(){return r.Z},td:function(){return d.Z},v0:function(){return m.Z},x4:function(){return o.Z},xv:function(){return u.Z},zx:function(){return l.Z}});var s=i(41649),l=i(20831),a=i(12514),r=i(67101),n=i(12485),m=i(18135),d=i(35242),o=i(29706),c=i(77991),u=i(84264),x=i(49566),h=i(96761)},62490:function(e,t,i){i.d(t,{Ct:function(){return s.Z},RM:function(){return n.Z},SC:function(){return c.Z},Zb:function(){return a.Z},iA:function(){return r.Z},pj:function(){return m.Z},ss:function(){return d.Z},xs:function(){return o.Z},xv:function(){return u.Z},zx:function(){return l.Z}});var s=i(41649),l=i(20831),a=i(12514),r=i(21626),n=i(97214),m=i(28241),d=i(58834),o=i(69552),c=i(71876),u=i(84264)},11318:function(e,t,i){i.d(t,{Z:function(){return n}});var s=i(2265),l=i(80443),a=i(19250);let r=async(e,t,i,s)=>"Admin"!=i&&"Admin Viewer"!=i?await (0,a.teamListCall)(e,(null==s?void 0:s.organization_id)||null,t):await (0,a.teamListCall)(e,(null==s?void 0:s.organization_id)||null);var n=()=>{let[e,t]=(0,s.useState)([]),{accessToken:i,userId:a,userRole:n}=(0,l.Z)();return(0,s.useEffect)(()=>{(async()=>{t(await r(i,a,n,null))})()},[i,a,n]),{teams:e,setTeams:t}}},33293:function(e,t,i){i.d(t,{Z:function(){return Y}});var s=i(57437),l=i(2265),a=i(24199),r=i(30078),n=i(20831),m=i(12514),d=i(47323),o=i(21626),c=i(97214),u=i(28241),x=i(58834),h=i(69552),_=i(71876),g=i(84264),p=i(15424),b=i(89970),v=i(53410),j=i(74998),f=i(59872),Z=e=>{let{teamData:t,canEditTeam:i,handleMemberDelete:l,setSelectedEditMember:a,setIsEditMemberModalVisible:r,setIsAddMemberModalVisible:Z}=e,y=e=>{if(null==e)return"0";if("number"==typeof e){let t=Number(e);return t===Math.floor(t)?t.toString():(0,f.pw)(t,8).replace(/\.?0+$/,"")}return"0"},N=e=>{if(!e)return 0;let i=t.team_memberships.find(t=>t.user_id===e);return(null==i?void 0:i.spend)||0},k=e=>{var i;if(!e)return null;let s=t.team_memberships.find(t=>t.user_id===e);console.log("membership=".concat(s));let l=null==s?void 0:null===(i=s.litellm_budget_table)||void 0===i?void 0:i.max_budget;return null==l?null:y(l)},w=e=>{var i,s;if(!e)return"No Limits";let l=t.team_memberships.find(t=>t.user_id===e),a=null==l?void 0:null===(i=l.litellm_budget_table)||void 0===i?void 0:i.rpm_limit,r=null==l?void 0:null===(s=l.litellm_budget_table)||void 0===s?void 0:s.tpm_limit,n=[a?"".concat(y(a)," RPM"):null,r?"".concat(y(r)," TPM"):null].filter(Boolean);return n.length>0?n.join(" / "):"No Limits"};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(m.Z,{className:"w-full mx-auto flex-auto overflow-auto max-h-[50vh]",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(o.Z,{className:"min-w-full",children:[(0,s.jsx)(x.Z,{children:(0,s.jsxs)(_.Z,{children:[(0,s.jsx)(h.Z,{children:"User ID"}),(0,s.jsx)(h.Z,{children:"User Email"}),(0,s.jsx)(h.Z,{children:"Role"}),(0,s.jsxs)(h.Z,{children:["Team Member Spend (USD)"," ",(0,s.jsx)(b.Z,{title:"This is the amount spent by a user in the team.",children:(0,s.jsx)(p.Z,{})})]}),(0,s.jsx)(h.Z,{children:"Team Member Budget (USD)"}),(0,s.jsxs)(h.Z,{children:["Team Member Rate Limits"," ",(0,s.jsx)(b.Z,{title:"Rate limits for this member's usage within this team.",children:(0,s.jsx)(p.Z,{})})]}),(0,s.jsx)(h.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:"Actions"})]})}),(0,s.jsx)(c.Z,{children:t.team_info.members_with_roles.map((e,n)=>(0,s.jsxs)(_.Z,{children:[(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:e.user_id})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:e.role})}),(0,s.jsx)(u.Z,{children:(0,s.jsxs)(g.Z,{className:"font-mono",children:["$",(0,f.pw)(N(e.user_id),4)]})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:k(e.user_id)?"$".concat((0,f.pw)(Number(k(e.user_id)),4)):"No Limit"})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:w(e.user_id)})}),(0,s.jsx)(u.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:i&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Z,{icon:v.Z,size:"sm",onClick:()=>{var i,s,l;let n=t.team_memberships.find(t=>t.user_id===e.user_id);a({...e,max_budget_in_team:(null==n?void 0:null===(i=n.litellm_budget_table)||void 0===i?void 0:i.max_budget)||null,tpm_limit:(null==n?void 0:null===(s=n.litellm_budget_table)||void 0===s?void 0:s.tpm_limit)||null,rpm_limit:(null==n?void 0:null===(l=n.litellm_budget_table)||void 0===l?void 0:l.rpm_limit)||null}),r(!0)},className:"cursor-pointer hover:text-blue-600"}),(0,s.jsx)(d.Z,{icon:j.Z,size:"sm",onClick:()=>l(e),className:"cursor-pointer hover:text-red-600"})]})})]},n))})]})})}),(0,s.jsx)(n.Z,{onClick:()=>Z(!0),children:"Add Member"})]})},y=i(96761),N=i(73002),k=i(4156),w=i(85180),M=i(89245),T=i(78355),S=i(19250);let C={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team"},P=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",L=e=>{let t=P(e),i=C[e];if(!i){for(let[t,s]of Object.entries(C))if(e.includes(t)){i=s;break}}return i||(i="Access ".concat(e)),{method:t,endpoint:e,description:i,route:e}};var I=i(9114),E=e=>{let{teamId:t,accessToken:i,canEditTeam:a}=e,[r,d]=(0,l.useState)([]),[p,b]=(0,l.useState)([]),[v,j]=(0,l.useState)(!0),[f,Z]=(0,l.useState)(!1),[C,P]=(0,l.useState)(!1),E=async()=>{try{if(j(!0),!i)return;let e=await (0,S.getTeamPermissionsCall)(i,t),s=e.all_available_permissions||[];d(s);let l=e.team_member_permissions||[];b(l),P(!1)}catch(e){I.Z.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{j(!1)}};(0,l.useEffect)(()=>{E()},[t,i]);let z=(e,t)=>{b(t?[...p,e]:p.filter(t=>t!==e)),P(!0)},A=async()=>{try{if(!i)return;Z(!0),await (0,S.teamPermissionsUpdateCall)(i,t,p),I.Z.success("Permissions updated successfully"),P(!1)}catch(e){I.Z.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{Z(!1)}};if(v)return(0,s.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let D=r.length>0;return(0,s.jsxs)(m.Z,{className:"bg-white shadow-md rounded-md p-6",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,s.jsx)(y.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),a&&C&&(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)(N.ZP,{icon:(0,s.jsx)(M.Z,{}),onClick:()=>{E()},children:"Reset"}),(0,s.jsxs)(n.Z,{onClick:A,loading:f,className:"flex items-center gap-2",children:[(0,s.jsx)(T.Z,{})," Save Changes"]})]})]}),(0,s.jsx)(g.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),D?(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(o.Z,{className:" min-w-full",children:[(0,s.jsx)(x.Z,{children:(0,s.jsxs)(_.Z,{children:[(0,s.jsx)(h.Z,{children:"Method"}),(0,s.jsx)(h.Z,{children:"Endpoint"}),(0,s.jsx)(h.Z,{children:"Description"}),(0,s.jsx)(h.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:"Allow Access"})]})}),(0,s.jsx)(c.Z,{children:r.map(e=>{let t=L(e);return(0,s.jsxs)(_.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,s.jsx)(u.Z,{children:(0,s.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===t.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:t.method})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)("span",{className:"font-mono text-sm text-gray-800",children:t.endpoint})}),(0,s.jsx)(u.Z,{className:"text-gray-700",children:t.description}),(0,s.jsx)(u.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,s.jsx)(k.Z,{checked:p.includes(e),onChange:t=>z(e,t.target.checked),disabled:!a})})]},e)})})]})}):(0,s.jsx)("div",{className:"py-12",children:(0,s.jsx)(w.Z,{description:"No permissions available"})})]})},z=i(13634),A=i(42264),D=i(64482),F=i(52787),B=i(10900),R=i(10901),U=i(33860),O=i(46468),V=i(98015),q=i(97415),K=i(95920),G=i(68473),$=i(21425),J=i(27799),Q=i(30401),W=i(78867),X=i(95096),H=i(33304),Y=e=>{var t,i,n,m,d,o,c,u,x,h,_,g,v,j,y,k;let{teamId:w,onClose:M,accessToken:T,is_team_admin:C,is_proxy_admin:P,userModels:L,editTeam:Y,premiumUser:ee=!1,onUpdate:et}=e,[ei,es]=(0,l.useState)(null),[el,ea]=(0,l.useState)(!0),[er,en]=(0,l.useState)(!1),[em]=z.Z.useForm(),[ed,eo]=(0,l.useState)(!1),[ec,eu]=(0,l.useState)(null),[ex,eh]=(0,l.useState)(!1),[e_,eg]=(0,l.useState)([]),[ep,eb]=(0,l.useState)(!1),[ev,ej]=(0,l.useState)({}),[ef,eZ]=(0,l.useState)([]);console.log("userModels in team info",L);let ey=C||P,eN=async()=>{try{if(ea(!0),!T)return;let e=await (0,S.teamInfoCall)(T,w);es(e)}catch(e){I.Z.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{ea(!1)}};(0,l.useEffect)(()=>{eN()},[w,T]),(0,l.useEffect)(()=>{(async()=>{try{if(!T)return;let e=(await (0,S.getGuardrailsList)(T)).guardrails.map(e=>e.guardrail_name);eZ(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[T]);let ek=async e=>{try{if(null==T)return;let t={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,S.teamMemberAddCall)(T,w,t),I.Z.success("Team member added successfully"),en(!1),em.resetFields();let i=await (0,S.teamInfoCall)(T,w);es(i),et(i)}catch(l){var t,i,s;let e="Failed to add team member";(null==l?void 0:null===(s=l.raw)||void 0===s?void 0:null===(i=s.detail)||void 0===i?void 0:null===(t=i.error)||void 0===t?void 0:t.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==l?void 0:l.message)&&(e=l.message),I.Z.fromBackend(e),console.error("Error adding team member:",l)}},ew=async e=>{try{if(null==T)return;let t={user_email:e.user_email,user_id:e.user_id,role:e.role,max_budget_in_team:e.max_budget_in_team,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit};console.log("Updating member with values:",t),A.ZP.destroy(),await (0,S.teamMemberUpdateCall)(T,w,t),I.Z.success("Team member updated successfully"),eo(!1);let i=await (0,S.teamInfoCall)(T,w);es(i),et(i)}catch(s){var t,i;let e="Failed to update team member";(null==s?void 0:null===(i=s.raw)||void 0===i?void 0:null===(t=i.detail)||void 0===t?void 0:t.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==s?void 0:s.message)&&(e=s.message),eo(!1),A.ZP.destroy(),I.Z.fromBackend(e),console.error("Error updating team member:",s)}},eM=async e=>{try{if(null==T)return;await (0,S.teamMemberDeleteCall)(T,w,e),I.Z.success("Team member removed successfully");let t=await (0,S.teamInfoCall)(T,w);es(t),et(t)}catch(e){I.Z.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}},eT=async e=>{try{if(!T)return;let t={};try{t=e.metadata?JSON.parse(e.metadata):{}}catch(e){I.Z.fromBackend("Invalid JSON in metadata field");return}let i=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,s={team_id:w,team_alias:e.team_alias,models:e.models,tpm_limit:i(e.tpm_limit),rpm_limit:i(e.rpm_limit),max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...t,guardrails:e.guardrails||[],logging:e.logging_settings||[]},organization_id:e.organization_id};s.max_budget=(0,H.C)(s.max_budget),void 0!==e.team_member_budget&&(s.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(s.team_member_key_duration=e.team_member_key_duration),(void 0!==e.team_member_tpm_limit||void 0!==e.team_member_rpm_limit)&&(s.team_member_tpm_limit=i(e.team_member_tpm_limit),s.team_member_rpm_limit=i(e.team_member_rpm_limit));let{servers:l,accessGroups:a}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]},r=e.mcp_tool_permissions||{};(l&&l.length>0||a&&a.length>0||Object.keys(r).length>0)&&(s.object_permission={},l&&l.length>0&&(s.object_permission.mcp_servers=l),a&&a.length>0&&(s.object_permission.mcp_access_groups=a),Object.keys(r).length>0&&(s.object_permission.mcp_tool_permissions=r)),delete e.mcp_servers_and_groups,delete e.mcp_tool_permissions,await (0,S.teamUpdateCall)(T,s),I.Z.success("Team settings updated successfully"),eh(!1),eN()}catch(e){console.error("Error updating team:",e)}};if(el)return(0,s.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==ei?void 0:ei.team_info))return(0,s.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:eS}=ei,eC=async(e,t)=>{await (0,f.vQ)(e)&&(ej(e=>({...e,[t]:!0})),setTimeout(()=>{ej(e=>({...e,[t]:!1}))},2e3))};return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(r.zx,{icon:B.Z,variant:"light",onClick:M,className:"mb-4",children:"Back to Teams"}),(0,s.jsx)(r.Dx,{children:eS.team_alias}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsx)(r.xv,{className:"text-gray-500 font-mono",children:eS.team_id}),(0,s.jsx)(N.ZP,{type:"text",size:"small",icon:ev["team-id"]?(0,s.jsx)(Q.Z,{size:12}):(0,s.jsx)(W.Z,{size:12}),onClick:()=>eC(eS.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(ev["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,s.jsxs)(r.v0,{defaultIndex:Y?3:0,children:[(0,s.jsx)(r.td,{className:"mb-4",children:[(0,s.jsx)(r.OK,{children:"Overview"},"overview"),...ey?[(0,s.jsx)(r.OK,{children:"Members"},"members"),(0,s.jsx)(r.OK,{children:"Member Permissions"},"member-permissions"),(0,s.jsx)(r.OK,{children:"Settings"},"settings")]:[]]}),(0,s.jsxs)(r.nP,{children:[(0,s.jsx)(r.x4,{children:(0,s.jsxs)(r.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(r.Zb,{children:[(0,s.jsx)(r.xv,{children:"Budget Status"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(r.Dx,{children:["$",(0,f.pw)(eS.spend,4)]}),(0,s.jsxs)(r.xv,{children:["of ",null===eS.max_budget?"Unlimited":"$".concat((0,f.pw)(eS.max_budget,4))]}),eS.budget_duration&&(0,s.jsxs)(r.xv,{className:"text-gray-500",children:["Reset: ",eS.budget_duration]}),(0,s.jsx)("br",{}),eS.team_member_budget_table&&(0,s.jsxs)(r.xv,{className:"text-gray-500",children:["Team Member Budget: $",(0,f.pw)(eS.team_member_budget_table.max_budget,4)]})]})]}),(0,s.jsxs)(r.Zb,{children:[(0,s.jsx)(r.xv,{children:"Rate Limits"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(r.xv,{children:["TPM: ",eS.tpm_limit||"Unlimited"]}),(0,s.jsxs)(r.xv,{children:["RPM: ",eS.rpm_limit||"Unlimited"]}),eS.max_parallel_requests&&(0,s.jsxs)(r.xv,{children:["Max Parallel Requests: ",eS.max_parallel_requests]})]})]}),(0,s.jsxs)(r.Zb,{children:[(0,s.jsx)(r.xv,{children:"Models"}),(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===eS.models.length?(0,s.jsx)(r.Ct,{color:"red",children:"All proxy models"}):eS.models.map((e,t)=>(0,s.jsx)(r.Ct,{color:"red",children:e},t))})]}),(0,s.jsxs)(r.Zb,{children:[(0,s.jsx)(r.xv,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(r.xv,{children:["User Keys: ",ei.keys.filter(e=>e.user_id).length]}),(0,s.jsxs)(r.xv,{children:["Service Account Keys: ",ei.keys.filter(e=>!e.user_id).length]}),(0,s.jsxs)(r.xv,{className:"text-gray-500",children:["Total: ",ei.keys.length]})]})]}),(0,s.jsx)(V.Z,{objectPermission:eS.object_permission,variant:"card",accessToken:T}),(0,s.jsx)(J.Z,{loggingConfigs:(null===(t=eS.metadata)||void 0===t?void 0:t.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,s.jsx)(r.x4,{children:(0,s.jsx)(Z,{teamData:ei,canEditTeam:ey,handleMemberDelete:eM,setSelectedEditMember:eu,setIsEditMemberModalVisible:eo,setIsAddMemberModalVisible:en})}),ey&&(0,s.jsx)(r.x4,{children:(0,s.jsx)(E,{teamId:w,accessToken:T,canEditTeam:ey})}),(0,s.jsx)(r.x4,{children:(0,s.jsxs)(r.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(r.Dx,{children:"Team Settings"}),ey&&!ex&&(0,s.jsx)(r.zx,{onClick:()=>eh(!0),children:"Edit Settings"})]}),ex?(0,s.jsxs)(z.Z,{form:em,onFinish:eT,initialValues:{...eS,team_alias:eS.team_alias,models:eS.models,tpm_limit:eS.tpm_limit,rpm_limit:eS.rpm_limit,max_budget:eS.max_budget,budget_duration:eS.budget_duration,team_member_tpm_limit:null===(i=eS.team_member_budget_table)||void 0===i?void 0:i.tpm_limit,team_member_rpm_limit:null===(n=eS.team_member_budget_table)||void 0===n?void 0:n.rpm_limit,guardrails:(null===(m=eS.metadata)||void 0===m?void 0:m.guardrails)||[],metadata:eS.metadata?JSON.stringify((e=>{let{logging:t,...i}=e;return i})(eS.metadata),null,2):"",logging_settings:(null===(d=eS.metadata)||void 0===d?void 0:d.logging)||[],organization_id:eS.organization_id,vector_stores:(null===(o=eS.object_permission)||void 0===o?void 0:o.vector_stores)||[],mcp_servers:(null===(c=eS.object_permission)||void 0===c?void 0:c.mcp_servers)||[],mcp_access_groups:(null===(u=eS.object_permission)||void 0===u?void 0:u.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(x=eS.object_permission)||void 0===x?void 0:x.mcp_servers)||[],accessGroups:(null===(h=eS.object_permission)||void 0===h?void 0:h.mcp_access_groups)||[]},mcp_tool_permissions:(null===(_=eS.object_permission)||void 0===_?void 0:_.mcp_tool_permissions)||{}},layout:"vertical",children:[(0,s.jsx)(z.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,s.jsx)(D.default,{type:""})}),(0,s.jsx)(z.Z.Item,{label:"Models",name:"models",children:(0,s.jsxs)(F.default,{mode:"multiple",placeholder:"Select models",children:[(0,s.jsx)(F.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Array.from(new Set(L)).map((e,t)=>(0,s.jsx)(F.default.Option,{value:e,children:(0,O.W0)(e)},t))]})}),(0,s.jsx)(z.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,s.jsx)(a.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,s.jsx)(a.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,s.jsx)(r.oi,{placeholder:"e.g., 30d"})}),(0,s.jsx)(z.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"Default tokens per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,s.jsx)(a.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,s.jsx)(z.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"Default requests per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,s.jsx)(a.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})}),(0,s.jsx)(z.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,s.jsxs)(F.default,{placeholder:"n/a",children:[(0,s.jsx)(F.default.Option,{value:"24h",children:"daily"}),(0,s.jsx)(F.default.Option,{value:"7d",children:"weekly"}),(0,s.jsx)(F.default.Option,{value:"30d",children:"monthly"})]})}),(0,s.jsx)(z.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,s.jsx)(a.Z,{step:1,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,s.jsx)(a.Z,{step:1,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(b.Z,{title:"Setup your first guardrail",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,s.jsx)(F.default,{mode:"tags",placeholder:"Select or enter guardrails",options:ef.map(e=>({value:e,label:e}))})}),(0,s.jsx)(z.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,s.jsx)(q.Z,{onChange:e=>em.setFieldValue("vector_stores",e),value:em.getFieldValue("vector_stores"),accessToken:T||"",placeholder:"Select vector stores"})}),(0,s.jsx)(z.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,s.jsx)(X.Z,{onChange:e=>em.setFieldValue("allowed_passthrough_routes",e),value:em.getFieldValue("allowed_passthrough_routes"),accessToken:T||"",placeholder:"Select pass through routes"})}),(0,s.jsx)(z.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,s.jsx)(K.Z,{onChange:e=>em.setFieldValue("mcp_servers_and_groups",e),value:em.getFieldValue("mcp_servers_and_groups"),accessToken:T||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,s.jsx)(z.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,s.jsx)(D.default,{type:"hidden"})}),(0,s.jsx)(z.Z.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.mcp_servers_and_groups!==t.mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>{var e;return(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsx)(G.Z,{accessToken:T||"",selectedServers:(null===(e=em.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:em.getFieldValue("mcp_tool_permissions")||{},onChange:e=>em.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,s.jsx)(z.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,s.jsx)(D.default,{type:""})}),(0,s.jsx)(z.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,s.jsx)($.Z,{value:em.getFieldValue("logging_settings"),onChange:e=>em.setFieldValue("logging_settings",e)})}),(0,s.jsx)(z.Z.Item,{label:"Metadata",name:"metadata",children:(0,s.jsx)(D.default.TextArea,{rows:10})}),(0,s.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,s.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,s.jsx)(N.ZP,{htmlType:"button",onClick:()=>eh(!1),children:"Cancel"}),(0,s.jsx)(r.zx,{type:"submit",children:"Save Changes"})]})})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(r.xv,{className:"font-medium",children:"Team Name"}),(0,s.jsx)("div",{children:eS.team_alias})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(r.xv,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"font-mono",children:eS.team_id})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(r.xv,{className:"font-medium",children:"Created At"}),(0,s.jsx)("div",{children:new Date(eS.created_at).toLocaleString()})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(r.xv,{className:"font-medium",children:"Models"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:eS.models.map((e,t)=>(0,s.jsx)(r.Ct,{color:"red",children:e},t))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(r.xv,{className:"font-medium",children:"Rate Limits"}),(0,s.jsxs)("div",{children:["TPM: ",eS.tpm_limit||"Unlimited"]}),(0,s.jsxs)("div",{children:["RPM: ",eS.rpm_limit||"Unlimited"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(r.xv,{className:"font-medium",children:"Team Budget"}),(0,s.jsxs)("div",{children:["Max Budget:"," ",null!==eS.max_budget?"$".concat((0,f.pw)(eS.max_budget,4)):"No Limit"]}),(0,s.jsxs)("div",{children:["Budget Reset: ",eS.budget_duration||"Never"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(r.xv,{className:"font-medium",children:["Team Member Settings"," ",(0,s.jsx)(b.Z,{title:"These are limits on individual team members",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),(0,s.jsxs)("div",{children:["Max Budget: ",(null===(g=eS.team_member_budget_table)||void 0===g?void 0:g.max_budget)||"No Limit"]}),(0,s.jsxs)("div",{children:["Key Duration: ",(null===(v=eS.metadata)||void 0===v?void 0:v.team_member_key_duration)||"No Limit"]}),(0,s.jsxs)("div",{children:["TPM Limit: ",(null===(j=eS.team_member_budget_table)||void 0===j?void 0:j.tpm_limit)||"No Limit"]}),(0,s.jsxs)("div",{children:["RPM Limit: ",(null===(y=eS.team_member_budget_table)||void 0===y?void 0:y.rpm_limit)||"No Limit"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(r.xv,{className:"font-medium",children:"Organization ID"}),(0,s.jsx)("div",{children:eS.organization_id})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(r.xv,{className:"font-medium",children:"Status"}),(0,s.jsx)(r.Ct,{color:eS.blocked?"red":"green",children:eS.blocked?"Blocked":"Active"})]}),(0,s.jsx)(V.Z,{objectPermission:eS.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:T}),(0,s.jsx)(J.Z,{loggingConfigs:(null===(k=eS.metadata)||void 0===k?void 0:k.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,s.jsx)(R.Z,{visible:ed,onCancel:()=>eo(!1),onSubmit:ew,initialData:ec,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}],additionalFields:[{name:"max_budget_in_team",label:(0,s.jsxs)("span",{children:["Team Member Budget (USD)"," ",(0,s.jsx)(b.Z,{title:"Maximum amount in USD this member can spend within this team. This is separate from any global user budget limits",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:.01,min:0,placeholder:"Budget limit for this member within this team"},{name:"tpm_limit",label:(0,s.jsxs)("span",{children:["Team Member TPM Limit"," ",(0,s.jsx)(b.Z,{title:"Maximum tokens per minute this member can use within this team. This is separate from any global user TPM limit",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Tokens per minute limit for this member in this team"},{name:"rpm_limit",label:(0,s.jsxs)("span",{children:["Team Member RPM Limit"," ",(0,s.jsx)(b.Z,{title:"Maximum requests per minute this member can make within this team. This is separate from any global user RPM limit",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"}]}}),(0,s.jsx)(U.Z,{isVisible:er,onCancel:()=>en(!1),onSubmit:ek,accessToken:T})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2012-90188715a5858c8c.js b/litellm/proxy/_experimental/out/_next/static/chunks/2012-90188715a5858c8c.js deleted file mode 100644 index 3e83fbe886..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2012-90188715a5858c8c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2012],{26210:function(e,t,i){i.d(t,{UQ:function(){return s.Z},X1:function(){return l.Z},_m:function(){return r.Z},oi:function(){return n.Z},xv:function(){return a.Z}});var s=i(87452),l=i(88829),r=i(72208),a=i(84264),n=i(49566)},30078:function(e,t,i){i.d(t,{Ct:function(){return s.Z},Dx:function(){return h.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return c.Z},oi:function(){return x.Z},rj:function(){return a.Z},td:function(){return d.Z},v0:function(){return m.Z},x4:function(){return o.Z},xv:function(){return u.Z},zx:function(){return l.Z}});var s=i(41649),l=i(20831),r=i(12514),a=i(67101),n=i(12485),m=i(18135),d=i(35242),o=i(29706),c=i(77991),u=i(84264),x=i(49566),h=i(96761)},62490:function(e,t,i){i.d(t,{Ct:function(){return s.Z},RM:function(){return n.Z},SC:function(){return c.Z},Zb:function(){return r.Z},iA:function(){return a.Z},pj:function(){return m.Z},ss:function(){return d.Z},xs:function(){return o.Z},xv:function(){return u.Z},zx:function(){return l.Z}});var s=i(41649),l=i(20831),r=i(12514),a=i(21626),n=i(97214),m=i(28241),d=i(58834),o=i(69552),c=i(71876),u=i(84264)},11318:function(e,t,i){i.d(t,{Z:function(){return n}});var s=i(2265),l=i(39760),r=i(19250);let a=async(e,t,i,s)=>"Admin"!=i&&"Admin Viewer"!=i?await (0,r.teamListCall)(e,(null==s?void 0:s.organization_id)||null,t):await (0,r.teamListCall)(e,(null==s?void 0:s.organization_id)||null);var n=()=>{let[e,t]=(0,s.useState)([]),{accessToken:i,userId:r,userRole:n}=(0,l.Z)();return(0,s.useEffect)(()=>{(async()=>{t(await a(i,r,n,null))})()},[i,r,n]),{teams:e,setTeams:t}}},33293:function(e,t,i){i.d(t,{Z:function(){return X}});var s=i(57437),l=i(2265),r=i(24199),a=i(30078),n=i(20831),m=i(12514),d=i(47323),o=i(21626),c=i(97214),u=i(28241),x=i(58834),h=i(69552),_=i(71876),g=i(84264),p=i(15424),b=i(89970),v=i(53410),j=i(74998),f=i(59872),Z=e=>{let{teamData:t,canEditTeam:i,handleMemberDelete:l,setSelectedEditMember:r,setIsEditMemberModalVisible:a,setIsAddMemberModalVisible:Z}=e,y=e=>{if(null==e)return"0";if("number"==typeof e){let t=Number(e);return t===Math.floor(t)?t.toString():(0,f.pw)(t,8).replace(/\.?0+$/,"")}return"0"},N=e=>{if(!e)return 0;let i=t.team_memberships.find(t=>t.user_id===e);return(null==i?void 0:i.spend)||0},k=e=>{var i;if(!e)return null;let s=t.team_memberships.find(t=>t.user_id===e);console.log("membership=".concat(s));let l=null==s?void 0:null===(i=s.litellm_budget_table)||void 0===i?void 0:i.max_budget;return null==l?null:y(l)},w=e=>{var i,s;if(!e)return"No Limits";let l=t.team_memberships.find(t=>t.user_id===e),r=null==l?void 0:null===(i=l.litellm_budget_table)||void 0===i?void 0:i.rpm_limit,a=null==l?void 0:null===(s=l.litellm_budget_table)||void 0===s?void 0:s.tpm_limit,n=[r?"".concat(y(r)," RPM"):null,a?"".concat(y(a)," TPM"):null].filter(Boolean);return n.length>0?n.join(" / "):"No Limits"};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(m.Z,{className:"w-full mx-auto flex-auto overflow-auto max-h-[50vh]",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(o.Z,{className:"min-w-full",children:[(0,s.jsx)(x.Z,{children:(0,s.jsxs)(_.Z,{children:[(0,s.jsx)(h.Z,{children:"User ID"}),(0,s.jsx)(h.Z,{children:"User Email"}),(0,s.jsx)(h.Z,{children:"Role"}),(0,s.jsxs)(h.Z,{children:["Team Member Spend (USD)"," ",(0,s.jsx)(b.Z,{title:"This is the amount spent by a user in the team.",children:(0,s.jsx)(p.Z,{})})]}),(0,s.jsx)(h.Z,{children:"Team Member Budget (USD)"}),(0,s.jsxs)(h.Z,{children:["Team Member Rate Limits"," ",(0,s.jsx)(b.Z,{title:"Rate limits for this member's usage within this team.",children:(0,s.jsx)(p.Z,{})})]}),(0,s.jsx)(h.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:"Actions"})]})}),(0,s.jsx)(c.Z,{children:t.team_info.members_with_roles.map((e,n)=>(0,s.jsxs)(_.Z,{children:[(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:e.user_id})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:e.role})}),(0,s.jsx)(u.Z,{children:(0,s.jsxs)(g.Z,{className:"font-mono",children:["$",(0,f.pw)(N(e.user_id),4)]})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:k(e.user_id)?"$".concat((0,f.pw)(Number(k(e.user_id)),4)):"No Limit"})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)(g.Z,{className:"font-mono",children:w(e.user_id)})}),(0,s.jsx)(u.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:i&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Z,{icon:v.Z,size:"sm",onClick:()=>{var i,s,l;let n=t.team_memberships.find(t=>t.user_id===e.user_id);r({...e,max_budget_in_team:(null==n?void 0:null===(i=n.litellm_budget_table)||void 0===i?void 0:i.max_budget)||null,tpm_limit:(null==n?void 0:null===(s=n.litellm_budget_table)||void 0===s?void 0:s.tpm_limit)||null,rpm_limit:(null==n?void 0:null===(l=n.litellm_budget_table)||void 0===l?void 0:l.rpm_limit)||null}),a(!0)},className:"cursor-pointer hover:text-blue-600"}),(0,s.jsx)(d.Z,{icon:j.Z,size:"sm",onClick:()=>l(e),className:"cursor-pointer hover:text-red-600"})]})})]},n))})]})})}),(0,s.jsx)(n.Z,{onClick:()=>Z(!0),children:"Add Member"})]})},y=i(96761),N=i(73002),k=i(61994),w=i(85180),M=i(89245),T=i(78355),S=i(19250);let C={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team"},P=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",L=e=>{let t=P(e),i=C[e];if(!i){for(let[t,s]of Object.entries(C))if(e.includes(t)){i=s;break}}return i||(i="Access ".concat(e)),{method:t,endpoint:e,description:i,route:e}};var I=i(9114),E=e=>{let{teamId:t,accessToken:i,canEditTeam:r}=e,[a,d]=(0,l.useState)([]),[p,b]=(0,l.useState)([]),[v,j]=(0,l.useState)(!0),[f,Z]=(0,l.useState)(!1),[C,P]=(0,l.useState)(!1),E=async()=>{try{if(j(!0),!i)return;let e=await (0,S.getTeamPermissionsCall)(i,t),s=e.all_available_permissions||[];d(s);let l=e.team_member_permissions||[];b(l),P(!1)}catch(e){I.Z.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{j(!1)}};(0,l.useEffect)(()=>{E()},[t,i]);let z=(e,t)=>{b(t?[...p,e]:p.filter(t=>t!==e)),P(!0)},D=async()=>{try{if(!i)return;Z(!0),await (0,S.teamPermissionsUpdateCall)(i,t,p),I.Z.success("Permissions updated successfully"),P(!1)}catch(e){I.Z.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{Z(!1)}};if(v)return(0,s.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let A=a.length>0;return(0,s.jsxs)(m.Z,{className:"bg-white shadow-md rounded-md p-6",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,s.jsx)(y.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),r&&C&&(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)(N.ZP,{icon:(0,s.jsx)(M.Z,{}),onClick:()=>{E()},children:"Reset"}),(0,s.jsxs)(n.Z,{onClick:D,loading:f,className:"flex items-center gap-2",children:[(0,s.jsx)(T.Z,{})," Save Changes"]})]})]}),(0,s.jsx)(g.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),A?(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(o.Z,{className:" min-w-full",children:[(0,s.jsx)(x.Z,{children:(0,s.jsxs)(_.Z,{children:[(0,s.jsx)(h.Z,{children:"Method"}),(0,s.jsx)(h.Z,{children:"Endpoint"}),(0,s.jsx)(h.Z,{children:"Description"}),(0,s.jsx)(h.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:"Allow Access"})]})}),(0,s.jsx)(c.Z,{children:a.map(e=>{let t=L(e);return(0,s.jsxs)(_.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,s.jsx)(u.Z,{children:(0,s.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===t.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:t.method})}),(0,s.jsx)(u.Z,{children:(0,s.jsx)("span",{className:"font-mono text-sm text-gray-800",children:t.endpoint})}),(0,s.jsx)(u.Z,{className:"text-gray-700",children:t.description}),(0,s.jsx)(u.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,s.jsx)(k.Z,{checked:p.includes(e),onChange:t=>z(e,t.target.checked),disabled:!r})})]},e)})})]})}):(0,s.jsx)("div",{className:"py-12",children:(0,s.jsx)(w.Z,{description:"No permissions available"})})]})},z=i(13634),D=i(42264),A=i(64482),B=i(52787),U=i(10900),F=i(10901),O=i(33860),R=i(46468),V=i(98015),q=i(97415),K=i(95920),G=i(68473),$=i(21425),J=i(27799),Q=i(30401),W=i(78867),X=e=>{var t,i,n,m,d,o,c,u,x,h,_,g,v,j,y,k;let{teamId:w,onClose:M,accessToken:T,is_team_admin:C,is_proxy_admin:P,userModels:L,editTeam:X,premiumUser:H=!1,onUpdate:Y}=e,[ee,et]=(0,l.useState)(null),[ei,es]=(0,l.useState)(!0),[el,er]=(0,l.useState)(!1),[ea]=z.Z.useForm(),[en,em]=(0,l.useState)(!1),[ed,eo]=(0,l.useState)(null),[ec,eu]=(0,l.useState)(!1),[ex,eh]=(0,l.useState)([]),[e_,eg]=(0,l.useState)(!1),[ep,eb]=(0,l.useState)({}),[ev,ej]=(0,l.useState)([]);console.log("userModels in team info",L);let ef=C||P,eZ=async()=>{try{if(es(!0),!T)return;let e=await (0,S.teamInfoCall)(T,w);et(e)}catch(e){I.Z.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{es(!1)}};(0,l.useEffect)(()=>{eZ()},[w,T]),(0,l.useEffect)(()=>{(async()=>{try{if(!T)return;let e=(await (0,S.getGuardrailsList)(T)).guardrails.map(e=>e.guardrail_name);ej(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[T]);let ey=async e=>{try{if(null==T)return;let t={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,S.teamMemberAddCall)(T,w,t),I.Z.success("Team member added successfully"),er(!1),ea.resetFields();let i=await (0,S.teamInfoCall)(T,w);et(i),Y(i)}catch(l){var t,i,s;let e="Failed to add team member";(null==l?void 0:null===(s=l.raw)||void 0===s?void 0:null===(i=s.detail)||void 0===i?void 0:null===(t=i.error)||void 0===t?void 0:t.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==l?void 0:l.message)&&(e=l.message),I.Z.fromBackend(e),console.error("Error adding team member:",l)}},eN=async e=>{try{if(null==T)return;let t={user_email:e.user_email,user_id:e.user_id,role:e.role,max_budget_in_team:e.max_budget_in_team,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit};console.log("Updating member with values:",t),D.ZP.destroy(),await (0,S.teamMemberUpdateCall)(T,w,t),I.Z.success("Team member updated successfully"),em(!1);let i=await (0,S.teamInfoCall)(T,w);et(i),Y(i)}catch(s){var t,i;let e="Failed to update team member";(null==s?void 0:null===(i=s.raw)||void 0===i?void 0:null===(t=i.detail)||void 0===t?void 0:t.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==s?void 0:s.message)&&(e=s.message),em(!1),D.ZP.destroy(),I.Z.fromBackend(e),console.error("Error updating team member:",s)}},ek=async e=>{try{if(null==T)return;await (0,S.teamMemberDeleteCall)(T,w,e),I.Z.success("Team member removed successfully");let t=await (0,S.teamInfoCall)(T,w);et(t),Y(t)}catch(e){I.Z.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}},ew=async e=>{try{if(!T)return;let t={};try{t=e.metadata?JSON.parse(e.metadata):{}}catch(e){I.Z.fromBackend("Invalid JSON in metadata field");return}let i=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,s={team_id:w,team_alias:e.team_alias,models:e.models,tpm_limit:i(e.tpm_limit),rpm_limit:i(e.rpm_limit),max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...t,guardrails:e.guardrails||[],logging:e.logging_settings||[]},organization_id:e.organization_id};void 0!==e.team_member_budget&&(s.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(s.team_member_key_duration=e.team_member_key_duration),(void 0!==e.team_member_tpm_limit||void 0!==e.team_member_rpm_limit)&&(s.team_member_tpm_limit=i(e.team_member_tpm_limit),s.team_member_rpm_limit=i(e.team_member_rpm_limit));let{servers:l,accessGroups:r}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]},a=e.mcp_tool_permissions||{};(l&&l.length>0||r&&r.length>0||Object.keys(a).length>0)&&(s.object_permission={},l&&l.length>0&&(s.object_permission.mcp_servers=l),r&&r.length>0&&(s.object_permission.mcp_access_groups=r),Object.keys(a).length>0&&(s.object_permission.mcp_tool_permissions=a)),delete e.mcp_servers_and_groups,delete e.mcp_tool_permissions,await (0,S.teamUpdateCall)(T,s),I.Z.success("Team settings updated successfully"),eu(!1),eZ()}catch(e){console.error("Error updating team:",e)}};if(ei)return(0,s.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==ee?void 0:ee.team_info))return(0,s.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:eM}=ee,eT=async(e,t)=>{await (0,f.vQ)(e)&&(eb(e=>({...e,[t]:!0})),setTimeout(()=>{eb(e=>({...e,[t]:!1}))},2e3))};return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(a.zx,{icon:U.Z,variant:"light",onClick:M,className:"mb-4",children:"Back to Teams"}),(0,s.jsx)(a.Dx,{children:eM.team_alias}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsx)(a.xv,{className:"text-gray-500 font-mono",children:eM.team_id}),(0,s.jsx)(N.ZP,{type:"text",size:"small",icon:ep["team-id"]?(0,s.jsx)(Q.Z,{size:12}):(0,s.jsx)(W.Z,{size:12}),onClick:()=>eT(eM.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(ep["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,s.jsxs)(a.v0,{defaultIndex:X?3:0,children:[(0,s.jsx)(a.td,{className:"mb-4",children:[(0,s.jsx)(a.OK,{children:"Overview"},"overview"),...ef?[(0,s.jsx)(a.OK,{children:"Members"},"members"),(0,s.jsx)(a.OK,{children:"Member Permissions"},"member-permissions"),(0,s.jsx)(a.OK,{children:"Settings"},"settings")]:[]]}),(0,s.jsxs)(a.nP,{children:[(0,s.jsx)(a.x4,{children:(0,s.jsxs)(a.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(a.Zb,{children:[(0,s.jsx)(a.xv,{children:"Budget Status"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(a.Dx,{children:["$",(0,f.pw)(eM.spend,4)]}),(0,s.jsxs)(a.xv,{children:["of ",null===eM.max_budget?"Unlimited":"$".concat((0,f.pw)(eM.max_budget,4))]}),eM.budget_duration&&(0,s.jsxs)(a.xv,{className:"text-gray-500",children:["Reset: ",eM.budget_duration]}),(0,s.jsx)("br",{}),eM.team_member_budget_table&&(0,s.jsxs)(a.xv,{className:"text-gray-500",children:["Team Member Budget: $",(0,f.pw)(eM.team_member_budget_table.max_budget,4)]})]})]}),(0,s.jsxs)(a.Zb,{children:[(0,s.jsx)(a.xv,{children:"Rate Limits"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(a.xv,{children:["TPM: ",eM.tpm_limit||"Unlimited"]}),(0,s.jsxs)(a.xv,{children:["RPM: ",eM.rpm_limit||"Unlimited"]}),eM.max_parallel_requests&&(0,s.jsxs)(a.xv,{children:["Max Parallel Requests: ",eM.max_parallel_requests]})]})]}),(0,s.jsxs)(a.Zb,{children:[(0,s.jsx)(a.xv,{children:"Models"}),(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===eM.models.length?(0,s.jsx)(a.Ct,{color:"red",children:"All proxy models"}):eM.models.map((e,t)=>(0,s.jsx)(a.Ct,{color:"red",children:e},t))})]}),(0,s.jsxs)(a.Zb,{children:[(0,s.jsx)(a.xv,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(a.xv,{children:["User Keys: ",ee.keys.filter(e=>e.user_id).length]}),(0,s.jsxs)(a.xv,{children:["Service Account Keys: ",ee.keys.filter(e=>!e.user_id).length]}),(0,s.jsxs)(a.xv,{className:"text-gray-500",children:["Total: ",ee.keys.length]})]})]}),(0,s.jsx)(V.Z,{objectPermission:eM.object_permission,variant:"card",accessToken:T}),(0,s.jsx)(J.Z,{loggingConfigs:(null===(t=eM.metadata)||void 0===t?void 0:t.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,s.jsx)(a.x4,{children:(0,s.jsx)(Z,{teamData:ee,canEditTeam:ef,handleMemberDelete:ek,setSelectedEditMember:eo,setIsEditMemberModalVisible:em,setIsAddMemberModalVisible:er})}),ef&&(0,s.jsx)(a.x4,{children:(0,s.jsx)(E,{teamId:w,accessToken:T,canEditTeam:ef})}),(0,s.jsx)(a.x4,{children:(0,s.jsxs)(a.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(a.Dx,{children:"Team Settings"}),ef&&!ec&&(0,s.jsx)(a.zx,{onClick:()=>eu(!0),children:"Edit Settings"})]}),ec?(0,s.jsxs)(z.Z,{form:ea,onFinish:ew,initialValues:{...eM,team_alias:eM.team_alias,models:eM.models,tpm_limit:eM.tpm_limit,rpm_limit:eM.rpm_limit,max_budget:eM.max_budget,budget_duration:eM.budget_duration,team_member_tpm_limit:null===(i=eM.team_member_budget_table)||void 0===i?void 0:i.tpm_limit,team_member_rpm_limit:null===(n=eM.team_member_budget_table)||void 0===n?void 0:n.rpm_limit,guardrails:(null===(m=eM.metadata)||void 0===m?void 0:m.guardrails)||[],metadata:eM.metadata?JSON.stringify((e=>{let{logging:t,...i}=e;return i})(eM.metadata),null,2):"",logging_settings:(null===(d=eM.metadata)||void 0===d?void 0:d.logging)||[],organization_id:eM.organization_id,vector_stores:(null===(o=eM.object_permission)||void 0===o?void 0:o.vector_stores)||[],mcp_servers:(null===(c=eM.object_permission)||void 0===c?void 0:c.mcp_servers)||[],mcp_access_groups:(null===(u=eM.object_permission)||void 0===u?void 0:u.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(x=eM.object_permission)||void 0===x?void 0:x.mcp_servers)||[],accessGroups:(null===(h=eM.object_permission)||void 0===h?void 0:h.mcp_access_groups)||[]},mcp_tool_permissions:(null===(_=eM.object_permission)||void 0===_?void 0:_.mcp_tool_permissions)||{}},layout:"vertical",children:[(0,s.jsx)(z.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,s.jsx)(A.default,{type:""})}),(0,s.jsx)(z.Z.Item,{label:"Models",name:"models",children:(0,s.jsxs)(B.default,{mode:"multiple",placeholder:"Select models",children:[(0,s.jsx)(B.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Array.from(new Set(L)).map((e,t)=>(0,s.jsx)(B.default.Option,{value:e,children:(0,R.W0)(e)},t))]})}),(0,s.jsx)(z.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,s.jsx)(r.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,s.jsx)(r.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,s.jsx)(a.oi,{placeholder:"e.g., 30d"})}),(0,s.jsx)(z.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"Default tokens per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,s.jsx)(r.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,s.jsx)(z.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"Default requests per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,s.jsx)(r.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})}),(0,s.jsx)(z.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,s.jsxs)(B.default,{placeholder:"n/a",children:[(0,s.jsx)(B.default.Option,{value:"24h",children:"daily"}),(0,s.jsx)(B.default.Option,{value:"7d",children:"weekly"}),(0,s.jsx)(B.default.Option,{value:"30d",children:"monthly"})]})}),(0,s.jsx)(z.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,s.jsx)(r.Z,{step:1,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,s.jsx)(r.Z,{step:1,style:{width:"100%"}})}),(0,s.jsx)(z.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(b.Z,{title:"Setup your first guardrail",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,s.jsx)(B.default,{mode:"tags",placeholder:"Select or enter guardrails",options:ev.map(e=>({value:e,label:e}))})}),(0,s.jsx)(z.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,s.jsx)(q.Z,{onChange:e=>ea.setFieldValue("vector_stores",e),value:ea.getFieldValue("vector_stores"),accessToken:T||"",placeholder:"Select vector stores"})}),(0,s.jsx)(z.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,s.jsx)(K.Z,{onChange:e=>ea.setFieldValue("mcp_servers_and_groups",e),value:ea.getFieldValue("mcp_servers_and_groups"),accessToken:T||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,s.jsx)(z.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,s.jsx)(A.default,{type:"hidden"})}),(0,s.jsx)(z.Z.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.mcp_servers_and_groups!==t.mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>{var e;return(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsx)(G.Z,{accessToken:T||"",selectedServers:(null===(e=ea.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:ea.getFieldValue("mcp_tool_permissions")||{},onChange:e=>ea.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,s.jsx)(z.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,s.jsx)(A.default,{type:""})}),(0,s.jsx)(z.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,s.jsx)($.Z,{value:ea.getFieldValue("logging_settings"),onChange:e=>ea.setFieldValue("logging_settings",e)})}),(0,s.jsx)(z.Z.Item,{label:"Metadata",name:"metadata",children:(0,s.jsx)(A.default.TextArea,{rows:10})}),(0,s.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,s.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,s.jsx)(N.ZP,{htmlType:"button",onClick:()=>eu(!1),children:"Cancel"}),(0,s.jsx)(a.zx,{type:"submit",children:"Save Changes"})]})})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Team Name"}),(0,s.jsx)("div",{children:eM.team_alias})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"font-mono",children:eM.team_id})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Created At"}),(0,s.jsx)("div",{children:new Date(eM.created_at).toLocaleString()})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Models"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:eM.models.map((e,t)=>(0,s.jsx)(a.Ct,{color:"red",children:e},t))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Rate Limits"}),(0,s.jsxs)("div",{children:["TPM: ",eM.tpm_limit||"Unlimited"]}),(0,s.jsxs)("div",{children:["RPM: ",eM.rpm_limit||"Unlimited"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Team Budget"}),(0,s.jsxs)("div",{children:["Max Budget:"," ",null!==eM.max_budget?"$".concat((0,f.pw)(eM.max_budget,4)):"No Limit"]}),(0,s.jsxs)("div",{children:["Budget Reset: ",eM.budget_duration||"Never"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(a.xv,{className:"font-medium",children:["Team Member Settings"," ",(0,s.jsx)(b.Z,{title:"These are limits on individual team members",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),(0,s.jsxs)("div",{children:["Max Budget: ",(null===(g=eM.team_member_budget_table)||void 0===g?void 0:g.max_budget)||"No Limit"]}),(0,s.jsxs)("div",{children:["Key Duration: ",(null===(v=eM.metadata)||void 0===v?void 0:v.team_member_key_duration)||"No Limit"]}),(0,s.jsxs)("div",{children:["TPM Limit: ",(null===(j=eM.team_member_budget_table)||void 0===j?void 0:j.tpm_limit)||"No Limit"]}),(0,s.jsxs)("div",{children:["RPM Limit: ",(null===(y=eM.team_member_budget_table)||void 0===y?void 0:y.rpm_limit)||"No Limit"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Organization ID"}),(0,s.jsx)("div",{children:eM.organization_id})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.xv,{className:"font-medium",children:"Status"}),(0,s.jsx)(a.Ct,{color:eM.blocked?"red":"green",children:eM.blocked?"Blocked":"Active"})]}),(0,s.jsx)(V.Z,{objectPermission:eM.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:T}),(0,s.jsx)(J.Z,{loggingConfigs:(null===(k=eM.metadata)||void 0===k?void 0:k.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,s.jsx)(F.Z,{visible:en,onCancel:()=>em(!1),onSubmit:eN,initialData:ed,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}],additionalFields:[{name:"max_budget_in_team",label:(0,s.jsxs)("span",{children:["Team Member Budget (USD)"," ",(0,s.jsx)(b.Z,{title:"Maximum amount in USD this member can spend within this team. This is separate from any global user budget limits",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:.01,min:0,placeholder:"Budget limit for this member within this team"},{name:"tpm_limit",label:(0,s.jsxs)("span",{children:["Team Member TPM Limit"," ",(0,s.jsx)(b.Z,{title:"Maximum tokens per minute this member can use within this team. This is separate from any global user TPM limit",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Tokens per minute limit for this member in this team"},{name:"rpm_limit",label:(0,s.jsxs)("span",{children:["Team Member RPM Limit"," ",(0,s.jsx)(b.Z,{title:"Maximum requests per minute this member can make within this team. This is separate from any global user RPM limit",children:(0,s.jsx)(p.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"}]}}),(0,s.jsx)(O.Z,{isVisible:el,onCancel:()=>er(!1),onSubmit:ey,accessToken:T})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2284-4cbc9a7f33eb7c89.js b/litellm/proxy/_experimental/out/_next/static/chunks/2284-4cbc9a7f33eb7c89.js deleted file mode 100644 index c705f26458..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2284-4cbc9a7f33eb7c89.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2284],{61994:function(e,t,n){n.d(t,{Z:function(){return C}});var o=n(2265),a=n(36760),r=n.n(a),c=n(20873),l=n(6694),i=n(34709),s=n(71744),d=n(86586),u=n(64024),p=n(39109);let b=o.createContext(null);var f=n(23159),v=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let h=o.forwardRef((e,t)=>{var n;let{prefixCls:a,className:h,rootClassName:m,children:g,indeterminate:y=!1,style:k,onMouseEnter:C,onMouseLeave:x,skipGroup:O=!1,disabled:w}=e,S=v(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:E,direction:j,checkbox:Z}=o.useContext(s.E_),P=o.useContext(b),{isFormItemInput:N}=o.useContext(p.aM),I=o.useContext(d.Z),z=null!==(n=(null==P?void 0:P.disabled)||w)&&void 0!==n?n:I,B=o.useRef(S.value);o.useEffect(()=>{null==P||P.registerValue(S.value)},[]),o.useEffect(()=>{if(!O)return S.value!==B.current&&(null==P||P.cancelValue(B.current),null==P||P.registerValue(S.value),B.current=S.value),()=>null==P?void 0:P.cancelValue(S.value)},[S.value]);let D=E("checkbox",a),M=(0,u.Z)(D),[R,_,V]=(0,f.ZP)(D,M),W=Object.assign({},S);P&&!O&&(W.onChange=function(){S.onChange&&S.onChange.apply(S,arguments),P.toggleOption&&P.toggleOption({label:g,value:S.value})},W.name=P.name,W.checked=P.value.includes(S.value));let H=r()("".concat(D,"-wrapper"),{["".concat(D,"-rtl")]:"rtl"===j,["".concat(D,"-wrapper-checked")]:W.checked,["".concat(D,"-wrapper-disabled")]:z,["".concat(D,"-wrapper-in-form-item")]:N},null==Z?void 0:Z.className,h,m,V,M,_),L=r()({["".concat(D,"-indeterminate")]:y},i.A,_),T=y?"mixed":void 0;return R(o.createElement(l.Z,{component:"Checkbox",disabled:z},o.createElement("label",{className:H,style:Object.assign(Object.assign({},null==Z?void 0:Z.style),k),onMouseEnter:C,onMouseLeave:x},o.createElement(c.Z,Object.assign({"aria-checked":T},W,{prefixCls:D,className:L,disabled:z,ref:t})),void 0!==g&&o.createElement("span",null,g))))});var m=n(83145),g=n(18694),y=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let k=o.forwardRef((e,t)=>{let{defaultValue:n,children:a,options:c=[],prefixCls:l,className:i,rootClassName:d,style:p,onChange:v}=e,k=y(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:C,direction:x}=o.useContext(s.E_),[O,w]=o.useState(k.value||n||[]),[S,E]=o.useState([]);o.useEffect(()=>{"value"in k&&w(k.value||[])},[k.value]);let j=o.useMemo(()=>c.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[c]),Z=C("checkbox",l),P="".concat(Z,"-group"),N=(0,u.Z)(Z),[I,z,B]=(0,f.ZP)(Z,N),D=(0,g.Z)(k,["value","disabled"]),M=c.length?j.map(e=>o.createElement(h,{prefixCls:Z,key:e.value.toString(),disabled:"disabled"in e?e.disabled:k.disabled,value:e.value,checked:O.includes(e.value),onChange:e.onChange,className:"".concat(P,"-item"),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):a,R={toggleOption:e=>{let t=O.indexOf(e.value),n=(0,m.Z)(O);-1===t?n.push(e.value):n.splice(t,1),"value"in k||w(n),null==v||v(n.filter(e=>S.includes(e)).sort((e,t)=>j.findIndex(t=>t.value===e)-j.findIndex(e=>e.value===t)))},value:O,disabled:k.disabled,name:k.name,registerValue:e=>{E(t=>[].concat((0,m.Z)(t),[e]))},cancelValue:e=>{E(t=>t.filter(t=>t!==e))}},_=r()(P,{["".concat(P,"-rtl")]:"rtl"===x},i,d,B,N,z);return I(o.createElement("div",Object.assign({className:_,style:p},D,{ref:t}),o.createElement(b.Provider,{value:R},M)))});h.Group=k,h.__ANT_CHECKBOX=!0;var C=h},23159:function(e,t,n){n.d(t,{C2:function(){return i}});var o=n(352),a=n(12918),r=n(3104),c=n(80669);let l=e=>{let{checkboxCls:t}=e,n="".concat(t,"-wrapper");return[{["".concat(t,"-group")]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,["> ".concat(e.antCls,"-row")]:{flex:1}}),[n]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},["& + ".concat(n)]:{marginInlineStart:0},["&".concat(n,"-in-form-item")]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Object.assign(Object.assign({},(0,a.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,["&:focus-visible + ".concat(t,"-inner")]:Object.assign({},(0,a.oN)(e))},["".concat(t,"-inner")]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:"".concat((0,o.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:"all ".concat(e.motionDurationSlow),"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:e.calc(e.checkboxSize).div(14).mul(5).equal(),height:e.calc(e.checkboxSize).div(14).mul(8).equal(),border:"".concat((0,o.bf)(e.lineWidthBold)," solid ").concat(e.colorWhite),borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:"all ".concat(e.motionDurationFast," ").concat(e.motionEaseInBack,", opacity ").concat(e.motionDurationFast)}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{["\n ".concat(n,":not(").concat(n,"-disabled),\n ").concat(t,":not(").concat(t,"-disabled)\n ")]:{["&:hover ".concat(t,"-inner")]:{borderColor:e.colorPrimary}},["".concat(n,":not(").concat(n,"-disabled)")]:{["&:hover ".concat(t,"-checked:not(").concat(t,"-disabled) ").concat(t,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},["&:hover ".concat(t,"-checked:not(").concat(t,"-disabled):after")]:{borderColor:e.colorPrimaryHover}}},{["".concat(t,"-checked")]:{["".concat(t,"-inner")]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack," ").concat(e.motionDurationFast)}}},["\n ".concat(n,"-checked:not(").concat(n,"-disabled),\n ").concat(t,"-checked:not(").concat(t,"-disabled)\n ")]:{["&:hover ".concat(t,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{["".concat(t,"-inner")]:{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{["".concat(n,"-disabled")]:{cursor:"not-allowed"},["".concat(t,"-disabled")]:{["&, ".concat(t,"-input")]:{cursor:"not-allowed",pointerEvents:"none"},["".concat(t,"-inner")]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},["&".concat(t,"-indeterminate ").concat(t,"-inner::after")]:{background:e.colorTextDisabled}}}]};function i(e,t){return[l((0,r.TS)(t,{checkboxCls:".".concat(e),checkboxSize:t.controlInteractiveSize}))]}t.ZP=(0,c.I$)("Checkbox",(e,t)=>{let{prefixCls:n}=t;return[i(n,e)]})},20873:function(e,t,n){var o=n(1119),a=n(31686),r=n(11993),c=n(26365),l=n(6989),i=n(36760),s=n.n(i),d=n(50506),u=n(2265),p=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],b=(0,u.forwardRef)(function(e,t){var n,i=e.prefixCls,b=void 0===i?"rc-checkbox":i,f=e.className,v=e.style,h=e.checked,m=e.disabled,g=e.defaultChecked,y=e.type,k=void 0===y?"checkbox":y,C=e.title,x=e.onChange,O=(0,l.Z)(e,p),w=(0,u.useRef)(null),S=(0,d.Z)(void 0!==g&&g,{value:h}),E=(0,c.Z)(S,2),j=E[0],Z=E[1];(0,u.useImperativeHandle)(t,function(){return{focus:function(){var e;null===(e=w.current)||void 0===e||e.focus()},blur:function(){var e;null===(e=w.current)||void 0===e||e.blur()},input:w.current}});var P=s()(b,f,(n={},(0,r.Z)(n,"".concat(b,"-checked"),j),(0,r.Z)(n,"".concat(b,"-disabled"),m),n));return u.createElement("span",{className:P,title:C,style:v},u.createElement("input",(0,o.Z)({},O,{className:"".concat(b,"-input"),ref:w,onChange:function(t){m||("checked"in e||Z(t.target.checked),null==x||x({target:(0,a.Z)((0,a.Z)({},e),{},{type:k,checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t.nativeEvent}))},disabled:m,checked:!!j,type:k})),u.createElement("span",{className:"".concat(b,"-inner")}))});t.Z=b},74998:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});t.Z=a}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2284-6840f6cabd9dbd7e.js b/litellm/proxy/_experimental/out/_next/static/chunks/2284-6840f6cabd9dbd7e.js new file mode 100644 index 0000000000..442d54cdba --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2284-6840f6cabd9dbd7e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2284],{4156:function(e,t,n){n.d(t,{Z:function(){return C}});var o=n(2265),a=n(36760),r=n.n(a),c=n(20873),l=n(6694),i=n(34709),s=n(71744),d=n(86586),u=n(64024),p=n(39109);let b=o.createContext(null);var f=n(23159),v=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let h=o.forwardRef((e,t)=>{var n;let{prefixCls:a,className:h,rootClassName:m,children:g,indeterminate:y=!1,style:k,onMouseEnter:C,onMouseLeave:x,skipGroup:O=!1,disabled:w}=e,S=v(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:E,direction:j,checkbox:Z}=o.useContext(s.E_),P=o.useContext(b),{isFormItemInput:N}=o.useContext(p.aM),I=o.useContext(d.Z),z=null!==(n=(null==P?void 0:P.disabled)||w)&&void 0!==n?n:I,B=o.useRef(S.value);o.useEffect(()=>{null==P||P.registerValue(S.value)},[]),o.useEffect(()=>{if(!O)return S.value!==B.current&&(null==P||P.cancelValue(B.current),null==P||P.registerValue(S.value),B.current=S.value),()=>null==P?void 0:P.cancelValue(S.value)},[S.value]);let D=E("checkbox",a),M=(0,u.Z)(D),[R,_,V]=(0,f.ZP)(D,M),W=Object.assign({},S);P&&!O&&(W.onChange=function(){S.onChange&&S.onChange.apply(S,arguments),P.toggleOption&&P.toggleOption({label:g,value:S.value})},W.name=P.name,W.checked=P.value.includes(S.value));let H=r()("".concat(D,"-wrapper"),{["".concat(D,"-rtl")]:"rtl"===j,["".concat(D,"-wrapper-checked")]:W.checked,["".concat(D,"-wrapper-disabled")]:z,["".concat(D,"-wrapper-in-form-item")]:N},null==Z?void 0:Z.className,h,m,V,M,_),L=r()({["".concat(D,"-indeterminate")]:y},i.A,_),T=y?"mixed":void 0;return R(o.createElement(l.Z,{component:"Checkbox",disabled:z},o.createElement("label",{className:H,style:Object.assign(Object.assign({},null==Z?void 0:Z.style),k),onMouseEnter:C,onMouseLeave:x},o.createElement(c.Z,Object.assign({"aria-checked":T},W,{prefixCls:D,className:L,disabled:z,ref:t})),void 0!==g&&o.createElement("span",null,g))))});var m=n(83145),g=n(18694),y=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let k=o.forwardRef((e,t)=>{let{defaultValue:n,children:a,options:c=[],prefixCls:l,className:i,rootClassName:d,style:p,onChange:v}=e,k=y(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:C,direction:x}=o.useContext(s.E_),[O,w]=o.useState(k.value||n||[]),[S,E]=o.useState([]);o.useEffect(()=>{"value"in k&&w(k.value||[])},[k.value]);let j=o.useMemo(()=>c.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[c]),Z=C("checkbox",l),P="".concat(Z,"-group"),N=(0,u.Z)(Z),[I,z,B]=(0,f.ZP)(Z,N),D=(0,g.Z)(k,["value","disabled"]),M=c.length?j.map(e=>o.createElement(h,{prefixCls:Z,key:e.value.toString(),disabled:"disabled"in e?e.disabled:k.disabled,value:e.value,checked:O.includes(e.value),onChange:e.onChange,className:"".concat(P,"-item"),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):a,R={toggleOption:e=>{let t=O.indexOf(e.value),n=(0,m.Z)(O);-1===t?n.push(e.value):n.splice(t,1),"value"in k||w(n),null==v||v(n.filter(e=>S.includes(e)).sort((e,t)=>j.findIndex(t=>t.value===e)-j.findIndex(e=>e.value===t)))},value:O,disabled:k.disabled,name:k.name,registerValue:e=>{E(t=>[].concat((0,m.Z)(t),[e]))},cancelValue:e=>{E(t=>t.filter(t=>t!==e))}},_=r()(P,{["".concat(P,"-rtl")]:"rtl"===x},i,d,B,N,z);return I(o.createElement("div",Object.assign({className:_,style:p},D,{ref:t}),o.createElement(b.Provider,{value:R},M)))});h.Group=k,h.__ANT_CHECKBOX=!0;var C=h},23159:function(e,t,n){n.d(t,{C2:function(){return i}});var o=n(352),a=n(12918),r=n(3104),c=n(80669);let l=e=>{let{checkboxCls:t}=e,n="".concat(t,"-wrapper");return[{["".concat(t,"-group")]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,["> ".concat(e.antCls,"-row")]:{flex:1}}),[n]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},["& + ".concat(n)]:{marginInlineStart:0},["&".concat(n,"-in-form-item")]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Object.assign(Object.assign({},(0,a.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,["&:focus-visible + ".concat(t,"-inner")]:Object.assign({},(0,a.oN)(e))},["".concat(t,"-inner")]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:"".concat((0,o.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:"all ".concat(e.motionDurationSlow),"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:e.calc(e.checkboxSize).div(14).mul(5).equal(),height:e.calc(e.checkboxSize).div(14).mul(8).equal(),border:"".concat((0,o.bf)(e.lineWidthBold)," solid ").concat(e.colorWhite),borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:"all ".concat(e.motionDurationFast," ").concat(e.motionEaseInBack,", opacity ").concat(e.motionDurationFast)}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{["\n ".concat(n,":not(").concat(n,"-disabled),\n ").concat(t,":not(").concat(t,"-disabled)\n ")]:{["&:hover ".concat(t,"-inner")]:{borderColor:e.colorPrimary}},["".concat(n,":not(").concat(n,"-disabled)")]:{["&:hover ".concat(t,"-checked:not(").concat(t,"-disabled) ").concat(t,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},["&:hover ".concat(t,"-checked:not(").concat(t,"-disabled):after")]:{borderColor:e.colorPrimaryHover}}},{["".concat(t,"-checked")]:{["".concat(t,"-inner")]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack," ").concat(e.motionDurationFast)}}},["\n ".concat(n,"-checked:not(").concat(n,"-disabled),\n ").concat(t,"-checked:not(").concat(t,"-disabled)\n ")]:{["&:hover ".concat(t,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{["".concat(t,"-inner")]:{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{["".concat(n,"-disabled")]:{cursor:"not-allowed"},["".concat(t,"-disabled")]:{["&, ".concat(t,"-input")]:{cursor:"not-allowed",pointerEvents:"none"},["".concat(t,"-inner")]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},["&".concat(t,"-indeterminate ").concat(t,"-inner::after")]:{background:e.colorTextDisabled}}}]};function i(e,t){return[l((0,r.TS)(t,{checkboxCls:".".concat(e),checkboxSize:t.controlInteractiveSize}))]}t.ZP=(0,c.I$)("Checkbox",(e,t)=>{let{prefixCls:n}=t;return[i(n,e)]})},20873:function(e,t,n){var o=n(1119),a=n(31686),r=n(11993),c=n(26365),l=n(6989),i=n(36760),s=n.n(i),d=n(50506),u=n(2265),p=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],b=(0,u.forwardRef)(function(e,t){var n,i=e.prefixCls,b=void 0===i?"rc-checkbox":i,f=e.className,v=e.style,h=e.checked,m=e.disabled,g=e.defaultChecked,y=e.type,k=void 0===y?"checkbox":y,C=e.title,x=e.onChange,O=(0,l.Z)(e,p),w=(0,u.useRef)(null),S=(0,d.Z)(void 0!==g&&g,{value:h}),E=(0,c.Z)(S,2),j=E[0],Z=E[1];(0,u.useImperativeHandle)(t,function(){return{focus:function(){var e;null===(e=w.current)||void 0===e||e.focus()},blur:function(){var e;null===(e=w.current)||void 0===e||e.blur()},input:w.current}});var P=s()(b,f,(n={},(0,r.Z)(n,"".concat(b,"-checked"),j),(0,r.Z)(n,"".concat(b,"-disabled"),m),n));return u.createElement("span",{className:P,title:C,style:v},u.createElement("input",(0,o.Z)({},O,{className:"".concat(b,"-input"),ref:w,onChange:function(t){m||("checked"in e||Z(t.target.checked),null==x||x({target:(0,a.Z)((0,a.Z)({},e),{},{type:k,checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t.nativeEvent}))},disabled:m,checked:!!j,type:k})),u.createElement("span",{className:"".concat(b,"-inner")}))});t.Z=b},74998:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});t.Z=a}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2344-169e12738d6439ab.js b/litellm/proxy/_experimental/out/_next/static/chunks/2344-17c84cab77fa632a.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/2344-169e12738d6439ab.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2344-17c84cab77fa632a.js index 89ac20e063..be8549235c 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2344-169e12738d6439ab.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2344-17c84cab77fa632a.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2344],{40278:function(t,e,n){"use strict";n.d(e,{Z:function(){return j}});var r=n(5853),o=n(7084),i=n(26898),a=n(97324),u=n(1153),c=n(2265),l=n(47625),s=n(93765),f=n(31699),p=n(97059),h=n(62994),d=n(25311),y=(0,s.z)({chartName:"BarChart",GraphicalChild:f.$,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:p.K},{axisType:"yAxis",AxisComp:h.B}],formatAxisMap:d.t9}),v=n(56940),m=n(8147),g=n(22190),b=n(65278),x=n(98593),O=n(69448),w=n(32644);let j=c.forwardRef((t,e)=>{let{data:n=[],categories:s=[],index:d,colors:j=i.s,valueFormatter:S=u.Cj,layout:E="horizontal",stack:k=!1,relative:P=!1,startEndOnly:A=!1,animationDuration:M=900,showAnimation:_=!1,showXAxis:T=!0,showYAxis:C=!0,yAxisWidth:N=56,intervalType:D="equidistantPreserveStart",showTooltip:I=!0,showLegend:L=!0,showGridLines:B=!0,autoMinValue:R=!1,minValue:z,maxValue:U,allowDecimals:F=!0,noDataText:$,onValueChange:q,enableLegendSlider:Z=!1,customTooltip:W,rotateLabelX:G,tickGap:X=5,className:Y}=t,H=(0,r._T)(t,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),V=T||C?20:0,[K,J]=(0,c.useState)(60),Q=(0,w.me)(s,j),[tt,te]=c.useState(void 0),[tn,tr]=(0,c.useState)(void 0),to=!!q;function ti(t,e,n){var r,o,i,a;n.stopPropagation(),q&&((0,w.vZ)(tt,Object.assign(Object.assign({},t.payload),{value:t.value}))?(tr(void 0),te(void 0),null==q||q(null)):(tr(null===(o=null===(r=t.tooltipPayload)||void 0===r?void 0:r[0])||void 0===o?void 0:o.dataKey),te(Object.assign(Object.assign({},t.payload),{value:t.value})),null==q||q(Object.assign({eventType:"bar",categoryClicked:null===(a=null===(i=t.tooltipPayload)||void 0===i?void 0:i[0])||void 0===a?void 0:a.dataKey},t.payload))))}let ta=(0,w.i4)(R,z,U);return c.createElement("div",Object.assign({ref:e,className:(0,a.q)("w-full h-80",Y)},H),c.createElement(l.h,{className:"h-full w-full"},(null==n?void 0:n.length)?c.createElement(y,{data:n,stackOffset:k?"sign":P?"expand":"none",layout:"vertical"===E?"vertical":"horizontal",onClick:to&&(tn||tt)?()=>{te(void 0),tr(void 0),null==q||q(null)}:void 0},B?c.createElement(v.q,{className:(0,a.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==E,vertical:"vertical"===E}):null,"vertical"!==E?c.createElement(p.K,{padding:{left:V,right:V},hide:!T,dataKey:d,interval:A?"preserveStartEnd":D,tick:{transform:"translate(0, 6)"},ticks:A?[n[0][d],n[n.length-1][d]]:void 0,fill:"",stroke:"",className:(0,a.q)("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==G?void 0:G.angle,dy:null==G?void 0:G.verticalShift,height:null==G?void 0:G.xAxisHeight,minTickGap:X}):c.createElement(p.K,{hide:!T,type:"number",tick:{transform:"translate(-3, 0)"},domain:ta,fill:"",stroke:"",className:(0,a.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:S,minTickGap:X,allowDecimals:F,angle:null==G?void 0:G.angle,dy:null==G?void 0:G.verticalShift,height:null==G?void 0:G.xAxisHeight}),"vertical"!==E?c.createElement(h.B,{width:N,hide:!C,axisLine:!1,tickLine:!1,type:"number",domain:ta,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,a.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:P?t=>"".concat((100*t).toString()," %"):S,allowDecimals:F}):c.createElement(h.B,{width:N,hide:!C,dataKey:d,axisLine:!1,tickLine:!1,ticks:A?[n[0][d],n[n.length-1][d]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:(0,a.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),c.createElement(m.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:I?t=>{let{active:e,payload:n,label:r}=t;return W?c.createElement(W,{payload:null==n?void 0:n.map(t=>{var e;return Object.assign(Object.assign({},t),{color:null!==(e=Q.get(t.dataKey))&&void 0!==e?e:o.fr.Gray})}),active:e,label:r}):c.createElement(x.ZP,{active:e,payload:n,label:r,valueFormatter:S,categoryColors:Q})}:c.createElement(c.Fragment,null),position:{y:0}}),L?c.createElement(g.D,{verticalAlign:"top",height:K,content:t=>{let{payload:e}=t;return(0,b.Z)({payload:e},Q,J,tn,to?t=>{to&&(t!==tn||tt?(tr(t),null==q||q({eventType:"category",categoryClicked:t})):(tr(void 0),null==q||q(null)),te(void 0))}:void 0,Z)}}):null,s.map(t=>{var e;return c.createElement(f.$,{className:(0,a.q)((0,u.bM)(null!==(e=Q.get(t))&&void 0!==e?e:o.fr.Gray,i.K.background).fillColor,q?"cursor-pointer":""),key:t,name:t,type:"linear",stackId:k||P?"a":void 0,dataKey:t,fill:"",isAnimationActive:_,animationDuration:M,shape:t=>((t,e,n,r)=>{let{fillOpacity:o,name:i,payload:a,value:u}=t,{x:l,width:s,y:f,height:p}=t;return"horizontal"===r&&p<0?(f+=p,p=Math.abs(p)):"vertical"===r&&s<0&&(l+=s,s=Math.abs(s)),c.createElement("rect",{x:l,y:f,width:s,height:p,opacity:e||n&&n!==i?(0,w.vZ)(e,Object.assign(Object.assign({},a),{value:u}))?o:.3:o})})(t,tt,tn,E),onClick:ti})})):c.createElement(O.Z,{noDataText:$})))});j.displayName="BarChart"},65278:function(t,e,n){"use strict";n.d(e,{Z:function(){return y}});var r=n(2265);let o=(t,e)=>{let[n,o]=(0,r.useState)(e);(0,r.useEffect)(()=>{let e=()=>{o(window.innerWidth),t()};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[t,n])};var i=n(5853),a=n(26898),u=n(97324),c=n(1153);let l=t=>{var e=(0,i._T)(t,[]);return r.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))},s=t=>{var e=(0,i._T)(t,[]);return r.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))},f=(0,c.fn)("Legend"),p=t=>{let{name:e,color:n,onClick:o,activeLegend:i}=t,l=!!o;return r.createElement("li",{className:(0,u.q)(f("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",l?"cursor-pointer":"cursor-default","text-tremor-content",l?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",l?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:t=>{t.stopPropagation(),null==o||o(e,n)}},r.createElement("svg",{className:(0,u.q)("flex-none h-2 w-2 mr-1.5",(0,c.bM)(n,a.K.text).textColor,i&&i!==e?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},r.createElement("circle",{cx:4,cy:4,r:4})),r.createElement("p",{className:(0,u.q)("whitespace-nowrap truncate text-tremor-default","text-tremor-content",l?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",i&&i!==e?"opacity-40":"opacity-100",l?"dark:group-hover:text-dark-tremor-content-emphasis":"")},e))},h=t=>{let{icon:e,onClick:n,disabled:o}=t,[i,a]=r.useState(!1),c=r.useRef(null);return r.useEffect(()=>(i?c.current=setInterval(()=>{null==n||n()},300):clearInterval(c.current),()=>clearInterval(c.current)),[i,n]),(0,r.useEffect)(()=>{o&&(clearInterval(c.current),a(!1))},[o]),r.createElement("button",{type:"button",className:(0,u.q)(f("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:t=>{t.stopPropagation(),null==n||n()},onMouseDown:t=>{t.stopPropagation(),a(!0)},onMouseUp:t=>{t.stopPropagation(),a(!1)}},r.createElement(e,{className:"w-full"}))},d=r.forwardRef((t,e)=>{var n,o;let{categories:c,colors:d=a.s,className:y,onClickLegendItem:v,activeLegend:m,enableLegendSlider:g=!1}=t,b=(0,i._T)(t,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),x=r.useRef(null),[O,w]=r.useState(null),[j,S]=r.useState(null),E=r.useRef(null),k=(0,r.useCallback)(()=>{let t=null==x?void 0:x.current;t&&w({left:t.scrollLeft>0,right:t.scrollWidth-t.clientWidth>t.scrollLeft})},[w]),P=(0,r.useCallback)(t=>{var e;let n=null==x?void 0:x.current,r=null!==(e=null==n?void 0:n.clientWidth)&&void 0!==e?e:0;n&&g&&(n.scrollTo({left:"left"===t?n.scrollLeft-r:n.scrollLeft+r,behavior:"smooth"}),setTimeout(()=>{k()},400))},[g,k]);r.useEffect(()=>{let t=t=>{"ArrowLeft"===t?P("left"):"ArrowRight"===t&&P("right")};return j?(t(j),E.current=setInterval(()=>{t(j)},300)):clearInterval(E.current),()=>clearInterval(E.current)},[j,P]);let A=t=>{t.stopPropagation(),"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),S(t.key))},M=t=>{t.stopPropagation(),S(null)};return r.useEffect(()=>{let t=null==x?void 0:x.current;return g&&(k(),null==t||t.addEventListener("keydown",A),null==t||t.addEventListener("keyup",M)),()=>{null==t||t.removeEventListener("keydown",A),null==t||t.removeEventListener("keyup",M)}},[k,g]),r.createElement("ol",Object.assign({ref:e,className:(0,u.q)(f("root"),"relative overflow-hidden",y)},b),r.createElement("div",{ref:x,tabIndex:0,className:(0,u.q)("h-full flex",g?(null==O?void 0:O.right)||(null==O?void 0:O.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},c.map((t,e)=>r.createElement(p,{key:"item-".concat(e),name:t,color:d[e],onClick:v,activeLegend:m}))),g&&((null==O?void 0:O.right)||(null==O?void 0:O.left))?r.createElement(r.Fragment,null,r.createElement("div",{className:(0,u.q)("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),r.createElement("div",{className:(0,u.q)("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),r.createElement("div",{className:(0,u.q)("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},r.createElement(h,{icon:l,onClick:()=>{S(null),P("left")},disabled:!(null==O?void 0:O.left)}),r.createElement(h,{icon:s,onClick:()=>{S(null),P("right")},disabled:!(null==O?void 0:O.right)}))):null)});d.displayName="Legend";let y=(t,e,n,i,a,u)=>{let{payload:c}=t,l=(0,r.useRef)(null);o(()=>{var t,e;n((e=null===(t=l.current)||void 0===t?void 0:t.clientHeight)?Number(e)+20:60)});let s=c.filter(t=>"none"!==t.type);return r.createElement("div",{ref:l,className:"flex items-center justify-end"},r.createElement(d,{categories:s.map(t=>t.value),colors:s.map(t=>e.get(t.value)),onClickLegendItem:a,activeLegend:i,enableLegendSlider:u}))}},98593:function(t,e,n){"use strict";n.d(e,{$B:function(){return c},ZP:function(){return s},zX:function(){return l}});var r=n(2265),o=n(7084),i=n(26898),a=n(97324),u=n(1153);let c=t=>{let{children:e}=t;return r.createElement("div",{className:(0,a.q)("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},e)},l=t=>{let{value:e,name:n,color:o}=t;return r.createElement("div",{className:"flex items-center justify-between space-x-8"},r.createElement("div",{className:"flex items-center space-x-2"},r.createElement("span",{className:(0,a.q)("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",(0,u.bM)(o,i.K.background).bgColor)}),r.createElement("p",{className:(0,a.q)("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},n)),r.createElement("p",{className:(0,a.q)("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e))},s=t=>{let{active:e,payload:n,label:i,categoryColors:u,valueFormatter:s}=t;if(e&&n){let t=n.filter(t=>"none"!==t.type);return r.createElement(c,null,r.createElement("div",{className:(0,a.q)("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},r.createElement("p",{className:(0,a.q)("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},i)),r.createElement("div",{className:(0,a.q)("px-4 py-2 space-y-1")},t.map((t,e)=>{var n;let{value:i,name:a}=t;return r.createElement(l,{key:"id-".concat(e),value:s(i),name:a,color:null!==(n=u.get(a))&&void 0!==n?n:o.fr.Blue})})))}return null}},69448:function(t,e,n){"use strict";n.d(e,{Z:function(){return p}});var r=n(97324),o=n(2265),i=n(5853);let a=(0,n(1153).fn)("Flex"),u={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},c={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},l={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},s=o.forwardRef((t,e)=>{let{flexDirection:n="row",justifyContent:s="between",alignItems:f="center",children:p,className:h}=t,d=(0,i._T)(t,["flexDirection","justifyContent","alignItems","children","className"]);return o.createElement("div",Object.assign({ref:e,className:(0,r.q)(a("root"),"flex w-full",l[n],u[s],c[f],h)},d),p)});s.displayName="Flex";var f=n(84264);let p=t=>{let{noDataText:e="No data"}=t;return o.createElement(s,{alignItems:"center",justifyContent:"center",className:(0,r.q)("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},o.createElement(f.Z,{className:(0,r.q)("text-tremor-content","dark:text-dark-tremor-content")},e))}},32644:function(t,e,n){"use strict";n.d(e,{FB:function(){return i},i4:function(){return o},me:function(){return r},vZ:function(){return function t(e,n){if(e===n)return!0;if("object"!=typeof e||"object"!=typeof n||null===e||null===n)return!1;let r=Object.keys(e),o=Object.keys(n);if(r.length!==o.length)return!1;for(let i of r)if(!o.includes(i)||!t(e[i],n[i]))return!1;return!0}}});let r=(t,e)=>{let n=new Map;return t.forEach((t,r)=>{n.set(t,e[r])}),n},o=(t,e,n)=>[t?"auto":null!=e?e:0,null!=n?n:"auto"];function i(t,e){let n=[];for(let r of t)if(Object.prototype.hasOwnProperty.call(r,e)&&(n.push(r[e]),n.length>1))return!1;return!0}},97765:function(t,e,n){"use strict";n.d(e,{Z:function(){return c}});var r=n(5853),o=n(26898),i=n(97324),a=n(1153),u=n(2265);let c=u.forwardRef((t,e)=>{let{color:n,children:c,className:l}=t,s=(0,r._T)(t,["color","children","className"]);return u.createElement("p",Object.assign({ref:e,className:(0,i.q)(n?(0,a.bM)(n,o.K.lightText).textColor:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",l)},s),c)});c.displayName="Subtitle"},7656:function(t,e,n){"use strict";function r(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}n.d(e,{Z:function(){return r}})},47869:function(t,e,n){"use strict";function r(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}n.d(e,{Z:function(){return r}})},25721:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(47869),o=n(99735),i=n(7656);function a(t,e){(0,i.Z)(2,arguments);var n=(0,o.Z)(t),a=(0,r.Z)(e);return isNaN(a)?new Date(NaN):(a&&n.setDate(n.getDate()+a),n)}},55463:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(47869),o=n(99735),i=n(7656);function a(t,e){(0,i.Z)(2,arguments);var n=(0,o.Z)(t),a=(0,r.Z)(e);if(isNaN(a))return new Date(NaN);if(!a)return n;var u=n.getDate(),c=new Date(n.getTime());return(c.setMonth(n.getMonth()+a+1,0),u>=c.getDate())?c:(n.setFullYear(c.getFullYear(),c.getMonth(),u),n)}},99735:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(41154),o=n(7656);function i(t){(0,o.Z)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===(0,r.Z)(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):(("string"==typeof t||"[object String]"===e)&&"undefined"!=typeof console&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}},61134:function(t,e,n){var r;!function(o){"use strict";var i,a={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},u=!0,c="[DecimalError] ",l=c+"Invalid argument: ",s=c+"Exponent out of range: ",f=Math.floor,p=Math.pow,h=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d=f(1286742750677284.5),y={};function v(t,e){var n,r,o,i,a,c,l,s,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s||(e=new f(t)),u?k(e,p):e;if(l=t.d,s=e.d,a=t.e,o=e.e,l=l.slice(),i=a-o){for(i<0?(r=l,i=-i,c=s.length):(r=s,o=a,c=l.length),i>(c=(a=Math.ceil(p/7))>c?a+1:c+1)&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((c=l.length)-(i=s.length)<0&&(i=c,r=s,s=l,l=r),n=0;i;)n=(l[--i]=l[i]+s[i]+n)/1e7|0,l[i]%=1e7;for(n&&(l.unshift(n),++o),c=l.length;0==l[--c];)l.pop();return e.d=l,e.e=o,u?k(e,p):e}function m(t,e,n){if(t!==~~t||tn)throw Error(l+t)}function g(t){var e,n,r,o=t.length-1,i="",a=t[0];if(o>0){for(i+=a,e=1;et.e^this.s<0?1:-1;for(e=0,n=(r=this.d.length)<(o=t.d.length)?r:o;et.d[e]^this.s<0?1:-1;return r===o?0:r>o^this.s<0?1:-1},y.decimalPlaces=y.dp=function(){var t=this.d.length-1,e=(t-this.e)*7;if(t=this.d[t])for(;t%10==0;t/=10)e--;return e<0?0:e},y.dividedBy=y.div=function(t){return b(this,new this.constructor(t))},y.dividedToIntegerBy=y.idiv=function(t){var e=this.constructor;return k(b(this,new e(t),0,1),e.precision)},y.equals=y.eq=function(t){return!this.cmp(t)},y.exponent=function(){return O(this)},y.greaterThan=y.gt=function(t){return this.cmp(t)>0},y.greaterThanOrEqualTo=y.gte=function(t){return this.cmp(t)>=0},y.isInteger=y.isint=function(){return this.e>this.d.length-2},y.isNegative=y.isneg=function(){return this.s<0},y.isPositive=y.ispos=function(){return this.s>0},y.isZero=function(){return 0===this.s},y.lessThan=y.lt=function(t){return 0>this.cmp(t)},y.lessThanOrEqualTo=y.lte=function(t){return 1>this.cmp(t)},y.logarithm=y.log=function(t){var e,n=this.constructor,r=n.precision,o=r+5;if(void 0===t)t=new n(10);else if((t=new n(t)).s<1||t.eq(i))throw Error(c+"NaN");if(this.s<1)throw Error(c+(this.s?"NaN":"-Infinity"));return this.eq(i)?new n(0):(u=!1,e=b(S(this,o),S(t,o),o),u=!0,k(e,r))},y.minus=y.sub=function(t){return t=new this.constructor(t),this.s==t.s?P(this,t):v(this,(t.s=-t.s,t))},y.modulo=y.mod=function(t){var e,n=this.constructor,r=n.precision;if(!(t=new n(t)).s)throw Error(c+"NaN");return this.s?(u=!1,e=b(this,t,0,1).times(t),u=!0,this.minus(e)):k(new n(this),r)},y.naturalExponential=y.exp=function(){return x(this)},y.naturalLogarithm=y.ln=function(){return S(this)},y.negated=y.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t},y.plus=y.add=function(t){return t=new this.constructor(t),this.s==t.s?v(this,t):P(this,(t.s=-t.s,t))},y.precision=y.sd=function(t){var e,n,r;if(void 0!==t&&!!t!==t&&1!==t&&0!==t)throw Error(l+t);if(e=O(this)+1,n=7*(r=this.d.length-1)+1,r=this.d[r]){for(;r%10==0;r/=10)n--;for(r=this.d[0];r>=10;r/=10)n++}return t&&e>n?e:n},y.squareRoot=y.sqrt=function(){var t,e,n,r,o,i,a,l=this.constructor;if(this.s<1){if(!this.s)return new l(0);throw Error(c+"NaN")}for(t=O(this),u=!1,0==(o=Math.sqrt(+this))||o==1/0?(((e=g(this.d)).length+t)%2==0&&(e+="0"),o=Math.sqrt(e),t=f((t+1)/2)-(t<0||t%2),r=new l(e=o==1/0?"5e"+t:(e=o.toExponential()).slice(0,e.indexOf("e")+1)+t)):r=new l(o.toString()),o=a=(n=l.precision)+3;;)if(r=(i=r).plus(b(this,i,a+2)).times(.5),g(i.d).slice(0,a)===(e=g(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),o==a&&"4999"==e){if(k(i,n+1,0),i.times(i).eq(this)){r=i;break}}else if("9999"!=e)break;a+=4}return u=!0,k(r,n)},y.times=y.mul=function(t){var e,n,r,o,i,a,c,l,s,f=this.constructor,p=this.d,h=(t=new f(t)).d;if(!this.s||!t.s)return new f(0);for(t.s*=this.s,n=this.e+t.e,(l=p.length)<(s=h.length)&&(i=p,p=h,h=i,a=l,l=s,s=a),i=[],r=a=l+s;r--;)i.push(0);for(r=s;--r>=0;){for(e=0,o=l+r;o>r;)c=i[o]+h[r]*p[o-r-1]+e,i[o--]=c%1e7|0,e=c/1e7|0;i[o]=(i[o]+e)%1e7|0}for(;!i[--a];)i.pop();return e?++n:i.shift(),t.d=i,t.e=n,u?k(t,f.precision):t},y.toDecimalPlaces=y.todp=function(t,e){var n=this,r=n.constructor;return(n=new r(n),void 0===t)?n:(m(t,0,1e9),void 0===e?e=r.rounding:m(e,0,8),k(n,t+O(n)+1,e))},y.toExponential=function(t,e){var n,r=this,o=r.constructor;return void 0===t?n=A(r,!0):(m(t,0,1e9),void 0===e?e=o.rounding:m(e,0,8),n=A(r=k(new o(r),t+1,e),!0,t+1)),n},y.toFixed=function(t,e){var n,r,o=this.constructor;return void 0===t?A(this):(m(t,0,1e9),void 0===e?e=o.rounding:m(e,0,8),n=A((r=k(new o(this),t+O(this)+1,e)).abs(),!1,t+O(r)+1),this.isneg()&&!this.isZero()?"-"+n:n)},y.toInteger=y.toint=function(){var t=this.constructor;return k(new t(this),O(this)+1,t.rounding)},y.toNumber=function(){return+this},y.toPower=y.pow=function(t){var e,n,r,o,a,l,s=this,p=s.constructor,h=+(t=new p(t));if(!t.s)return new p(i);if(!(s=new p(s)).s){if(t.s<1)throw Error(c+"Infinity");return s}if(s.eq(i))return s;if(r=p.precision,t.eq(i))return k(s,r);if(l=(e=t.e)>=(n=t.d.length-1),a=s.s,l){if((n=h<0?-h:h)<=9007199254740991){for(o=new p(i),e=Math.ceil(r/7+4),u=!1;n%2&&M((o=o.times(s)).d,e),0!==(n=f(n/2));)M((s=s.times(s)).d,e);return u=!0,t.s<0?new p(i).div(o):k(o,r)}}else if(a<0)throw Error(c+"NaN");return a=a<0&&1&t.d[Math.max(e,n)]?-1:1,s.s=1,u=!1,o=t.times(S(s,r+12)),u=!0,(o=x(o)).s=a,o},y.toPrecision=function(t,e){var n,r,o=this,i=o.constructor;return void 0===t?(n=O(o),r=A(o,n<=i.toExpNeg||n>=i.toExpPos)):(m(t,1,1e9),void 0===e?e=i.rounding:m(e,0,8),n=O(o=k(new i(o),t,e)),r=A(o,t<=n||n<=i.toExpNeg,t)),r},y.toSignificantDigits=y.tosd=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(m(t,1,1e9),void 0===e?e=n.rounding:m(e,0,8)),k(new n(this),t,e)},y.toString=y.valueOf=y.val=y.toJSON=function(){var t=O(this),e=this.constructor;return A(this,t<=e.toExpNeg||t>=e.toExpPos)};var b=function(){function t(t,e){var n,r=0,o=t.length;for(t=t.slice();o--;)n=t[o]*e+r,t[o]=n%1e7|0,r=n/1e7|0;return r&&t.unshift(r),t}function e(t,e,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;oe[o]?1:-1;break}return i}function n(t,e,n){for(var r=0;n--;)t[n]-=r,r=t[n]1;)t.shift()}return function(r,o,i,a){var u,l,s,f,p,h,d,y,v,m,g,b,x,w,j,S,E,P,A=r.constructor,M=r.s==o.s?1:-1,_=r.d,T=o.d;if(!r.s)return new A(r);if(!o.s)throw Error(c+"Division by zero");for(s=0,l=r.e-o.e,E=T.length,j=_.length,y=(d=new A(M)).d=[];T[s]==(_[s]||0);)++s;if(T[s]>(_[s]||0)&&--l,(b=null==i?i=A.precision:a?i+(O(r)-O(o))+1:i)<0)return new A(0);if(b=b/7+2|0,s=0,1==E)for(f=0,T=T[0],b++;(s1&&(T=t(T,f),_=t(_,f),E=T.length,j=_.length),w=E,m=(v=_.slice(0,E)).length;m=1e7/2&&++S;do f=0,(u=e(T,v,E,m))<0?(g=v[0],E!=m&&(g=1e7*g+(v[1]||0)),(f=g/S|0)>1?(f>=1e7&&(f=1e7-1),h=(p=t(T,f)).length,m=v.length,1==(u=e(p,v,h,m))&&(f--,n(p,E16)throw Error(s+O(t));if(!t.s)return new h(i);for(null==e?(u=!1,c=d):c=e,a=new h(.03125);t.abs().gte(.1);)t=t.times(a),f+=5;for(c+=Math.log(p(2,f))/Math.LN10*2+5|0,n=r=o=new h(i),h.precision=c;;){if(r=k(r.times(t),c),n=n.times(++l),g((a=o.plus(b(r,n,c))).d).slice(0,c)===g(o.d).slice(0,c)){for(;f--;)o=k(o.times(o),c);return h.precision=d,null==e?(u=!0,k(o,d)):o}o=a}}function O(t){for(var e=7*t.e,n=t.d[0];n>=10;n/=10)e++;return e}function w(t,e,n){if(e>t.LN10.sd())throw u=!0,n&&(t.precision=n),Error(c+"LN10 precision limit exceeded");return k(new t(t.LN10),e)}function j(t){for(var e="";t--;)e+="0";return e}function S(t,e){var n,r,o,a,l,s,f,p,h,d=1,y=t,v=y.d,m=y.constructor,x=m.precision;if(y.s<1)throw Error(c+(y.s?"NaN":"-Infinity"));if(y.eq(i))return new m(0);if(null==e?(u=!1,p=x):p=e,y.eq(10))return null==e&&(u=!0),w(m,p);if(p+=10,m.precision=p,r=(n=g(v)).charAt(0),!(15e14>Math.abs(a=O(y))))return f=w(m,p+2,x).times(a+""),y=S(new m(r+"."+n.slice(1)),p-10).plus(f),m.precision=x,null==e?(u=!0,k(y,x)):y;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=g((y=y.times(t)).d)).charAt(0),d++;for(a=O(y),r>1?(y=new m("0."+n),a++):y=new m(r+"."+n.slice(1)),s=l=y=b(y.minus(i),y.plus(i),p),h=k(y.times(y),p),o=3;;){if(l=k(l.times(h),p),g((f=s.plus(b(l,new m(o),p))).d).slice(0,p)===g(s.d).slice(0,p))return s=s.times(2),0!==a&&(s=s.plus(w(m,p+2,x).times(a+""))),s=b(s,new m(d),p),m.precision=x,null==e?(u=!0,k(s,x)):s;s=f,o+=2}}function E(t,e){var n,r,o;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);)++r;for(o=e.length;48===e.charCodeAt(o-1);)--o;if(e=e.slice(r,o)){if(o-=r,n=n-r-1,t.e=f(n/7),t.d=[],r=(n+1)%7,n<0&&(r+=7),rd||t.e<-d))throw Error(s+n)}else t.s=0,t.e=0,t.d=[0];return t}function k(t,e,n){var r,o,i,a,c,l,h,y,v=t.d;for(a=1,i=v[0];i>=10;i/=10)a++;if((r=e-a)<0)r+=7,o=e,h=v[y=0];else{if((y=Math.ceil((r+1)/7))>=(i=v.length))return t;for(a=1,h=i=v[y];i>=10;i/=10)a++;r%=7,o=r-7+a}if(void 0!==n&&(c=h/(i=p(10,a-o-1))%10|0,l=e<0||void 0!==v[y+1]||h%i,l=n<4?(c||l)&&(0==n||n==(t.s<0?3:2)):c>5||5==c&&(4==n||l||6==n&&(r>0?o>0?h/p(10,a-o):0:v[y-1])%10&1||n==(t.s<0?8:7))),e<1||!v[0])return l?(i=O(t),v.length=1,e=e-i-1,v[0]=p(10,(7-e%7)%7),t.e=f(-e/7)||0):(v.length=1,v[0]=t.e=t.s=0),t;if(0==r?(v.length=y,i=1,y--):(v.length=y+1,i=p(10,7-r),v[y]=o>0?(h/p(10,a-o)%p(10,o)|0)*i:0),l)for(;;){if(0==y){1e7==(v[0]+=i)&&(v[0]=1,++t.e);break}if(v[y]+=i,1e7!=v[y])break;v[y--]=0,i=1}for(r=v.length;0===v[--r];)v.pop();if(u&&(t.e>d||t.e<-d))throw Error(s+O(t));return t}function P(t,e){var n,r,o,i,a,c,l,s,f,p,h=t.constructor,d=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),u?k(e,d):e;if(l=t.d,p=e.d,r=e.e,s=t.e,l=l.slice(),a=s-r){for((f=a<0)?(n=l,a=-a,c=p.length):(n=p,r=s,c=l.length),a>(o=Math.max(Math.ceil(d/7),c)+2)&&(a=o,n.length=1),n.reverse(),o=a;o--;)n.push(0);n.reverse()}else{for((f=(o=l.length)<(c=p.length))&&(c=o),o=0;o0;--o)l[c++]=0;for(o=p.length;o>a;){if(l[--o]0?i=i.charAt(0)+"."+i.slice(1)+j(r):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(o<0?"e":"e+")+o):o<0?(i="0."+j(-o-1)+i,n&&(r=n-a)>0&&(i+=j(r))):o>=a?(i+=j(o+1-a),n&&(r=n-o-1)>0&&(i=i+"."+j(r))):((r=o+1)0&&(o+1===a&&(i+="."),i+=j(r))),t.s<0?"-"+i:i}function M(t,e){if(t.length>e)return t.length=e,!0}function _(t){if(!t||"object"!=typeof t)throw Error(c+"Object expected");var e,n,r,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e=o[e+1]&&r<=o[e+2])this[n]=r;else throw Error(l+n+": "+r)}if(void 0!==(r=t[n="LN10"])){if(r==Math.LN10)this[n]=new this(r);else throw Error(l+n+": "+r)}return this}(a=function t(e){var n,r,o;function i(t){if(!(this instanceof i))return new i(t);if(this.constructor=i,t instanceof i){this.s=t.s,this.e=t.e,this.d=(t=t.d)?t.slice():t;return}if("number"==typeof t){if(0*t!=0)throw Error(l+t);if(t>0)this.s=1;else if(t<0)t=-t,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(t===~~t&&t<1e7){this.e=0,this.d=[t];return}return E(this,t.toString())}if("string"!=typeof t)throw Error(l+t);if(45===t.charCodeAt(0)?(t=t.slice(1),this.s=-1):this.s=1,h.test(t))E(this,t);else throw Error(l+t)}if(i.prototype=y,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=t,i.config=i.set=_,void 0===e&&(e={}),e)for(n=0,o=["precision","rounding","toExpNeg","toExpPos","LN10"];n-1}},56883:function(t){t.exports=function(t,e,n){for(var r=-1,o=null==t?0:t.length;++r0&&i(s)?n>1?t(s,n-1,i,a,u):r(u,s):a||(u[u.length]=s)}return u}},63321:function(t,e,n){var r=n(33023)();t.exports=r},98060:function(t,e,n){var r=n(63321),o=n(43228);t.exports=function(t,e){return t&&r(t,e,o)}},92167:function(t,e,n){var r=n(67906),o=n(70235);t.exports=function(t,e){e=r(e,t);for(var n=0,i=e.length;null!=t&&ne}},93012:function(t){t.exports=function(t,e){return null!=t&&e in Object(t)}},47909:function(t,e,n){var r=n(8235),o=n(31953),i=n(35281);t.exports=function(t,e,n){return e==e?i(t,e,n):r(t,o,n)}},90370:function(t,e,n){var r=n(54506),o=n(10303);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},56318:function(t,e,n){var r=n(6791),o=n(10303);t.exports=function t(e,n,i,a,u){return e===n||(null!=e&&null!=n&&(o(e)||o(n))?r(e,n,i,a,t,u):e!=e&&n!=n)}},6791:function(t,e,n){var r=n(85885),o=n(97638),i=n(88030),a=n(64974),u=n(81690),c=n(25614),l=n(98051),s=n(9792),f="[object Arguments]",p="[object Array]",h="[object Object]",d=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,y,v,m){var g=c(t),b=c(e),x=g?p:u(t),O=b?p:u(e);x=x==f?h:x,O=O==f?h:O;var w=x==h,j=O==h,S=x==O;if(S&&l(t)){if(!l(e))return!1;g=!0,w=!1}if(S&&!w)return m||(m=new r),g||s(t)?o(t,e,n,y,v,m):i(t,e,x,n,y,v,m);if(!(1&n)){var E=w&&d.call(t,"__wrapped__"),k=j&&d.call(e,"__wrapped__");if(E||k){var P=E?t.value():t,A=k?e.value():e;return m||(m=new r),v(P,A,n,y,m)}}return!!S&&(m||(m=new r),a(t,e,n,y,v,m))}},62538:function(t,e,n){var r=n(85885),o=n(56318);t.exports=function(t,e,n,i){var a=n.length,u=a,c=!i;if(null==t)return!u;for(t=Object(t);a--;){var l=n[a];if(c&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++ao?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r=200){var y=e?null:u(t);if(y)return c(y);p=!1,s=a,d=new r}else d=e?[]:h;t:for(;++l=o?t:r(t,e,n)}},1536:function(t,e,n){var r=n(78371);t.exports=function(t,e){if(t!==e){var n=void 0!==t,o=null===t,i=t==t,a=r(t),u=void 0!==e,c=null===e,l=e==e,s=r(e);if(!c&&!s&&!a&&t>e||a&&u&&l&&!c&&!s||o&&u&&l||!n&&l||!i)return 1;if(!o&&!a&&!s&&t=c)return l;return l*("desc"==n[o]?-1:1)}}return t.index-e.index}},92077:function(t,e,n){var r=n(74288)["__core-js_shared__"];t.exports=r},97930:function(t,e,n){var r=n(5629);t.exports=function(t,e){return function(n,o){if(null==n)return n;if(!r(n))return t(n,o);for(var i=n.length,a=e?i:-1,u=Object(n);(e?a--:++a-1?u[c?e[l]:l]:void 0}}},35464:function(t,e,n){var r=n(19608),o=n(49639),i=n(175);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&o(e,n,a)&&(n=a=void 0),e=i(e),void 0===n?(n=e,e=0):n=i(n),a=void 0===a?es))return!1;var p=c.get(t),h=c.get(e);if(p&&h)return p==e&&h==t;var d=-1,y=!0,v=2&n?new r:void 0;for(c.set(t,e),c.set(e,t);++d-1&&t%1==0&&t-1}},13368:function(t,e,n){var r=n(24457);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},38764:function(t,e,n){var r=n(9855),o=n(99078),i=n(88675);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},78615:function(t,e,n){var r=n(1507);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},83391:function(t,e,n){var r=n(1507);t.exports=function(t){return r(this,t).get(t)}},53483:function(t,e,n){var r=n(1507);t.exports=function(t){return r(this,t).has(t)}},74724:function(t,e,n){var r=n(1507);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},22523:function(t){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}},47073:function(t){t.exports=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}},23787:function(t,e,n){var r=n(50967);t.exports=function(t){var e=r(t,function(t){return 500===n.size&&n.clear(),t}),n=e.cache;return e}},20453:function(t,e,n){var r=n(39866)(Object,"create");t.exports=r},77184:function(t,e,n){var r=n(45070)(Object.keys,Object);t.exports=r},39931:function(t,e,n){t=n.nmd(t);var r=n(17071),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,u=function(){try{var t=i&&i.require&&i.require("util").types;if(t)return t;return a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=u},45070:function(t){t.exports=function(t,e){return function(n){return t(e(n))}}},49478:function(t,e,n){var r=n(60493),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},84092:function(t,e,n){var r=n(99078);t.exports=function(){this.__data__=new r,this.size=0}},31663:function(t){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},69135:function(t){t.exports=function(t){return this.__data__.get(t)}},39552:function(t){t.exports=function(t){return this.__data__.has(t)}},63960:function(t,e,n){var r=n(99078),o=n(88675),i=n(76219);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},35281:function(t){t.exports=function(t,e,n){for(var r=n-1,o=t.length;++r-1&&t%1==0&&t<=9007199254740991}},82559:function(t,e,n){var r=n(22345);t.exports=function(t){return r(t)&&t!=+t}},77571:function(t){t.exports=function(t){return null==t}},22345:function(t,e,n){var r=n(54506),o=n(10303);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==r(t)}},90231:function(t,e,n){var r=n(54506),o=n(62602),i=n(10303),a=Object.prototype,u=Function.prototype.toString,c=a.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},42715:function(t,e,n){var r=n(54506),o=n(25614),i=n(10303);t.exports=function(t){return"string"==typeof t||!o(t)&&i(t)&&"[object String]"==r(t)}},9792:function(t,e,n){var r=n(59332),o=n(23305),i=n(39931),a=i&&i.isTypedArray,u=a?o(a):r;t.exports=u},43228:function(t,e,n){var r=n(28579),o=n(4578),i=n(5629);t.exports=function(t){return i(t)?r(t):o(t)}},86185:function(t){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},89238:function(t,e,n){var r=n(73819),o=n(88157),i=n(24240),a=n(25614);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},41443:function(t,e,n){var r=n(83023),o=n(98060),i=n(88157);t.exports=function(t,e){var n={};return e=i(e,3),o(t,function(t,o,i){r(n,o,e(t,o,i))}),n}},95645:function(t,e,n){var r=n(67646),o=n(58905),i=n(79586);t.exports=function(t){return t&&t.length?r(t,i,o):void 0}},50967:function(t,e,n){var r=n(76219);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},99008:function(t,e,n){var r=n(67646),o=n(20121),i=n(79586);t.exports=function(t){return t&&t.length?r(t,i,o):void 0}},93810:function(t){t.exports=function(){}},22350:function(t,e,n){var r=n(18155),o=n(73584),i=n(67352),a=n(70235);t.exports=function(t){return i(t)?r(a(t)):o(t)}},99676:function(t,e,n){var r=n(35464)();t.exports=r},33645:function(t,e,n){var r=n(25253),o=n(88157),i=n(12327),a=n(25614),u=n(49639);t.exports=function(t,e,n){var c=a(t)?r:i;return n&&u(t,e,n)&&(e=void 0),c(t,o(e,3))}},34935:function(t,e,n){var r=n(72569),o=n(84046),i=n(44843),a=n(49639),u=i(function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),o(t,r(e,1),[])});t.exports=u},55716:function(t){t.exports=function(){return[]}},7406:function(t){t.exports=function(){return!1}},37065:function(t,e,n){var r=n(7310),o=n(28302);t.exports=function(t,e,n){var i=!0,a=!0;if("function"!=typeof t)throw TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:i,maxWait:e,trailing:a})}},175:function(t,e,n){var r=n(6660),o=1/0;t.exports=function(t){return t?(t=r(t))===o||t===-o?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0}},85759:function(t,e,n){var r=n(175);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},3641:function(t,e,n){var r=n(65020);t.exports=function(t){return null==t?"":r(t)}},47230:function(t,e,n){var r=n(88157),o=n(13826);t.exports=function(t,e){return t&&t.length?o(t,r(e,2)):[]}},75551:function(t,e,n){var r=n(80675)("toUpperCase");t.exports=r},48049:function(t,e,n){"use strict";var r=n(14397);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,i,a){if(a!==r){var u=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},40718:function(t,e,n){t.exports=n(48049)()},14397:function(t){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},13126:function(t,e){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,s=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,d=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),y=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope"),e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},e.isFragment=function(t){return function(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case r:switch(t=t.type){case s:case f:case i:case u:case a:case h:return t;default:switch(t=t&&t.$$typeof){case l:case p:case y:case d:case c:return t;default:return e}}case o:return e}}}(t)===i}},82558:function(t,e,n){"use strict";t.exports=n(13126)},52181:function(t,e,n){"use strict";function r(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=t&&this.setState(t)}function o(t){this.setState((function(e){var n=this.constructor.getDerivedStateFromProps(t,e);return null!=n?n:null}).bind(this))}function i(t,e){try{var n=this.props,r=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(t){var e=t.prototype;if(!e||!e.isReactComponent)throw Error("Can only polyfill class components");if("function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate)return t;var n=null,a=null,u=null;if("function"==typeof e.componentWillMount?n="componentWillMount":"function"==typeof e.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof e.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof e.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof e.componentWillUpdate?u="componentWillUpdate":"function"==typeof e.UNSAFE_componentWillUpdate&&(u="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==u)throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+(t.displayName||t.name)+" uses "+("function"==typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()")+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==u?"\n "+u:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks");if("function"==typeof t.getDerivedStateFromProps&&(e.componentWillMount=r,e.componentWillReceiveProps=o),"function"==typeof e.getSnapshotBeforeUpdate){if("function"!=typeof e.componentDidUpdate)throw Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=i;var c=e.componentDidUpdate;e.componentDidUpdate=function(t,e,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,t,e,r)}}return t}n.r(e),n.d(e,{polyfill:function(){return a}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},59221:function(t,e,n){"use strict";n.d(e,{ZP:function(){return tU},bO:function(){return W}});var r=n(2265),o=n(40718),i=n.n(o),a=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty;function l(t,e){return function(n,r,o){return t(n,r,o)&&e(n,r,o)}}function s(t){return function(e,n,r){if(!e||!n||"object"!=typeof e||"object"!=typeof n)return t(e,n,r);var o=r.cache,i=o.get(e),a=o.get(n);if(i&&a)return i===n&&a===e;o.set(e,n),o.set(n,e);var u=t(e,n,r);return o.delete(e),o.delete(n),u}}function f(t){return a(t).concat(u(t))}var p=Object.hasOwn||function(t,e){return c.call(t,e)};function h(t,e){return t||e?t===e:t===e||t!=t&&e!=e}var d="_owner",y=Object.getOwnPropertyDescriptor,v=Object.keys;function m(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function g(t,e){return h(t.getTime(),e.getTime())}function b(t,e,n){if(t.size!==e.size)return!1;for(var r,o,i={},a=t.entries(),u=0;(r=a.next())&&!r.done;){for(var c=e.entries(),l=!1,s=0;(o=c.next())&&!o.done;){var f=r.value,p=f[0],h=f[1],d=o.value,y=d[0],v=d[1];!l&&!i[s]&&(l=n.equals(p,y,u,s,t,e,n)&&n.equals(h,v,p,y,t,e,n))&&(i[s]=!0),s++}if(!l)return!1;u++}return!0}function x(t,e,n){var r,o=v(t),i=o.length;if(v(e).length!==i)return!1;for(;i-- >0;)if((r=o[i])===d&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!p(e,r)||!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function O(t,e,n){var r,o,i,a=f(t),u=a.length;if(f(e).length!==u)return!1;for(;u-- >0;)if((r=a[u])===d&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!p(e,r)||!n.equals(t[r],e[r],r,r,t,e,n)||(o=y(t,r),i=y(e,r),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable)))return!1;return!0}function w(t,e){return h(t.valueOf(),e.valueOf())}function j(t,e){return t.source===e.source&&t.flags===e.flags}function S(t,e,n){if(t.size!==e.size)return!1;for(var r,o,i={},a=t.values();(r=a.next())&&!r.done;){for(var u=e.values(),c=!1,l=0;(o=u.next())&&!o.done;)!c&&!i[l]&&(c=n.equals(r.value,o.value,r.value,o.value,t,e,n))&&(i[l]=!0),l++;if(!c)return!1}return!0}function E(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var k=Array.isArray,P="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,A=Object.assign,M=Object.prototype.toString.call.bind(Object.prototype.toString),_=T();function T(t){void 0===t&&(t={});var e,n,r,o,i,a,u,c,f,p=t.circular,h=t.createInternalComparator,d=t.createState,y=t.strict,v=(n=(e=function(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,o={areArraysEqual:r?O:m,areDatesEqual:g,areMapsEqual:r?l(b,O):b,areObjectsEqual:r?O:x,arePrimitiveWrappersEqual:w,areRegExpsEqual:j,areSetsEqual:r?l(S,O):S,areTypedArraysEqual:r?O:E};if(n&&(o=A({},o,n(o))),e){var i=s(o.areArraysEqual),a=s(o.areMapsEqual),u=s(o.areObjectsEqual),c=s(o.areSetsEqual);o=A({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:u,areSetsEqual:c})}return o}(t)).areArraysEqual,r=e.areDatesEqual,o=e.areMapsEqual,i=e.areObjectsEqual,a=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,c=e.areSetsEqual,f=e.areTypedArraysEqual,function(t,e,l){if(t===e)return!0;if(null==t||null==e||"object"!=typeof t||"object"!=typeof e)return t!=t&&e!=e;var s=t.constructor;if(s!==e.constructor)return!1;if(s===Object)return i(t,e,l);if(k(t))return n(t,e,l);if(null!=P&&P(t))return f(t,e,l);if(s===Date)return r(t,e,l);if(s===RegExp)return u(t,e,l);if(s===Map)return o(t,e,l);if(s===Set)return c(t,e,l);var p=M(t);return"[object Date]"===p?r(t,e,l):"[object RegExp]"===p?u(t,e,l):"[object Map]"===p?o(t,e,l):"[object Set]"===p?c(t,e,l):"[object Object]"===p?"function"!=typeof t.then&&"function"!=typeof e.then&&i(t,e,l):"[object Arguments]"===p?i(t,e,l):("[object Boolean]"===p||"[object Number]"===p||"[object String]"===p)&&a(t,e,l)}),_=h?h(v):function(t,e,n,r,o,i,a){return v(t,e,a)};return function(t){var e=t.circular,n=t.comparator,r=t.createState,o=t.equals,i=t.strict;if(r)return function(t,a){var u=r(),c=u.cache;return n(t,a,{cache:void 0===c?e?new WeakMap:void 0:c,equals:o,meta:u.meta,strict:i})};if(e)return function(t,e){return n(t,e,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(t,e){return n(t,e,a)}}({circular:void 0!==p&&p,comparator:v,createState:d,equals:_,strict:void 0!==y&&y})}function C(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1;requestAnimationFrame(function r(o){if(n<0&&(n=o),o-n>e)t(o),n=-1;else{var i;i=r,"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(i)}})}function N(t){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0&&t<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",r);var p=J(i,u),h=J(a,c),d=(t=i,e=u,function(n){var r;return K([].concat(function(t){if(Array.isArray(t))return H(t)}(r=V(t,e).map(function(t,e){return t*e}).slice(1))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||Y(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),n)}),y=function(t){for(var e=t>1?1:t,n=e,r=0;r<8;++r){var o,i=p(n)-e,a=d(n);if(1e-4>Math.abs(i-e)||a<1e-4)break;n=(o=n-i/a)>1?1:o<0?0:o}return h(n)};return y.isStepper=!1,y},tt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.stiff,n=void 0===e?100:e,r=t.damping,o=void 0===r?8:r,i=t.dt,a=void 0===i?17:i,u=function(t,e,r){var i=r+(-(t-e)*n-r*o)*a/1e3,u=r*a/1e3+t;return 1e-4>Math.abs(u-e)&&1e-4>Math.abs(i)?[e,0]:[u,i]};return u.isStepper=!0,u.dt=a,u},te=function(){for(var t=arguments.length,e=Array(t),n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n0?n[o-1]:r,p=l||Object.keys(c);if("function"==typeof u||"spring"===u)return[].concat(ty(t),[e.runJSAnimation.bind(e,{from:f.style,to:c,duration:i,easing:u}),i]);var h=G(p,i,u),d=tg(tg(tg({},f.style),c),{},{transition:h});return[].concat(ty(t),[d,i,s]).filter($)},[a,Math.max(void 0===u?0:u,r)])),[t.onAnimationEnd]))}},{key:"runAnimation",value:function(t){if(!this.manager){var e,n,r;this.manager=(e=function(){return null},n=!1,r=function t(r){if(!n){if(Array.isArray(r)){if(!r.length)return;var o=function(t){if(Array.isArray(t))return t}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return D(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(t,void 0)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=o[0],a=o.slice(1);if("number"==typeof i){C(t.bind(null,a),i);return}t(i),C(t.bind(null,a));return}"object"===N(r)&&e(r),"function"==typeof r&&r()}},{stop:function(){n=!0},start:function(t){n=!1,r(t)},subscribe:function(t){return e=t,function(){e=function(){return null}}}})}var o=t.begin,i=t.duration,a=t.attributeName,u=t.to,c=t.easing,l=t.onAnimationStart,s=t.onAnimationEnd,f=t.steps,p=t.children,h=this.manager;if(this.unSubscribe=h.subscribe(this.handleStyleChange),"function"==typeof c||"function"==typeof p||"spring"===c){this.runJSAnimation(t);return}if(f.length>1){this.runStepAnimation(t);return}var d=a?tb({},a,u):u,y=G(Object.keys(d),i,c);h.start([l,o,tg(tg({},d),{},{transition:y}),i,s])}},{key:"render",value:function(){var t=this.props,e=t.children,n=(t.begin,t.duration),o=(t.attributeName,t.easing,t.isActive),i=(t.steps,t.from,t.to,t.canBegin,t.onAnimationEnd,t.shouldReAnimate,t.onAnimationReStart,function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,td)),a=r.Children.count(e),u=W(this.state.style);if("function"==typeof e)return e(u);if(!o||0===a||n<=0)return e;var c=function(t){var e=t.props,n=e.style,o=e.className;return(0,r.cloneElement)(t,tg(tg({},i),{},{style:tg(tg({},void 0===n?{}:n),u),className:o}))};return 1===a?c(r.Children.only(e)):r.createElement("div",null,r.Children.map(e,function(t){return c(t)}))}}],function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=t.steps,n=t.duration;return e&&e.length?e.reduce(function(t,e){return t+(Number.isFinite(e.duration)&&e.duration>0?e.duration:0)},0):Number.isFinite(n)?n:0},tR=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tC(t,e)}(i,t);var e,n,o=(e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,n=tD(i);return t=e?Reflect.construct(n,arguments,tD(this).constructor):n.apply(this,arguments),function(t,e){if(e&&("object"===tA(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return tN(t)}(this,t)});function i(){var t;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),tI(tN(t=o.call(this)),"handleEnter",function(e,n){var r=t.props,o=r.appearOptions,i=r.enterOptions;t.handleStyleActive(n?o:i)}),tI(tN(t),"handleExit",function(){var e=t.props.leaveOptions;t.handleStyleActive(e)}),t.state={isActive:!1},t}return n=[{key:"handleStyleActive",value:function(t){if(t){var e=t.onAnimationEnd?function(){t.onAnimationEnd()}:null;this.setState(tT(tT({},t),{},{onAnimationEnd:e,isActive:!0}))}}},{key:"parseTimeout",value:function(){var t=this.props,e=t.appearOptions,n=t.enterOptions,r=t.leaveOptions;return tB(e)+tB(n)+tB(r)}},{key:"render",value:function(){var t=this,e=this.props,n=e.children,o=(e.appearOptions,e.enterOptions,e.leaveOptions,function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,tP));return r.createElement(tk.Transition,tM({},o,{onEnter:this.handleEnter,onExit:this.handleExit,timeout:this.parseTimeout()}),function(){return r.createElement(tE,t.state,r.Children.only(n))})}}],function(t,e){for(var n=0;n=0||(o[n]=t[n]);return o}(t,["children","in"]),a=r.default.Children.toArray(e),u=a[0],c=a[1];return delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,r.default.createElement(i.default,o,n?r.default.cloneElement(u,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(c,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},e}(r.default.Component);u.propTypes={},e.default=u,t.exports=e.default},20536:function(t,e,n){"use strict";e.__esModule=!0,e.default=e.EXITING=e.ENTERED=e.ENTERING=e.EXITED=e.UNMOUNTED=void 0;var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,n):{};r.get||r.set?Object.defineProperty(e,n,r):e[n]=t[n]}}return e.default=t,e}(n(40718)),o=u(n(2265)),i=u(n(54887)),a=n(52181);function u(t){return t&&t.__esModule?t:{default:t}}n(32601);var c="unmounted";e.UNMOUNTED=c;var l="exited";e.EXITED=l;var s="entering";e.ENTERING=s;var f="entered";e.ENTERED=f;var p="exiting";e.EXITING=p;var h=function(t){function e(e,n){r=t.call(this,e,n)||this;var r,o,i=n.transitionGroup,a=i&&!i.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?a?(o=l,r.appearStatus=s):o=f:o=e.unmountOnExit||e.mountOnEnter?c:l,r.state={status:o},r.nextCallback=null,r}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t;var n=e.prototype;return n.getChildContext=function(){return{transitionGroup:null}},e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===c?{status:l}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==s&&n!==f&&(e=s):(n===s||n===f)&&(e=p)}this.updateStatus(!1,e)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var t,e,n,r=this.props.timeout;return t=e=n=r,null!=r&&"number"!=typeof r&&(t=r.exit,e=r.enter,n=void 0!==r.appear?r.appear:e),{exit:t,enter:e,appear:n}},n.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e){this.cancelNextCallback();var n=i.default.findDOMNode(this);e===s?this.performEnter(n,t):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===l&&this.setState({status:c})},n.performEnter=function(t,e){var n=this,r=this.props.enter,o=this.context.transitionGroup?this.context.transitionGroup.isMounting:e,i=this.getTimeouts(),a=o?i.appear:i.enter;if(!e&&!r){this.safeSetState({status:f},function(){n.props.onEntered(t)});return}this.props.onEnter(t,o),this.safeSetState({status:s},function(){n.props.onEntering(t,o),n.onTransitionEnd(t,a,function(){n.safeSetState({status:f},function(){n.props.onEntered(t,o)})})})},n.performExit=function(t){var e=this,n=this.props.exit,r=this.getTimeouts();if(!n){this.safeSetState({status:l},function(){e.props.onExited(t)});return}this.props.onExit(t),this.safeSetState({status:p},function(){e.props.onExiting(t),e.onTransitionEnd(t,r.exit,function(){e.safeSetState({status:l},function(){e.props.onExited(t)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},n.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,e.nextCallback=null,t(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(t,e,n){this.setNextCallback(n);var r=null==e&&!this.props.addEndListener;if(!t||r){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(t,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var t=this.state.status;if(t===c)return null;var e=this.props,n=e.children,r=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(e,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(t,r);var i=o.default.Children.only(n);return o.default.cloneElement(i,r)},e}(o.default.Component);function d(){}h.contextTypes={transitionGroup:r.object},h.childContextTypes={transitionGroup:function(){}},h.propTypes={},h.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:d,onEntering:d,onEntered:d,onExit:d,onExiting:d,onExited:d},h.UNMOUNTED=0,h.EXITED=1,h.ENTERING=2,h.ENTERED=3,h.EXITING=4;var y=(0,a.polyfill)(h);e.default=y},38244:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=u(n(40718)),o=u(n(2265)),i=n(52181),a=n(28710);function u(t){return t&&t.__esModule?t:{default:t}}function c(){return(c=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,["component","childFactory"]),i=s(this.state.children).map(n);return(delete r.appear,delete r.enter,delete r.exit,null===e)?i:o.default.createElement(e,r,i)},e}(o.default.Component);f.childContextTypes={transitionGroup:r.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(t){return t}};var p=(0,i.polyfill)(f);e.default=p,t.exports=e.default},30719:function(t,e,n){"use strict";var r=u(n(33664)),o=u(n(31601)),i=u(n(38244)),a=u(n(20536));function u(t){return t&&t.__esModule?t:{default:t}}t.exports={Transition:a.default,TransitionGroup:i.default,ReplaceTransition:o.default,CSSTransition:r.default}},28710:function(t,e,n){"use strict";e.__esModule=!0,e.getChildMapping=o,e.mergeChildMappings=i,e.getInitialChildMapping=function(t,e){return o(t.children,function(n){return(0,r.cloneElement)(n,{onExited:e.bind(null,n),in:!0,appear:a(n,"appear",t),enter:a(n,"enter",t),exit:a(n,"exit",t)})})},e.getNextChildMapping=function(t,e,n){var u=o(t.children),c=i(e,u);return Object.keys(c).forEach(function(o){var i=c[o];if((0,r.isValidElement)(i)){var l=o in e,s=o in u,f=e[o],p=(0,r.isValidElement)(f)&&!f.props.in;s&&(!l||p)?c[o]=(0,r.cloneElement)(i,{onExited:n.bind(null,i),in:!0,exit:a(i,"exit",t),enter:a(i,"enter",t)}):s||!l||p?s&&l&&(0,r.isValidElement)(f)&&(c[o]=(0,r.cloneElement)(i,{onExited:n.bind(null,i),in:f.props.in,exit:a(i,"exit",t),enter:a(i,"enter",t)})):c[o]=(0,r.cloneElement)(i,{in:!1})}}),c};var r=n(2265);function o(t,e){var n=Object.create(null);return t&&r.Children.map(t,function(t){return t}).forEach(function(t){n[t.key]=e&&(0,r.isValidElement)(t)?e(t):t}),n}function i(t,e){function n(n){return n in e?e[n]:t[n]}t=t||{},e=e||{};var r,o=Object.create(null),i=[];for(var a in t)a in e?i.length&&(o[a]=i,i=[]):i.push(a);var u={};for(var c in e){if(o[c])for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,O),i=parseInt("".concat(n),10),a=parseInt("".concat(r),10),u=parseInt("".concat(e.height||o.height),10),c=parseInt("".concat(e.width||o.width),10);return S(S(S(S(S({},e),o),i?{x:i}:{}),a?{y:a}:{}),{},{height:u,width:c,name:e.name,radius:e.radius})}function k(t){return r.createElement(b.bn,w({shapeType:"rectangle",propTransformer:E,activeClassName:"recharts-active-bar"},t))}var P=["value","background"];function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(){return(M=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,P);if(!u)return null;var l=T(T(T(T(T({},c),{},{fill:"#eee"},u),a),(0,g.bw)(t.props,e,n)),{},{onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd,dataKey:o,index:n,key:"background-bar-".concat(n),className:"recharts-bar-background-rectangle"});return r.createElement(k,M({option:t.props.background,isActive:n===i},l))})}},{key:"renderErrorBar",value:function(t,e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.data,i=n.xAxis,a=n.yAxis,u=n.layout,c=n.children,l=(0,y.NN)(c,f.W);if(!l)return null;var p="vertical"===u?o[0].height/2:o[0].width/2,h=function(t,e){var n=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:n,errorVal:(0,m.F$)(t,e)}};return r.createElement(s.m,{clipPath:t?"url(#clipPath-".concat(e,")"):null},l.map(function(t){return r.cloneElement(t,{key:"error-bar-".concat(e,"-").concat(t.props.dataKey),data:o,xAxis:i,yAxis:a,layout:u,offset:p,dataPointFormatter:h})}))}},{key:"render",value:function(){var t=this.props,e=t.hide,n=t.data,i=t.className,a=t.xAxis,u=t.yAxis,c=t.left,f=t.top,p=t.width,d=t.height,y=t.isAnimationActive,v=t.background,m=t.id;if(e||!n||!n.length)return null;var g=this.state.isAnimationFinished,b=(0,o.Z)("recharts-bar",i),x=a&&a.allowDataOverflow,O=u&&u.allowDataOverflow,w=x||O,j=l()(m)?this.id:m;return r.createElement(s.m,{className:b},x||O?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(j)},r.createElement("rect",{x:x?c:c-p/2,y:O?f:f-d/2,width:x?p:2*p,height:O?d:2*d}))):null,r.createElement(s.m,{className:"recharts-bar-rectangles",clipPath:w?"url(#clipPath-".concat(j,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(w,j),(!y||g)&&h.e.renderCallByParent(this.props,n))}}],a=[{key:"getDerivedStateFromProps",value:function(t,e){return t.animationId!==e.prevAnimationId?{prevAnimationId:t.animationId,curData:t.data,prevData:e.curData}:t.data!==e.curData?{curData:t.data}:null}}],n&&C(p.prototype,n),a&&C(p,a),Object.defineProperty(p,"prototype",{writable:!1}),p}(r.PureComponent);L(R,"displayName","Bar"),L(R,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!v.x.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),L(R,"getComposedData",function(t){var e=t.props,n=t.item,r=t.barPosition,o=t.bandSize,i=t.xAxis,a=t.yAxis,u=t.xAxisTicks,c=t.yAxisTicks,l=t.stackedData,s=t.dataStartIndex,f=t.displayedData,h=t.offset,v=(0,m.Bu)(r,n);if(!v)return null;var g=e.layout,b=n.props,x=b.dataKey,O=b.children,w=b.minPointSize,j="horizontal"===g?a:i,S=l?j.scale.domain():null,E=(0,m.Yj)({numericAxis:j}),k=(0,y.NN)(O,p.b),P=f.map(function(t,e){var r,f,p,h,y,b;if(l?r=(0,m.Vv)(l[s+e],S):Array.isArray(r=(0,m.F$)(t,x))||(r=[E,r]),"horizontal"===g){var O,j=[a.scale(r[0]),a.scale(r[1])],P=j[0],A=j[1];f=(0,m.Fy)({axis:i,ticks:u,bandSize:o,offset:v.offset,entry:t,index:e}),p=null!==(O=null!=A?A:P)&&void 0!==O?O:void 0,h=v.size;var M=P-A;if(y=Number.isNaN(M)?0:M,b={x:f,y:a.y,width:h,height:a.height},Math.abs(w)>0&&Math.abs(y)0&&Math.abs(h)=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function E(t,e){for(var n=0;n0?this.props:d)),o<=0||a<=0||!y||!y.length)?null:r.createElement(s.m,{className:(0,c.Z)("recharts-cartesian-axis",l),ref:function(e){t.layerReference=e}},n&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),p._.renderCallByParent(this.props))}}],o=[{key:"renderTickItem",value:function(t,e,n){return r.isValidElement(t)?r.cloneElement(t,e):i()(t)?t(e):r.createElement(f.x,O({},e,{className:"recharts-cartesian-axis-tick-value"}),n)}}],n&&E(w.prototype,n),o&&E(w,o),Object.defineProperty(w,"prototype",{writable:!1}),w}(r.Component);A(_,"displayName","CartesianAxis"),A(_,"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"})},56940:function(t,e,n){"use strict";n.d(e,{q:function(){return M}});var r=n(2265),o=n(86757),i=n.n(o),a=n(1175),u=n(16630),c=n(82944),l=n(85355),s=n(78242),f=n(80285),p=n(25739),h=["x1","y1","x2","y2","key"],d=["offset"];function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function m(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var x=function(t){var e=t.fill;if(!e||"none"===e)return null;var n=t.fillOpacity,o=t.x,i=t.y,a=t.width,u=t.height;return r.createElement("rect",{x:o,y:i,width:a,height:u,stroke:"none",fill:e,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function O(t,e){var n;if(r.isValidElement(t))n=r.cloneElement(t,e);else if(i()(t))n=t(e);else{var o=e.x1,a=e.y1,u=e.x2,l=e.y2,s=e.key,f=b(e,h),p=(0,c.L6)(f,!1),y=(p.offset,b(p,d));n=r.createElement("line",g({},y,{x1:o,y1:a,x2:u,y2:l,fill:"none",key:s}))}return n}function w(t){var e=t.x,n=t.width,o=t.horizontal,i=void 0===o||o,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var u=a.map(function(r,o){return O(i,m(m({},t),{},{x1:e,y1:r,x2:e+n,y2:r,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function j(t){var e=t.y,n=t.height,o=t.vertical,i=void 0===o||o,a=t.verticalPoints;if(!i||!a||!a.length)return null;var u=a.map(function(r,o){return O(i,m(m({},t),{},{x1:r,y1:e,x2:r,y2:e+n,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function S(t){var e=t.horizontalFill,n=t.fillOpacity,o=t.x,i=t.y,a=t.width,u=t.height,c=t.horizontalPoints,l=t.horizontal;if(!(void 0===l||l)||!e||!e.length)return null;var s=c.map(function(t){return Math.round(t+i-i)}).sort(function(t,e){return t-e});i!==s[0]&&s.unshift(0);var f=s.map(function(t,c){var l=s[c+1]?s[c+1]-t:i+u-t;if(l<=0)return null;var f=c%e.length;return r.createElement("rect",{key:"react-".concat(c),y:t,x:o,height:l,width:a,stroke:"none",fill:e[f],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function E(t){var e=t.vertical,n=t.verticalFill,o=t.fillOpacity,i=t.x,a=t.y,u=t.width,c=t.height,l=t.verticalPoints;if(!(void 0===e||e)||!n||!n.length)return null;var s=l.map(function(t){return Math.round(t+i-i)}).sort(function(t,e){return t-e});i!==s[0]&&s.unshift(0);var f=s.map(function(t,e){var l=s[e+1]?s[e+1]-t:i+u-t;if(l<=0)return null;var f=e%n.length;return r.createElement("rect",{key:"react-".concat(e),x:t,y:a,width:l,height:c,stroke:"none",fill:n[f],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var k=function(t,e){var n=t.xAxis,r=t.width,o=t.height,i=t.offset;return(0,l.Rf)((0,s.f)(m(m(m({},f.O.defaultProps),n),{},{ticks:(0,l.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),i.left,i.left+i.width,e)},P=function(t,e){var n=t.yAxis,r=t.width,o=t.height,i=t.offset;return(0,l.Rf)((0,s.f)(m(m(m({},f.O.defaultProps),n),{},{ticks:(0,l.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),i.top,i.top+i.height,e)},A={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function M(t){var e,n,o,c,l,s,f=(0,p.zn)(),h=(0,p.Mw)(),d=(0,p.qD)(),v=m(m({},t),{},{stroke:null!==(e=t.stroke)&&void 0!==e?e:A.stroke,fill:null!==(n=t.fill)&&void 0!==n?n:A.fill,horizontal:null!==(o=t.horizontal)&&void 0!==o?o:A.horizontal,horizontalFill:null!==(c=t.horizontalFill)&&void 0!==c?c:A.horizontalFill,vertical:null!==(l=t.vertical)&&void 0!==l?l:A.vertical,verticalFill:null!==(s=t.verticalFill)&&void 0!==s?s:A.verticalFill}),b=v.x,O=v.y,M=v.width,_=v.height,T=v.xAxis,C=v.yAxis,N=v.syncWithTicks,D=v.horizontalValues,I=v.verticalValues;if(!(0,u.hj)(M)||M<=0||!(0,u.hj)(_)||_<=0||!(0,u.hj)(b)||b!==+b||!(0,u.hj)(O)||O!==+O)return null;var L=v.verticalCoordinatesGenerator||k,B=v.horizontalCoordinatesGenerator||P,R=v.horizontalPoints,z=v.verticalPoints;if((!R||!R.length)&&i()(B)){var U=D&&D.length,F=B({yAxis:C?m(m({},C),{},{ticks:U?D:C.ticks}):void 0,width:f,height:h,offset:d},!!U||N);(0,a.Z)(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(y(F),"]")),Array.isArray(F)&&(R=F)}if((!z||!z.length)&&i()(L)){var $=I&&I.length,q=L({xAxis:T?m(m({},T),{},{ticks:$?I:T.ticks}):void 0,width:f,height:h,offset:d},!!$||N);(0,a.Z)(Array.isArray(q),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(y(q),"]")),Array.isArray(q)&&(z=q)}return r.createElement("g",{className:"recharts-cartesian-grid"},r.createElement(x,{fill:v.fill,fillOpacity:v.fillOpacity,x:v.x,y:v.y,width:v.width,height:v.height}),r.createElement(w,g({},v,{offset:d,horizontalPoints:R})),r.createElement(j,g({},v,{offset:d,verticalPoints:z})),r.createElement(S,g({},v,{horizontalPoints:R})),r.createElement(E,g({},v,{verticalPoints:z})))}M.displayName="CartesianGrid"},13137:function(t,e,n){"use strict";n.d(e,{W:function(){return s}});var r=n(2265),o=n(69398),i=n(9841),a=n(82944),u=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function c(){return(c=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,u),m=(0,a.L6)(v,!1);"x"===t.direction&&"number"!==d.type&&(0,o.Z)(!1);var g=p.map(function(t){var o,a,u=h(t,f),p=u.x,v=u.y,g=u.value,b=u.errorVal;if(!b)return null;var x=[];if(Array.isArray(b)){var O=function(t){if(Array.isArray(t))return t}(b)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{for(i=(n=n.call(t)).next;!(c=(r=i.call(n)).done)&&(u.push(r.value),2!==u.length);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(b,2)||function(t,e){if(t){if("string"==typeof t)return l(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,2)}}(b,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=O[0],a=O[1]}else o=a=b;if("vertical"===n){var w=d.scale,j=v+e,S=j+s,E=j-s,k=w(g-o),P=w(g+a);x.push({x1:P,y1:S,x2:P,y2:E}),x.push({x1:k,y1:j,x2:P,y2:j}),x.push({x1:k,y1:S,x2:k,y2:E})}else if("horizontal"===n){var A=y.scale,M=p+e,_=M-s,T=M+s,C=A(g-o),N=A(g+a);x.push({x1:_,y1:N,x2:T,y2:N}),x.push({x1:M,y1:C,x2:M,y2:N}),x.push({x1:_,y1:C,x2:T,y2:C})}return r.createElement(i.m,c({className:"recharts-errorBar",key:"bar-".concat(x.map(function(t){return"".concat(t.x1,"-").concat(t.x2,"-").concat(t.y1,"-").concat(t.y2)}))},m),x.map(function(t){return r.createElement("line",c({},t,{key:"line-".concat(t.x1,"-").concat(t.x2,"-").concat(t.y1,"-").concat(t.y2)}))}))});return r.createElement(i.m,{className:"recharts-errorBars"},g)}s.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},s.displayName="ErrorBar"},97059:function(t,e,n){"use strict";n.d(e,{K:function(){return l}});var r=n(2265),o=n(87602),i=n(25739),a=n(80285),u=n(85355);function c(){return(c=Object.assign?Object.assign.bind():function(t){for(var e=1;et*o)return!1;var i=n();return t*(e-t*i/2-r)>=0&&t*(e+t*i/2-o)<=0}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var e=1;e=2?(0,i.uY)(m[1].coordinate-m[0].coordinate):1,M=(r="width"===E,f=g.x,p=g.y,d=g.width,y=g.height,1===A?{start:r?f:p,end:r?f+d:p+y}:{start:r?f+d:p+y,end:r?f:p});return"equidistantPreserveStart"===O?function(t,e,n,r,o){for(var i,a=(r||[]).slice(),u=e.start,c=e.end,f=0,p=1,h=u;p<=a.length;)if(i=function(){var e,i=null==r?void 0:r[f];if(void 0===i)return{v:l(r,p)};var a=f,d=function(){return void 0===e&&(e=n(i,a)),e},y=i.coordinate,v=0===f||s(t,y,d,h,c);v||(f=0,h=u,p+=1),v&&(h=y+t*(d()/2+o),f+=p)}())return i.v;return[]}(A,M,P,m,b):("preserveStart"===O||"preserveStartEnd"===O?function(t,e,n,r,o,i){var a=(r||[]).slice(),u=a.length,c=e.start,l=e.end;if(i){var f=r[u-1],p=n(f,u-1),d=t*(f.coordinate+t*p/2-l);a[u-1]=f=h(h({},f),{},{tickCoord:d>0?f.coordinate-d*t:f.coordinate}),s(t,f.tickCoord,function(){return p},c,l)&&(l=f.tickCoord-t*(p/2+o),a[u-1]=h(h({},f),{},{isShow:!0}))}for(var y=i?u-1:u,v=function(e){var r,i=a[e],u=function(){return void 0===r&&(r=n(i,e)),r};if(0===e){var f=t*(i.coordinate-t*u()/2-c);a[e]=i=h(h({},i),{},{tickCoord:f<0?i.coordinate-f*t:i.coordinate})}else a[e]=i=h(h({},i),{},{tickCoord:i.coordinate});s(t,i.tickCoord,u,c,l)&&(c=i.tickCoord+t*(u()/2+o),a[e]=h(h({},i),{},{isShow:!0}))},m=0;m0?l.coordinate-p*t:l.coordinate})}else i[e]=l=h(h({},l),{},{tickCoord:l.coordinate});s(t,l.tickCoord,f,u,c)&&(c=l.tickCoord-t*(f()/2+o),i[e]=h(h({},l),{},{isShow:!0}))},f=a-1;f>=0;f--)l(f);return i}(A,M,P,m,b)).filter(function(t){return t.isShow})}},93765:function(t,e,n){"use strict";n.d(e,{z:function(){return ex}});var r=n(2265),o=n(77571),i=n.n(o),a=n(86757),u=n.n(a),c=n(99676),l=n.n(c),s=n(13735),f=n.n(s),p=n(34935),h=n.n(p),d=n(37065),y=n.n(d),v=n(84173),m=n.n(v),g=n(32242),b=n.n(g),x=n(87602),O=n(69398),w=n(48777),j=n(9841),S=n(8147),E=n(22190),k=n(81889),P=n(73649),A=n(82944),M=n(55284),_=n(58811),T=n(85355),C=n(16630);function N(t){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function I(t){for(var e=1;e0&&e.handleDrag(t.changedTouches[0])}),X(W(e),"handleDragEnd",function(){e.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var t=e.props,n=t.endIndex,r=t.onDragEnd,o=t.startIndex;null==r||r({endIndex:n,startIndex:o})}),e.detachDragEndListener()}),X(W(e),"handleLeaveWrapper",function(){(e.state.isTravellerMoving||e.state.isSlideMoving)&&(e.leaveTimer=window.setTimeout(e.handleDragEnd,e.props.leaveTimeOut))}),X(W(e),"handleEnterSlideOrTraveller",function(){e.setState({isTextActive:!0})}),X(W(e),"handleLeaveSlideOrTraveller",function(){e.setState({isTextActive:!1})}),X(W(e),"handleSlideDragStart",function(t){var n=V(t)?t.changedTouches[0]:t;e.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:n.pageX}),e.attachDragEndListener()}),e.travellerDragStartHandlers={startX:e.handleTravellerDragStart.bind(W(e),"startX"),endX:e.handleTravellerDragStart.bind(W(e),"endX")},e.state={},e}return n=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(t){var e=t.startX,n=t.endX,r=this.state.scaleValues,o=this.props,i=o.gap,u=o.data.length-1,c=a.getIndexInRange(r,Math.min(e,n)),l=a.getIndexInRange(r,Math.max(e,n));return{startIndex:c-c%i,endIndex:l===u?u:l-l%i}}},{key:"getTextOfTick",value:function(t){var e=this.props,n=e.data,r=e.tickFormatter,o=e.dataKey,i=(0,T.F$)(n[t],o,t);return u()(r)?r(i,t):i}},{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(t){var e=this.state,n=e.slideMoveStartX,r=e.startX,o=e.endX,i=this.props,a=i.x,u=i.width,c=i.travellerWidth,l=i.startIndex,s=i.endIndex,f=i.onChange,p=t.pageX-n;p>0?p=Math.min(p,a+u-c-o,a+u-c-r):p<0&&(p=Math.max(p,a-r,a-o));var h=this.getIndex({startX:r+p,endX:o+p});(h.startIndex!==l||h.endIndex!==s)&&f&&f(h),this.setState({startX:r+p,endX:o+p,slideMoveStartX:t.pageX})}},{key:"handleTravellerDragStart",value:function(t,e){var n=V(e)?e.changedTouches[0]:e;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:t,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(t){var e,n=this.state,r=n.brushMoveStartX,o=n.movingTravellerId,i=n.endX,a=n.startX,u=this.state[o],c=this.props,l=c.x,s=c.width,f=c.travellerWidth,p=c.onChange,h=c.gap,d=c.data,y={startX:this.state.startX,endX:this.state.endX},v=t.pageX-r;v>0?v=Math.min(v,l+s-f-u):v<0&&(v=Math.max(v,l-u)),y[o]=u+v;var m=this.getIndex(y),g=m.startIndex,b=m.endIndex,x=function(){var t=d.length-1;return"startX"===o&&(i>a?g%h==0:b%h==0)||ia?b%h==0:g%h==0)||i>a&&b===t};this.setState((X(e={},o,u+v),X(e,"brushMoveStartX",t.pageX),e),function(){p&&x()&&p(m)})}},{key:"handleTravellerMoveKeyboard",value:function(t,e){var n=this,r=this.state,o=r.scaleValues,i=r.startX,a=r.endX,u=this.state[e],c=o.indexOf(u);if(-1!==c){var l=c+t;if(-1!==l&&!(l>=o.length)){var s=o[l];"startX"===e&&s>=a||"endX"===e&&s<=i||this.setState(X({},e,s),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:"renderBackground",value:function(){var t=this.props,e=t.x,n=t.y,o=t.width,i=t.height,a=t.fill,u=t.stroke;return r.createElement("rect",{stroke:u,fill:a,x:e,y:n,width:o,height:i})}},{key:"renderPanorama",value:function(){var t=this.props,e=t.x,n=t.y,o=t.width,i=t.height,a=t.data,u=t.children,c=t.padding,l=r.Children.only(u);return l?r.cloneElement(l,{x:e,y:n,width:o,height:i,margin:c,compact:!0,data:a}):null}},{key:"renderTravellerLayer",value:function(t,e){var n=this,o=this.props,i=o.y,u=o.travellerWidth,c=o.height,l=o.traveller,s=o.ariaLabel,f=o.data,p=o.startIndex,h=o.endIndex,d=Math.max(t,this.props.x),y=$($({},(0,A.L6)(this.props,!1)),{},{x:d,y:i,width:u,height:c}),v=s||"Min value: ".concat(f[p].name,", Max value: ").concat(f[h].name);return r.createElement(j.m,{tabIndex:0,role:"slider","aria-label":v,"aria-valuenow":t,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[e],onTouchStart:this.travellerDragStartHandlers[e],onKeyDown:function(t){["ArrowLeft","ArrowRight"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),n.handleTravellerMoveKeyboard("ArrowRight"===t.key?1:-1,e))},onFocus:function(){n.setState({isTravellerFocused:!0})},onBlur:function(){n.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},a.renderTraveller(l,y))}},{key:"renderSlide",value:function(t,e){var n=this.props,o=n.y,i=n.height,a=n.stroke,u=n.travellerWidth;return r.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:a,fillOpacity:.2,x:Math.min(t,e)+u,y:o,width:Math.max(Math.abs(e-t)-u,0),height:i})}},{key:"renderText",value:function(){var t=this.props,e=t.startIndex,n=t.endIndex,o=t.y,i=t.height,a=t.travellerWidth,u=t.stroke,c=this.state,l=c.startX,s=c.endX,f={pointerEvents:"none",fill:u};return r.createElement(j.m,{className:"recharts-brush-texts"},r.createElement(_.x,U({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,s)-5,y:o+i/2},f),this.getTextOfTick(e)),r.createElement(_.x,U({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,s)+a+5,y:o+i/2},f),this.getTextOfTick(n)))}},{key:"render",value:function(){var t=this.props,e=t.data,n=t.className,o=t.children,i=t.x,a=t.y,u=t.width,c=t.height,l=t.alwaysShowText,s=this.state,f=s.startX,p=s.endX,h=s.isTextActive,d=s.isSlideMoving,y=s.isTravellerMoving,v=s.isTravellerFocused;if(!e||!e.length||!(0,C.hj)(i)||!(0,C.hj)(a)||!(0,C.hj)(u)||!(0,C.hj)(c)||u<=0||c<=0)return null;var m=(0,x.Z)("recharts-brush",n),g=1===r.Children.count(o),b=R("userSelect","none");return r.createElement(j.m,{className:m,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),g&&this.renderPanorama(),this.renderSlide(f,p),this.renderTravellerLayer(f,"startX"),this.renderTravellerLayer(p,"endX"),(h||d||y||v||l)&&this.renderText())}}],o=[{key:"renderDefaultTraveller",value:function(t){var e=t.x,n=t.y,o=t.width,i=t.height,a=t.stroke,u=Math.floor(n+i/2)-1;return r.createElement(r.Fragment,null,r.createElement("rect",{x:e,y:n,width:o,height:i,fill:a,stroke:"none"}),r.createElement("line",{x1:e+1,y1:u,x2:e+o-1,y2:u,fill:"none",stroke:"#fff"}),r.createElement("line",{x1:e+1,y1:u+2,x2:e+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(t,e){return r.isValidElement(t)?r.cloneElement(t,e):u()(t)?t(e):a.renderDefaultTraveller(e)}},{key:"getDerivedStateFromProps",value:function(t,e){var n=t.data,r=t.width,o=t.x,i=t.travellerWidth,a=t.updateId,u=t.startIndex,c=t.endIndex;if(n!==e.prevData||a!==e.prevUpdateId)return $({prevData:n,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:r},n&&n.length?H({data:n,width:r,x:o,travellerWidth:i,startIndex:u,endIndex:c}):{scale:null,scaleValues:null});if(e.scale&&(r!==e.prevWidth||o!==e.prevX||i!==e.prevTravellerWidth)){e.scale.range([o,o+r-i]);var l=e.scale.domain().map(function(t){return e.scale(t)});return{prevData:n,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:r,startX:e.scale(t.startIndex),endX:e.scale(t.endIndex),scaleValues:l}}return null}},{key:"getIndexInRange",value:function(t,e){for(var n=t.length,r=0,o=n-1;o-r>1;){var i=Math.floor((r+o)/2);t[i]>e?o=i:r=i}return e>=t[o]?o:r}}],n&&q(a.prototype,n),o&&q(a,o),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);X(K,"displayName","Brush"),X(K,"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 J=n(4094),Q=n(38569),tt=n(26680),te=function(t,e){var n=t.alwaysShow,r=t.ifOverflow;return n&&(r="extendDomain"),r===e},tn=n(25311),tr=n(1175);function to(t){return(to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ti(){return(ti=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,t$));return(0,C.hj)(n)&&(0,C.hj)(i)&&(0,C.hj)(f)&&(0,C.hj)(h)&&(0,C.hj)(u)&&(0,C.hj)(l)?r.createElement("path",tq({},(0,A.L6)(y,!0),{className:(0,x.Z)("recharts-cross",d),d:"M".concat(n,",").concat(u,"v").concat(h,"M").concat(l,",").concat(i,"h").concat(f)})):null};function tG(t){var e=t.cx,n=t.cy,r=t.radius,o=t.startAngle,i=t.endAngle;return{points:[(0,tM.op)(e,n,r,o),(0,tM.op)(e,n,r,i)],cx:e,cy:n,radius:r,startAngle:o,endAngle:i}}var tX=n(60474);function tY(t){return(tY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tH(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function tV(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function t6(t,e){return(t6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function t3(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function t7(t){return(t7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t8(t){return function(t){if(Array.isArray(t))return t9(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||t4(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t4(t,e){if(t){if("string"==typeof t)return t9(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t9(t,e)}}function t9(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0?i:t&&t.length&&(0,C.hj)(r)&&(0,C.hj)(o)?t.slice(r,o+1):[]};function es(t){return"number"===t?[0,"auto"]:void 0}var ef=function(t,e,n,r){var o=t.graphicalItems,i=t.tooltipAxis,a=el(e,t);return n<0||!o||!o.length||n>=a.length?null:o.reduce(function(o,u){var c,l,s=null!==(c=u.props.data)&&void 0!==c?c:e;if(s&&t.dataStartIndex+t.dataEndIndex!==0&&(s=s.slice(t.dataStartIndex,t.dataEndIndex+1)),i.dataKey&&!i.allowDuplicatedCategory){var f=void 0===s?a:s;l=(0,C.Ap)(f,i.dataKey,r)}else l=s&&s[n]||a[n];return l?[].concat(t8(o),[(0,T.Qo)(u,l)]):o},[])},ep=function(t,e,n,r){var o=r||{x:t.chartX,y:t.chartY},i="horizontal"===n?o.x:"vertical"===n?o.y:"centric"===n?o.angle:o.radius,a=t.orderedTooltipTicks,u=t.tooltipAxis,c=t.tooltipTicks,l=(0,T.VO)(i,a,c,u);if(l>=0&&c){var s=c[l]&&c[l].value,f=ef(t,e,l,s),p=ec(n,a,l,o);return{activeTooltipIndex:l,activeLabel:s,activePayload:f,activeCoordinate:p}}return null},eh=function(t,e){var n=e.axes,r=e.graphicalItems,o=e.axisType,a=e.axisIdKey,u=e.stackGroups,c=e.dataStartIndex,s=e.dataEndIndex,f=t.layout,p=t.children,h=t.stackOffset,d=(0,T.NA)(f,o);return n.reduce(function(e,n){var y=n.props,v=y.type,m=y.dataKey,g=y.allowDataOverflow,b=y.allowDuplicatedCategory,x=y.scale,O=y.ticks,w=y.includeHidden,j=n.props[a];if(e[j])return e;var S=el(t.data,{graphicalItems:r.filter(function(t){return t.props[a]===j}),dataStartIndex:c,dataEndIndex:s}),E=S.length;(function(t,e,n){if("number"===n&&!0===e&&Array.isArray(t)){var r=null==t?void 0:t[0],o=null==t?void 0:t[1];if(r&&o&&(0,C.hj)(r)&&(0,C.hj)(o))return!0}return!1})(n.props.domain,g,v)&&(A=(0,T.LG)(n.props.domain,null,g),d&&("number"===v||"auto"!==x)&&(_=(0,T.gF)(S,m,"category")));var k=es(v);if(!A||0===A.length){var P,A,M,_,N,D=null!==(N=n.props.domain)&&void 0!==N?N:k;if(m){if(A=(0,T.gF)(S,m,v),"category"===v&&d){var I=(0,C.bv)(A);b&&I?(M=A,A=l()(0,E)):b||(A=(0,T.ko)(D,A,n).reduce(function(t,e){return t.indexOf(e)>=0?t:[].concat(t8(t),[e])},[]))}else if("category"===v)A=b?A.filter(function(t){return""!==t&&!i()(t)}):(0,T.ko)(D,A,n).reduce(function(t,e){return t.indexOf(e)>=0||""===e||i()(e)?t:[].concat(t8(t),[e])},[]);else if("number"===v){var L=(0,T.ZI)(S,r.filter(function(t){return t.props[a]===j&&(w||!t.props.hide)}),m,o,f);L&&(A=L)}d&&("number"===v||"auto"!==x)&&(_=(0,T.gF)(S,m,"category"))}else A=d?l()(0,E):u&&u[j]&&u[j].hasStack&&"number"===v?"expand"===h?[0,1]:(0,T.EB)(u[j].stackGroups,c,s):(0,T.s6)(S,r.filter(function(t){return t.props[a]===j&&(w||!t.props.hide)}),v,f,!0);"number"===v?(A=tA(p,A,j,o,O),D&&(A=(0,T.LG)(D,A,g))):"category"===v&&D&&A.every(function(t){return D.indexOf(t)>=0})&&(A=D)}return ee(ee({},e),{},en({},j,ee(ee({},n.props),{},{axisType:o,domain:A,categoricalDomain:_,duplicateDomain:M,originalDomain:null!==(P=n.props.domain)&&void 0!==P?P:k,isCategorical:d,layout:f})))},{})},ed=function(t,e){var n=e.graphicalItems,r=e.Axis,o=e.axisType,i=e.axisIdKey,a=e.stackGroups,u=e.dataStartIndex,c=e.dataEndIndex,s=t.layout,p=t.children,h=el(t.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:c}),d=h.length,y=(0,T.NA)(s,o),v=-1;return n.reduce(function(t,e){var m,g=e.props[i],b=es("number");return t[g]?t:(v++,m=y?l()(0,d):a&&a[g]&&a[g].hasStack?tA(p,m=(0,T.EB)(a[g].stackGroups,u,c),g,o):tA(p,m=(0,T.LG)(b,(0,T.s6)(h,n.filter(function(t){return t.props[i]===g&&!t.props.hide}),"number",s),r.defaultProps.allowDataOverflow),g,o),ee(ee({},t),{},en({},g,ee(ee({axisType:o},r.defaultProps),{},{hide:!0,orientation:f()(eo,"".concat(o,".").concat(v%2),null),domain:m,originalDomain:b,isCategorical:y,layout:s}))))},{})},ey=function(t,e){var n=e.axisType,r=void 0===n?"xAxis":n,o=e.AxisComp,i=e.graphicalItems,a=e.stackGroups,u=e.dataStartIndex,c=e.dataEndIndex,l=t.children,s="".concat(r,"Id"),f=(0,A.NN)(l,o),p={};return f&&f.length?p=eh(t,{axes:f,graphicalItems:i,axisType:r,axisIdKey:s,stackGroups:a,dataStartIndex:u,dataEndIndex:c}):i&&i.length&&(p=ed(t,{Axis:o,graphicalItems:i,axisType:r,axisIdKey:s,stackGroups:a,dataStartIndex:u,dataEndIndex:c})),p},ev=function(t){var e=(0,C.Kt)(t),n=(0,T.uY)(e,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:h()(n,function(t){return t.coordinate}),tooltipAxis:e,tooltipAxisBandSize:(0,T.zT)(e,n)}},em=function(t){var e=t.children,n=t.defaultShowTooltip,r=(0,A.sP)(e,K),o=0,i=0;return t.data&&0!==t.data.length&&(i=t.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(o=r.props.startIndex),r.props.endIndex>=0&&(i=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:i,activeTooltipIndex:-1,isTooltipActive:!!n}},eg=function(t){return"horizontal"===t?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===t?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===t?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},eb=function(t,e){var n=t.props,r=t.graphicalItems,o=t.xAxisMap,i=void 0===o?{}:o,a=t.yAxisMap,u=void 0===a?{}:a,c=n.width,l=n.height,s=n.children,p=n.margin||{},h=(0,A.sP)(s,K),d=(0,A.sP)(s,E.D),y=Object.keys(u).reduce(function(t,e){var n=u[e],r=n.orientation;return n.mirror||n.hide?t:ee(ee({},t),{},en({},r,t[r]+n.width))},{left:p.left||0,right:p.right||0}),v=Object.keys(i).reduce(function(t,e){var n=i[e],r=n.orientation;return n.mirror||n.hide?t:ee(ee({},t),{},en({},r,f()(t,"".concat(r))+n.height))},{top:p.top||0,bottom:p.bottom||0}),m=ee(ee({},v),y),g=m.bottom;h&&(m.bottom+=h.props.height||K.defaultProps.height),d&&e&&(m=(0,T.By)(m,r,n,e));var b=c-m.left-m.right,x=l-m.top-m.bottom;return ee(ee({brushBottom:g},m),{},{width:Math.max(b,0),height:Math.max(x,0)})},ex=function(t){var e,n=t.chartName,o=t.GraphicalChild,a=t.defaultTooltipEventType,c=void 0===a?"axis":a,l=t.validateTooltipEventTypes,s=void 0===l?["axis"]:l,p=t.axisComponents,h=t.legendContent,d=t.formatAxisMap,v=t.defaultProps,g=function(t,e){var n=e.graphicalItems,r=e.stackGroups,o=e.offset,a=e.updateId,u=e.dataStartIndex,c=e.dataEndIndex,l=t.barSize,s=t.layout,f=t.barGap,h=t.barCategoryGap,d=t.maxBarSize,y=eg(s),v=y.numericAxisName,m=y.cateAxisName,g=!!n&&!!n.length&&n.some(function(t){var e=(0,A.Gf)(t&&t.type);return e&&e.indexOf("Bar")>=0})&&(0,T.pt)({barSize:l,stackGroups:r}),b=[];return n.forEach(function(n,l){var y,x=el(t.data,{graphicalItems:[n],dataStartIndex:u,dataEndIndex:c}),w=n.props,j=w.dataKey,S=w.maxBarSize,E=n.props["".concat(v,"Id")],k=n.props["".concat(m,"Id")],P=p.reduce(function(t,r){var o,i=e["".concat(r.axisType,"Map")],a=n.props["".concat(r.axisType,"Id")];i&&i[a]||"zAxis"===r.axisType||(0,O.Z)(!1);var u=i[a];return ee(ee({},t),{},(en(o={},r.axisType,u),en(o,"".concat(r.axisType,"Ticks"),(0,T.uY)(u)),o))},{}),M=P[m],_=P["".concat(m,"Ticks")],C=r&&r[E]&&r[E].hasStack&&(0,T.O3)(n,r[E].stackGroups),N=(0,A.Gf)(n.type).indexOf("Bar")>=0,D=(0,T.zT)(M,_),I=[];if(N){var L,B,R=i()(S)?d:S,z=null!==(L=null!==(B=(0,T.zT)(M,_,!0))&&void 0!==B?B:R)&&void 0!==L?L:0;I=(0,T.qz)({barGap:f,barCategoryGap:h,bandSize:z!==D?z:D,sizeList:g[k],maxBarSize:R}),z!==D&&(I=I.map(function(t){return ee(ee({},t),{},{position:ee(ee({},t.position),{},{offset:t.position.offset-z/2})})}))}var U=n&&n.type&&n.type.getComposedData;U&&b.push({props:ee(ee({},U(ee(ee({},P),{},{displayedData:x,props:t,dataKey:j,item:n,bandSize:D,barPosition:I,offset:o,stackedData:C,layout:s,dataStartIndex:u,dataEndIndex:c}))),{},(en(y={key:n.key||"item-".concat(l)},v,P[v]),en(y,m,P[m]),en(y,"animationId",a),y)),childIndex:(0,A.$R)(n,t.children),item:n})}),b},E=function(t,e){var r=t.props,i=t.dataStartIndex,a=t.dataEndIndex,u=t.updateId;if(!(0,A.TT)({props:r}))return null;var c=r.children,l=r.layout,s=r.stackOffset,f=r.data,h=r.reverseStackOrder,y=eg(l),v=y.numericAxisName,m=y.cateAxisName,b=(0,A.NN)(c,o),x=(0,T.wh)(f,b,"".concat(v,"Id"),"".concat(m,"Id"),s,h),O=p.reduce(function(t,e){var n="".concat(e.axisType,"Map");return ee(ee({},t),{},en({},n,ey(r,ee(ee({},e),{},{graphicalItems:b,stackGroups:e.axisType===v&&x,dataStartIndex:i,dataEndIndex:a}))))},{}),w=eb(ee(ee({},O),{},{props:r,graphicalItems:b}),null==e?void 0:e.legendBBox);Object.keys(O).forEach(function(t){O[t]=d(r,O[t],w,t.replace("Map",""),n)});var j=ev(O["".concat(m,"Map")]),S=g(r,ee(ee({},O),{},{dataStartIndex:i,dataEndIndex:a,updateId:u,graphicalItems:b,stackGroups:x,offset:w}));return ee(ee({formattedGraphicalItems:S,graphicalItems:b,offset:w,stackGroups:x},j),O)};return e=function(t){(function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&t6(t,e)})(l,t);var e,o,a=(e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,n=t7(l);return t=e?Reflect.construct(n,arguments,t7(this).constructor):n.apply(this,arguments),function(t,e){if(e&&("object"===t0(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return t3(t)}(this,t)});function l(t){var e,o,c;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,l),en(t3(c=a.call(this,t)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),en(t3(c),"accessibilityManager",new tR),en(t3(c),"handleLegendBBoxUpdate",function(t){if(t){var e=c.state,n=e.dataStartIndex,r=e.dataEndIndex,o=e.updateId;c.setState(ee({legendBBox:t},E({props:c.props,dataStartIndex:n,dataEndIndex:r,updateId:o},ee(ee({},c.state),{},{legendBBox:t}))))}}),en(t3(c),"handleReceiveSyncEvent",function(t,e,n){c.props.syncId===t&&(n!==c.eventEmitterSymbol||"function"==typeof c.props.syncMethod)&&c.applySyncEvent(e)}),en(t3(c),"handleBrushChange",function(t){var e=t.startIndex,n=t.endIndex;if(e!==c.state.dataStartIndex||n!==c.state.dataEndIndex){var r=c.state.updateId;c.setState(function(){return ee({dataStartIndex:e,dataEndIndex:n},E({props:c.props,dataStartIndex:e,dataEndIndex:n,updateId:r},c.state))}),c.triggerSyncEvent({dataStartIndex:e,dataEndIndex:n})}}),en(t3(c),"handleMouseEnter",function(t){var e=c.getMouseInfo(t);if(e){var n=ee(ee({},e),{},{isTooltipActive:!0});c.setState(n),c.triggerSyncEvent(n);var r=c.props.onMouseEnter;u()(r)&&r(n,t)}}),en(t3(c),"triggeredAfterMouseMove",function(t){var e=c.getMouseInfo(t),n=e?ee(ee({},e),{},{isTooltipActive:!0}):{isTooltipActive:!1};c.setState(n),c.triggerSyncEvent(n);var r=c.props.onMouseMove;u()(r)&&r(n,t)}),en(t3(c),"handleItemMouseEnter",function(t){c.setState(function(){return{isTooltipActive:!0,activeItem:t,activePayload:t.tooltipPayload,activeCoordinate:t.tooltipPosition||{x:t.cx,y:t.cy}}})}),en(t3(c),"handleItemMouseLeave",function(){c.setState(function(){return{isTooltipActive:!1}})}),en(t3(c),"handleMouseMove",function(t){t.persist(),c.throttleTriggeredAfterMouseMove(t)}),en(t3(c),"handleMouseLeave",function(t){var e={isTooltipActive:!1};c.setState(e),c.triggerSyncEvent(e);var n=c.props.onMouseLeave;u()(n)&&n(e,t)}),en(t3(c),"handleOuterEvent",function(t){var e,n=(0,A.Bh)(t),r=f()(c.props,"".concat(n));n&&u()(r)&&r(null!==(e=/.*touch.*/i.test(n)?c.getMouseInfo(t.changedTouches[0]):c.getMouseInfo(t))&&void 0!==e?e:{},t)}),en(t3(c),"handleClick",function(t){var e=c.getMouseInfo(t);if(e){var n=ee(ee({},e),{},{isTooltipActive:!0});c.setState(n),c.triggerSyncEvent(n);var r=c.props.onClick;u()(r)&&r(n,t)}}),en(t3(c),"handleMouseDown",function(t){var e=c.props.onMouseDown;u()(e)&&e(c.getMouseInfo(t),t)}),en(t3(c),"handleMouseUp",function(t){var e=c.props.onMouseUp;u()(e)&&e(c.getMouseInfo(t),t)}),en(t3(c),"handleTouchMove",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&c.throttleTriggeredAfterMouseMove(t.changedTouches[0])}),en(t3(c),"handleTouchStart",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&c.handleMouseDown(t.changedTouches[0])}),en(t3(c),"handleTouchEnd",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&c.handleMouseUp(t.changedTouches[0])}),en(t3(c),"triggerSyncEvent",function(t){void 0!==c.props.syncId&&tC.emit(tN,c.props.syncId,t,c.eventEmitterSymbol)}),en(t3(c),"applySyncEvent",function(t){var e=c.props,n=e.layout,r=e.syncMethod,o=c.state.updateId,i=t.dataStartIndex,a=t.dataEndIndex;if(void 0!==t.dataStartIndex||void 0!==t.dataEndIndex)c.setState(ee({dataStartIndex:i,dataEndIndex:a},E({props:c.props,dataStartIndex:i,dataEndIndex:a,updateId:o},c.state)));else if(void 0!==t.activeTooltipIndex){var u=t.chartX,l=t.chartY,s=t.activeTooltipIndex,f=c.state,p=f.offset,h=f.tooltipTicks;if(!p)return;if("function"==typeof r)s=r(h,t);else if("value"===r){s=-1;for(var d=0;d=0){if(s.dataKey&&!s.allowDuplicatedCategory){var P="function"==typeof s.dataKey?function(t){return"function"==typeof s.dataKey?s.dataKey(t.payload):null}:"payload.".concat(s.dataKey.toString());_=(0,C.Ap)(v,P,p),N=m&&g&&(0,C.Ap)(g,P,p)}else _=null==v?void 0:v[f],N=m&&g&&g[f];if(j||w){var M=void 0!==t.props.activeIndex?t.props.activeIndex:f;return[(0,r.cloneElement)(t,ee(ee(ee({},o.props),E),{},{activeIndex:M})),null,null]}if(!i()(_))return[k].concat(t8(c.renderActivePoints({item:o,activePoint:_,basePoint:N,childIndex:f,isRange:m})))}else{var _,N,D,I=(null!==(D=c.getItemByXY(c.state.activeCoordinate))&&void 0!==D?D:{graphicalItem:k}).graphicalItem,L=I.item,B=void 0===L?t:L,R=I.childIndex,z=ee(ee(ee({},o.props),E),{},{activeIndex:R});return[(0,r.cloneElement)(B,z),null,null]}}return m?[k,null,null]:[k,null]}),en(t3(c),"renderCustomized",function(t,e,n){return(0,r.cloneElement)(t,ee(ee({key:"recharts-customized-".concat(n)},c.props),c.state))}),en(t3(c),"renderMap",{CartesianGrid:{handler:c.renderGrid,once:!0},ReferenceArea:{handler:c.renderReferenceElement},ReferenceLine:{handler:eu},ReferenceDot:{handler:c.renderReferenceElement},XAxis:{handler:eu},YAxis:{handler:eu},Brush:{handler:c.renderBrush,once:!0},Bar:{handler:c.renderGraphicChild},Line:{handler:c.renderGraphicChild},Area:{handler:c.renderGraphicChild},Radar:{handler:c.renderGraphicChild},RadialBar:{handler:c.renderGraphicChild},Scatter:{handler:c.renderGraphicChild},Pie:{handler:c.renderGraphicChild},Funnel:{handler:c.renderGraphicChild},Tooltip:{handler:c.renderCursor,once:!0},PolarGrid:{handler:c.renderPolarGrid,once:!0},PolarAngleAxis:{handler:c.renderPolarAxis},PolarRadiusAxis:{handler:c.renderPolarAxis},Customized:{handler:c.renderCustomized}}),c.clipPathId="".concat(null!==(e=t.id)&&void 0!==e?e:(0,C.EL)("recharts"),"-clip"),c.throttleTriggeredAfterMouseMove=y()(c.triggeredAfterMouseMove,null!==(o=t.throttleDelay)&&void 0!==o?o:1e3/60),c.state={},c}return o=[{key:"componentDidMount",value:function(){var t,e;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(t=this.props.margin.left)&&void 0!==t?t:0,top:null!==(e=this.props.margin.top)&&void 0!==e?e:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var t=this.props,e=t.children,n=t.data,r=t.height,o=t.layout,i=(0,A.sP)(e,S.u);if(i){var a=i.props.defaultIndex;if("number"==typeof a&&!(a<0)&&!(a>this.state.tooltipTicks.length)){var u=this.state.tooltipTicks[a]&&this.state.tooltipTicks[a].value,c=ef(this.state,n,a,u),l=this.state.tooltipTicks[a].coordinate,s=(this.state.offset.top+r)/2,f="horizontal"===o?{x:l,y:s}:{y:l,x:s},p=this.state.formattedGraphicalItems.find(function(t){return"Scatter"===t.item.type.name});p&&(f=ee(ee({},f),p.props.points[a].tooltipPosition),c=p.props.points[a].tooltipPayload);var h={activeTooltipIndex:a,isTooltipActive:!0,activeLabel:u,activePayload:c,activeCoordinate:f};this.setState(h),this.renderCursor(i),this.accessibilityManager.setIndex(a)}}}},{key:"getSnapshotBeforeUpdate",value:function(t,e){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==e.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==t.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==t.margin){var n,r;this.accessibilityManager.setDetails({offset:{left:null!==(n=this.props.margin.left)&&void 0!==n?n:0,top:null!==(r=this.props.margin.top)&&void 0!==r?r:0}})}return null}},{key:"componentDidUpdate",value:function(t){(0,A.rL)([(0,A.sP)(t.children,S.u)],[(0,A.sP)(this.props.children,S.u)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var t=(0,A.sP)(this.props.children,S.u);if(t&&"boolean"==typeof t.props.shared){var e=t.props.shared?"axis":"item";return s.indexOf(e)>=0?e:c}return c}},{key:"getMouseInfo",value:function(t){if(!this.container)return null;var e=this.container,n=e.getBoundingClientRect(),r=(0,J.os)(n),o={chartX:Math.round(t.pageX-r.left),chartY:Math.round(t.pageY-r.top)},i=n.width/e.offsetWidth||1,a=this.inRange(o.chartX,o.chartY,i);if(!a)return null;var u=this.state,c=u.xAxisMap,l=u.yAxisMap;if("axis"!==this.getTooltipEventType()&&c&&l){var s=(0,C.Kt)(c).scale,f=(0,C.Kt)(l).scale,p=s&&s.invert?s.invert(o.chartX):null,h=f&&f.invert?f.invert(o.chartY):null;return ee(ee({},o),{},{xValue:p,yValue:h})}var d=ep(this.state,this.props.data,this.props.layout,a);return d?ee(ee({},o),d):null}},{key:"inRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.props.layout,o=t/n,i=e/n;if("horizontal"===r||"vertical"===r){var a=this.state.offset;return o>=a.left&&o<=a.left+a.width&&i>=a.top&&i<=a.top+a.height?{x:o,y:i}:null}var u=this.state,c=u.angleAxisMap,l=u.radiusAxisMap;if(c&&l){var s=(0,C.Kt)(c);return(0,tM.z3)({x:o,y:i},s)}return null}},{key:"parseEventsOfWrapper",value:function(){var t=this.props.children,e=this.getTooltipEventType(),n=(0,A.sP)(t,S.u),r={};return n&&"axis"===e&&(r="click"===n.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),ee(ee({},(0,tD.Ym)(this.props,this.handleOuterEvent)),r)}},{key:"addListener",value:function(){tC.on(tN,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){tC.removeListener(tN,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(t,e,n){for(var r=this.state.formattedGraphicalItems,o=0,i=r.length;ot.length)&&(e=t.length);for(var n=0,r=Array(e);n=0?1:-1;"insideStart"===u?(o=g+S*l,a=O):"insideEnd"===u?(o=b-S*l,a=!O):"end"===u&&(o=b+S*l,a=O),a=j<=0?a:!a;var E=(0,d.op)(p,y,w,o),k=(0,d.op)(p,y,w,o+(a?1:-1)*359),P="M".concat(E.x,",").concat(E.y,"\n A").concat(w,",").concat(w,",0,1,").concat(a?0:1,",\n ").concat(k.x,",").concat(k.y),A=i()(t.id)?(0,h.EL)("recharts-radial-line-"):t.id;return r.createElement("text",x({},n,{dominantBaseline:"central",className:(0,s.Z)("recharts-radial-bar-label",f)}),r.createElement("defs",null,r.createElement("path",{id:A,d:P})),r.createElement("textPath",{xlinkHref:"#".concat(A)},e))},j=function(t){var e=t.viewBox,n=t.offset,r=t.position,o=e.cx,i=e.cy,a=e.innerRadius,u=e.outerRadius,c=(e.startAngle+e.endAngle)/2;if("outside"===r){var l=(0,d.op)(o,i,u+n,c),s=l.x;return{x:s,y:l.y,textAnchor:s>=o?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"end"};var f=(0,d.op)(o,i,(a+u)/2,c);return{x:f.x,y:f.y,textAnchor:"middle",verticalAnchor:"middle"}},S=function(t){var e=t.viewBox,n=t.parentViewBox,r=t.offset,o=t.position,i=e.x,a=e.y,u=e.width,c=e.height,s=c>=0?1:-1,f=s*r,p=s>0?"end":"start",d=s>0?"start":"end",y=u>=0?1:-1,v=y*r,m=y>0?"end":"start",g=y>0?"start":"end";if("top"===o)return b(b({},{x:i+u/2,y:a-s*r,textAnchor:"middle",verticalAnchor:p}),n?{height:Math.max(a-n.y,0),width:u}:{});if("bottom"===o)return b(b({},{x:i+u/2,y:a+c+f,textAnchor:"middle",verticalAnchor:d}),n?{height:Math.max(n.y+n.height-(a+c),0),width:u}:{});if("left"===o){var x={x:i-v,y:a+c/2,textAnchor:m,verticalAnchor:"middle"};return b(b({},x),n?{width:Math.max(x.x-n.x,0),height:c}:{})}if("right"===o){var O={x:i+u+v,y:a+c/2,textAnchor:g,verticalAnchor:"middle"};return b(b({},O),n?{width:Math.max(n.x+n.width-O.x,0),height:c}:{})}var w=n?{width:u,height:c}:{};return"insideLeft"===o?b({x:i+v,y:a+c/2,textAnchor:g,verticalAnchor:"middle"},w):"insideRight"===o?b({x:i+u-v,y:a+c/2,textAnchor:m,verticalAnchor:"middle"},w):"insideTop"===o?b({x:i+u/2,y:a+f,textAnchor:"middle",verticalAnchor:d},w):"insideBottom"===o?b({x:i+u/2,y:a+c-f,textAnchor:"middle",verticalAnchor:p},w):"insideTopLeft"===o?b({x:i+v,y:a+f,textAnchor:g,verticalAnchor:d},w):"insideTopRight"===o?b({x:i+u-v,y:a+f,textAnchor:m,verticalAnchor:d},w):"insideBottomLeft"===o?b({x:i+v,y:a+c-f,textAnchor:g,verticalAnchor:p},w):"insideBottomRight"===o?b({x:i+u-v,y:a+c-f,textAnchor:m,verticalAnchor:p},w):l()(o)&&((0,h.hj)(o.x)||(0,h.hU)(o.x))&&((0,h.hj)(o.y)||(0,h.hU)(o.y))?b({x:i+(0,h.h1)(o.x,u),y:a+(0,h.h1)(o.y,c),textAnchor:"end",verticalAnchor:"end"},w):b({x:i+u/2,y:a+c/2,textAnchor:"middle",verticalAnchor:"middle"},w)};function E(t){var e,n=t.offset,o=b({offset:void 0===n?5:n},function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,v)),a=o.viewBox,c=o.position,l=o.value,d=o.children,y=o.content,m=o.className,g=o.textBreakAll;if(!a||i()(l)&&i()(d)&&!(0,r.isValidElement)(y)&&!u()(y))return null;if((0,r.isValidElement)(y))return(0,r.cloneElement)(y,o);if(u()(y)){if(e=(0,r.createElement)(y,o),(0,r.isValidElement)(e))return e}else e=O(o);var E="cx"in a&&(0,h.hj)(a.cx),k=(0,p.L6)(o,!0);if(E&&("insideStart"===c||"insideEnd"===c||"end"===c))return w(o,e,k);var P=E?j(o):S(o);return r.createElement(f.x,x({className:(0,s.Z)("recharts-label",void 0===m?"":m)},k,P,{breakAll:g}),e)}E.displayName="Label";var k=function(t){var e=t.cx,n=t.cy,r=t.angle,o=t.startAngle,i=t.endAngle,a=t.r,u=t.radius,c=t.innerRadius,l=t.outerRadius,s=t.x,f=t.y,p=t.top,d=t.left,y=t.width,v=t.height,m=t.clockWise,g=t.labelViewBox;if(g)return g;if((0,h.hj)(y)&&(0,h.hj)(v)){if((0,h.hj)(s)&&(0,h.hj)(f))return{x:s,y:f,width:y,height:v};if((0,h.hj)(p)&&(0,h.hj)(d))return{x:p,y:d,width:y,height:v}}return(0,h.hj)(s)&&(0,h.hj)(f)?{x:s,y:f,width:0,height:0}:(0,h.hj)(e)&&(0,h.hj)(n)?{cx:e,cy:n,startAngle:o||r||0,endAngle:i||r||0,innerRadius:c||0,outerRadius:l||u||a||0,clockWise:m}:t.viewBox?t.viewBox:{}};E.parseViewBox=k,E.renderCallByParent=function(t,e){var n,o,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t||!t.children&&i&&!t.label)return null;var a=t.children,c=k(t),s=(0,p.NN)(a,E).map(function(t,n){return(0,r.cloneElement)(t,{viewBox:e||c,key:"label-".concat(n)})});return i?[(n=t.label,o=e||c,n?!0===n?r.createElement(E,{key:"label-implicit",viewBox:o}):(0,h.P2)(n)?r.createElement(E,{key:"label-implicit",viewBox:o,value:n}):(0,r.isValidElement)(n)?n.type===E?(0,r.cloneElement)(n,{key:"label-implicit",viewBox:o}):r.createElement(E,{key:"label-implicit",content:n,viewBox:o}):u()(n)?r.createElement(E,{key:"label-implicit",content:n,viewBox:o}):l()(n)?r.createElement(E,x({viewBox:o},n,{key:"label-implicit"})):null:null)].concat(function(t){if(Array.isArray(t))return m(t)}(s)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(s)||function(t,e){if(t){if("string"==typeof t)return m(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,void 0)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):s}},58772:function(t,e,n){"use strict";n.d(e,{e:function(){return E}});var r=n(2265),o=n(77571),i=n.n(o),a=n(28302),u=n.n(a),c=n(86757),l=n.n(c),s=n(86185),f=n.n(s),p=n(26680),h=n(9841),d=n(82944),y=n(85355);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var m=["valueAccessor"],g=["data","dataKey","clockWise","id","textBreakAll"];function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var S=function(t){return Array.isArray(t.value)?f()(t.value):t.value};function E(t){var e=t.valueAccessor,n=void 0===e?S:e,o=j(t,m),a=o.data,u=o.dataKey,c=o.clockWise,l=o.id,s=o.textBreakAll,f=j(o,g);return a&&a.length?r.createElement(h.m,{className:"recharts-label-list"},a.map(function(t,e){var o=i()(u)?n(t,e):(0,y.F$)(t&&t.payload,u),a=i()(l)?{}:{id:"".concat(l,"-").concat(e)};return r.createElement(p._,x({},(0,d.L6)(t,!0),f,a,{parentViewBox:t.parentViewBox,value:o,textBreakAll:s,viewBox:p._.parseViewBox(i()(c)?t:w(w({},t),{},{clockWise:c})),key:"label-".concat(e),index:e}))})):null}E.displayName="LabelList",E.renderCallByParent=function(t,e){var n,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t||!t.children&&o&&!t.label)return null;var i=t.children,a=(0,d.NN)(i,E).map(function(t,n){return(0,r.cloneElement)(t,{data:e,key:"labelList-".concat(n)})});return o?[(n=t.label)?!0===n?r.createElement(E,{key:"labelList-implicit",data:e}):r.isValidElement(n)||l()(n)?r.createElement(E,{key:"labelList-implicit",data:e,content:n}):u()(n)?r.createElement(E,x({data:e},n,{key:"labelList-implicit"})):null:null].concat(function(t){if(Array.isArray(t))return b(t)}(a)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return b(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,void 0)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):a}},22190:function(t,e,n){"use strict";n.d(e,{D:function(){return C}});var r=n(2265),o=n(86757),i=n.n(o),a=n(87602),u=n(1175),c=n(48777),l=n(14870),s=n(41637);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(){return(p=Object.assign?Object.assign.bind():function(t){for(var e=1;e');var O=e.inactive?h:e.color;return r.createElement("li",p({className:b,style:y,key:"legend-item-".concat(n)},(0,s.bw)(t.props,e,n)),r.createElement(c.T,{width:o,height:o,viewBox:d,style:m},t.renderIcon(e)),r.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},g?g(x,e,n):x))})}},{key:"render",value:function(){var t=this.props,e=t.payload,n=t.layout,o=t.align;return e&&e.length?r.createElement("ul",{className:"recharts-default-legend",style:{padding:0,margin:0,textAlign:"horizontal"===n?o:"left"}},this.renderItems()):null}}],function(t,e){for(var n=0;n1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height,t&&t(e))}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,t&&t(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?S({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(t){var e,n,r=this.props,o=r.layout,i=r.align,a=r.verticalAlign,u=r.margin,c=r.chartWidth,l=r.chartHeight;return t&&(void 0!==t.left&&null!==t.left||void 0!==t.right&&null!==t.right)||(e="center"===i&&"vertical"===o?{left:((c||0)-this.getBBoxSnapshot().width)/2}:"right"===i?{right:u&&u.right||0}:{left:u&&u.left||0}),t&&(void 0!==t.top&&null!==t.top||void 0!==t.bottom&&null!==t.bottom)||(n="middle"===a?{top:((l||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:u&&u.bottom||0}:{top:u&&u.top||0}),S(S({},e),n)}},{key:"render",value:function(){var t=this,e=this.props,n=e.content,o=e.width,i=e.height,a=e.wrapperStyle,u=e.payloadUniqBy,c=e.payload,l=S(S({position:"absolute",width:o||"auto",height:i||"auto"},this.getDefaultPosition(a)),a);return r.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(e){t.wrapperNode=e}},function(t,e){if(r.isValidElement(t))return r.cloneElement(t,e);if("function"==typeof t)return r.createElement(t,e);e.ref;var n=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,w);return r.createElement(g,n)}(n,S(S({},this.props),{},{payload:(0,x.z)(c,u,T)})))}}],o=[{key:"getWithHeight",value:function(t,e){var n=t.props.layout;return"vertical"===n&&(0,b.hj)(t.props.height)?{height:t.props.height}:"horizontal"===n?{width:t.props.width||e}:null}}],n&&E(a.prototype,n),o&&E(a,o),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);M(C,"displayName","Legend"),M(C,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"})},47625:function(t,e,n){"use strict";n.d(e,{h:function(){return y}});var r=n(87602),o=n(2265),i=n(37065),a=n.n(i),u=n(82558),c=n(16630),l=n(1175),s=n(82944);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&(t=a()(t,E,{trailing:!0,leading:!1}));var e=new ResizeObserver(t),n=_.current.getBoundingClientRect();return I(n.width,n.height),e.observe(_.current),function(){e.disconnect()}},[I,E]);var L=(0,o.useMemo)(function(){var t=N.containerWidth,e=N.containerHeight;if(t<0||e<0)return null;(0,l.Z)((0,c.hU)(v)||(0,c.hU)(g),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",v,g),(0,l.Z)(!i||i>0,"The aspect(%s) must be greater than zero.",i);var n=(0,c.hU)(v)?t:v,r=(0,c.hU)(g)?e:g;i&&i>0&&(n?r=n/i:r&&(n=r*i),w&&r>w&&(r=w)),(0,l.Z)(n>0||r>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,r,v,g,x,O,i);var a=!Array.isArray(j)&&(0,u.isElement)(j)&&(0,s.Gf)(j.type).endsWith("Chart");return o.Children.map(j,function(t){return(0,u.isElement)(t)?(0,o.cloneElement)(t,h({width:n,height:r},a?{style:h({height:"100%",width:"100%",maxHeight:r,maxWidth:n},t.props.style)}:{})):t})},[i,j,g,w,O,x,N,v]);return o.createElement("div",{id:k?"".concat(k):void 0,className:(0,r.Z)("recharts-responsive-container",P),style:h(h({},void 0===M?{}:M),{},{width:v,height:g,minWidth:x,minHeight:O,maxHeight:w}),ref:_},L)})},58811:function(t,e,n){"use strict";n.d(e,{x:function(){return B}});var r=n(2265),o=n(77571),i=n.n(o),a=n(87602),u=n(16630),c=n(34067),l=n(82944),s=n(4094);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function M(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&void 0!==arguments[0]?arguments[0]:[];return t.reduce(function(t,e){var i=e.word,a=e.width,u=t[t.length-1];return u&&(null==r||o||u.width+a+na||e.reduce(function(t,e){return t.width>e.width?t:e}).width>Number(r),e]},y=0,v=c.length-1,m=0;y<=v&&m<=c.length-1;){var g=Math.floor((y+v)/2),b=M(d(g-1),2),x=b[0],O=b[1],w=M(d(g),1)[0];if(x||w||(y=g+1),x&&w&&(v=g-1),!x&&w){i=O;break}m++}return i||h},D=function(t){return[{words:i()(t)?[]:t.toString().split(T)}]},I=function(t){var e=t.width,n=t.scaleToFit,r=t.children,o=t.style,i=t.breakAll,a=t.maxLines;if((e||n)&&!c.x.isSsr){var u=C({breakAll:i,children:r,style:o});return u?N({breakAll:i,children:r,maxLines:a,style:o},u.wordsWithComputedWidth,u.spaceWidth,e,n):D(r)}return D(r)},L="#808080",B=function(t){var e,n=t.x,o=void 0===n?0:n,i=t.y,c=void 0===i?0:i,s=t.lineHeight,f=void 0===s?"1em":s,p=t.capHeight,h=void 0===p?"0.71em":p,d=t.scaleToFit,y=void 0!==d&&d,v=t.textAnchor,m=t.verticalAnchor,g=t.fill,b=void 0===g?L:g,x=A(t,E),O=(0,r.useMemo)(function(){return I({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:y,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,y,x.style,x.width]),w=x.dx,j=x.dy,M=x.angle,_=x.className,T=x.breakAll,C=A(x,k);if(!(0,u.P2)(o)||!(0,u.P2)(c))return null;var N=o+((0,u.hj)(w)?w:0),D=c+((0,u.hj)(j)?j:0);switch(void 0===m?"end":m){case"start":e=S("calc(".concat(h,")"));break;case"middle":e=S("calc(".concat((O.length-1)/2," * -").concat(f," + (").concat(h," / 2))"));break;default:e=S("calc(".concat(O.length-1," * -").concat(f,")"))}var B=[];if(y){var R=O[0].width,z=x.width;B.push("scale(".concat(((0,u.hj)(z)?z/R:1)/R,")"))}return M&&B.push("rotate(".concat(M,", ").concat(N,", ").concat(D,")")),B.length&&(C.transform=B.join(" ")),r.createElement("text",P({},(0,l.L6)(C,!0),{x:N,y:D,className:(0,a.Z)("recharts-text",_),textAnchor:void 0===v?"start":v,fill:b.includes("url")?L:b}),O.map(function(t,n){var o=t.words.join(T?"":" ");return r.createElement("tspan",{x:N,dy:0===n?e:f,key:o},o)}))}},8147:function(t,e,n){"use strict";n.d(e,{u:function(){return F}});var r=n(2265),o=n(34935),i=n.n(o),a=n(77571),u=n.n(a),c=n(87602),l=n(16630);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nc[r]+s?Math.max(f,c[r]):Math.max(p,c[r])}function w(t){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function S(t){for(var e=1;e1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height)}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.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 t,e;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(t=this.props.coordinate)||void 0===t?void 0:t.x)!==this.state.dismissedAtCoordinate.x||(null===(e=this.props.coordinate)||void 0===e?void 0:e.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var t,e,n,o,i,a,u,s,f,p,h,d,y,m,w,j,E,k,P,A,M,_=this,T=this.props,C=T.active,N=T.allowEscapeViewBox,D=T.animationDuration,I=T.animationEasing,L=T.children,B=T.coordinate,R=T.hasPayload,z=T.isAnimationActive,U=T.offset,F=T.position,$=T.reverseDirection,q=T.useTranslate3d,Z=T.viewBox,W=T.wrapperStyle,G=(m=(t={allowEscapeViewBox:N,coordinate:B,offsetTopLeft:U,position:F,reverseDirection:$,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:q,viewBox:Z}).allowEscapeViewBox,w=t.coordinate,j=t.offsetTopLeft,E=t.position,k=t.reverseDirection,P=t.tooltipBox,A=t.useTranslate3d,M=t.viewBox,P.height>0&&P.width>0&&w?(n=(e={translateX:d=O({allowEscapeViewBox:m,coordinate:w,key:"x",offsetTopLeft:j,position:E,reverseDirection:k,tooltipDimension:P.width,viewBox:M,viewBoxDimension:M.width}),translateY:y=O({allowEscapeViewBox:m,coordinate:w,key:"y",offsetTopLeft:j,position:E,reverseDirection:k,tooltipDimension:P.height,viewBox:M,viewBoxDimension:M.height}),useTranslate3d:A}).translateX,o=e.translateY,i=e.useTranslate3d,h=(0,v.bO)({transform:i?"translate3d(".concat(n,"px, ").concat(o,"px, 0)"):"translate(".concat(n,"px, ").concat(o,"px)")})):h=x,{cssProperties:h,cssClasses:(s=(a={translateX:d,translateY:y,coordinate:w}).coordinate,f=a.translateX,p=a.translateY,(0,c.Z)(b,(g(u={},"".concat(b,"-right"),(0,l.hj)(f)&&s&&(0,l.hj)(s.x)&&f>=s.x),g(u,"".concat(b,"-left"),(0,l.hj)(f)&&s&&(0,l.hj)(s.x)&&f=s.y),g(u,"".concat(b,"-top"),(0,l.hj)(p)&&s&&(0,l.hj)(s.y)&&p0;return r.createElement(_,{allowEscapeViewBox:i,animationDuration:a,animationEasing:u,isAnimationActive:f,active:o,coordinate:l,hasPayload:w,offset:p,position:v,reverseDirection:m,useTranslate3d:g,viewBox:b,wrapperStyle:x},(t=I(I({},this.props),{},{payload:O}),r.isValidElement(c)?r.cloneElement(c,t):"function"==typeof c?r.createElement(c,t):r.createElement(y,t)))}}],function(t,e){for(var n=0;n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,a),s=(0,o.Z)("recharts-layer",c);return r.createElement("g",u({className:s},(0,i.L6)(l,!0),{ref:e}),n)})},48777:function(t,e,n){"use strict";n.d(e,{T:function(){return c}});var r=n(2265),o=n(87602),i=n(82944),a=["children","width","height","viewBox","className","style","title","desc"];function u(){return(u=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,a),y=l||{width:n,height:c,x:0,y:0},v=(0,o.Z)("recharts-surface",s);return r.createElement("svg",u({},(0,i.L6)(d,!0,"svg"),{className:v,width:n,height:c,style:f,viewBox:"".concat(y.x," ").concat(y.y," ").concat(y.width," ").concat(y.height)}),r.createElement("title",null,p),r.createElement("desc",null,h),e)}},25739:function(t,e,n){"use strict";n.d(e,{br:function(){return d},Mw:function(){return O},zn:function(){return x},sp:function(){return y},qD:function(){return b},d2:function(){return g},bH:function(){return v},Ud:function(){return m}});var r=n(2265),o=n(69398),i=n(50967),a=n.n(i)()(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),u=(0,r.createContext)(void 0),c=(0,r.createContext)(void 0),l=(0,r.createContext)(void 0),s=(0,r.createContext)({}),f=(0,r.createContext)(void 0),p=(0,r.createContext)(0),h=(0,r.createContext)(0),d=function(t){var e=t.state,n=e.xAxisMap,o=e.yAxisMap,i=e.offset,d=t.clipPathId,y=t.children,v=t.width,m=t.height,g=a(i);return r.createElement(u.Provider,{value:n},r.createElement(c.Provider,{value:o},r.createElement(s.Provider,{value:i},r.createElement(l.Provider,{value:g},r.createElement(f.Provider,{value:d},r.createElement(p.Provider,{value:m},r.createElement(h.Provider,{value:v},y)))))))},y=function(){return(0,r.useContext)(f)},v=function(t){var e=(0,r.useContext)(u);null!=e||(0,o.Z)(!1);var n=e[t];return null!=n||(0,o.Z)(!1),n},m=function(t){var e=(0,r.useContext)(c);null!=e||(0,o.Z)(!1);var n=e[t];return null!=n||(0,o.Z)(!1),n},g=function(){return(0,r.useContext)(l)},b=function(){return(0,r.useContext)(s)},x=function(){return(0,r.useContext)(h)},O=function(){return(0,r.useContext)(p)}},57165:function(t,e,n){"use strict";n.d(e,{H:function(){return X}});var r=n(2265);function o(){}function i(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function a(t){this._context=t}function u(t){this._context=t}function c(t){this._context=t}a.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:i(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},u.prototype={areaStart:o,areaEnd:o,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)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},c.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};class l{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function s(t){this._context=t}function f(t){this._context=t}function p(t){return new f(t)}function h(t,e,n){var r=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(r||o<0&&-0),a=(n-t._y1)/(o||r<0&&-0);return((i<0?-1:1)+(a<0?-1:1))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs((i*o+a*r)/(r+o)))||0}function d(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function y(t,e,n){var r=t._x0,o=t._y0,i=t._x1,a=t._y1,u=(i-r)/3;t._context.bezierCurveTo(r+u,o+u*e,i-u,a-u*n,i,a)}function v(t){this._context=t}function m(t){this._context=new g(t)}function g(t){this._context=t}function b(t){this._context=t}function x(t){var e,n,r=t.length-1,o=Array(r),i=Array(r),a=Array(r);for(o[0]=0,i[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)o[e]=(a[e]-o[e+1])/i[e];for(e=0,i[r-1]=(t[r]+o[r-1])/2;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var w=n(22516),j=n(76115),S=n(67790);function E(t){return t[0]}function k(t){return t[1]}function P(t,e){var n=(0,j.Z)(!0),r=null,o=p,i=null,a=(0,S.d)(u);function u(u){var c,l,s,f=(u=(0,w.Z)(u)).length,p=!1;for(null==r&&(i=o(s=a())),c=0;c<=f;++c)!(c=f;--p)u.point(m[p],g[p]);u.lineEnd(),u.areaEnd()}}v&&(m[s]=+t(h,s,l),g[s]=+e(h,s,l),u.point(r?+r(h,s,l):m[s],n?+n(h,s,l):g[s]))}if(d)return u=null,d+""||null}function s(){return P().defined(o).curve(a).context(i)}return t="function"==typeof t?t:void 0===t?E:(0,j.Z)(+t),e="function"==typeof e?e:void 0===e?(0,j.Z)(0):(0,j.Z)(+e),n="function"==typeof n?n:void 0===n?k:(0,j.Z)(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:(0,j.Z)(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:(0,j.Z)(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:(0,j.Z)(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:(0,j.Z)(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:(0,j.Z)(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:(0,j.Z)(+t),l):n},l.lineX0=l.lineY0=function(){return s().x(t).y(e)},l.lineY1=function(){return s().x(t).y(n)},l.lineX1=function(){return s().x(r).y(e)},l.defined=function(t){return arguments.length?(o="function"==typeof t?t:(0,j.Z)(!!t),l):o},l.curve=function(t){return arguments.length?(a=t,null!=i&&(u=a(i)),l):a},l.context=function(t){return arguments.length?(null==t?i=u=null:u=a(i=t),l):i},l}var M=n(75551),_=n.n(M),T=n(86757),C=n.n(T),N=n(87602),D=n(41637),I=n(82944),L=n(16630);function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(){return(R=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n=0?1:-1,c=n>=0?1:-1,l=r>=0&&n>=0||r<0&&n<0?1:0;if(a>0&&o instanceof Array){for(var s=[0,0,0,0],f=0;f<4;f++)s[f]=o[f]>a?a:o[f];i="M".concat(t,",").concat(e+u*s[0]),s[0]>0&&(i+="A ".concat(s[0],",").concat(s[0],",0,0,").concat(l,",").concat(t+c*s[0],",").concat(e)),i+="L ".concat(t+n-c*s[1],",").concat(e),s[1]>0&&(i+="A ".concat(s[1],",").concat(s[1],",0,0,").concat(l,",\n ").concat(t+n,",").concat(e+u*s[1])),i+="L ".concat(t+n,",").concat(e+r-u*s[2]),s[2]>0&&(i+="A ".concat(s[2],",").concat(s[2],",0,0,").concat(l,",\n ").concat(t+n-c*s[2],",").concat(e+r)),i+="L ".concat(t+c*s[3],",").concat(e+r),s[3]>0&&(i+="A ".concat(s[3],",").concat(s[3],",0,0,").concat(l,",\n ").concat(t,",").concat(e+r-u*s[3])),i+="Z"}else if(a>0&&o===+o&&o>0){var p=Math.min(a,o);i="M ".concat(t,",").concat(e+u*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+c*p,",").concat(e,"\n L ").concat(t+n-c*p,",").concat(e,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+n,",").concat(e+u*p,"\n L ").concat(t+n,",").concat(e+r-u*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+n-c*p,",").concat(e+r,"\n L ").concat(t+c*p,",").concat(e+r,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t,",").concat(e+r-u*p," Z")}else i="M ".concat(t,",").concat(e," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return i},h=function(t,e){if(!t||!e)return!1;var n=t.x,r=t.y,o=e.x,i=e.y,a=e.width,u=e.height;return!!(Math.abs(a)>0&&Math.abs(u)>0)&&n>=Math.min(o,o+a)&&n<=Math.max(o,o+a)&&r>=Math.min(i,i+u)&&r<=Math.max(i,i+u)},d={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},y=function(t){var e,n=f(f({},d),t),u=(0,r.useRef)(),s=function(t){if(Array.isArray(t))return t}(e=(0,r.useState)(-1))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{for(i=(n=n.call(t)).next;!(c=(r=i.call(n)).done)&&(u.push(r.value),2!==u.length);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,2)||function(t,e){if(t){if("string"==typeof t)return l(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=s[0],y=s[1];(0,r.useEffect)(function(){if(u.current&&u.current.getTotalLength)try{var t=u.current.getTotalLength();t&&y(t)}catch(t){}},[]);var v=n.x,m=n.y,g=n.width,b=n.height,x=n.radius,O=n.className,w=n.animationEasing,j=n.animationDuration,S=n.animationBegin,E=n.isAnimationActive,k=n.isUpdateAnimationActive;if(v!==+v||m!==+m||g!==+g||b!==+b||0===g||0===b)return null;var P=(0,o.Z)("recharts-rectangle",O);return k?r.createElement(i.ZP,{canBegin:h>0,from:{width:g,height:b,x:v,y:m},to:{width:g,height:b,x:v,y:m},duration:j,animationEasing:w,isActive:k},function(t){var e=t.width,o=t.height,l=t.x,s=t.y;return r.createElement(i.ZP,{canBegin:h>0,from:"0px ".concat(-1===h?1:h,"px"),to:"".concat(h,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:j,isActive:E,easing:w},r.createElement("path",c({},(0,a.L6)(n,!0),{className:P,d:p(l,s,e,o,x),ref:u})))}):r.createElement("path",c({},(0,a.L6)(n,!0),{className:P,d:p(v,m,g,b,x)}))}},60474:function(t,e,n){"use strict";n.d(e,{L:function(){return v}});var r=n(2265),o=n(87602),i=n(82944),a=n(39206),u=n(16630);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(){return(l=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(c>s),",\n ").concat(p.x,",").concat(p.y,"\n ");if(o>0){var d=(0,a.op)(n,r,o,c),y=(0,a.op)(n,r,o,s);h+="L ".concat(y.x,",").concat(y.y,"\n A ").concat(o,",").concat(o,",0,\n ").concat(+(Math.abs(l)>180),",").concat(+(c<=s),",\n ").concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},d=function(t){var e=t.cx,n=t.cy,r=t.innerRadius,o=t.outerRadius,i=t.cornerRadius,a=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,s=t.endAngle,f=(0,u.uY)(s-l),d=p({cx:e,cy:n,radius:o,angle:l,sign:f,cornerRadius:i,cornerIsExternal:c}),y=d.circleTangency,v=d.lineTangency,m=d.theta,g=p({cx:e,cy:n,radius:o,angle:s,sign:-f,cornerRadius:i,cornerIsExternal:c}),b=g.circleTangency,x=g.lineTangency,O=g.theta,w=c?Math.abs(l-s):Math.abs(l-s)-m-O;if(w<0)return a?"M ".concat(v.x,",").concat(v.y,"\n a").concat(i,",").concat(i,",0,0,1,").concat(2*i,",0\n a").concat(i,",").concat(i,",0,0,1,").concat(-(2*i),",0\n "):h({cx:e,cy:n,innerRadius:r,outerRadius:o,startAngle:l,endAngle:s});var j="M ".concat(v.x,",").concat(v.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,"\n A").concat(o,",").concat(o,",0,").concat(+(w>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,"\n ");if(r>0){var S=p({cx:e,cy:n,radius:r,angle:l,sign:f,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),E=S.circleTangency,k=S.lineTangency,P=S.theta,A=p({cx:e,cy:n,radius:r,angle:s,sign:-f,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),M=A.circleTangency,_=A.lineTangency,T=A.theta,C=c?Math.abs(l-s):Math.abs(l-s)-P-T;if(C<0&&0===i)return"".concat(j,"L").concat(e,",").concat(n,"Z");j+="L".concat(_.x,",").concat(_.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(M.x,",").concat(M.y,"\n A").concat(r,",").concat(r,",0,").concat(+(C>180),",").concat(+(f>0),",").concat(E.x,",").concat(E.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(k.x,",").concat(k.y,"Z")}else j+="L".concat(e,",").concat(n,"Z");return j},y={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},v=function(t){var e,n=f(f({},y),t),a=n.cx,c=n.cy,s=n.innerRadius,p=n.outerRadius,v=n.cornerRadius,m=n.forceCornerRadius,g=n.cornerIsExternal,b=n.startAngle,x=n.endAngle,O=n.className;if(p0&&360>Math.abs(b-x)?d({cx:a,cy:c,innerRadius:s,outerRadius:p,cornerRadius:Math.min(S,j/2),forceCornerRadius:m,cornerIsExternal:g,startAngle:b,endAngle:x}):h({cx:a,cy:c,innerRadius:s,outerRadius:p,startAngle:b,endAngle:x}),r.createElement("path",l({},(0,i.L6)(n,!0),{className:w,d:e,role:"img"}))}},14870:function(t,e,n){"use strict";n.d(e,{v:function(){return N}});var r=n(2265),o=n(75551),i=n.n(o);let a=Math.cos,u=Math.sin,c=Math.sqrt,l=Math.PI,s=2*l;var f={draw(t,e){let n=c(e/l);t.moveTo(n,0),t.arc(0,0,n,0,s)}};let p=c(1/3),h=2*p,d=u(l/10)/u(7*l/10),y=u(s/10)*d,v=-a(s/10)*d,m=c(3),g=c(3)/2,b=1/c(12),x=(b/2+1)*3;var O=n(76115),w=n(67790);c(3),c(3);var j=n(87602),S=n(82944);function E(t){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var k=["type","size","sizeType"];function P(){return(P=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,k)),{},{type:o,size:u,sizeType:l}),p=s.className,h=s.cx,d=s.cy,y=(0,S.L6)(s,!0);return h===+h&&d===+d&&u===+u?r.createElement("path",P({},y,{className:(0,j.Z)("recharts-symbols",p),transform:"translate(".concat(h,", ").concat(d,")"),d:(e=_["symbol".concat(i()(o))]||f,(function(t,e){let n=null,r=(0,w.d)(o);function o(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return t="function"==typeof t?t:(0,O.Z)(t||f),e="function"==typeof e?e:(0,O.Z)(void 0===e?64:+e),o.type=function(e){return arguments.length?(t="function"==typeof e?e:(0,O.Z)(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:(0,O.Z)(+t),o):e},o.context=function(t){return arguments.length?(n=null==t?null:t,o):n},o})().type(e).size(C(u,l,o))())})):null};N.registerSymbol=function(t,e){_["symbol".concat(i()(t))]=e}},11638:function(t,e,n){"use strict";n.d(e,{bn:function(){return C},a3:function(){return z},lT:function(){return N},V$:function(){return D},w7:function(){return I}});var r=n(2265),o=n(86757),i=n.n(o),a=n(90231),u=n.n(a),c=n(24342),l=n.n(c),s=n(21652),f=n.n(s),p=n(73649),h=n(87602),d=n(59221),y=n(82944);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(){return(m=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:p,x:c,y:l},to:{upperWidth:s,lowerWidth:f,height:p,x:c,y:l},duration:j,animationEasing:b,isActive:E},function(t){var e=t.upperWidth,i=t.lowerWidth,u=t.height,c=t.x,l=t.y;return r.createElement(d.ZP,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:j,easing:b},r.createElement("path",m({},(0,y.L6)(n,!0),{className:k,d:O(c,l,e,i,u),ref:o})))}):r.createElement("g",null,r.createElement("path",m({},(0,y.L6)(n,!0),{className:k,d:O(c,l,s,f,p)})))},S=n(60474),E=n(9841),k=n(14870),P=["option","shapeType","propTransformer","activeClassName","isActive"];function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,P);if((0,r.isValidElement)(n))e=(0,r.cloneElement)(n,_(_({},f),(0,r.isValidElement)(n)?n.props:n));else if(i()(n))e=n(f);else if(u()(n)&&!l()(n)){var p=(void 0===a?function(t,e){return _(_({},e),t)}:a)(n,f);e=r.createElement(T,{shapeType:o,elementProps:p})}else e=r.createElement(T,{shapeType:o,elementProps:f});return s?r.createElement(E.m,{className:void 0===c?"recharts-active-shape":c},e):e}function N(t,e){return null!=e&&"trapezoids"in t.props}function D(t,e){return null!=e&&"sectors"in t.props}function I(t,e){return null!=e&&"points"in t.props}function L(t,e){var n,r,o=t.x===(null==e||null===(n=e.labelViewBox)||void 0===n?void 0:n.x)||t.x===e.x,i=t.y===(null==e||null===(r=e.labelViewBox)||void 0===r?void 0:r.y)||t.y===e.y;return o&&i}function B(t,e){var n=t.endAngle===e.endAngle,r=t.startAngle===e.startAngle;return n&&r}function R(t,e){var n=t.x===e.x,r=t.y===e.y,o=t.z===e.z;return n&&r&&o}function z(t){var e,n,r,o=t.activeTooltipItem,i=t.graphicalItem,a=t.itemData,u=(N(i,o)?e="trapezoids":D(i,o)?e="sectors":I(i,o)&&(e="points"),e),c=N(i,o)?null===(n=o.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:D(i,o)?null===(r=o.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:I(i,o)?o.payload:{},l=a.filter(function(t,e){var n=f()(c,t),r=i.props[u].filter(function(t){var e;return(N(i,o)?e=L:D(i,o)?e=B:I(i,o)&&(e=R),e)(t,o)}),a=i.props[u].indexOf(r[r.length-1]);return n&&e===a});return a.indexOf(l[l.length-1])}},25311:function(t,e,n){"use strict";n.d(e,{Ky:function(){return O},O1:function(){return g},_b:function(){return b},t9:function(){return m},xE:function(){return w}});var r=n(41443),o=n.n(r),i=n(32242),a=n.n(i),u=n(85355),c=n(82944),l=n(16630),s=n(31699);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){for(var n=0;n0&&(A=Math.min((t||0)-(M[e-1]||0),A))});var _=A/P,T="vertical"===b.layout?n.height:n.width;if("gap"===b.padding&&(c=_*T/2),"no-gap"===b.padding){var C=(0,l.h1)(t.barCategoryGap,_*T),N=_*T/2;c=N-C-(N-C)/T*C}}s="xAxis"===r?[n.left+(j.left||0)+(c||0),n.left+n.width-(j.right||0)-(c||0)]:"yAxis"===r?"horizontal"===f?[n.top+n.height-(j.bottom||0),n.top+(j.top||0)]:[n.top+(j.top||0)+(c||0),n.top+n.height-(j.bottom||0)-(c||0)]:b.range,E&&(s=[s[1],s[0]]);var D=(0,u.Hq)(b,o,m),I=D.scale,L=D.realScaleType;I.domain(O).range(s),(0,u.zF)(I);var B=(0,u.g$)(I,d(d({},b),{},{realScaleType:L}));"xAxis"===r?(g="top"===x&&!S||"bottom"===x&&S,p=n.left,h=v[k]-g*b.height):"yAxis"===r&&(g="left"===x&&!S||"right"===x&&S,p=v[k]-g*b.width,h=n.top);var R=d(d(d({},b),B),{},{realScaleType:L,x:p,y:h,scale:I,width:"xAxis"===r?n.width:b.width,height:"yAxis"===r?n.height:b.height});return R.bandSize=(0,u.zT)(R,B),b.hide||"xAxis"!==r?b.hide||(v[k]+=(g?-1:1)*R.width):v[k]+=(g?-1:1)*R.height,d(d({},i),{},y({},a,R))},{})},g=function(t,e){var n=t.x,r=t.y,o=e.x,i=e.y;return{x:Math.min(n,o),y:Math.min(r,i),width:Math.abs(o-n),height:Math.abs(i-r)}},b=function(t){return g({x:t.x1,y:t.y1},{x:t.x2,y:t.y2})},x=function(){var t,e;function n(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,n),this.scale=t}return t=[{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(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.bandAware,r=e.position;if(void 0!==t){if(r)switch(r){case"start":default:return this.scale(t);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+o;case"end":var i=this.bandwidth?this.bandwidth():0;return this.scale(t)+i}if(n){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+a}return this.scale(t)}}},{key:"isInRange",value:function(t){var e=this.range(),n=e[0],r=e[e.length-1];return n<=r?t>=n&&t<=r:t>=r&&t<=n}}],e=[{key:"create",value:function(t){return new n(t)}}],t&&p(n.prototype,t),e&&p(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}();y(x,"EPS",1e-4);var O=function(t){var e=Object.keys(t).reduce(function(e,n){return d(d({},e),{},y({},n,x.create(t[n])))},{});return d(d({},e),{},{apply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.bandAware,i=n.position;return o()(t,function(t,n){return e[n].apply(t,{bandAware:r,position:i})})},isInRange:function(t){return a()(t,function(t,n){return e[n].isInRange(t)})}})},w=function(t){var e=t.width,n=t.height,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(r%180+180)%180*Math.PI/180,i=Math.atan(n/e);return Math.abs(o>i&&otx(e,t()).base(e.base()),tj.o.apply(e,arguments),e}},scaleOrdinal:function(){return tY.Z},scalePoint:function(){return f.x},scalePow:function(){return tQ},scaleQuantile:function(){return function t(){var e,n=[],r=[],o=[];function i(){var t=0,e=Math.max(1,r.length);for(o=Array(e-1);++t=1)return+n(t[r-1],r-1,t);var r,o=(r-1)*e,i=Math.floor(o),a=+n(t[i],i,t);return a+(+n(t[i+1],i+1,t)-a)*(o-i)}}(n,t/e);return a}function a(t){return null==t||isNaN(t=+t)?e:r[E(o,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?o[e-1]:n[0],e=o?[i[o-1],r]:[i[e-1],i[e]]},u.unknown=function(t){return arguments.length&&(e=t),u},u.thresholds=function(){return i.slice()},u.copy=function(){return t().domain([n,r]).range(a).unknown(e)},tj.o.apply(tI(u),arguments)}},scaleRadial:function(){return function t(){var e,n=tw(),r=[0,1],o=!1;function i(t){var r,i=Math.sign(r=n(t))*Math.sqrt(Math.abs(r));return isNaN(i)?e:o?Math.round(i):i}return i.invert=function(t){return n.invert(t1(t))},i.domain=function(t){return arguments.length?(n.domain(t),i):n.domain()},i.range=function(t){return arguments.length?(n.range((r=Array.from(t,td)).map(t1)),i):r.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(o=!!t,i):o},i.clamp=function(t){return arguments.length?(n.clamp(t),i):n.clamp()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t(n.domain(),r).round(o).clamp(n.clamp()).unknown(e)},tj.o.apply(i,arguments),tI(i)}},scaleSequential:function(){return function t(){var e=tI(nY()(tv));return e.copy=function(){return nH(e,t())},tj.O.apply(e,arguments)}},scaleSequentialLog:function(){return function t(){var e=tZ(nY()).domain([1,10]);return e.copy=function(){return nH(e,t()).base(e.base())},tj.O.apply(e,arguments)}},scaleSequentialPow:function(){return nV},scaleSequentialQuantile:function(){return function t(){var e=[],n=tv;function r(t){if(null!=t&&!isNaN(t=+t))return n((E(e,t,1)-1)/(e.length-1))}return r.domain=function(t){if(!arguments.length)return e.slice();for(let n of(e=[],t))null==n||isNaN(n=+n)||e.push(n);return e.sort(b),r},r.interpolator=function(t){return arguments.length?(n=t,r):n},r.range=function(){return e.map((t,r)=>n(r/(e.length-1)))},r.quantiles=function(t){return Array.from({length:t+1},(n,r)=>(function(t,e,n){if(!(!(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,void 0))).length)||isNaN(e=+e))){if(e<=0||r<2)return t5(t);if(e>=1)return t2(t);var r,o=(r-1)*e,i=Math.floor(o),a=t2((function t(e,n,r=0,o=1/0,i){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),o=Math.floor(Math.min(e.length-1,o)),!(r<=n&&n<=o))return e;for(i=void 0===i?t6:function(t=b){if(t===b)return t6;if("function"!=typeof t)throw TypeError("compare is not a function");return(e,n)=>{let r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}(i);o>r;){if(o-r>600){let a=o-r+1,u=n-r+1,c=Math.log(a),l=.5*Math.exp(2*c/3),s=.5*Math.sqrt(c*l*(a-l)/a)*(u-a/2<0?-1:1),f=Math.max(r,Math.floor(n-u*l/a+s)),p=Math.min(o,Math.floor(n+(a-u)*l/a+s));t(e,n,f,p,i)}let a=e[n],u=r,c=o;for(t3(e,r,n),i(e[o],a)>0&&t3(e,r,o);ui(e[u],a);)++u;for(;i(e[c],a)>0;)--c}0===i(e[r],a)?t3(e,r,c):t3(e,++c,o),c<=n&&(r=c+1),n<=c&&(o=c-1)}return e})(t,i).subarray(0,i+1));return a+(t5(t.subarray(i+1))-a)*(o-i)}})(e,r/t))},r.copy=function(){return t(n).domain(e)},tj.O.apply(r,arguments)}},scaleSequentialSqrt:function(){return nK},scaleSequentialSymlog:function(){return function t(){var e=tX(nY());return e.copy=function(){return nH(e,t()).constant(e.constant())},tj.O.apply(e,arguments)}},scaleSqrt:function(){return t0},scaleSymlog:function(){return function t(){var e=tX(tO());return e.copy=function(){return tx(e,t()).constant(e.constant())},tj.o.apply(e,arguments)}},scaleThreshold:function(){return function t(){var e,n=[.5],r=[0,1],o=1;function i(t){return null!=t&&t<=t?r[E(n,t,0,o)]:e}return i.domain=function(t){return arguments.length?(o=Math.min((n=Array.from(t)).length,r.length-1),i):n.slice()},i.range=function(t){return arguments.length?(r=Array.from(t),o=Math.min(n.length,r.length-1),i):r.slice()},i.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t().domain(n).range(r).unknown(e)},tj.o.apply(i,arguments)}},scaleTime:function(){return nG},scaleUtc:function(){return nX},tickFormat:function(){return tD}});var f=n(55284);let p=Math.sqrt(50),h=Math.sqrt(10),d=Math.sqrt(2);function y(t,e,n){let r,o,i;let a=(e-t)/Math.max(0,n),u=Math.floor(Math.log10(a)),c=a/Math.pow(10,u),l=c>=p?10:c>=h?5:c>=d?2:1;return(u<0?(r=Math.round(t*(i=Math.pow(10,-u)/l)),o=Math.round(e*i),r/ie&&--o,i=-i):(r=Math.round(t/(i=Math.pow(10,u)*l)),o=Math.round(e/i),r*ie&&--o),o0))return[];if(t===e)return[t];let r=e=o))return[];let u=i-o+1,c=Array(u);if(r){if(a<0)for(let t=0;te?1:t>=e?0:NaN}function x(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function O(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o>>1;0>n(t[e],r)?o=e+1:i=e}while(ob(t(e),n),r=(e,n)=>t(e)-n):(e=t===b||t===x?t:w,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){let a=o(t,e,n,i-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,o=0,i=t.length){if(o>>1;0>=n(t[e],r)?o=e+1:i=e}while(o>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Z(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Z(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=N.exec(t))?new G(e[1],e[2],e[3],1):(e=D.exec(t))?new G(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=I.exec(t))?Z(e[1],e[2],e[3],e[4]):(e=L.exec(t))?Z(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=B.exec(t))?J(e[1],e[2]/100,e[3]/100,1):(e=R.exec(t))?J(e[1],e[2]/100,e[3]/100,e[4]):z.hasOwnProperty(t)?q(z[t]):"transparent"===t?new G(NaN,NaN,NaN,0):null}function q(t){return new G(t>>16&255,t>>8&255,255&t,1)}function Z(t,e,n,r){return r<=0&&(t=e=n=NaN),new G(t,e,n,r)}function W(t,e,n,r){var o;return 1==arguments.length?((o=t)instanceof A||(o=$(o)),o)?new G((o=o.rgb()).r,o.g,o.b,o.opacity):new G:new G(t,e,n,null==r?1:r)}function G(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function X(){return`#${K(this.r)}${K(this.g)}${K(this.b)}`}function Y(){let t=H(this.opacity);return`${1===t?"rgb(":"rgba("}${V(this.r)}, ${V(this.g)}, ${V(this.b)}${1===t?")":`, ${t})`}`}function H(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function V(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function K(t){return((t=V(t))<16?"0":"")+t.toString(16)}function J(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new tt(t,e,n,r)}function Q(t){if(t instanceof tt)return new tt(t.h,t.s,t.l,t.opacity);if(t instanceof A||(t=$(t)),!t)return new tt;if(t instanceof tt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,u=i-o,c=(i+o)/2;return u?(a=e===i?(n-r)/u+(n0&&c<1?0:a,new tt(a,u,c,t.opacity)}function tt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function te(t){return(t=(t||0)%360)<0?t+360:t}function tn(t){return Math.max(0,Math.min(1,t||0))}function tr(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function to(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}k(A,$,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:U,formatHex:U,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Q(this).formatHsl()},formatRgb:F,toString:F}),k(G,W,P(A,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new G(V(this.r),V(this.g),V(this.b),H(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:X,formatHex:X,formatHex8:function(){return`#${K(this.r)}${K(this.g)}${K(this.b)}${K((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:Y,toString:Y})),k(tt,function(t,e,n,r){return 1==arguments.length?Q(t):new tt(t,e,n,null==r?1:r)},P(A,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new tt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new tt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new G(tr(t>=240?t-240:t+120,o,r),tr(t,o,r),tr(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new tt(te(this.h),tn(this.s),tn(this.l),H(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(){let t=H(this.opacity);return`${1===t?"hsl(":"hsla("}${te(this.h)}, ${100*tn(this.s)}%, ${100*tn(this.l)}%${1===t?")":`, ${t})`}`}}));var ti=t=>()=>t;function ta(t,e){var n=e-t;return n?function(e){return t+e*n}:ti(isNaN(t)?e:t)}var tu=function t(e){var n,r=1==(n=+(n=e))?ta:function(t,e){var r,o,i;return e-t?(r=t,o=e,r=Math.pow(r,i=n),o=Math.pow(o,i)-r,i=1/i,function(t){return Math.pow(r+t*o,i)}):ti(isNaN(t)?e:t)};function o(t,e){var n=r((t=W(t)).r,(e=W(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=ta(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return o.gamma=t,o}(1);function tc(t){return function(e){var n,r,o=e.length,i=Array(o),a=Array(o),u=Array(o);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,u=ru&&(a=e.slice(u,a),l[c]?l[c]+=a:l[++c]=a),(o=o[0])===(i=i[0])?l[c]?l[c]+=i:l[++c]=i:(l[++c]=null,s.push({i:c,x:tl(o,i)})),u=tf.lastIndex;return ue&&(n=t,t=e,e=n),l=function(n){return Math.max(t,Math.min(e,n))}),r=c>2?tb:tg,o=i=null,f}function f(e){return null==e||isNaN(e=+e)?n:(o||(o=r(a.map(t),u,c)))(t(l(e)))}return f.invert=function(n){return l(e((i||(i=r(u,a.map(t),tl)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,td),s()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),s()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),c=th,s()},f.clamp=function(t){return arguments.length?(l=!!t||tv,s()):l!==tv},f.interpolate=function(t){return arguments.length?(c=t,s()):c},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,s()}}function tw(){return tO()(tv,tv)}var tj=n(89999),tS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tE(t){var e;if(!(e=tS.exec(t)))throw Error("invalid format: "+t);return new tk({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function tk(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function tP(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function tA(t){return(t=tP(Math.abs(t)))?t[1]:NaN}function tM(t,e){var n=tP(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+Array(o-r.length+2).join("0")}tE.prototype=tk.prototype,tk.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var t_={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>tM(100*t,e),r:tM,s:function(t,e){var n=tP(t,e);if(!n)return t+"";var o=n[0],i=n[1],a=i-(r=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=o.length;return a===u?o:a>u?o+Array(a-u+1).join("0"):a>0?o.slice(0,a)+"."+o.slice(a):"0."+Array(1-a).join("0")+tP(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function tT(t){return t}var tC=Array.prototype.map,tN=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function tD(t,e,n,r){var o,u,c=g(t,e,n);switch((r=tE(null==r?",f":r)).type){case"s":var l=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(u=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(tA(l)/3)))-tA(Math.abs(c))))||(r.precision=u),a(r,l);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(u=Math.max(0,tA(Math.abs(Math.max(Math.abs(t),Math.abs(e)))-(o=Math.abs(o=c)))-tA(o))+1)||(r.precision=u-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(u=Math.max(0,-tA(Math.abs(c))))||(r.precision=u-("%"===r.type)*2)}return i(r)}function tI(t){var e=t.domain;return t.ticks=function(t){var n=e();return v(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return tD(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,o,i=e(),a=0,u=i.length-1,c=i[a],l=i[u],s=10;for(l0;){if((o=m(c,l,n))===r)return i[a]=c,i[u]=l,e(i);if(o>0)c=Math.floor(c/o)*o,l=Math.ceil(l/o)*o;else if(o<0)c=Math.ceil(c*o)/o,l=Math.floor(l*o)/o;else break;r=o}return t},t}function tL(){var t=tw();return t.copy=function(){return tx(t,tL())},tj.o.apply(t,arguments),tI(t)}function tB(t,e){t=t.slice();var n,r=0,o=t.length-1,i=t[r],a=t[o];return a-t(-e,n)}function tZ(t){let e,n;let r=t(tR,tz),o=r.domain,a=10;function u(){var i,u;return e=(i=a)===Math.E?Math.log:10===i&&Math.log10||2===i&&Math.log2||(i=Math.log(i),t=>Math.log(t)/i),n=10===(u=a)?t$:u===Math.E?Math.exp:t=>Math.pow(u,t),o()[0]<0?(e=tq(e),n=tq(n),t(tU,tF)):t(tR,tz),r}return r.base=function(t){return arguments.length?(a=+t,u()):a},r.domain=function(t){return arguments.length?(o(t),u()):o()},r.ticks=t=>{let r,i;let u=o(),c=u[0],l=u[u.length-1],s=l0){for(;f<=p;++f)for(r=1;rl)break;d.push(i)}}else for(;f<=p;++f)for(r=a-1;r>=1;--r)if(!((i=f>0?r/n(-f):r*n(f))l)break;d.push(i)}2*d.length{if(null==t&&(t=10),null==o&&(o=10===a?"s":","),"function"!=typeof o&&(a%1||null!=(o=tE(o)).precision||(o.trim=!0),o=i(o)),t===1/0)return o;let u=Math.max(1,a*t/r.ticks().length);return t=>{let r=t/n(Math.round(e(t)));return r*ao(tB(o(),{floor:t=>n(Math.floor(e(t))),ceil:t=>n(Math.ceil(e(t)))})),r}function tW(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function tG(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function tX(t){var e=1,n=t(tW(1),tG(e));return n.constant=function(n){return arguments.length?t(tW(e=+n),tG(e)):e},tI(n)}i=(o=function(t){var e,n,o,i=void 0===t.grouping||void 0===t.thousands?tT:(e=tC.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var o=t.length,i=[],a=0,u=e[0],c=0;o>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),i.push(t.substring(o-=u,o+u)),!((c+=u+1)>r));)u=e[a=(a+1)%e.length];return i.reverse().join(n)}),a=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",c=void 0===t.decimal?".":t.decimal+"",l=void 0===t.numerals?tT:(o=tC.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return o[+t]})}),s=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"−":t.minus+"",p=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=tE(t)).fill,n=t.align,o=t.sign,h=t.symbol,d=t.zero,y=t.width,v=t.comma,m=t.precision,g=t.trim,b=t.type;"n"===b?(v=!0,b="g"):t_[b]||(void 0===m&&(m=12),g=!0,b="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var x="$"===h?a:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",O="$"===h?u:/[%p]/.test(b)?s:"",w=t_[b],j=/[defgprs%]/.test(b);function S(t){var a,u,s,h=x,S=O;if("c"===b)S=w(t)+S,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?p:w(Math.abs(t),m),g&&(t=function(t){e:for(var e,n=t.length,r=1,o=-1;r0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==o&&(E=!1),h=(E?"("===o?o:f:"-"===o||"("===o?"":o)+h,S=("s"===b?tN[8+r/3]:"")+S+(E&&"("===o?")":""),j){for(a=-1,u=t.length;++a(s=t.charCodeAt(a))||s>57){S=(46===s?c+t.slice(a+1):t.slice(a))+S,t=t.slice(0,a);break}}}v&&!d&&(t=i(t,1/0));var k=h.length+t.length+S.length,P=k>1)+h+t+S+P.slice(k);break;default:t=P+h+t+S}return l(t)}return m=void 0===m?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),S.toString=function(){return t+""},S}return{format:h,formatPrefix:function(t,e){var n=h(((t=tE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(tA(e)/3))),o=Math.pow(10,-r),i=tN[8+r/3];return function(t){return n(o*t)+i}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,a=o.formatPrefix;var tY=n(36967);function tH(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function tV(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function tK(t){return t<0?-t*t:t*t}function tJ(t){var e=t(tv,tv),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(tv,tv):.5===n?t(tV,tK):t(tH(n),tH(1/n)):n},tI(e)}function tQ(){var t=tJ(tO());return t.copy=function(){return tx(t,tQ()).exponent(t.exponent())},tj.o.apply(t,arguments),t}function t0(){return tQ.apply(null,arguments).exponent(.5)}function t1(t){return Math.sign(t)*t*t}function t2(t,e){let n;if(void 0===e)for(let e of t)null!=e&&(n=e)&&(n=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(n=o)&&(n=o)}return n}function t5(t,e){let n;if(void 0===e)for(let e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function t6(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function t3(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}let t7=new Date,t8=new Date;function t4(t,e,n,r){function o(e){return t(e=0==arguments.length?new Date:new Date(+e)),e}return o.floor=e=>(t(e=new Date(+e)),e),o.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),o.round=t=>{let e=o(t),n=o.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),o.range=(n,r,i)=>{let a;let u=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n0))return u;do u.push(a=new Date(+n)),e(n,i),t(n);while(at4(e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},(t,r)=>{if(t>=t){if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}}),n&&(o.count=(e,r)=>(t7.setTime(+e),t8.setTime(+r),t(t7),t(t8),Math.floor(n(t7,t8))),o.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?o.filter(r?e=>r(e)%t==0:e=>o.count(0,e)%t==0):o:null),o}let t9=t4(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);t9.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?t4(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):t9:null,t9.range;let et=t4(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+1e3*e)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds());et.range;let ee=t4(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getMinutes());ee.range;let en=t4(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes());en.range;let er=t4(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getHours());er.range;let eo=t4(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours());eo.range;let ei=t4(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1);ei.range;let ea=t4(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1);ea.range;let eu=t4(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5));function ec(t){return t4(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+7*e)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}eu.range;let el=ec(0),es=ec(1),ef=ec(2),ep=ec(3),eh=ec(4),ed=ec(5),ey=ec(6);function ev(t){return t4(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)},(t,e)=>(e-t)/6048e5)}el.range,es.range,ef.range,ep.range,eh.range,ed.range,ey.range;let em=ev(0),eg=ev(1),eb=ev(2),ex=ev(3),eO=ev(4),ew=ev(5),ej=ev(6);em.range,eg.range,eb.range,ex.range,eO.range,ew.range,ej.range;let eS=t4(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());eS.range;let eE=t4(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());eE.range;let ek=t4(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ek.every=t=>isFinite(t=Math.floor(t))&&t>0?t4(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)}):null,ek.range;let eP=t4(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function eA(t,e,n,r,o,i){let a=[[et,1,1e3],[et,5,5e3],[et,15,15e3],[et,30,3e4],[i,1,6e4],[i,5,3e5],[i,15,9e5],[i,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function u(e,n,r){let o=Math.abs(n-e)/r,i=O(([,,t])=>t).right(a,o);if(i===a.length)return t.every(g(e/31536e6,n/31536e6,r));if(0===i)return t9.every(Math.max(g(e,n,r),1));let[u,c]=a[o/a[i-1][2]isFinite(t=Math.floor(t))&&t>0?t4(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null,eP.range;let[eM,e_]=eA(eP,eE,em,eu,eo,en),[eT,eC]=eA(ek,eS,el,ei,er,ee);function eN(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function eD(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function eI(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var eL={"-":"",_:" ",0:"0"},eB=/^\s*\d+/,eR=/^%/,ez=/[\\^$*+?|[\]().{}]/g;function eU(t,e,n){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i[t.toLowerCase(),e]))}function eZ(t,e,n){var r=eB.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function eW(t,e,n){var r=eB.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function eG(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function eX(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function eY(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function eH(t,e,n){var r=eB.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function eV(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function eK(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function eJ(t,e,n){var r=eB.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function eQ(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function e0(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function e1(t,e,n){var r=eB.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function e2(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function e5(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function e6(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function e3(t,e,n){var r=eB.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function e7(t,e,n){var r=eB.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function e8(t,e,n){var r=eR.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function e4(t,e,n){var r=eB.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function e9(t,e,n){var r=eB.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function nt(t,e){return eU(t.getDate(),e,2)}function ne(t,e){return eU(t.getHours(),e,2)}function nn(t,e){return eU(t.getHours()%12||12,e,2)}function nr(t,e){return eU(1+ei.count(ek(t),t),e,3)}function no(t,e){return eU(t.getMilliseconds(),e,3)}function ni(t,e){return no(t,e)+"000"}function na(t,e){return eU(t.getMonth()+1,e,2)}function nu(t,e){return eU(t.getMinutes(),e,2)}function nc(t,e){return eU(t.getSeconds(),e,2)}function nl(t){var e=t.getDay();return 0===e?7:e}function ns(t,e){return eU(el.count(ek(t)-1,t),e,2)}function nf(t){var e=t.getDay();return e>=4||0===e?eh(t):eh.ceil(t)}function np(t,e){return t=nf(t),eU(eh.count(ek(t),t)+(4===ek(t).getDay()),e,2)}function nh(t){return t.getDay()}function nd(t,e){return eU(es.count(ek(t)-1,t),e,2)}function ny(t,e){return eU(t.getFullYear()%100,e,2)}function nv(t,e){return eU((t=nf(t)).getFullYear()%100,e,2)}function nm(t,e){return eU(t.getFullYear()%1e4,e,4)}function ng(t,e){var n=t.getDay();return eU((t=n>=4||0===n?eh(t):eh.ceil(t)).getFullYear()%1e4,e,4)}function nb(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+eU(e/60|0,"0",2)+eU(e%60,"0",2)}function nx(t,e){return eU(t.getUTCDate(),e,2)}function nO(t,e){return eU(t.getUTCHours(),e,2)}function nw(t,e){return eU(t.getUTCHours()%12||12,e,2)}function nj(t,e){return eU(1+ea.count(eP(t),t),e,3)}function nS(t,e){return eU(t.getUTCMilliseconds(),e,3)}function nE(t,e){return nS(t,e)+"000"}function nk(t,e){return eU(t.getUTCMonth()+1,e,2)}function nP(t,e){return eU(t.getUTCMinutes(),e,2)}function nA(t,e){return eU(t.getUTCSeconds(),e,2)}function nM(t){var e=t.getUTCDay();return 0===e?7:e}function n_(t,e){return eU(em.count(eP(t)-1,t),e,2)}function nT(t){var e=t.getUTCDay();return e>=4||0===e?eO(t):eO.ceil(t)}function nC(t,e){return t=nT(t),eU(eO.count(eP(t),t)+(4===eP(t).getUTCDay()),e,2)}function nN(t){return t.getUTCDay()}function nD(t,e){return eU(eg.count(eP(t)-1,t),e,2)}function nI(t,e){return eU(t.getUTCFullYear()%100,e,2)}function nL(t,e){return eU((t=nT(t)).getUTCFullYear()%100,e,2)}function nB(t,e){return eU(t.getUTCFullYear()%1e4,e,4)}function nR(t,e){var n=t.getUTCDay();return eU((t=n>=4||0===n?eO(t):eO.ceil(t)).getUTCFullYear()%1e4,e,4)}function nz(){return"+0000"}function nU(){return"%"}function nF(t){return+t}function n$(t){return Math.floor(+t/1e3)}function nq(t){return new Date(t)}function nZ(t){return t instanceof Date?+t:+new Date(+t)}function nW(t,e,n,r,o,i,a,u,c,l){var s=tw(),f=s.invert,p=s.domain,h=l(".%L"),d=l(":%S"),y=l("%I:%M"),v=l("%I %p"),m=l("%a %d"),g=l("%b %d"),b=l("%B"),x=l("%Y");function O(t){return(c(t)1)for(var n,r,o,i=1,a=t[e[0]],u=a.length;i=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:nF,s:n$,S:nc,u:nl,U:ns,V:np,w:nh,W:nd,x:null,X:null,y:ny,Y:nm,Z:nb,"%":nU},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:nx,e:nx,f:nE,g:nL,G:nR,H:nO,I:nw,j:nj,L:nS,m:nk,M:nP,p:function(t){return o[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:nF,s:n$,S:nA,u:nM,U:n_,V:nC,w:nN,W:nD,x:null,X:null,y:nI,Y:nB,Z:nz,"%":nU},O={a:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return S(t,e,n,r)},d:e0,e:e0,f:e7,g:eV,G:eH,H:e2,I:e2,j:e1,L:e3,m:eQ,M:e5,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=s.get(r[0].toLowerCase()),n+r[0].length):-1},q:eJ,Q:e4,s:e9,S:e6,u:eW,U:eG,V:eX,w:eZ,W:eY,x:function(t,e,r){return S(t,n,e,r)},X:function(t,e,n){return S(t,r,e,n)},y:eV,Y:eH,Z:eK,"%":e8};function w(t,e){return function(n){var r,o,i,a=[],u=-1,c=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in i||(i.w=1),"Z"in i?(r=(o=(r=eD(eI(i.y,0,1))).getUTCDay())>4||0===o?eg.ceil(r):eg(r),r=ea.offset(r,(i.V-1)*7),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(r=(o=(r=eN(eI(i.y,0,1))).getDay())>4||0===o?es.ceil(r):es(r),r=ei.offset(r,(i.V-1)*7),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?eD(eI(i.y,0,1)).getUTCDay():eN(eI(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,eD(i)):eN(i)}}function S(t,e,n,r){for(var o,i,a=0,u=e.length,c=n.length;a=c)return -1;if(37===(o=e.charCodeAt(a++))){if(!(i=O[(o=e.charAt(a++))in eL?e.charAt(a++):o])||(r=i(t,n,r))<0)return -1}else if(o!=n.charCodeAt(r++))return -1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=j(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=j(t+="",!0);return e.toString=function(){return t},e}}}({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"]})).format,u.parse,l=u.utcFormat,u.utcParse;var n2=n(22516),n5=n(76115);function n6(t){for(var e=t.length,n=Array(e);--e>=0;)n[e]=e;return n}function n3(t,e){return t[e]}function n7(t){let e=[];return e.key=t,e}var n8=n(95645),n4=n.n(n8),n9=n(99008),rt=n.n(n9),re=n(77571),rn=n.n(re),rr=n(86757),ro=n.n(rr),ri=n(42715),ra=n.n(ri),ru=n(13735),rc=n.n(ru),rl=n(11314),rs=n.n(rl),rf=n(82559),rp=n.n(rf),rh=n(75551),rd=n.n(rh),ry=n(21652),rv=n.n(ry),rm=n(34935),rg=n.n(rm),rb=n(61134),rx=n.n(rb);function rO(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=e?n.apply(void 0,o):t(e-a,rE(function(){for(var t=arguments.length,e=Array(t),r=0;rt.length)&&(e=t.length);for(var n=0,r=Array(e);nr&&(o=r,i=n),[o,i]}function rR(t,e,n){if(t.lte(0))return new(rx())(0);var r=rC.getDigitCount(t.toNumber()),o=new(rx())(10).pow(r),i=t.div(o),a=1!==r?.05:.1,u=new(rx())(Math.ceil(i.div(a).toNumber())).add(n).mul(a).mul(o);return e?u:new(rx())(Math.ceil(u))}function rz(t,e,n){var r=1,o=new(rx())(t);if(!o.isint()&&n){var i=Math.abs(t);i<1?(r=new(rx())(10).pow(rC.getDigitCount(t)-1),o=new(rx())(Math.floor(o.div(r).toNumber())).mul(r)):i>1&&(o=new(rx())(Math.floor(t)))}else 0===t?o=new(rx())(Math.floor((e-1)/2)):n||(o=new(rx())(Math.floor(t)));var a=Math.floor((e-1)/2);return rM(rA(function(t){return o.add(new(rx())(t-a).mul(r)).toNumber()}),rP)(0,e)}var rU=rT(function(t){var e=rD(t,2),n=e[0],r=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),u=rD(rB([n,r]),2),c=u[0],l=u[1];if(c===-1/0||l===1/0){var s=l===1/0?[c].concat(rN(rP(0,o-1).map(function(){return 1/0}))):[].concat(rN(rP(0,o-1).map(function(){return-1/0})),[l]);return n>r?r_(s):s}if(c===l)return rz(c,o,i);var f=function t(e,n,r,o){var i,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((n-e)/(r-1)))return{step:new(rx())(0),tickMin:new(rx())(0),tickMax:new(rx())(0)};var u=rR(new(rx())(n).sub(e).div(r-1),o,a),c=Math.ceil((i=e<=0&&n>=0?new(rx())(0):(i=new(rx())(e).add(n).div(2)).sub(new(rx())(i).mod(u))).sub(e).div(u).toNumber()),l=Math.ceil(new(rx())(n).sub(i).div(u).toNumber()),s=c+l+1;return s>r?t(e,n,r,o,a+1):(s0?l+(r-s):l,c=n>0?c:c+(r-s)),{step:u,tickMin:i.sub(new(rx())(c).mul(u)),tickMax:i.add(new(rx())(l).mul(u))})}(c,l,a,i),p=f.step,h=f.tickMin,d=f.tickMax,y=rC.rangeStep(h,d.add(new(rx())(.1).mul(p)),p);return n>r?r_(y):y});rT(function(t){var e=rD(t,2),n=e[0],r=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),u=rD(rB([n,r]),2),c=u[0],l=u[1];if(c===-1/0||l===1/0)return[n,r];if(c===l)return rz(c,o,i);var s=rR(new(rx())(l).sub(c).div(a-1),i,0),f=rM(rA(function(t){return new(rx())(c).add(new(rx())(t).mul(s)).toNumber()}),rP)(0,a).filter(function(t){return t>=c&&t<=l});return n>r?r_(f):f});var rF=rT(function(t,e){var n=rD(t,2),r=n[0],o=n[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=rD(rB([r,o]),2),u=a[0],c=a[1];if(u===-1/0||c===1/0)return[r,o];if(u===c)return[u];var l=rR(new(rx())(c).sub(u).div(Math.max(e,2)-1),i,0),s=[].concat(rN(rC.rangeStep(new(rx())(u),new(rx())(c).sub(new(rx())(.99).mul(l)),l)),[c]);return r>o?r_(s):s}),r$=n(13137),rq=n(16630),rZ=n(82944),rW=n(38569);function rG(t){return(rG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function rY(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=-1,a=null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0;if(a<=1)return 0;if(o&&"angleAxis"===o.axisType&&1e-6>=Math.abs(Math.abs(o.range[1]-o.range[0])-360))for(var u=o.range,c=0;c0?r[c-1].coordinate:r[a-1].coordinate,s=r[c].coordinate,f=c>=a-1?r[0].coordinate:r[c+1].coordinate,p=void 0;if((0,rq.uY)(s-l)!==(0,rq.uY)(f-s)){var h=[];if((0,rq.uY)(f-s)===(0,rq.uY)(u[1]-u[0])){p=f;var d=s+u[1]-u[0];h[0]=Math.min(d,(d+l)/2),h[1]=Math.max(d,(d+l)/2)}else{p=l;var y=f+u[1]-u[0];h[0]=Math.min(s,(y+s)/2),h[1]=Math.max(s,(y+s)/2)}var v=[Math.min(s,(p+s)/2),Math.max(s,(p+s)/2)];if(t>v[0]&&t<=v[1]||t>=h[0]&&t<=h[1]){i=r[c].index;break}}else{var m=Math.min(l,f),g=Math.max(l,f);if(t>(m+s)/2&&t<=(g+s)/2){i=r[c].index;break}}}else for(var b=0;b0&&b(n[b].coordinate+n[b-1].coordinate)/2&&t<=(n[b].coordinate+n[b+1].coordinate)/2||b===a-1&&t>(n[b].coordinate+n[b-1].coordinate)/2){i=n[b].index;break}return i},r1=function(t){var e,n=t.type.displayName,r=t.props,o=r.stroke,i=r.fill;switch(n){case"Line":e=o;break;case"Area":case"Radar":e=o&&"none"!==o?o:i;break;default:e=i}return e},r2=function(t){var e=t.barSize,n=t.stackGroups,r=void 0===n?{}:n;if(!r)return{};for(var o={},i=Object.keys(r),a=0,u=i.length;a=0});if(y&&y.length){var v=y[0].props.barSize,m=y[0].props[d];o[m]||(o[m]=[]),o[m].push({item:y[0],stackList:y.slice(1),barSize:rn()(v)?e:v})}}return o},r5=function(t){var e,n=t.barGap,r=t.barCategoryGap,o=t.bandSize,i=t.sizeList,a=void 0===i?[]:i,u=t.maxBarSize,c=a.length;if(c<1)return null;var l=(0,rq.h1)(n,o,0,!0),s=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=o/c,h=a.reduce(function(t,e){return t+e.barSize||0},0);(h+=(c-1)*l)>=o&&(h-=(c-1)*l,l=0),h>=o&&p>0&&(f=!0,p*=.9,h=c*p);var d={offset:((o-h)/2>>0)-l,size:0};e=a.reduce(function(t,e){var n={item:e.item,position:{offset:d.offset+d.size+l,size:f?p:e.barSize}},r=[].concat(rV(t),[n]);return d=r[r.length-1].position,e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){r.push({item:t,position:d})}),r},s)}else{var y=(0,rq.h1)(r,o,0,!0);o-2*y-(c-1)*l<=0&&(l=0);var v=(o-2*y-(c-1)*l)/c;v>1&&(v>>=0);var m=u===+u?Math.min(v,u):v;e=a.reduce(function(t,e,n){var r=[].concat(rV(t),[{item:e.item,position:{offset:y+(v+l)*n+(v-m)/2,size:m}}]);return e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){r.push({item:t,position:r[r.length-1].position})}),r},s)}return e},r6=function(t,e,n,r){var o=n.children,i=n.width,a=n.margin,u=i-(a.left||0)-(a.right||0),c=(0,rW.z)({children:o,legendWidth:u});if(c){var l=r||{},s=l.width,f=l.height,p=c.align,h=c.verticalAlign,d=c.layout;if(("vertical"===d||"horizontal"===d&&"middle"===h)&&"center"!==p&&(0,rq.hj)(t[p]))return rY(rY({},t),{},rH({},p,t[p]+(s||0)));if(("horizontal"===d||"vertical"===d&&"center"===p)&&"middle"!==h&&(0,rq.hj)(t[h]))return rY(rY({},t),{},rH({},h,t[h]+(f||0)))}return t},r3=function(t,e,n,r,o){var i=e.props.children,a=(0,rZ.NN)(i,r$.W).filter(function(t){var e;return e=t.props.direction,!!rn()(o)||("horizontal"===r?"yAxis"===o:"vertical"===r||"x"===e?"xAxis"===o:"y"!==e||"yAxis"===o)});if(a&&a.length){var u=a.map(function(t){return t.props.dataKey});return t.reduce(function(t,e){var r=rJ(e,n,0),o=Array.isArray(r)?[rt()(r),n4()(r)]:[r,r],i=u.reduce(function(t,n){var r=rJ(e,n,0),i=o[0]-Math.abs(Array.isArray(r)?r[0]:r),a=o[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(i,t[0]),Math.max(a,t[1])]},[1/0,-1/0]);return[Math.min(i[0],t[0]),Math.max(i[1],t[1])]},[1/0,-1/0])}return null},r7=function(t,e,n,r,o){var i=e.map(function(e){return r3(t,e,n,o,r)}).filter(function(t){return!rn()(t)});return i&&i.length?i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]):null},r8=function(t,e,n,r,o){var i=e.map(function(e){var i=e.props.dataKey;return"number"===n&&i&&r3(t,e,i,r)||rQ(t,i,n,o)});if("number"===n)return i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]);var a={};return i.reduce(function(t,e){for(var n=0,r=e.length;n=2?2*(0,rq.uY)(a[0]-a[1])*c:c,e&&(t.ticks||t.niceTicks))?(t.ticks||t.niceTicks).map(function(t){return{coordinate:r(o?o.indexOf(t):t)+c,value:t,offset:c}}).filter(function(t){return!rp()(t.coordinate)}):t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(t,e){return{coordinate:r(t)+c,value:t,index:e,offset:c}}):r.ticks&&!n?r.ticks(t.tickCount).map(function(t){return{coordinate:r(t)+c,value:t,offset:c}}):r.domain().map(function(t,e){return{coordinate:r(t)+c,value:o?o[t]:t,index:e,offset:c}})},oe=new WeakMap,on=function(t,e){if("function"!=typeof e)return t;oe.has(t)||oe.set(t,new WeakMap);var n=oe.get(t);if(n.has(e))return n.get(e);var r=function(){t.apply(void 0,arguments),e.apply(void 0,arguments)};return n.set(e,r),r},or=function(t,e,n){var r=t.scale,o=t.type,i=t.layout,a=t.axisType;if("auto"===r)return"radial"===i&&"radiusAxis"===a?{scale:f.Z(),realScaleType:"band"}:"radial"===i&&"angleAxis"===a?{scale:tL(),realScaleType:"linear"}:"category"===o&&e&&(e.indexOf("LineChart")>=0||e.indexOf("AreaChart")>=0||e.indexOf("ComposedChart")>=0&&!n)?{scale:f.x(),realScaleType:"point"}:"category"===o?{scale:f.Z(),realScaleType:"band"}:{scale:tL(),realScaleType:"linear"};if(ra()(r)){var u="scale".concat(rd()(r));return{scale:(s[u]||f.x)(),realScaleType:s[u]?u:"point"}}return ro()(r)?{scale:r}:{scale:f.x(),realScaleType:"point"}},oo=function(t){var e=t.domain();if(e&&!(e.length<=2)){var n=e.length,r=t.range(),o=Math.min(r[0],r[1])-1e-4,i=Math.max(r[0],r[1])+1e-4,a=t(e[0]),u=t(e[n-1]);(ai||ui)&&t.domain([e[0],e[n-1]])}},oi=function(t,e){if(!t)return null;for(var n=0,r=t.length;nr)&&(o[1]=r),o[0]>r&&(o[0]=r),o[1]=0?(t[a][n][0]=o,t[a][n][1]=o+u,o=t[a][n][1]):(t[a][n][0]=i,t[a][n][1]=i+u,i=t[a][n][1])}},expand:function(t,e){if((r=t.length)>0){for(var n,r,o,i=0,a=t[0].length;i0){for(var n,r=0,o=t[e[0]],i=o.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,o,i=0,a=1;a=0?(t[i][n][0]=o,t[i][n][1]=o+a,o=t[i][n][1]):(t[i][n][0]=0,t[i][n][1]=0)}}},oc=function(t,e,n){var r=e.map(function(t){return t.props.dataKey}),o=ou[n];return(function(){var t=(0,n5.Z)([]),e=n6,n=n1,r=n3;function o(o){var i,a,u=Array.from(t.apply(this,arguments),n7),c=u.length,l=-1;for(let t of o)for(i=0,++l;i=0?0:o<0?o:r}return n[0]},od=function(t,e){var n=t.props.stackId;if((0,rq.P2)(n)){var r=e[n];if(r){var o=r.items.indexOf(t);return o>=0?r.stackedData[o]:null}}return null},oy=function(t,e,n){return Object.keys(t).reduce(function(r,o){var i=t[o].stackedData.reduce(function(t,r){var o=r.slice(e,n+1).reduce(function(t,e){return[rt()(e.concat([t[0]]).filter(rq.hj)),n4()(e.concat([t[1]]).filter(rq.hj))]},[1/0,-1/0]);return[Math.min(t[0],o[0]),Math.max(t[1],o[1])]},[1/0,-1/0]);return[Math.min(i[0],r[0]),Math.max(i[1],r[1])]},[1/0,-1/0]).map(function(t){return t===1/0||t===-1/0?0:t})},ov=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,om=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,og=function(t,e,n){if(ro()(t))return t(e,n);if(!Array.isArray(t))return e;var r=[];if((0,rq.hj)(t[0]))r[0]=n?t[0]:Math.min(t[0],e[0]);else if(ov.test(t[0])){var o=+ov.exec(t[0])[1];r[0]=e[0]-o}else ro()(t[0])?r[0]=t[0](e[0]):r[0]=e[0];if((0,rq.hj)(t[1]))r[1]=n?t[1]:Math.max(t[1],e[1]);else if(om.test(t[1])){var i=+om.exec(t[1])[1];r[1]=e[1]+i}else ro()(t[1])?r[1]=t[1](e[1]):r[1]=e[1];return r},ob=function(t,e,n){if(t&&t.scale&&t.scale.bandwidth){var r=t.scale.bandwidth();if(!n||r>0)return r}if(t&&e&&e.length>=2){for(var o=rg()(e,function(t){return t.coordinate}),i=1/0,a=1,u=o.length;a1&&void 0!==arguments[1]?arguments[1]:{};if(null==t||r.x.isSsr)return{width:0,height:0};var o=(Object.keys(e=a({},n)).forEach(function(t){e[t]||delete e[t]}),e),i=JSON.stringify({text:t,copyStyle:o});if(u.widthCache[i])return u.widthCache[i];try{var s=document.getElementById(l);s||((s=document.createElement("span")).setAttribute("id",l),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var f=a(a({},c),o);Object.assign(s.style,f),s.textContent="".concat(t);var p=s.getBoundingClientRect(),h={width:p.width,height:p.height};return u.widthCache[i]=h,++u.cacheCount>2e3&&(u.cacheCount=0,u.widthCache={}),h}catch(t){return{width:0,height:0}}},f=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}}},16630:function(t,e,n){"use strict";n.d(e,{Ap:function(){return O},EL:function(){return v},Kt:function(){return g},P2:function(){return d},bv:function(){return b},h1:function(){return m},hU:function(){return p},hj:function(){return h},k4:function(){return x},uY:function(){return f}});var r=n(42715),o=n.n(r),i=n(82559),a=n.n(i),u=n(13735),c=n.n(u),l=n(22345),s=n.n(l),f=function(t){return 0===t?0:t>0?1:-1},p=function(t){return o()(t)&&t.indexOf("%")===t.length-1},h=function(t){return s()(t)&&!a()(t)},d=function(t){return h(t)||o()(t)},y=0,v=function(t){var e=++y;return"".concat(t||"").concat(e)},m=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!h(t)&&!o()(t))return r;if(p(t)){var u=t.indexOf("%");n=e*parseFloat(t.slice(0,u))/100}else n=+t;return a()(n)&&(n=r),i&&n>e&&(n=e),n},g=function(t){if(!t)return null;var e=Object.keys(t);return e&&e.length?t[e[0]]:null},b=function(t){if(!Array.isArray(t))return!1;for(var e=t.length,n={},r=0;r2?n-2:0),o=2;ot.length)&&(e=t.length);for(var n=0,r=Array(e);n2&&void 0!==arguments[2]?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(e-(n.top||0)-(n.bottom||0)))/2},y=function(t,e,n,r,u){var c=t.width,p=t.height,h=t.startAngle,y=t.endAngle,v=(0,i.h1)(t.cx,c,c/2),m=(0,i.h1)(t.cy,p,p/2),g=d(c,p,n),b=(0,i.h1)(t.innerRadius,g,0),x=(0,i.h1)(t.outerRadius,g,.8*g);return Object.keys(e).reduce(function(t,n){var i,c=e[n],p=c.domain,d=c.reversed;if(o()(c.range))"angleAxis"===r?i=[h,y]:"radiusAxis"===r&&(i=[b,x]),d&&(i=[i[1],i[0]]);else{var g,O=function(t){if(Array.isArray(t))return t}(g=i=c.range)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{for(i=(n=n.call(t)).next;!(c=(r=i.call(n)).done)&&(u.push(r.value),2!==u.length);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(g,2)||function(t,e){if(t){if("string"==typeof t)return f(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,2)}}(g,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();h=O[0],y=O[1]}var w=(0,a.Hq)(c,u),j=w.realScaleType,S=w.scale;S.domain(p).range(i),(0,a.zF)(S);var E=(0,a.g$)(S,l(l({},c),{},{realScaleType:j})),k=l(l(l({},c),E),{},{range:i,radius:x,realScaleType:j,scale:S,cx:v,cy:m,innerRadius:b,outerRadius:x,startAngle:h,endAngle:y});return l(l({},t),{},s({},n,k))},{})},v=function(t,e){var n=t.x,r=t.y;return Math.sqrt(Math.pow(n-e.x,2)+Math.pow(r-e.y,2))},m=function(t,e){var n=t.x,r=t.y,o=e.cx,i=e.cy,a=v({x:n,y:r},{x:o,y:i});if(a<=0)return{radius:a};var u=Math.acos((n-o)/a);return r>i&&(u=2*Math.PI-u),{radius:a,angle:180*u/Math.PI,angleInRadian:u}},g=function(t){var e=t.startAngle,n=t.endAngle,r=Math.min(Math.floor(e/360),Math.floor(n/360));return{startAngle:e-360*r,endAngle:n-360*r}},b=function(t,e){var n,r=m({x:t.x,y:t.y},e),o=r.radius,i=r.angle,a=e.innerRadius,u=e.outerRadius;if(ou)return!1;if(0===o)return!0;var c=g(e),s=c.startAngle,f=c.endAngle,p=i;if(s<=f){for(;p>f;)p-=360;for(;p=s&&p<=f}else{for(;p>s;)p-=360;for(;p=f&&p<=s}return n?l(l({},e),{},{radius:o,angle:p+360*Math.min(Math.floor(e.startAngle/360),Math.floor(e.endAngle/360))}):null}},82944:function(t,e,n){"use strict";n.d(e,{$R:function(){return R},$k:function(){return T},Bh:function(){return B},Gf:function(){return j},L6:function(){return N},NN:function(){return P},TT:function(){return M},eu:function(){return L},rL:function(){return D},sP:function(){return A}});var r=n(13735),o=n.n(r),i=n(77571),a=n.n(i),u=n(42715),c=n.n(u),l=n(86757),s=n.n(l),f=n(28302),p=n.n(f),h=n(2265),d=n(82558),y=n(16630),v=n(46485),m=n(41637),g=["children"],b=["children"];function x(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}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"},j=function(t){return"string"==typeof t?t:t?t.displayName||t.name||"Component":""},S=null,E=null,k=function t(e){if(e===S&&Array.isArray(E))return E;var n=[];return h.Children.forEach(e,function(e){a()(e)||((0,d.isFragment)(e)?n=n.concat(t(e.props.children)):n.push(e))}),E=n,S=e,n};function P(t,e){var n=[],r=[];return r=Array.isArray(e)?e.map(function(t){return j(t)}):[j(e)],k(t).forEach(function(t){var e=o()(t,"type.displayName")||o()(t,"type.name");-1!==r.indexOf(e)&&n.push(t)}),n}function A(t,e){var n=P(t,e);return n&&n[0]}var M=function(t){if(!t||!t.props)return!1;var e=t.props,n=e.width,r=e.height;return!!(0,y.hj)(n)&&!(n<=0)&&!!(0,y.hj)(r)&&!(r<=0)},_=["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"],T=function(t){return t&&"object"===O(t)&&"cx"in t&&"cy"in t&&"r"in t},C=function(t,e,n,r){var o,i=null!==(o=null===m.ry||void 0===m.ry?void 0:m.ry[r])&&void 0!==o?o:[];return!s()(t)&&(r&&i.includes(e)||m.Yh.includes(e))||n&&m.nv.includes(e)},N=function(t,e,n){if(!t||"function"==typeof t||"boolean"==typeof t)return null;var r=t;if((0,h.isValidElement)(t)&&(r=t.props),!p()(r))return null;var o={};return Object.keys(r).forEach(function(t){var i;C(null===(i=r)||void 0===i?void 0:i[t],t,e,n)&&(o[t]=r[t])}),o},D=function t(e,n){if(e===n)return!0;var r=h.Children.count(e);if(r!==h.Children.count(n))return!1;if(0===r)return!0;if(1===r)return I(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var o=0;o=0)n.push(t);else if(t){var i=j(t.type),a=e[i]||{},u=a.handler,l=a.once;if(u&&(!l||!r[i])){var s=u(t,i,o);n.push(s),r[i]=!0}}}),n},B=function(t){var e=t&&t.type;return e&&w[e]?w[e]:null},R=function(t,e){return k(e).indexOf(t)}},46485:function(t,e,n){"use strict";function r(t,e){for(var n in t)if(({}).hasOwnProperty.call(t,n)&&(!({}).hasOwnProperty.call(e,n)||t[n]!==e[n]))return!1;for(var r in e)if(({}).hasOwnProperty.call(e,r)&&!({}).hasOwnProperty.call(t,r))return!1;return!0}n.d(e,{w:function(){return r}})},38569:function(t,e,n){"use strict";n.d(e,{z:function(){return l}});var r=n(22190),o=n(85355),i=n(82944);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function c(t){for(var e=1;e=0))throw Error(`invalid digits: ${t}`);if(e>15)return a;let n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e1e-6){if(Math.abs(f*c-l*s)>1e-6&&i){let h=n-a,d=o-u,y=c*c+l*l,v=Math.sqrt(y),m=Math.sqrt(p),g=i*Math.tan((r-Math.acos((y+p-(h*h+d*d))/(2*v*m)))/2),b=g/m,x=g/v;Math.abs(b-1)>1e-6&&this._append`L${t+b*s},${e+b*f}`,this._append`A${i},${i},0,0,${+(f*h>s*d)},${this._x1=t+x*c},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`}}arc(t,e,n,a,u,c){if(t=+t,e=+e,c=!!c,(n=+n)<0)throw Error(`negative radius: ${n}`);let l=n*Math.cos(a),s=n*Math.sin(a),f=t+l,p=e+s,h=1^c,d=c?a-u:u-a;null===this._x1?this._append`M${f},${p}`:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-p)>1e-6)&&this._append`L${f},${p}`,n&&(d<0&&(d=d%o+o),d>i?this._append`A${n},${n},0,1,${h},${t-l},${e-s}A${n},${n},0,1,${h},${this._x1=f},${this._y1=p}`:d>1e-6&&this._append`A${n},${n},0,${+(d>=r)},${h},${this._x1=t+n*Math.cos(u)},${this._y1=e+n*Math.sin(u)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function c(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{let t=Math.floor(n);if(!(t>=0))throw RangeError(`invalid digits: ${n}`);e=t}return t},()=>new u(e)}u.prototype},69398:function(t,e,n){"use strict";function r(t,e){if(!t)throw Error("Invariant failed")}n.d(e,{Z:function(){return r}})}}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2344],{40278:function(t,e,n){"use strict";n.d(e,{Z:function(){return j}});var r=n(5853),o=n(7084),i=n(26898),a=n(97324),u=n(1153),c=n(2265),l=n(47625),s=n(93765),f=n(31699),p=n(97059),h=n(62994),d=n(25311),y=(0,s.z)({chartName:"BarChart",GraphicalChild:f.$,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:p.K},{axisType:"yAxis",AxisComp:h.B}],formatAxisMap:d.t9}),v=n(56940),m=n(8147),g=n(22190),b=n(65278),x=n(98593),O=n(69448),w=n(32644);let j=c.forwardRef((t,e)=>{let{data:n=[],categories:s=[],index:d,colors:j=i.s,valueFormatter:S=u.Cj,layout:E="horizontal",stack:k=!1,relative:P=!1,startEndOnly:A=!1,animationDuration:M=900,showAnimation:_=!1,showXAxis:T=!0,showYAxis:C=!0,yAxisWidth:N=56,intervalType:D="equidistantPreserveStart",showTooltip:I=!0,showLegend:L=!0,showGridLines:B=!0,autoMinValue:R=!1,minValue:z,maxValue:U,allowDecimals:F=!0,noDataText:$,onValueChange:q,enableLegendSlider:Z=!1,customTooltip:W,rotateLabelX:G,tickGap:X=5,className:Y}=t,H=(0,r._T)(t,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),V=T||C?20:0,[K,J]=(0,c.useState)(60),Q=(0,w.me)(s,j),[tt,te]=c.useState(void 0),[tn,tr]=(0,c.useState)(void 0),to=!!q;function ti(t,e,n){var r,o,i,a;n.stopPropagation(),q&&((0,w.vZ)(tt,Object.assign(Object.assign({},t.payload),{value:t.value}))?(tr(void 0),te(void 0),null==q||q(null)):(tr(null===(o=null===(r=t.tooltipPayload)||void 0===r?void 0:r[0])||void 0===o?void 0:o.dataKey),te(Object.assign(Object.assign({},t.payload),{value:t.value})),null==q||q(Object.assign({eventType:"bar",categoryClicked:null===(a=null===(i=t.tooltipPayload)||void 0===i?void 0:i[0])||void 0===a?void 0:a.dataKey},t.payload))))}let ta=(0,w.i4)(R,z,U);return c.createElement("div",Object.assign({ref:e,className:(0,a.q)("w-full h-80",Y)},H),c.createElement(l.h,{className:"h-full w-full"},(null==n?void 0:n.length)?c.createElement(y,{data:n,stackOffset:k?"sign":P?"expand":"none",layout:"vertical"===E?"vertical":"horizontal",onClick:to&&(tn||tt)?()=>{te(void 0),tr(void 0),null==q||q(null)}:void 0},B?c.createElement(v.q,{className:(0,a.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==E,vertical:"vertical"===E}):null,"vertical"!==E?c.createElement(p.K,{padding:{left:V,right:V},hide:!T,dataKey:d,interval:A?"preserveStartEnd":D,tick:{transform:"translate(0, 6)"},ticks:A?[n[0][d],n[n.length-1][d]]:void 0,fill:"",stroke:"",className:(0,a.q)("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==G?void 0:G.angle,dy:null==G?void 0:G.verticalShift,height:null==G?void 0:G.xAxisHeight,minTickGap:X}):c.createElement(p.K,{hide:!T,type:"number",tick:{transform:"translate(-3, 0)"},domain:ta,fill:"",stroke:"",className:(0,a.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:S,minTickGap:X,allowDecimals:F,angle:null==G?void 0:G.angle,dy:null==G?void 0:G.verticalShift,height:null==G?void 0:G.xAxisHeight}),"vertical"!==E?c.createElement(h.B,{width:N,hide:!C,axisLine:!1,tickLine:!1,type:"number",domain:ta,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,a.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:P?t=>"".concat((100*t).toString()," %"):S,allowDecimals:F}):c.createElement(h.B,{width:N,hide:!C,dataKey:d,axisLine:!1,tickLine:!1,ticks:A?[n[0][d],n[n.length-1][d]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:(0,a.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),c.createElement(m.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:I?t=>{let{active:e,payload:n,label:r}=t;return W?c.createElement(W,{payload:null==n?void 0:n.map(t=>{var e;return Object.assign(Object.assign({},t),{color:null!==(e=Q.get(t.dataKey))&&void 0!==e?e:o.fr.Gray})}),active:e,label:r}):c.createElement(x.ZP,{active:e,payload:n,label:r,valueFormatter:S,categoryColors:Q})}:c.createElement(c.Fragment,null),position:{y:0}}),L?c.createElement(g.D,{verticalAlign:"top",height:K,content:t=>{let{payload:e}=t;return(0,b.Z)({payload:e},Q,J,tn,to?t=>{to&&(t!==tn||tt?(tr(t),null==q||q({eventType:"category",categoryClicked:t})):(tr(void 0),null==q||q(null)),te(void 0))}:void 0,Z)}}):null,s.map(t=>{var e;return c.createElement(f.$,{className:(0,a.q)((0,u.bM)(null!==(e=Q.get(t))&&void 0!==e?e:o.fr.Gray,i.K.background).fillColor,q?"cursor-pointer":""),key:t,name:t,type:"linear",stackId:k||P?"a":void 0,dataKey:t,fill:"",isAnimationActive:_,animationDuration:M,shape:t=>((t,e,n,r)=>{let{fillOpacity:o,name:i,payload:a,value:u}=t,{x:l,width:s,y:f,height:p}=t;return"horizontal"===r&&p<0?(f+=p,p=Math.abs(p)):"vertical"===r&&s<0&&(l+=s,s=Math.abs(s)),c.createElement("rect",{x:l,y:f,width:s,height:p,opacity:e||n&&n!==i?(0,w.vZ)(e,Object.assign(Object.assign({},a),{value:u}))?o:.3:o})})(t,tt,tn,E),onClick:ti})})):c.createElement(O.Z,{noDataText:$})))});j.displayName="BarChart"},65278:function(t,e,n){"use strict";n.d(e,{Z:function(){return y}});var r=n(2265);let o=(t,e)=>{let[n,o]=(0,r.useState)(e);(0,r.useEffect)(()=>{let e=()=>{o(window.innerWidth),t()};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[t,n])};var i=n(5853),a=n(26898),u=n(97324),c=n(1153);let l=t=>{var e=(0,i._T)(t,[]);return r.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))},s=t=>{var e=(0,i._T)(t,[]);return r.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))},f=(0,c.fn)("Legend"),p=t=>{let{name:e,color:n,onClick:o,activeLegend:i}=t,l=!!o;return r.createElement("li",{className:(0,u.q)(f("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",l?"cursor-pointer":"cursor-default","text-tremor-content",l?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",l?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:t=>{t.stopPropagation(),null==o||o(e,n)}},r.createElement("svg",{className:(0,u.q)("flex-none h-2 w-2 mr-1.5",(0,c.bM)(n,a.K.text).textColor,i&&i!==e?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},r.createElement("circle",{cx:4,cy:4,r:4})),r.createElement("p",{className:(0,u.q)("whitespace-nowrap truncate text-tremor-default","text-tremor-content",l?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",i&&i!==e?"opacity-40":"opacity-100",l?"dark:group-hover:text-dark-tremor-content-emphasis":"")},e))},h=t=>{let{icon:e,onClick:n,disabled:o}=t,[i,a]=r.useState(!1),c=r.useRef(null);return r.useEffect(()=>(i?c.current=setInterval(()=>{null==n||n()},300):clearInterval(c.current),()=>clearInterval(c.current)),[i,n]),(0,r.useEffect)(()=>{o&&(clearInterval(c.current),a(!1))},[o]),r.createElement("button",{type:"button",className:(0,u.q)(f("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:t=>{t.stopPropagation(),null==n||n()},onMouseDown:t=>{t.stopPropagation(),a(!0)},onMouseUp:t=>{t.stopPropagation(),a(!1)}},r.createElement(e,{className:"w-full"}))},d=r.forwardRef((t,e)=>{var n,o;let{categories:c,colors:d=a.s,className:y,onClickLegendItem:v,activeLegend:m,enableLegendSlider:g=!1}=t,b=(0,i._T)(t,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),x=r.useRef(null),[O,w]=r.useState(null),[j,S]=r.useState(null),E=r.useRef(null),k=(0,r.useCallback)(()=>{let t=null==x?void 0:x.current;t&&w({left:t.scrollLeft>0,right:t.scrollWidth-t.clientWidth>t.scrollLeft})},[w]),P=(0,r.useCallback)(t=>{var e;let n=null==x?void 0:x.current,r=null!==(e=null==n?void 0:n.clientWidth)&&void 0!==e?e:0;n&&g&&(n.scrollTo({left:"left"===t?n.scrollLeft-r:n.scrollLeft+r,behavior:"smooth"}),setTimeout(()=>{k()},400))},[g,k]);r.useEffect(()=>{let t=t=>{"ArrowLeft"===t?P("left"):"ArrowRight"===t&&P("right")};return j?(t(j),E.current=setInterval(()=>{t(j)},300)):clearInterval(E.current),()=>clearInterval(E.current)},[j,P]);let A=t=>{t.stopPropagation(),"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),S(t.key))},M=t=>{t.stopPropagation(),S(null)};return r.useEffect(()=>{let t=null==x?void 0:x.current;return g&&(k(),null==t||t.addEventListener("keydown",A),null==t||t.addEventListener("keyup",M)),()=>{null==t||t.removeEventListener("keydown",A),null==t||t.removeEventListener("keyup",M)}},[k,g]),r.createElement("ol",Object.assign({ref:e,className:(0,u.q)(f("root"),"relative overflow-hidden",y)},b),r.createElement("div",{ref:x,tabIndex:0,className:(0,u.q)("h-full flex",g?(null==O?void 0:O.right)||(null==O?void 0:O.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},c.map((t,e)=>r.createElement(p,{key:"item-".concat(e),name:t,color:d[e],onClick:v,activeLegend:m}))),g&&((null==O?void 0:O.right)||(null==O?void 0:O.left))?r.createElement(r.Fragment,null,r.createElement("div",{className:(0,u.q)("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),r.createElement("div",{className:(0,u.q)("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),r.createElement("div",{className:(0,u.q)("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},r.createElement(h,{icon:l,onClick:()=>{S(null),P("left")},disabled:!(null==O?void 0:O.left)}),r.createElement(h,{icon:s,onClick:()=>{S(null),P("right")},disabled:!(null==O?void 0:O.right)}))):null)});d.displayName="Legend";let y=(t,e,n,i,a,u)=>{let{payload:c}=t,l=(0,r.useRef)(null);o(()=>{var t,e;n((e=null===(t=l.current)||void 0===t?void 0:t.clientHeight)?Number(e)+20:60)});let s=c.filter(t=>"none"!==t.type);return r.createElement("div",{ref:l,className:"flex items-center justify-end"},r.createElement(d,{categories:s.map(t=>t.value),colors:s.map(t=>e.get(t.value)),onClickLegendItem:a,activeLegend:i,enableLegendSlider:u}))}},98593:function(t,e,n){"use strict";n.d(e,{$B:function(){return c},ZP:function(){return s},zX:function(){return l}});var r=n(2265),o=n(7084),i=n(26898),a=n(97324),u=n(1153);let c=t=>{let{children:e}=t;return r.createElement("div",{className:(0,a.q)("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},e)},l=t=>{let{value:e,name:n,color:o}=t;return r.createElement("div",{className:"flex items-center justify-between space-x-8"},r.createElement("div",{className:"flex items-center space-x-2"},r.createElement("span",{className:(0,a.q)("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",(0,u.bM)(o,i.K.background).bgColor)}),r.createElement("p",{className:(0,a.q)("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},n)),r.createElement("p",{className:(0,a.q)("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e))},s=t=>{let{active:e,payload:n,label:i,categoryColors:u,valueFormatter:s}=t;if(e&&n){let t=n.filter(t=>"none"!==t.type);return r.createElement(c,null,r.createElement("div",{className:(0,a.q)("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},r.createElement("p",{className:(0,a.q)("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},i)),r.createElement("div",{className:(0,a.q)("px-4 py-2 space-y-1")},t.map((t,e)=>{var n;let{value:i,name:a}=t;return r.createElement(l,{key:"id-".concat(e),value:s(i),name:a,color:null!==(n=u.get(a))&&void 0!==n?n:o.fr.Blue})})))}return null}},69448:function(t,e,n){"use strict";n.d(e,{Z:function(){return p}});var r=n(97324),o=n(2265),i=n(5853);let a=(0,n(1153).fn)("Flex"),u={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},c={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},l={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},s=o.forwardRef((t,e)=>{let{flexDirection:n="row",justifyContent:s="between",alignItems:f="center",children:p,className:h}=t,d=(0,i._T)(t,["flexDirection","justifyContent","alignItems","children","className"]);return o.createElement("div",Object.assign({ref:e,className:(0,r.q)(a("root"),"flex w-full",l[n],u[s],c[f],h)},d),p)});s.displayName="Flex";var f=n(84264);let p=t=>{let{noDataText:e="No data"}=t;return o.createElement(s,{alignItems:"center",justifyContent:"center",className:(0,r.q)("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},o.createElement(f.Z,{className:(0,r.q)("text-tremor-content","dark:text-dark-tremor-content")},e))}},32644:function(t,e,n){"use strict";n.d(e,{FB:function(){return i},i4:function(){return o},me:function(){return r},vZ:function(){return function t(e,n){if(e===n)return!0;if("object"!=typeof e||"object"!=typeof n||null===e||null===n)return!1;let r=Object.keys(e),o=Object.keys(n);if(r.length!==o.length)return!1;for(let i of r)if(!o.includes(i)||!t(e[i],n[i]))return!1;return!0}}});let r=(t,e)=>{let n=new Map;return t.forEach((t,r)=>{n.set(t,e[r])}),n},o=(t,e,n)=>[t?"auto":null!=e?e:0,null!=n?n:"auto"];function i(t,e){let n=[];for(let r of t)if(Object.prototype.hasOwnProperty.call(r,e)&&(n.push(r[e]),n.length>1))return!1;return!0}},97765:function(t,e,n){"use strict";n.d(e,{Z:function(){return c}});var r=n(5853),o=n(26898),i=n(97324),a=n(1153),u=n(2265);let c=u.forwardRef((t,e)=>{let{color:n,children:c,className:l}=t,s=(0,r._T)(t,["color","children","className"]);return u.createElement("p",Object.assign({ref:e,className:(0,i.q)(n?(0,a.bM)(n,o.K.lightText).textColor:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",l)},s),c)});c.displayName="Subtitle"},7656:function(t,e,n){"use strict";function r(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}n.d(e,{Z:function(){return r}})},47869:function(t,e,n){"use strict";function r(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}n.d(e,{Z:function(){return r}})},25721:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(47869),o=n(99735),i=n(7656);function a(t,e){(0,i.Z)(2,arguments);var n=(0,o.Z)(t),a=(0,r.Z)(e);return isNaN(a)?new Date(NaN):(a&&n.setDate(n.getDate()+a),n)}},55463:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(47869),o=n(99735),i=n(7656);function a(t,e){(0,i.Z)(2,arguments);var n=(0,o.Z)(t),a=(0,r.Z)(e);if(isNaN(a))return new Date(NaN);if(!a)return n;var u=n.getDate(),c=new Date(n.getTime());return(c.setMonth(n.getMonth()+a+1,0),u>=c.getDate())?c:(n.setFullYear(c.getFullYear(),c.getMonth(),u),n)}},99735:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(41154),o=n(7656);function i(t){(0,o.Z)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===(0,r.Z)(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):(("string"==typeof t||"[object String]"===e)&&"undefined"!=typeof console&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}},61134:function(t,e,n){var r;!function(o){"use strict";var i,a={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},u=!0,c="[DecimalError] ",l=c+"Invalid argument: ",s=c+"Exponent out of range: ",f=Math.floor,p=Math.pow,h=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d=f(1286742750677284.5),y={};function v(t,e){var n,r,o,i,a,c,l,s,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s||(e=new f(t)),u?k(e,p):e;if(l=t.d,s=e.d,a=t.e,o=e.e,l=l.slice(),i=a-o){for(i<0?(r=l,i=-i,c=s.length):(r=s,o=a,c=l.length),i>(c=(a=Math.ceil(p/7))>c?a+1:c+1)&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((c=l.length)-(i=s.length)<0&&(i=c,r=s,s=l,l=r),n=0;i;)n=(l[--i]=l[i]+s[i]+n)/1e7|0,l[i]%=1e7;for(n&&(l.unshift(n),++o),c=l.length;0==l[--c];)l.pop();return e.d=l,e.e=o,u?k(e,p):e}function m(t,e,n){if(t!==~~t||tn)throw Error(l+t)}function g(t){var e,n,r,o=t.length-1,i="",a=t[0];if(o>0){for(i+=a,e=1;et.e^this.s<0?1:-1;for(e=0,n=(r=this.d.length)<(o=t.d.length)?r:o;et.d[e]^this.s<0?1:-1;return r===o?0:r>o^this.s<0?1:-1},y.decimalPlaces=y.dp=function(){var t=this.d.length-1,e=(t-this.e)*7;if(t=this.d[t])for(;t%10==0;t/=10)e--;return e<0?0:e},y.dividedBy=y.div=function(t){return b(this,new this.constructor(t))},y.dividedToIntegerBy=y.idiv=function(t){var e=this.constructor;return k(b(this,new e(t),0,1),e.precision)},y.equals=y.eq=function(t){return!this.cmp(t)},y.exponent=function(){return O(this)},y.greaterThan=y.gt=function(t){return this.cmp(t)>0},y.greaterThanOrEqualTo=y.gte=function(t){return this.cmp(t)>=0},y.isInteger=y.isint=function(){return this.e>this.d.length-2},y.isNegative=y.isneg=function(){return this.s<0},y.isPositive=y.ispos=function(){return this.s>0},y.isZero=function(){return 0===this.s},y.lessThan=y.lt=function(t){return 0>this.cmp(t)},y.lessThanOrEqualTo=y.lte=function(t){return 1>this.cmp(t)},y.logarithm=y.log=function(t){var e,n=this.constructor,r=n.precision,o=r+5;if(void 0===t)t=new n(10);else if((t=new n(t)).s<1||t.eq(i))throw Error(c+"NaN");if(this.s<1)throw Error(c+(this.s?"NaN":"-Infinity"));return this.eq(i)?new n(0):(u=!1,e=b(S(this,o),S(t,o),o),u=!0,k(e,r))},y.minus=y.sub=function(t){return t=new this.constructor(t),this.s==t.s?P(this,t):v(this,(t.s=-t.s,t))},y.modulo=y.mod=function(t){var e,n=this.constructor,r=n.precision;if(!(t=new n(t)).s)throw Error(c+"NaN");return this.s?(u=!1,e=b(this,t,0,1).times(t),u=!0,this.minus(e)):k(new n(this),r)},y.naturalExponential=y.exp=function(){return x(this)},y.naturalLogarithm=y.ln=function(){return S(this)},y.negated=y.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t},y.plus=y.add=function(t){return t=new this.constructor(t),this.s==t.s?v(this,t):P(this,(t.s=-t.s,t))},y.precision=y.sd=function(t){var e,n,r;if(void 0!==t&&!!t!==t&&1!==t&&0!==t)throw Error(l+t);if(e=O(this)+1,n=7*(r=this.d.length-1)+1,r=this.d[r]){for(;r%10==0;r/=10)n--;for(r=this.d[0];r>=10;r/=10)n++}return t&&e>n?e:n},y.squareRoot=y.sqrt=function(){var t,e,n,r,o,i,a,l=this.constructor;if(this.s<1){if(!this.s)return new l(0);throw Error(c+"NaN")}for(t=O(this),u=!1,0==(o=Math.sqrt(+this))||o==1/0?(((e=g(this.d)).length+t)%2==0&&(e+="0"),o=Math.sqrt(e),t=f((t+1)/2)-(t<0||t%2),r=new l(e=o==1/0?"5e"+t:(e=o.toExponential()).slice(0,e.indexOf("e")+1)+t)):r=new l(o.toString()),o=a=(n=l.precision)+3;;)if(r=(i=r).plus(b(this,i,a+2)).times(.5),g(i.d).slice(0,a)===(e=g(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),o==a&&"4999"==e){if(k(i,n+1,0),i.times(i).eq(this)){r=i;break}}else if("9999"!=e)break;a+=4}return u=!0,k(r,n)},y.times=y.mul=function(t){var e,n,r,o,i,a,c,l,s,f=this.constructor,p=this.d,h=(t=new f(t)).d;if(!this.s||!t.s)return new f(0);for(t.s*=this.s,n=this.e+t.e,(l=p.length)<(s=h.length)&&(i=p,p=h,h=i,a=l,l=s,s=a),i=[],r=a=l+s;r--;)i.push(0);for(r=s;--r>=0;){for(e=0,o=l+r;o>r;)c=i[o]+h[r]*p[o-r-1]+e,i[o--]=c%1e7|0,e=c/1e7|0;i[o]=(i[o]+e)%1e7|0}for(;!i[--a];)i.pop();return e?++n:i.shift(),t.d=i,t.e=n,u?k(t,f.precision):t},y.toDecimalPlaces=y.todp=function(t,e){var n=this,r=n.constructor;return(n=new r(n),void 0===t)?n:(m(t,0,1e9),void 0===e?e=r.rounding:m(e,0,8),k(n,t+O(n)+1,e))},y.toExponential=function(t,e){var n,r=this,o=r.constructor;return void 0===t?n=A(r,!0):(m(t,0,1e9),void 0===e?e=o.rounding:m(e,0,8),n=A(r=k(new o(r),t+1,e),!0,t+1)),n},y.toFixed=function(t,e){var n,r,o=this.constructor;return void 0===t?A(this):(m(t,0,1e9),void 0===e?e=o.rounding:m(e,0,8),n=A((r=k(new o(this),t+O(this)+1,e)).abs(),!1,t+O(r)+1),this.isneg()&&!this.isZero()?"-"+n:n)},y.toInteger=y.toint=function(){var t=this.constructor;return k(new t(this),O(this)+1,t.rounding)},y.toNumber=function(){return+this},y.toPower=y.pow=function(t){var e,n,r,o,a,l,s=this,p=s.constructor,h=+(t=new p(t));if(!t.s)return new p(i);if(!(s=new p(s)).s){if(t.s<1)throw Error(c+"Infinity");return s}if(s.eq(i))return s;if(r=p.precision,t.eq(i))return k(s,r);if(l=(e=t.e)>=(n=t.d.length-1),a=s.s,l){if((n=h<0?-h:h)<=9007199254740991){for(o=new p(i),e=Math.ceil(r/7+4),u=!1;n%2&&M((o=o.times(s)).d,e),0!==(n=f(n/2));)M((s=s.times(s)).d,e);return u=!0,t.s<0?new p(i).div(o):k(o,r)}}else if(a<0)throw Error(c+"NaN");return a=a<0&&1&t.d[Math.max(e,n)]?-1:1,s.s=1,u=!1,o=t.times(S(s,r+12)),u=!0,(o=x(o)).s=a,o},y.toPrecision=function(t,e){var n,r,o=this,i=o.constructor;return void 0===t?(n=O(o),r=A(o,n<=i.toExpNeg||n>=i.toExpPos)):(m(t,1,1e9),void 0===e?e=i.rounding:m(e,0,8),n=O(o=k(new i(o),t,e)),r=A(o,t<=n||n<=i.toExpNeg,t)),r},y.toSignificantDigits=y.tosd=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(m(t,1,1e9),void 0===e?e=n.rounding:m(e,0,8)),k(new n(this),t,e)},y.toString=y.valueOf=y.val=y.toJSON=function(){var t=O(this),e=this.constructor;return A(this,t<=e.toExpNeg||t>=e.toExpPos)};var b=function(){function t(t,e){var n,r=0,o=t.length;for(t=t.slice();o--;)n=t[o]*e+r,t[o]=n%1e7|0,r=n/1e7|0;return r&&t.unshift(r),t}function e(t,e,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;oe[o]?1:-1;break}return i}function n(t,e,n){for(var r=0;n--;)t[n]-=r,r=t[n]1;)t.shift()}return function(r,o,i,a){var u,l,s,f,p,h,d,y,v,m,g,b,x,w,j,S,E,P,A=r.constructor,M=r.s==o.s?1:-1,_=r.d,T=o.d;if(!r.s)return new A(r);if(!o.s)throw Error(c+"Division by zero");for(s=0,l=r.e-o.e,E=T.length,j=_.length,y=(d=new A(M)).d=[];T[s]==(_[s]||0);)++s;if(T[s]>(_[s]||0)&&--l,(b=null==i?i=A.precision:a?i+(O(r)-O(o))+1:i)<0)return new A(0);if(b=b/7+2|0,s=0,1==E)for(f=0,T=T[0],b++;(s1&&(T=t(T,f),_=t(_,f),E=T.length,j=_.length),w=E,m=(v=_.slice(0,E)).length;m=1e7/2&&++S;do f=0,(u=e(T,v,E,m))<0?(g=v[0],E!=m&&(g=1e7*g+(v[1]||0)),(f=g/S|0)>1?(f>=1e7&&(f=1e7-1),h=(p=t(T,f)).length,m=v.length,1==(u=e(p,v,h,m))&&(f--,n(p,E16)throw Error(s+O(t));if(!t.s)return new h(i);for(null==e?(u=!1,c=d):c=e,a=new h(.03125);t.abs().gte(.1);)t=t.times(a),f+=5;for(c+=Math.log(p(2,f))/Math.LN10*2+5|0,n=r=o=new h(i),h.precision=c;;){if(r=k(r.times(t),c),n=n.times(++l),g((a=o.plus(b(r,n,c))).d).slice(0,c)===g(o.d).slice(0,c)){for(;f--;)o=k(o.times(o),c);return h.precision=d,null==e?(u=!0,k(o,d)):o}o=a}}function O(t){for(var e=7*t.e,n=t.d[0];n>=10;n/=10)e++;return e}function w(t,e,n){if(e>t.LN10.sd())throw u=!0,n&&(t.precision=n),Error(c+"LN10 precision limit exceeded");return k(new t(t.LN10),e)}function j(t){for(var e="";t--;)e+="0";return e}function S(t,e){var n,r,o,a,l,s,f,p,h,d=1,y=t,v=y.d,m=y.constructor,x=m.precision;if(y.s<1)throw Error(c+(y.s?"NaN":"-Infinity"));if(y.eq(i))return new m(0);if(null==e?(u=!1,p=x):p=e,y.eq(10))return null==e&&(u=!0),w(m,p);if(p+=10,m.precision=p,r=(n=g(v)).charAt(0),!(15e14>Math.abs(a=O(y))))return f=w(m,p+2,x).times(a+""),y=S(new m(r+"."+n.slice(1)),p-10).plus(f),m.precision=x,null==e?(u=!0,k(y,x)):y;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=g((y=y.times(t)).d)).charAt(0),d++;for(a=O(y),r>1?(y=new m("0."+n),a++):y=new m(r+"."+n.slice(1)),s=l=y=b(y.minus(i),y.plus(i),p),h=k(y.times(y),p),o=3;;){if(l=k(l.times(h),p),g((f=s.plus(b(l,new m(o),p))).d).slice(0,p)===g(s.d).slice(0,p))return s=s.times(2),0!==a&&(s=s.plus(w(m,p+2,x).times(a+""))),s=b(s,new m(d),p),m.precision=x,null==e?(u=!0,k(s,x)):s;s=f,o+=2}}function E(t,e){var n,r,o;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);)++r;for(o=e.length;48===e.charCodeAt(o-1);)--o;if(e=e.slice(r,o)){if(o-=r,n=n-r-1,t.e=f(n/7),t.d=[],r=(n+1)%7,n<0&&(r+=7),rd||t.e<-d))throw Error(s+n)}else t.s=0,t.e=0,t.d=[0];return t}function k(t,e,n){var r,o,i,a,c,l,h,y,v=t.d;for(a=1,i=v[0];i>=10;i/=10)a++;if((r=e-a)<0)r+=7,o=e,h=v[y=0];else{if((y=Math.ceil((r+1)/7))>=(i=v.length))return t;for(a=1,h=i=v[y];i>=10;i/=10)a++;r%=7,o=r-7+a}if(void 0!==n&&(c=h/(i=p(10,a-o-1))%10|0,l=e<0||void 0!==v[y+1]||h%i,l=n<4?(c||l)&&(0==n||n==(t.s<0?3:2)):c>5||5==c&&(4==n||l||6==n&&(r>0?o>0?h/p(10,a-o):0:v[y-1])%10&1||n==(t.s<0?8:7))),e<1||!v[0])return l?(i=O(t),v.length=1,e=e-i-1,v[0]=p(10,(7-e%7)%7),t.e=f(-e/7)||0):(v.length=1,v[0]=t.e=t.s=0),t;if(0==r?(v.length=y,i=1,y--):(v.length=y+1,i=p(10,7-r),v[y]=o>0?(h/p(10,a-o)%p(10,o)|0)*i:0),l)for(;;){if(0==y){1e7==(v[0]+=i)&&(v[0]=1,++t.e);break}if(v[y]+=i,1e7!=v[y])break;v[y--]=0,i=1}for(r=v.length;0===v[--r];)v.pop();if(u&&(t.e>d||t.e<-d))throw Error(s+O(t));return t}function P(t,e){var n,r,o,i,a,c,l,s,f,p,h=t.constructor,d=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),u?k(e,d):e;if(l=t.d,p=e.d,r=e.e,s=t.e,l=l.slice(),a=s-r){for((f=a<0)?(n=l,a=-a,c=p.length):(n=p,r=s,c=l.length),a>(o=Math.max(Math.ceil(d/7),c)+2)&&(a=o,n.length=1),n.reverse(),o=a;o--;)n.push(0);n.reverse()}else{for((f=(o=l.length)<(c=p.length))&&(c=o),o=0;o0;--o)l[c++]=0;for(o=p.length;o>a;){if(l[--o]0?i=i.charAt(0)+"."+i.slice(1)+j(r):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(o<0?"e":"e+")+o):o<0?(i="0."+j(-o-1)+i,n&&(r=n-a)>0&&(i+=j(r))):o>=a?(i+=j(o+1-a),n&&(r=n-o-1)>0&&(i=i+"."+j(r))):((r=o+1)0&&(o+1===a&&(i+="."),i+=j(r))),t.s<0?"-"+i:i}function M(t,e){if(t.length>e)return t.length=e,!0}function _(t){if(!t||"object"!=typeof t)throw Error(c+"Object expected");var e,n,r,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e=o[e+1]&&r<=o[e+2])this[n]=r;else throw Error(l+n+": "+r)}if(void 0!==(r=t[n="LN10"])){if(r==Math.LN10)this[n]=new this(r);else throw Error(l+n+": "+r)}return this}(a=function t(e){var n,r,o;function i(t){if(!(this instanceof i))return new i(t);if(this.constructor=i,t instanceof i){this.s=t.s,this.e=t.e,this.d=(t=t.d)?t.slice():t;return}if("number"==typeof t){if(0*t!=0)throw Error(l+t);if(t>0)this.s=1;else if(t<0)t=-t,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(t===~~t&&t<1e7){this.e=0,this.d=[t];return}return E(this,t.toString())}if("string"!=typeof t)throw Error(l+t);if(45===t.charCodeAt(0)?(t=t.slice(1),this.s=-1):this.s=1,h.test(t))E(this,t);else throw Error(l+t)}if(i.prototype=y,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=t,i.config=i.set=_,void 0===e&&(e={}),e)for(n=0,o=["precision","rounding","toExpNeg","toExpPos","LN10"];n-1}},56883:function(t){t.exports=function(t,e,n){for(var r=-1,o=null==t?0:t.length;++r0&&i(s)?n>1?t(s,n-1,i,a,u):r(u,s):a||(u[u.length]=s)}return u}},63321:function(t,e,n){var r=n(33023)();t.exports=r},98060:function(t,e,n){var r=n(63321),o=n(43228);t.exports=function(t,e){return t&&r(t,e,o)}},92167:function(t,e,n){var r=n(67906),o=n(70235);t.exports=function(t,e){e=r(e,t);for(var n=0,i=e.length;null!=t&&ne}},93012:function(t){t.exports=function(t,e){return null!=t&&e in Object(t)}},47909:function(t,e,n){var r=n(8235),o=n(31953),i=n(35281);t.exports=function(t,e,n){return e==e?i(t,e,n):r(t,o,n)}},90370:function(t,e,n){var r=n(54506),o=n(10303);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},56318:function(t,e,n){var r=n(6791),o=n(10303);t.exports=function t(e,n,i,a,u){return e===n||(null!=e&&null!=n&&(o(e)||o(n))?r(e,n,i,a,t,u):e!=e&&n!=n)}},6791:function(t,e,n){var r=n(85885),o=n(97638),i=n(88030),a=n(64974),u=n(81690),c=n(25614),l=n(98051),s=n(9792),f="[object Arguments]",p="[object Array]",h="[object Object]",d=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,y,v,m){var g=c(t),b=c(e),x=g?p:u(t),O=b?p:u(e);x=x==f?h:x,O=O==f?h:O;var w=x==h,j=O==h,S=x==O;if(S&&l(t)){if(!l(e))return!1;g=!0,w=!1}if(S&&!w)return m||(m=new r),g||s(t)?o(t,e,n,y,v,m):i(t,e,x,n,y,v,m);if(!(1&n)){var E=w&&d.call(t,"__wrapped__"),k=j&&d.call(e,"__wrapped__");if(E||k){var P=E?t.value():t,A=k?e.value():e;return m||(m=new r),v(P,A,n,y,m)}}return!!S&&(m||(m=new r),a(t,e,n,y,v,m))}},62538:function(t,e,n){var r=n(85885),o=n(56318);t.exports=function(t,e,n,i){var a=n.length,u=a,c=!i;if(null==t)return!u;for(t=Object(t);a--;){var l=n[a];if(c&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++ao?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r=200){var y=e?null:u(t);if(y)return c(y);p=!1,s=a,d=new r}else d=e?[]:h;t:for(;++l=o?t:r(t,e,n)}},1536:function(t,e,n){var r=n(78371);t.exports=function(t,e){if(t!==e){var n=void 0!==t,o=null===t,i=t==t,a=r(t),u=void 0!==e,c=null===e,l=e==e,s=r(e);if(!c&&!s&&!a&&t>e||a&&u&&l&&!c&&!s||o&&u&&l||!n&&l||!i)return 1;if(!o&&!a&&!s&&t=c)return l;return l*("desc"==n[o]?-1:1)}}return t.index-e.index}},92077:function(t,e,n){var r=n(74288)["__core-js_shared__"];t.exports=r},97930:function(t,e,n){var r=n(5629);t.exports=function(t,e){return function(n,o){if(null==n)return n;if(!r(n))return t(n,o);for(var i=n.length,a=e?i:-1,u=Object(n);(e?a--:++a-1?u[c?e[l]:l]:void 0}}},35464:function(t,e,n){var r=n(19608),o=n(49639),i=n(175);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&o(e,n,a)&&(n=a=void 0),e=i(e),void 0===n?(n=e,e=0):n=i(n),a=void 0===a?es))return!1;var p=c.get(t),h=c.get(e);if(p&&h)return p==e&&h==t;var d=-1,y=!0,v=2&n?new r:void 0;for(c.set(t,e),c.set(e,t);++d-1&&t%1==0&&t-1}},13368:function(t,e,n){var r=n(24457);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},38764:function(t,e,n){var r=n(9855),o=n(99078),i=n(88675);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},78615:function(t,e,n){var r=n(1507);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},83391:function(t,e,n){var r=n(1507);t.exports=function(t){return r(this,t).get(t)}},53483:function(t,e,n){var r=n(1507);t.exports=function(t){return r(this,t).has(t)}},74724:function(t,e,n){var r=n(1507);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},22523:function(t){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}},47073:function(t){t.exports=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}},23787:function(t,e,n){var r=n(50967);t.exports=function(t){var e=r(t,function(t){return 500===n.size&&n.clear(),t}),n=e.cache;return e}},20453:function(t,e,n){var r=n(39866)(Object,"create");t.exports=r},77184:function(t,e,n){var r=n(45070)(Object.keys,Object);t.exports=r},39931:function(t,e,n){t=n.nmd(t);var r=n(17071),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,u=function(){try{var t=i&&i.require&&i.require("util").types;if(t)return t;return a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=u},45070:function(t){t.exports=function(t,e){return function(n){return t(e(n))}}},49478:function(t,e,n){var r=n(60493),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},84092:function(t,e,n){var r=n(99078);t.exports=function(){this.__data__=new r,this.size=0}},31663:function(t){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},69135:function(t){t.exports=function(t){return this.__data__.get(t)}},39552:function(t){t.exports=function(t){return this.__data__.has(t)}},63960:function(t,e,n){var r=n(99078),o=n(88675),i=n(76219);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},35281:function(t){t.exports=function(t,e,n){for(var r=n-1,o=t.length;++r-1&&t%1==0&&t<=9007199254740991}},82559:function(t,e,n){var r=n(22345);t.exports=function(t){return r(t)&&t!=+t}},77571:function(t){t.exports=function(t){return null==t}},22345:function(t,e,n){var r=n(54506),o=n(10303);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==r(t)}},90231:function(t,e,n){var r=n(54506),o=n(62602),i=n(10303),a=Object.prototype,u=Function.prototype.toString,c=a.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},42715:function(t,e,n){var r=n(54506),o=n(25614),i=n(10303);t.exports=function(t){return"string"==typeof t||!o(t)&&i(t)&&"[object String]"==r(t)}},9792:function(t,e,n){var r=n(59332),o=n(23305),i=n(39931),a=i&&i.isTypedArray,u=a?o(a):r;t.exports=u},43228:function(t,e,n){var r=n(28579),o=n(4578),i=n(5629);t.exports=function(t){return i(t)?r(t):o(t)}},86185:function(t){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},89238:function(t,e,n){var r=n(73819),o=n(88157),i=n(24240),a=n(25614);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},41443:function(t,e,n){var r=n(83023),o=n(98060),i=n(88157);t.exports=function(t,e){var n={};return e=i(e,3),o(t,function(t,o,i){r(n,o,e(t,o,i))}),n}},95645:function(t,e,n){var r=n(67646),o=n(58905),i=n(79586);t.exports=function(t){return t&&t.length?r(t,i,o):void 0}},50967:function(t,e,n){var r=n(76219);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},99008:function(t,e,n){var r=n(67646),o=n(20121),i=n(79586);t.exports=function(t){return t&&t.length?r(t,i,o):void 0}},93810:function(t){t.exports=function(){}},22350:function(t,e,n){var r=n(18155),o=n(73584),i=n(67352),a=n(70235);t.exports=function(t){return i(t)?r(a(t)):o(t)}},99676:function(t,e,n){var r=n(35464)();t.exports=r},33645:function(t,e,n){var r=n(25253),o=n(88157),i=n(12327),a=n(25614),u=n(49639);t.exports=function(t,e,n){var c=a(t)?r:i;return n&&u(t,e,n)&&(e=void 0),c(t,o(e,3))}},34935:function(t,e,n){var r=n(72569),o=n(84046),i=n(44843),a=n(49639),u=i(function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),o(t,r(e,1),[])});t.exports=u},55716:function(t){t.exports=function(){return[]}},7406:function(t){t.exports=function(){return!1}},37065:function(t,e,n){var r=n(7310),o=n(28302);t.exports=function(t,e,n){var i=!0,a=!0;if("function"!=typeof t)throw TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:i,maxWait:e,trailing:a})}},175:function(t,e,n){var r=n(6660),o=1/0;t.exports=function(t){return t?(t=r(t))===o||t===-o?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0}},85759:function(t,e,n){var r=n(175);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},3641:function(t,e,n){var r=n(65020);t.exports=function(t){return null==t?"":r(t)}},47230:function(t,e,n){var r=n(88157),o=n(13826);t.exports=function(t,e){return t&&t.length?o(t,r(e,2)):[]}},75551:function(t,e,n){var r=n(80675)("toUpperCase");t.exports=r},48049:function(t,e,n){"use strict";var r=n(14397);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,n,o,i,a){if(a!==r){var u=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},40718:function(t,e,n){t.exports=n(48049)()},14397:function(t){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},13126:function(t,e){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,s=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,d=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),y=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope"),e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},e.isFragment=function(t){return function(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case r:switch(t=t.type){case s:case f:case i:case u:case a:case h:return t;default:switch(t=t&&t.$$typeof){case l:case p:case y:case d:case c:return t;default:return e}}case o:return e}}}(t)===i}},82558:function(t,e,n){"use strict";t.exports=n(13126)},52181:function(t,e,n){"use strict";function r(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=t&&this.setState(t)}function o(t){this.setState((function(e){var n=this.constructor.getDerivedStateFromProps(t,e);return null!=n?n:null}).bind(this))}function i(t,e){try{var n=this.props,r=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(t){var e=t.prototype;if(!e||!e.isReactComponent)throw Error("Can only polyfill class components");if("function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate)return t;var n=null,a=null,u=null;if("function"==typeof e.componentWillMount?n="componentWillMount":"function"==typeof e.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof e.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof e.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof e.componentWillUpdate?u="componentWillUpdate":"function"==typeof e.UNSAFE_componentWillUpdate&&(u="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==u)throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+(t.displayName||t.name)+" uses "+("function"==typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()")+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==u?"\n "+u:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks");if("function"==typeof t.getDerivedStateFromProps&&(e.componentWillMount=r,e.componentWillReceiveProps=o),"function"==typeof e.getSnapshotBeforeUpdate){if("function"!=typeof e.componentDidUpdate)throw Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=i;var c=e.componentDidUpdate;e.componentDidUpdate=function(t,e,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,t,e,r)}}return t}n.r(e),n.d(e,{polyfill:function(){return a}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},59221:function(t,e,n){"use strict";n.d(e,{ZP:function(){return tU},bO:function(){return W}});var r=n(2265),o=n(40718),i=n.n(o),a=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty;function l(t,e){return function(n,r,o){return t(n,r,o)&&e(n,r,o)}}function s(t){return function(e,n,r){if(!e||!n||"object"!=typeof e||"object"!=typeof n)return t(e,n,r);var o=r.cache,i=o.get(e),a=o.get(n);if(i&&a)return i===n&&a===e;o.set(e,n),o.set(n,e);var u=t(e,n,r);return o.delete(e),o.delete(n),u}}function f(t){return a(t).concat(u(t))}var p=Object.hasOwn||function(t,e){return c.call(t,e)};function h(t,e){return t||e?t===e:t===e||t!=t&&e!=e}var d="_owner",y=Object.getOwnPropertyDescriptor,v=Object.keys;function m(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function g(t,e){return h(t.getTime(),e.getTime())}function b(t,e,n){if(t.size!==e.size)return!1;for(var r,o,i={},a=t.entries(),u=0;(r=a.next())&&!r.done;){for(var c=e.entries(),l=!1,s=0;(o=c.next())&&!o.done;){var f=r.value,p=f[0],h=f[1],d=o.value,y=d[0],v=d[1];!l&&!i[s]&&(l=n.equals(p,y,u,s,t,e,n)&&n.equals(h,v,p,y,t,e,n))&&(i[s]=!0),s++}if(!l)return!1;u++}return!0}function x(t,e,n){var r,o=v(t),i=o.length;if(v(e).length!==i)return!1;for(;i-- >0;)if((r=o[i])===d&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!p(e,r)||!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function O(t,e,n){var r,o,i,a=f(t),u=a.length;if(f(e).length!==u)return!1;for(;u-- >0;)if((r=a[u])===d&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!p(e,r)||!n.equals(t[r],e[r],r,r,t,e,n)||(o=y(t,r),i=y(e,r),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable)))return!1;return!0}function w(t,e){return h(t.valueOf(),e.valueOf())}function j(t,e){return t.source===e.source&&t.flags===e.flags}function S(t,e,n){if(t.size!==e.size)return!1;for(var r,o,i={},a=t.values();(r=a.next())&&!r.done;){for(var u=e.values(),c=!1,l=0;(o=u.next())&&!o.done;)!c&&!i[l]&&(c=n.equals(r.value,o.value,r.value,o.value,t,e,n))&&(i[l]=!0),l++;if(!c)return!1}return!0}function E(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var k=Array.isArray,P="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,A=Object.assign,M=Object.prototype.toString.call.bind(Object.prototype.toString),_=T();function T(t){void 0===t&&(t={});var e,n,r,o,i,a,u,c,f,p=t.circular,h=t.createInternalComparator,d=t.createState,y=t.strict,v=(n=(e=function(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,o={areArraysEqual:r?O:m,areDatesEqual:g,areMapsEqual:r?l(b,O):b,areObjectsEqual:r?O:x,arePrimitiveWrappersEqual:w,areRegExpsEqual:j,areSetsEqual:r?l(S,O):S,areTypedArraysEqual:r?O:E};if(n&&(o=A({},o,n(o))),e){var i=s(o.areArraysEqual),a=s(o.areMapsEqual),u=s(o.areObjectsEqual),c=s(o.areSetsEqual);o=A({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:u,areSetsEqual:c})}return o}(t)).areArraysEqual,r=e.areDatesEqual,o=e.areMapsEqual,i=e.areObjectsEqual,a=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,c=e.areSetsEqual,f=e.areTypedArraysEqual,function(t,e,l){if(t===e)return!0;if(null==t||null==e||"object"!=typeof t||"object"!=typeof e)return t!=t&&e!=e;var s=t.constructor;if(s!==e.constructor)return!1;if(s===Object)return i(t,e,l);if(k(t))return n(t,e,l);if(null!=P&&P(t))return f(t,e,l);if(s===Date)return r(t,e,l);if(s===RegExp)return u(t,e,l);if(s===Map)return o(t,e,l);if(s===Set)return c(t,e,l);var p=M(t);return"[object Date]"===p?r(t,e,l):"[object RegExp]"===p?u(t,e,l):"[object Map]"===p?o(t,e,l):"[object Set]"===p?c(t,e,l):"[object Object]"===p?"function"!=typeof t.then&&"function"!=typeof e.then&&i(t,e,l):"[object Arguments]"===p?i(t,e,l):("[object Boolean]"===p||"[object Number]"===p||"[object String]"===p)&&a(t,e,l)}),_=h?h(v):function(t,e,n,r,o,i,a){return v(t,e,a)};return function(t){var e=t.circular,n=t.comparator,r=t.createState,o=t.equals,i=t.strict;if(r)return function(t,a){var u=r(),c=u.cache;return n(t,a,{cache:void 0===c?e?new WeakMap:void 0:c,equals:o,meta:u.meta,strict:i})};if(e)return function(t,e){return n(t,e,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(t,e){return n(t,e,a)}}({circular:void 0!==p&&p,comparator:v,createState:d,equals:_,strict:void 0!==y&&y})}function C(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1;requestAnimationFrame(function r(o){if(n<0&&(n=o),o-n>e)t(o),n=-1;else{var i;i=r,"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(i)}})}function N(t){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0&&t<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",r);var p=J(i,u),h=J(a,c),d=(t=i,e=u,function(n){var r;return K([].concat(function(t){if(Array.isArray(t))return H(t)}(r=V(t,e).map(function(t,e){return t*e}).slice(1))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||Y(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),n)}),y=function(t){for(var e=t>1?1:t,n=e,r=0;r<8;++r){var o,i=p(n)-e,a=d(n);if(1e-4>Math.abs(i-e)||a<1e-4)break;n=(o=n-i/a)>1?1:o<0?0:o}return h(n)};return y.isStepper=!1,y},tt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.stiff,n=void 0===e?100:e,r=t.damping,o=void 0===r?8:r,i=t.dt,a=void 0===i?17:i,u=function(t,e,r){var i=r+(-(t-e)*n-r*o)*a/1e3,u=r*a/1e3+t;return 1e-4>Math.abs(u-e)&&1e-4>Math.abs(i)?[e,0]:[u,i]};return u.isStepper=!0,u.dt=a,u},te=function(){for(var t=arguments.length,e=Array(t),n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n0?n[o-1]:r,p=l||Object.keys(c);if("function"==typeof u||"spring"===u)return[].concat(ty(t),[e.runJSAnimation.bind(e,{from:f.style,to:c,duration:i,easing:u}),i]);var h=G(p,i,u),d=tg(tg(tg({},f.style),c),{},{transition:h});return[].concat(ty(t),[d,i,s]).filter($)},[a,Math.max(void 0===u?0:u,r)])),[t.onAnimationEnd]))}},{key:"runAnimation",value:function(t){if(!this.manager){var e,n,r;this.manager=(e=function(){return null},n=!1,r=function t(r){if(!n){if(Array.isArray(r)){if(!r.length)return;var o=function(t){if(Array.isArray(t))return t}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return D(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(t,void 0)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=o[0],a=o.slice(1);if("number"==typeof i){C(t.bind(null,a),i);return}t(i),C(t.bind(null,a));return}"object"===N(r)&&e(r),"function"==typeof r&&r()}},{stop:function(){n=!0},start:function(t){n=!1,r(t)},subscribe:function(t){return e=t,function(){e=function(){return null}}}})}var o=t.begin,i=t.duration,a=t.attributeName,u=t.to,c=t.easing,l=t.onAnimationStart,s=t.onAnimationEnd,f=t.steps,p=t.children,h=this.manager;if(this.unSubscribe=h.subscribe(this.handleStyleChange),"function"==typeof c||"function"==typeof p||"spring"===c){this.runJSAnimation(t);return}if(f.length>1){this.runStepAnimation(t);return}var d=a?tb({},a,u):u,y=G(Object.keys(d),i,c);h.start([l,o,tg(tg({},d),{},{transition:y}),i,s])}},{key:"render",value:function(){var t=this.props,e=t.children,n=(t.begin,t.duration),o=(t.attributeName,t.easing,t.isActive),i=(t.steps,t.from,t.to,t.canBegin,t.onAnimationEnd,t.shouldReAnimate,t.onAnimationReStart,function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,td)),a=r.Children.count(e),u=W(this.state.style);if("function"==typeof e)return e(u);if(!o||0===a||n<=0)return e;var c=function(t){var e=t.props,n=e.style,o=e.className;return(0,r.cloneElement)(t,tg(tg({},i),{},{style:tg(tg({},void 0===n?{}:n),u),className:o}))};return 1===a?c(r.Children.only(e)):r.createElement("div",null,r.Children.map(e,function(t){return c(t)}))}}],function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=t.steps,n=t.duration;return e&&e.length?e.reduce(function(t,e){return t+(Number.isFinite(e.duration)&&e.duration>0?e.duration:0)},0):Number.isFinite(n)?n:0},tR=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tC(t,e)}(i,t);var e,n,o=(e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,n=tD(i);return t=e?Reflect.construct(n,arguments,tD(this).constructor):n.apply(this,arguments),function(t,e){if(e&&("object"===tA(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return tN(t)}(this,t)});function i(){var t;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),tI(tN(t=o.call(this)),"handleEnter",function(e,n){var r=t.props,o=r.appearOptions,i=r.enterOptions;t.handleStyleActive(n?o:i)}),tI(tN(t),"handleExit",function(){var e=t.props.leaveOptions;t.handleStyleActive(e)}),t.state={isActive:!1},t}return n=[{key:"handleStyleActive",value:function(t){if(t){var e=t.onAnimationEnd?function(){t.onAnimationEnd()}:null;this.setState(tT(tT({},t),{},{onAnimationEnd:e,isActive:!0}))}}},{key:"parseTimeout",value:function(){var t=this.props,e=t.appearOptions,n=t.enterOptions,r=t.leaveOptions;return tB(e)+tB(n)+tB(r)}},{key:"render",value:function(){var t=this,e=this.props,n=e.children,o=(e.appearOptions,e.enterOptions,e.leaveOptions,function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,tP));return r.createElement(tk.Transition,tM({},o,{onEnter:this.handleEnter,onExit:this.handleExit,timeout:this.parseTimeout()}),function(){return r.createElement(tE,t.state,r.Children.only(n))})}}],function(t,e){for(var n=0;n=0||(o[n]=t[n]);return o}(t,["children","in"]),a=r.default.Children.toArray(e),u=a[0],c=a[1];return delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,r.default.createElement(i.default,o,n?r.default.cloneElement(u,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(c,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},e}(r.default.Component);u.propTypes={},e.default=u,t.exports=e.default},20536:function(t,e,n){"use strict";e.__esModule=!0,e.default=e.EXITING=e.ENTERED=e.ENTERING=e.EXITED=e.UNMOUNTED=void 0;var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,n):{};r.get||r.set?Object.defineProperty(e,n,r):e[n]=t[n]}}return e.default=t,e}(n(40718)),o=u(n(2265)),i=u(n(54887)),a=n(52181);function u(t){return t&&t.__esModule?t:{default:t}}n(32601);var c="unmounted";e.UNMOUNTED=c;var l="exited";e.EXITED=l;var s="entering";e.ENTERING=s;var f="entered";e.ENTERED=f;var p="exiting";e.EXITING=p;var h=function(t){function e(e,n){r=t.call(this,e,n)||this;var r,o,i=n.transitionGroup,a=i&&!i.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?a?(o=l,r.appearStatus=s):o=f:o=e.unmountOnExit||e.mountOnEnter?c:l,r.state={status:o},r.nextCallback=null,r}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t;var n=e.prototype;return n.getChildContext=function(){return{transitionGroup:null}},e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===c?{status:l}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==s&&n!==f&&(e=s):(n===s||n===f)&&(e=p)}this.updateStatus(!1,e)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var t,e,n,r=this.props.timeout;return t=e=n=r,null!=r&&"number"!=typeof r&&(t=r.exit,e=r.enter,n=void 0!==r.appear?r.appear:e),{exit:t,enter:e,appear:n}},n.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e){this.cancelNextCallback();var n=i.default.findDOMNode(this);e===s?this.performEnter(n,t):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===l&&this.setState({status:c})},n.performEnter=function(t,e){var n=this,r=this.props.enter,o=this.context.transitionGroup?this.context.transitionGroup.isMounting:e,i=this.getTimeouts(),a=o?i.appear:i.enter;if(!e&&!r){this.safeSetState({status:f},function(){n.props.onEntered(t)});return}this.props.onEnter(t,o),this.safeSetState({status:s},function(){n.props.onEntering(t,o),n.onTransitionEnd(t,a,function(){n.safeSetState({status:f},function(){n.props.onEntered(t,o)})})})},n.performExit=function(t){var e=this,n=this.props.exit,r=this.getTimeouts();if(!n){this.safeSetState({status:l},function(){e.props.onExited(t)});return}this.props.onExit(t),this.safeSetState({status:p},function(){e.props.onExiting(t),e.onTransitionEnd(t,r.exit,function(){e.safeSetState({status:l},function(){e.props.onExited(t)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},n.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,e.nextCallback=null,t(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(t,e,n){this.setNextCallback(n);var r=null==e&&!this.props.addEndListener;if(!t||r){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(t,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var t=this.state.status;if(t===c)return null;var e=this.props,n=e.children,r=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(e,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(t,r);var i=o.default.Children.only(n);return o.default.cloneElement(i,r)},e}(o.default.Component);function d(){}h.contextTypes={transitionGroup:r.object},h.childContextTypes={transitionGroup:function(){}},h.propTypes={},h.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:d,onEntering:d,onEntered:d,onExit:d,onExiting:d,onExited:d},h.UNMOUNTED=0,h.EXITED=1,h.ENTERING=2,h.ENTERED=3,h.EXITING=4;var y=(0,a.polyfill)(h);e.default=y},38244:function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=u(n(40718)),o=u(n(2265)),i=n(52181),a=n(28710);function u(t){return t&&t.__esModule?t:{default:t}}function c(){return(c=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,["component","childFactory"]),i=s(this.state.children).map(n);return(delete r.appear,delete r.enter,delete r.exit,null===e)?i:o.default.createElement(e,r,i)},e}(o.default.Component);f.childContextTypes={transitionGroup:r.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(t){return t}};var p=(0,i.polyfill)(f);e.default=p,t.exports=e.default},30719:function(t,e,n){"use strict";var r=u(n(33664)),o=u(n(31601)),i=u(n(38244)),a=u(n(20536));function u(t){return t&&t.__esModule?t:{default:t}}t.exports={Transition:a.default,TransitionGroup:i.default,ReplaceTransition:o.default,CSSTransition:r.default}},28710:function(t,e,n){"use strict";e.__esModule=!0,e.getChildMapping=o,e.mergeChildMappings=i,e.getInitialChildMapping=function(t,e){return o(t.children,function(n){return(0,r.cloneElement)(n,{onExited:e.bind(null,n),in:!0,appear:a(n,"appear",t),enter:a(n,"enter",t),exit:a(n,"exit",t)})})},e.getNextChildMapping=function(t,e,n){var u=o(t.children),c=i(e,u);return Object.keys(c).forEach(function(o){var i=c[o];if((0,r.isValidElement)(i)){var l=o in e,s=o in u,f=e[o],p=(0,r.isValidElement)(f)&&!f.props.in;s&&(!l||p)?c[o]=(0,r.cloneElement)(i,{onExited:n.bind(null,i),in:!0,exit:a(i,"exit",t),enter:a(i,"enter",t)}):s||!l||p?s&&l&&(0,r.isValidElement)(f)&&(c[o]=(0,r.cloneElement)(i,{onExited:n.bind(null,i),in:f.props.in,exit:a(i,"exit",t),enter:a(i,"enter",t)})):c[o]=(0,r.cloneElement)(i,{in:!1})}}),c};var r=n(2265);function o(t,e){var n=Object.create(null);return t&&r.Children.map(t,function(t){return t}).forEach(function(t){n[t.key]=e&&(0,r.isValidElement)(t)?e(t):t}),n}function i(t,e){function n(n){return n in e?e[n]:t[n]}t=t||{},e=e||{};var r,o=Object.create(null),i=[];for(var a in t)a in e?i.length&&(o[a]=i,i=[]):i.push(a);var u={};for(var c in e){if(o[c])for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,O),i=parseInt("".concat(n),10),a=parseInt("".concat(r),10),u=parseInt("".concat(e.height||o.height),10),c=parseInt("".concat(e.width||o.width),10);return S(S(S(S(S({},e),o),i?{x:i}:{}),a?{y:a}:{}),{},{height:u,width:c,name:e.name,radius:e.radius})}function k(t){return r.createElement(b.bn,w({shapeType:"rectangle",propTransformer:E,activeClassName:"recharts-active-bar"},t))}var P=["value","background"];function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(){return(M=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,P);if(!u)return null;var l=T(T(T(T(T({},c),{},{fill:"#eee"},u),a),(0,g.bw)(t.props,e,n)),{},{onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd,dataKey:o,index:n,key:"background-bar-".concat(n),className:"recharts-bar-background-rectangle"});return r.createElement(k,M({option:t.props.background,isActive:n===i},l))})}},{key:"renderErrorBar",value:function(t,e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.data,i=n.xAxis,a=n.yAxis,u=n.layout,c=n.children,l=(0,y.NN)(c,f.W);if(!l)return null;var p="vertical"===u?o[0].height/2:o[0].width/2,h=function(t,e){var n=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:n,errorVal:(0,m.F$)(t,e)}};return r.createElement(s.m,{clipPath:t?"url(#clipPath-".concat(e,")"):null},l.map(function(t){return r.cloneElement(t,{key:"error-bar-".concat(e,"-").concat(t.props.dataKey),data:o,xAxis:i,yAxis:a,layout:u,offset:p,dataPointFormatter:h})}))}},{key:"render",value:function(){var t=this.props,e=t.hide,n=t.data,i=t.className,a=t.xAxis,u=t.yAxis,c=t.left,f=t.top,p=t.width,d=t.height,y=t.isAnimationActive,v=t.background,m=t.id;if(e||!n||!n.length)return null;var g=this.state.isAnimationFinished,b=(0,o.Z)("recharts-bar",i),x=a&&a.allowDataOverflow,O=u&&u.allowDataOverflow,w=x||O,j=l()(m)?this.id:m;return r.createElement(s.m,{className:b},x||O?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(j)},r.createElement("rect",{x:x?c:c-p/2,y:O?f:f-d/2,width:x?p:2*p,height:O?d:2*d}))):null,r.createElement(s.m,{className:"recharts-bar-rectangles",clipPath:w?"url(#clipPath-".concat(j,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(w,j),(!y||g)&&h.e.renderCallByParent(this.props,n))}}],a=[{key:"getDerivedStateFromProps",value:function(t,e){return t.animationId!==e.prevAnimationId?{prevAnimationId:t.animationId,curData:t.data,prevData:e.curData}:t.data!==e.curData?{curData:t.data}:null}}],n&&C(p.prototype,n),a&&C(p,a),Object.defineProperty(p,"prototype",{writable:!1}),p}(r.PureComponent);L(R,"displayName","Bar"),L(R,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!v.x.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),L(R,"getComposedData",function(t){var e=t.props,n=t.item,r=t.barPosition,o=t.bandSize,i=t.xAxis,a=t.yAxis,u=t.xAxisTicks,c=t.yAxisTicks,l=t.stackedData,s=t.dataStartIndex,f=t.displayedData,h=t.offset,v=(0,m.Bu)(r,n);if(!v)return null;var g=e.layout,b=n.props,x=b.dataKey,O=b.children,w=b.minPointSize,j="horizontal"===g?a:i,S=l?j.scale.domain():null,E=(0,m.Yj)({numericAxis:j}),k=(0,y.NN)(O,p.b),P=f.map(function(t,e){var r,f,p,h,y,b;if(l?r=(0,m.Vv)(l[s+e],S):Array.isArray(r=(0,m.F$)(t,x))||(r=[E,r]),"horizontal"===g){var O,j=[a.scale(r[0]),a.scale(r[1])],P=j[0],A=j[1];f=(0,m.Fy)({axis:i,ticks:u,bandSize:o,offset:v.offset,entry:t,index:e}),p=null!==(O=null!=A?A:P)&&void 0!==O?O:void 0,h=v.size;var M=P-A;if(y=Number.isNaN(M)?0:M,b={x:f,y:a.y,width:h,height:a.height},Math.abs(w)>0&&Math.abs(y)0&&Math.abs(h)=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function E(t,e){for(var n=0;n0?this.props:d)),o<=0||a<=0||!y||!y.length)?null:r.createElement(s.m,{className:(0,c.Z)("recharts-cartesian-axis",l),ref:function(e){t.layerReference=e}},n&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),p._.renderCallByParent(this.props))}}],o=[{key:"renderTickItem",value:function(t,e,n){return r.isValidElement(t)?r.cloneElement(t,e):i()(t)?t(e):r.createElement(f.x,O({},e,{className:"recharts-cartesian-axis-tick-value"}),n)}}],n&&E(w.prototype,n),o&&E(w,o),Object.defineProperty(w,"prototype",{writable:!1}),w}(r.Component);A(_,"displayName","CartesianAxis"),A(_,"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"})},56940:function(t,e,n){"use strict";n.d(e,{q:function(){return M}});var r=n(2265),o=n(86757),i=n.n(o),a=n(1175),u=n(16630),c=n(82944),l=n(85355),s=n(78242),f=n(80285),p=n(25739),h=["x1","y1","x2","y2","key"],d=["offset"];function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function m(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var x=function(t){var e=t.fill;if(!e||"none"===e)return null;var n=t.fillOpacity,o=t.x,i=t.y,a=t.width,u=t.height;return r.createElement("rect",{x:o,y:i,width:a,height:u,stroke:"none",fill:e,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function O(t,e){var n;if(r.isValidElement(t))n=r.cloneElement(t,e);else if(i()(t))n=t(e);else{var o=e.x1,a=e.y1,u=e.x2,l=e.y2,s=e.key,f=b(e,h),p=(0,c.L6)(f,!1),y=(p.offset,b(p,d));n=r.createElement("line",g({},y,{x1:o,y1:a,x2:u,y2:l,fill:"none",key:s}))}return n}function w(t){var e=t.x,n=t.width,o=t.horizontal,i=void 0===o||o,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var u=a.map(function(r,o){return O(i,m(m({},t),{},{x1:e,y1:r,x2:e+n,y2:r,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function j(t){var e=t.y,n=t.height,o=t.vertical,i=void 0===o||o,a=t.verticalPoints;if(!i||!a||!a.length)return null;var u=a.map(function(r,o){return O(i,m(m({},t),{},{x1:r,y1:e,x2:r,y2:e+n,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function S(t){var e=t.horizontalFill,n=t.fillOpacity,o=t.x,i=t.y,a=t.width,u=t.height,c=t.horizontalPoints,l=t.horizontal;if(!(void 0===l||l)||!e||!e.length)return null;var s=c.map(function(t){return Math.round(t+i-i)}).sort(function(t,e){return t-e});i!==s[0]&&s.unshift(0);var f=s.map(function(t,c){var l=s[c+1]?s[c+1]-t:i+u-t;if(l<=0)return null;var f=c%e.length;return r.createElement("rect",{key:"react-".concat(c),y:t,x:o,height:l,width:a,stroke:"none",fill:e[f],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function E(t){var e=t.vertical,n=t.verticalFill,o=t.fillOpacity,i=t.x,a=t.y,u=t.width,c=t.height,l=t.verticalPoints;if(!(void 0===e||e)||!n||!n.length)return null;var s=l.map(function(t){return Math.round(t+i-i)}).sort(function(t,e){return t-e});i!==s[0]&&s.unshift(0);var f=s.map(function(t,e){var l=s[e+1]?s[e+1]-t:i+u-t;if(l<=0)return null;var f=e%n.length;return r.createElement("rect",{key:"react-".concat(e),x:t,y:a,width:l,height:c,stroke:"none",fill:n[f],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var k=function(t,e){var n=t.xAxis,r=t.width,o=t.height,i=t.offset;return(0,l.Rf)((0,s.f)(m(m(m({},f.O.defaultProps),n),{},{ticks:(0,l.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),i.left,i.left+i.width,e)},P=function(t,e){var n=t.yAxis,r=t.width,o=t.height,i=t.offset;return(0,l.Rf)((0,s.f)(m(m(m({},f.O.defaultProps),n),{},{ticks:(0,l.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),i.top,i.top+i.height,e)},A={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function M(t){var e,n,o,c,l,s,f=(0,p.zn)(),h=(0,p.Mw)(),d=(0,p.qD)(),v=m(m({},t),{},{stroke:null!==(e=t.stroke)&&void 0!==e?e:A.stroke,fill:null!==(n=t.fill)&&void 0!==n?n:A.fill,horizontal:null!==(o=t.horizontal)&&void 0!==o?o:A.horizontal,horizontalFill:null!==(c=t.horizontalFill)&&void 0!==c?c:A.horizontalFill,vertical:null!==(l=t.vertical)&&void 0!==l?l:A.vertical,verticalFill:null!==(s=t.verticalFill)&&void 0!==s?s:A.verticalFill}),b=v.x,O=v.y,M=v.width,_=v.height,T=v.xAxis,C=v.yAxis,N=v.syncWithTicks,D=v.horizontalValues,I=v.verticalValues;if(!(0,u.hj)(M)||M<=0||!(0,u.hj)(_)||_<=0||!(0,u.hj)(b)||b!==+b||!(0,u.hj)(O)||O!==+O)return null;var L=v.verticalCoordinatesGenerator||k,B=v.horizontalCoordinatesGenerator||P,R=v.horizontalPoints,z=v.verticalPoints;if((!R||!R.length)&&i()(B)){var U=D&&D.length,F=B({yAxis:C?m(m({},C),{},{ticks:U?D:C.ticks}):void 0,width:f,height:h,offset:d},!!U||N);(0,a.Z)(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(y(F),"]")),Array.isArray(F)&&(R=F)}if((!z||!z.length)&&i()(L)){var $=I&&I.length,q=L({xAxis:T?m(m({},T),{},{ticks:$?I:T.ticks}):void 0,width:f,height:h,offset:d},!!$||N);(0,a.Z)(Array.isArray(q),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(y(q),"]")),Array.isArray(q)&&(z=q)}return r.createElement("g",{className:"recharts-cartesian-grid"},r.createElement(x,{fill:v.fill,fillOpacity:v.fillOpacity,x:v.x,y:v.y,width:v.width,height:v.height}),r.createElement(w,g({},v,{offset:d,horizontalPoints:R})),r.createElement(j,g({},v,{offset:d,verticalPoints:z})),r.createElement(S,g({},v,{horizontalPoints:R})),r.createElement(E,g({},v,{verticalPoints:z})))}M.displayName="CartesianGrid"},13137:function(t,e,n){"use strict";n.d(e,{W:function(){return s}});var r=n(2265),o=n(69398),i=n(9841),a=n(82944),u=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function c(){return(c=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,u),m=(0,a.L6)(v,!1);"x"===t.direction&&"number"!==d.type&&(0,o.Z)(!1);var g=p.map(function(t){var o,a,u=h(t,f),p=u.x,v=u.y,g=u.value,b=u.errorVal;if(!b)return null;var x=[];if(Array.isArray(b)){var O=function(t){if(Array.isArray(t))return t}(b)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{for(i=(n=n.call(t)).next;!(c=(r=i.call(n)).done)&&(u.push(r.value),2!==u.length);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(b,2)||function(t,e){if(t){if("string"==typeof t)return l(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,2)}}(b,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=O[0],a=O[1]}else o=a=b;if("vertical"===n){var w=d.scale,j=v+e,S=j+s,E=j-s,k=w(g-o),P=w(g+a);x.push({x1:P,y1:S,x2:P,y2:E}),x.push({x1:k,y1:j,x2:P,y2:j}),x.push({x1:k,y1:S,x2:k,y2:E})}else if("horizontal"===n){var A=y.scale,M=p+e,_=M-s,T=M+s,C=A(g-o),N=A(g+a);x.push({x1:_,y1:N,x2:T,y2:N}),x.push({x1:M,y1:C,x2:M,y2:N}),x.push({x1:_,y1:C,x2:T,y2:C})}return r.createElement(i.m,c({className:"recharts-errorBar",key:"bar-".concat(x.map(function(t){return"".concat(t.x1,"-").concat(t.x2,"-").concat(t.y1,"-").concat(t.y2)}))},m),x.map(function(t){return r.createElement("line",c({},t,{key:"line-".concat(t.x1,"-").concat(t.x2,"-").concat(t.y1,"-").concat(t.y2)}))}))});return r.createElement(i.m,{className:"recharts-errorBars"},g)}s.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},s.displayName="ErrorBar"},97059:function(t,e,n){"use strict";n.d(e,{K:function(){return l}});var r=n(2265),o=n(61994),i=n(25739),a=n(80285),u=n(85355);function c(){return(c=Object.assign?Object.assign.bind():function(t){for(var e=1;et*o)return!1;var i=n();return t*(e-t*i/2-r)>=0&&t*(e+t*i/2-o)<=0}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var e=1;e=2?(0,i.uY)(m[1].coordinate-m[0].coordinate):1,M=(r="width"===E,f=g.x,p=g.y,d=g.width,y=g.height,1===A?{start:r?f:p,end:r?f+d:p+y}:{start:r?f+d:p+y,end:r?f:p});return"equidistantPreserveStart"===O?function(t,e,n,r,o){for(var i,a=(r||[]).slice(),u=e.start,c=e.end,f=0,p=1,h=u;p<=a.length;)if(i=function(){var e,i=null==r?void 0:r[f];if(void 0===i)return{v:l(r,p)};var a=f,d=function(){return void 0===e&&(e=n(i,a)),e},y=i.coordinate,v=0===f||s(t,y,d,h,c);v||(f=0,h=u,p+=1),v&&(h=y+t*(d()/2+o),f+=p)}())return i.v;return[]}(A,M,P,m,b):("preserveStart"===O||"preserveStartEnd"===O?function(t,e,n,r,o,i){var a=(r||[]).slice(),u=a.length,c=e.start,l=e.end;if(i){var f=r[u-1],p=n(f,u-1),d=t*(f.coordinate+t*p/2-l);a[u-1]=f=h(h({},f),{},{tickCoord:d>0?f.coordinate-d*t:f.coordinate}),s(t,f.tickCoord,function(){return p},c,l)&&(l=f.tickCoord-t*(p/2+o),a[u-1]=h(h({},f),{},{isShow:!0}))}for(var y=i?u-1:u,v=function(e){var r,i=a[e],u=function(){return void 0===r&&(r=n(i,e)),r};if(0===e){var f=t*(i.coordinate-t*u()/2-c);a[e]=i=h(h({},i),{},{tickCoord:f<0?i.coordinate-f*t:i.coordinate})}else a[e]=i=h(h({},i),{},{tickCoord:i.coordinate});s(t,i.tickCoord,u,c,l)&&(c=i.tickCoord+t*(u()/2+o),a[e]=h(h({},i),{},{isShow:!0}))},m=0;m0?l.coordinate-p*t:l.coordinate})}else i[e]=l=h(h({},l),{},{tickCoord:l.coordinate});s(t,l.tickCoord,f,u,c)&&(c=l.tickCoord-t*(f()/2+o),i[e]=h(h({},l),{},{isShow:!0}))},f=a-1;f>=0;f--)l(f);return i}(A,M,P,m,b)).filter(function(t){return t.isShow})}},93765:function(t,e,n){"use strict";n.d(e,{z:function(){return ex}});var r=n(2265),o=n(77571),i=n.n(o),a=n(86757),u=n.n(a),c=n(99676),l=n.n(c),s=n(13735),f=n.n(s),p=n(34935),h=n.n(p),d=n(37065),y=n.n(d),v=n(84173),m=n.n(v),g=n(32242),b=n.n(g),x=n(61994),O=n(69398),w=n(48777),j=n(9841),S=n(8147),E=n(22190),k=n(81889),P=n(73649),A=n(82944),M=n(55284),_=n(58811),T=n(85355),C=n(16630);function N(t){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function I(t){for(var e=1;e0&&e.handleDrag(t.changedTouches[0])}),X(W(e),"handleDragEnd",function(){e.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var t=e.props,n=t.endIndex,r=t.onDragEnd,o=t.startIndex;null==r||r({endIndex:n,startIndex:o})}),e.detachDragEndListener()}),X(W(e),"handleLeaveWrapper",function(){(e.state.isTravellerMoving||e.state.isSlideMoving)&&(e.leaveTimer=window.setTimeout(e.handleDragEnd,e.props.leaveTimeOut))}),X(W(e),"handleEnterSlideOrTraveller",function(){e.setState({isTextActive:!0})}),X(W(e),"handleLeaveSlideOrTraveller",function(){e.setState({isTextActive:!1})}),X(W(e),"handleSlideDragStart",function(t){var n=V(t)?t.changedTouches[0]:t;e.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:n.pageX}),e.attachDragEndListener()}),e.travellerDragStartHandlers={startX:e.handleTravellerDragStart.bind(W(e),"startX"),endX:e.handleTravellerDragStart.bind(W(e),"endX")},e.state={},e}return n=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(t){var e=t.startX,n=t.endX,r=this.state.scaleValues,o=this.props,i=o.gap,u=o.data.length-1,c=a.getIndexInRange(r,Math.min(e,n)),l=a.getIndexInRange(r,Math.max(e,n));return{startIndex:c-c%i,endIndex:l===u?u:l-l%i}}},{key:"getTextOfTick",value:function(t){var e=this.props,n=e.data,r=e.tickFormatter,o=e.dataKey,i=(0,T.F$)(n[t],o,t);return u()(r)?r(i,t):i}},{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(t){var e=this.state,n=e.slideMoveStartX,r=e.startX,o=e.endX,i=this.props,a=i.x,u=i.width,c=i.travellerWidth,l=i.startIndex,s=i.endIndex,f=i.onChange,p=t.pageX-n;p>0?p=Math.min(p,a+u-c-o,a+u-c-r):p<0&&(p=Math.max(p,a-r,a-o));var h=this.getIndex({startX:r+p,endX:o+p});(h.startIndex!==l||h.endIndex!==s)&&f&&f(h),this.setState({startX:r+p,endX:o+p,slideMoveStartX:t.pageX})}},{key:"handleTravellerDragStart",value:function(t,e){var n=V(e)?e.changedTouches[0]:e;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:t,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(t){var e,n=this.state,r=n.brushMoveStartX,o=n.movingTravellerId,i=n.endX,a=n.startX,u=this.state[o],c=this.props,l=c.x,s=c.width,f=c.travellerWidth,p=c.onChange,h=c.gap,d=c.data,y={startX:this.state.startX,endX:this.state.endX},v=t.pageX-r;v>0?v=Math.min(v,l+s-f-u):v<0&&(v=Math.max(v,l-u)),y[o]=u+v;var m=this.getIndex(y),g=m.startIndex,b=m.endIndex,x=function(){var t=d.length-1;return"startX"===o&&(i>a?g%h==0:b%h==0)||ia?b%h==0:g%h==0)||i>a&&b===t};this.setState((X(e={},o,u+v),X(e,"brushMoveStartX",t.pageX),e),function(){p&&x()&&p(m)})}},{key:"handleTravellerMoveKeyboard",value:function(t,e){var n=this,r=this.state,o=r.scaleValues,i=r.startX,a=r.endX,u=this.state[e],c=o.indexOf(u);if(-1!==c){var l=c+t;if(-1!==l&&!(l>=o.length)){var s=o[l];"startX"===e&&s>=a||"endX"===e&&s<=i||this.setState(X({},e,s),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:"renderBackground",value:function(){var t=this.props,e=t.x,n=t.y,o=t.width,i=t.height,a=t.fill,u=t.stroke;return r.createElement("rect",{stroke:u,fill:a,x:e,y:n,width:o,height:i})}},{key:"renderPanorama",value:function(){var t=this.props,e=t.x,n=t.y,o=t.width,i=t.height,a=t.data,u=t.children,c=t.padding,l=r.Children.only(u);return l?r.cloneElement(l,{x:e,y:n,width:o,height:i,margin:c,compact:!0,data:a}):null}},{key:"renderTravellerLayer",value:function(t,e){var n=this,o=this.props,i=o.y,u=o.travellerWidth,c=o.height,l=o.traveller,s=o.ariaLabel,f=o.data,p=o.startIndex,h=o.endIndex,d=Math.max(t,this.props.x),y=$($({},(0,A.L6)(this.props,!1)),{},{x:d,y:i,width:u,height:c}),v=s||"Min value: ".concat(f[p].name,", Max value: ").concat(f[h].name);return r.createElement(j.m,{tabIndex:0,role:"slider","aria-label":v,"aria-valuenow":t,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[e],onTouchStart:this.travellerDragStartHandlers[e],onKeyDown:function(t){["ArrowLeft","ArrowRight"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),n.handleTravellerMoveKeyboard("ArrowRight"===t.key?1:-1,e))},onFocus:function(){n.setState({isTravellerFocused:!0})},onBlur:function(){n.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},a.renderTraveller(l,y))}},{key:"renderSlide",value:function(t,e){var n=this.props,o=n.y,i=n.height,a=n.stroke,u=n.travellerWidth;return r.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:a,fillOpacity:.2,x:Math.min(t,e)+u,y:o,width:Math.max(Math.abs(e-t)-u,0),height:i})}},{key:"renderText",value:function(){var t=this.props,e=t.startIndex,n=t.endIndex,o=t.y,i=t.height,a=t.travellerWidth,u=t.stroke,c=this.state,l=c.startX,s=c.endX,f={pointerEvents:"none",fill:u};return r.createElement(j.m,{className:"recharts-brush-texts"},r.createElement(_.x,U({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,s)-5,y:o+i/2},f),this.getTextOfTick(e)),r.createElement(_.x,U({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,s)+a+5,y:o+i/2},f),this.getTextOfTick(n)))}},{key:"render",value:function(){var t=this.props,e=t.data,n=t.className,o=t.children,i=t.x,a=t.y,u=t.width,c=t.height,l=t.alwaysShowText,s=this.state,f=s.startX,p=s.endX,h=s.isTextActive,d=s.isSlideMoving,y=s.isTravellerMoving,v=s.isTravellerFocused;if(!e||!e.length||!(0,C.hj)(i)||!(0,C.hj)(a)||!(0,C.hj)(u)||!(0,C.hj)(c)||u<=0||c<=0)return null;var m=(0,x.Z)("recharts-brush",n),g=1===r.Children.count(o),b=R("userSelect","none");return r.createElement(j.m,{className:m,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),g&&this.renderPanorama(),this.renderSlide(f,p),this.renderTravellerLayer(f,"startX"),this.renderTravellerLayer(p,"endX"),(h||d||y||v||l)&&this.renderText())}}],o=[{key:"renderDefaultTraveller",value:function(t){var e=t.x,n=t.y,o=t.width,i=t.height,a=t.stroke,u=Math.floor(n+i/2)-1;return r.createElement(r.Fragment,null,r.createElement("rect",{x:e,y:n,width:o,height:i,fill:a,stroke:"none"}),r.createElement("line",{x1:e+1,y1:u,x2:e+o-1,y2:u,fill:"none",stroke:"#fff"}),r.createElement("line",{x1:e+1,y1:u+2,x2:e+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(t,e){return r.isValidElement(t)?r.cloneElement(t,e):u()(t)?t(e):a.renderDefaultTraveller(e)}},{key:"getDerivedStateFromProps",value:function(t,e){var n=t.data,r=t.width,o=t.x,i=t.travellerWidth,a=t.updateId,u=t.startIndex,c=t.endIndex;if(n!==e.prevData||a!==e.prevUpdateId)return $({prevData:n,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:r},n&&n.length?H({data:n,width:r,x:o,travellerWidth:i,startIndex:u,endIndex:c}):{scale:null,scaleValues:null});if(e.scale&&(r!==e.prevWidth||o!==e.prevX||i!==e.prevTravellerWidth)){e.scale.range([o,o+r-i]);var l=e.scale.domain().map(function(t){return e.scale(t)});return{prevData:n,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:r,startX:e.scale(t.startIndex),endX:e.scale(t.endIndex),scaleValues:l}}return null}},{key:"getIndexInRange",value:function(t,e){for(var n=t.length,r=0,o=n-1;o-r>1;){var i=Math.floor((r+o)/2);t[i]>e?o=i:r=i}return e>=t[o]?o:r}}],n&&q(a.prototype,n),o&&q(a,o),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);X(K,"displayName","Brush"),X(K,"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 J=n(4094),Q=n(38569),tt=n(26680),te=function(t,e){var n=t.alwaysShow,r=t.ifOverflow;return n&&(r="extendDomain"),r===e},tn=n(25311),tr=n(1175);function to(t){return(to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ti(){return(ti=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,t$));return(0,C.hj)(n)&&(0,C.hj)(i)&&(0,C.hj)(f)&&(0,C.hj)(h)&&(0,C.hj)(u)&&(0,C.hj)(l)?r.createElement("path",tq({},(0,A.L6)(y,!0),{className:(0,x.Z)("recharts-cross",d),d:"M".concat(n,",").concat(u,"v").concat(h,"M").concat(l,",").concat(i,"h").concat(f)})):null};function tG(t){var e=t.cx,n=t.cy,r=t.radius,o=t.startAngle,i=t.endAngle;return{points:[(0,tM.op)(e,n,r,o),(0,tM.op)(e,n,r,i)],cx:e,cy:n,radius:r,startAngle:o,endAngle:i}}var tX=n(60474);function tY(t){return(tY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tH(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function tV(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function t6(t,e){return(t6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function t3(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function t7(t){return(t7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t4(t){return function(t){if(Array.isArray(t))return t9(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||t8(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t8(t,e){if(t){if("string"==typeof t)return t9(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t9(t,e)}}function t9(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0?i:t&&t.length&&(0,C.hj)(r)&&(0,C.hj)(o)?t.slice(r,o+1):[]};function es(t){return"number"===t?[0,"auto"]:void 0}var ef=function(t,e,n,r){var o=t.graphicalItems,i=t.tooltipAxis,a=el(e,t);return n<0||!o||!o.length||n>=a.length?null:o.reduce(function(o,u){var c,l,s=null!==(c=u.props.data)&&void 0!==c?c:e;if(s&&t.dataStartIndex+t.dataEndIndex!==0&&(s=s.slice(t.dataStartIndex,t.dataEndIndex+1)),i.dataKey&&!i.allowDuplicatedCategory){var f=void 0===s?a:s;l=(0,C.Ap)(f,i.dataKey,r)}else l=s&&s[n]||a[n];return l?[].concat(t4(o),[(0,T.Qo)(u,l)]):o},[])},ep=function(t,e,n,r){var o=r||{x:t.chartX,y:t.chartY},i="horizontal"===n?o.x:"vertical"===n?o.y:"centric"===n?o.angle:o.radius,a=t.orderedTooltipTicks,u=t.tooltipAxis,c=t.tooltipTicks,l=(0,T.VO)(i,a,c,u);if(l>=0&&c){var s=c[l]&&c[l].value,f=ef(t,e,l,s),p=ec(n,a,l,o);return{activeTooltipIndex:l,activeLabel:s,activePayload:f,activeCoordinate:p}}return null},eh=function(t,e){var n=e.axes,r=e.graphicalItems,o=e.axisType,a=e.axisIdKey,u=e.stackGroups,c=e.dataStartIndex,s=e.dataEndIndex,f=t.layout,p=t.children,h=t.stackOffset,d=(0,T.NA)(f,o);return n.reduce(function(e,n){var y=n.props,v=y.type,m=y.dataKey,g=y.allowDataOverflow,b=y.allowDuplicatedCategory,x=y.scale,O=y.ticks,w=y.includeHidden,j=n.props[a];if(e[j])return e;var S=el(t.data,{graphicalItems:r.filter(function(t){return t.props[a]===j}),dataStartIndex:c,dataEndIndex:s}),E=S.length;(function(t,e,n){if("number"===n&&!0===e&&Array.isArray(t)){var r=null==t?void 0:t[0],o=null==t?void 0:t[1];if(r&&o&&(0,C.hj)(r)&&(0,C.hj)(o))return!0}return!1})(n.props.domain,g,v)&&(A=(0,T.LG)(n.props.domain,null,g),d&&("number"===v||"auto"!==x)&&(_=(0,T.gF)(S,m,"category")));var k=es(v);if(!A||0===A.length){var P,A,M,_,N,D=null!==(N=n.props.domain)&&void 0!==N?N:k;if(m){if(A=(0,T.gF)(S,m,v),"category"===v&&d){var I=(0,C.bv)(A);b&&I?(M=A,A=l()(0,E)):b||(A=(0,T.ko)(D,A,n).reduce(function(t,e){return t.indexOf(e)>=0?t:[].concat(t4(t),[e])},[]))}else if("category"===v)A=b?A.filter(function(t){return""!==t&&!i()(t)}):(0,T.ko)(D,A,n).reduce(function(t,e){return t.indexOf(e)>=0||""===e||i()(e)?t:[].concat(t4(t),[e])},[]);else if("number"===v){var L=(0,T.ZI)(S,r.filter(function(t){return t.props[a]===j&&(w||!t.props.hide)}),m,o,f);L&&(A=L)}d&&("number"===v||"auto"!==x)&&(_=(0,T.gF)(S,m,"category"))}else A=d?l()(0,E):u&&u[j]&&u[j].hasStack&&"number"===v?"expand"===h?[0,1]:(0,T.EB)(u[j].stackGroups,c,s):(0,T.s6)(S,r.filter(function(t){return t.props[a]===j&&(w||!t.props.hide)}),v,f,!0);"number"===v?(A=tA(p,A,j,o,O),D&&(A=(0,T.LG)(D,A,g))):"category"===v&&D&&A.every(function(t){return D.indexOf(t)>=0})&&(A=D)}return ee(ee({},e),{},en({},j,ee(ee({},n.props),{},{axisType:o,domain:A,categoricalDomain:_,duplicateDomain:M,originalDomain:null!==(P=n.props.domain)&&void 0!==P?P:k,isCategorical:d,layout:f})))},{})},ed=function(t,e){var n=e.graphicalItems,r=e.Axis,o=e.axisType,i=e.axisIdKey,a=e.stackGroups,u=e.dataStartIndex,c=e.dataEndIndex,s=t.layout,p=t.children,h=el(t.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:c}),d=h.length,y=(0,T.NA)(s,o),v=-1;return n.reduce(function(t,e){var m,g=e.props[i],b=es("number");return t[g]?t:(v++,m=y?l()(0,d):a&&a[g]&&a[g].hasStack?tA(p,m=(0,T.EB)(a[g].stackGroups,u,c),g,o):tA(p,m=(0,T.LG)(b,(0,T.s6)(h,n.filter(function(t){return t.props[i]===g&&!t.props.hide}),"number",s),r.defaultProps.allowDataOverflow),g,o),ee(ee({},t),{},en({},g,ee(ee({axisType:o},r.defaultProps),{},{hide:!0,orientation:f()(eo,"".concat(o,".").concat(v%2),null),domain:m,originalDomain:b,isCategorical:y,layout:s}))))},{})},ey=function(t,e){var n=e.axisType,r=void 0===n?"xAxis":n,o=e.AxisComp,i=e.graphicalItems,a=e.stackGroups,u=e.dataStartIndex,c=e.dataEndIndex,l=t.children,s="".concat(r,"Id"),f=(0,A.NN)(l,o),p={};return f&&f.length?p=eh(t,{axes:f,graphicalItems:i,axisType:r,axisIdKey:s,stackGroups:a,dataStartIndex:u,dataEndIndex:c}):i&&i.length&&(p=ed(t,{Axis:o,graphicalItems:i,axisType:r,axisIdKey:s,stackGroups:a,dataStartIndex:u,dataEndIndex:c})),p},ev=function(t){var e=(0,C.Kt)(t),n=(0,T.uY)(e,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:h()(n,function(t){return t.coordinate}),tooltipAxis:e,tooltipAxisBandSize:(0,T.zT)(e,n)}},em=function(t){var e=t.children,n=t.defaultShowTooltip,r=(0,A.sP)(e,K),o=0,i=0;return t.data&&0!==t.data.length&&(i=t.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(o=r.props.startIndex),r.props.endIndex>=0&&(i=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:i,activeTooltipIndex:-1,isTooltipActive:!!n}},eg=function(t){return"horizontal"===t?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===t?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===t?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},eb=function(t,e){var n=t.props,r=t.graphicalItems,o=t.xAxisMap,i=void 0===o?{}:o,a=t.yAxisMap,u=void 0===a?{}:a,c=n.width,l=n.height,s=n.children,p=n.margin||{},h=(0,A.sP)(s,K),d=(0,A.sP)(s,E.D),y=Object.keys(u).reduce(function(t,e){var n=u[e],r=n.orientation;return n.mirror||n.hide?t:ee(ee({},t),{},en({},r,t[r]+n.width))},{left:p.left||0,right:p.right||0}),v=Object.keys(i).reduce(function(t,e){var n=i[e],r=n.orientation;return n.mirror||n.hide?t:ee(ee({},t),{},en({},r,f()(t,"".concat(r))+n.height))},{top:p.top||0,bottom:p.bottom||0}),m=ee(ee({},v),y),g=m.bottom;h&&(m.bottom+=h.props.height||K.defaultProps.height),d&&e&&(m=(0,T.By)(m,r,n,e));var b=c-m.left-m.right,x=l-m.top-m.bottom;return ee(ee({brushBottom:g},m),{},{width:Math.max(b,0),height:Math.max(x,0)})},ex=function(t){var e,n=t.chartName,o=t.GraphicalChild,a=t.defaultTooltipEventType,c=void 0===a?"axis":a,l=t.validateTooltipEventTypes,s=void 0===l?["axis"]:l,p=t.axisComponents,h=t.legendContent,d=t.formatAxisMap,v=t.defaultProps,g=function(t,e){var n=e.graphicalItems,r=e.stackGroups,o=e.offset,a=e.updateId,u=e.dataStartIndex,c=e.dataEndIndex,l=t.barSize,s=t.layout,f=t.barGap,h=t.barCategoryGap,d=t.maxBarSize,y=eg(s),v=y.numericAxisName,m=y.cateAxisName,g=!!n&&!!n.length&&n.some(function(t){var e=(0,A.Gf)(t&&t.type);return e&&e.indexOf("Bar")>=0})&&(0,T.pt)({barSize:l,stackGroups:r}),b=[];return n.forEach(function(n,l){var y,x=el(t.data,{graphicalItems:[n],dataStartIndex:u,dataEndIndex:c}),w=n.props,j=w.dataKey,S=w.maxBarSize,E=n.props["".concat(v,"Id")],k=n.props["".concat(m,"Id")],P=p.reduce(function(t,r){var o,i=e["".concat(r.axisType,"Map")],a=n.props["".concat(r.axisType,"Id")];i&&i[a]||"zAxis"===r.axisType||(0,O.Z)(!1);var u=i[a];return ee(ee({},t),{},(en(o={},r.axisType,u),en(o,"".concat(r.axisType,"Ticks"),(0,T.uY)(u)),o))},{}),M=P[m],_=P["".concat(m,"Ticks")],C=r&&r[E]&&r[E].hasStack&&(0,T.O3)(n,r[E].stackGroups),N=(0,A.Gf)(n.type).indexOf("Bar")>=0,D=(0,T.zT)(M,_),I=[];if(N){var L,B,R=i()(S)?d:S,z=null!==(L=null!==(B=(0,T.zT)(M,_,!0))&&void 0!==B?B:R)&&void 0!==L?L:0;I=(0,T.qz)({barGap:f,barCategoryGap:h,bandSize:z!==D?z:D,sizeList:g[k],maxBarSize:R}),z!==D&&(I=I.map(function(t){return ee(ee({},t),{},{position:ee(ee({},t.position),{},{offset:t.position.offset-z/2})})}))}var U=n&&n.type&&n.type.getComposedData;U&&b.push({props:ee(ee({},U(ee(ee({},P),{},{displayedData:x,props:t,dataKey:j,item:n,bandSize:D,barPosition:I,offset:o,stackedData:C,layout:s,dataStartIndex:u,dataEndIndex:c}))),{},(en(y={key:n.key||"item-".concat(l)},v,P[v]),en(y,m,P[m]),en(y,"animationId",a),y)),childIndex:(0,A.$R)(n,t.children),item:n})}),b},E=function(t,e){var r=t.props,i=t.dataStartIndex,a=t.dataEndIndex,u=t.updateId;if(!(0,A.TT)({props:r}))return null;var c=r.children,l=r.layout,s=r.stackOffset,f=r.data,h=r.reverseStackOrder,y=eg(l),v=y.numericAxisName,m=y.cateAxisName,b=(0,A.NN)(c,o),x=(0,T.wh)(f,b,"".concat(v,"Id"),"".concat(m,"Id"),s,h),O=p.reduce(function(t,e){var n="".concat(e.axisType,"Map");return ee(ee({},t),{},en({},n,ey(r,ee(ee({},e),{},{graphicalItems:b,stackGroups:e.axisType===v&&x,dataStartIndex:i,dataEndIndex:a}))))},{}),w=eb(ee(ee({},O),{},{props:r,graphicalItems:b}),null==e?void 0:e.legendBBox);Object.keys(O).forEach(function(t){O[t]=d(r,O[t],w,t.replace("Map",""),n)});var j=ev(O["".concat(m,"Map")]),S=g(r,ee(ee({},O),{},{dataStartIndex:i,dataEndIndex:a,updateId:u,graphicalItems:b,stackGroups:x,offset:w}));return ee(ee({formattedGraphicalItems:S,graphicalItems:b,offset:w,stackGroups:x},j),O)};return e=function(t){(function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&t6(t,e)})(l,t);var e,o,a=(e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,n=t7(l);return t=e?Reflect.construct(n,arguments,t7(this).constructor):n.apply(this,arguments),function(t,e){if(e&&("object"===t0(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return t3(t)}(this,t)});function l(t){var e,o,c;return function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,l),en(t3(c=a.call(this,t)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),en(t3(c),"accessibilityManager",new tR),en(t3(c),"handleLegendBBoxUpdate",function(t){if(t){var e=c.state,n=e.dataStartIndex,r=e.dataEndIndex,o=e.updateId;c.setState(ee({legendBBox:t},E({props:c.props,dataStartIndex:n,dataEndIndex:r,updateId:o},ee(ee({},c.state),{},{legendBBox:t}))))}}),en(t3(c),"handleReceiveSyncEvent",function(t,e,n){c.props.syncId===t&&(n!==c.eventEmitterSymbol||"function"==typeof c.props.syncMethod)&&c.applySyncEvent(e)}),en(t3(c),"handleBrushChange",function(t){var e=t.startIndex,n=t.endIndex;if(e!==c.state.dataStartIndex||n!==c.state.dataEndIndex){var r=c.state.updateId;c.setState(function(){return ee({dataStartIndex:e,dataEndIndex:n},E({props:c.props,dataStartIndex:e,dataEndIndex:n,updateId:r},c.state))}),c.triggerSyncEvent({dataStartIndex:e,dataEndIndex:n})}}),en(t3(c),"handleMouseEnter",function(t){var e=c.getMouseInfo(t);if(e){var n=ee(ee({},e),{},{isTooltipActive:!0});c.setState(n),c.triggerSyncEvent(n);var r=c.props.onMouseEnter;u()(r)&&r(n,t)}}),en(t3(c),"triggeredAfterMouseMove",function(t){var e=c.getMouseInfo(t),n=e?ee(ee({},e),{},{isTooltipActive:!0}):{isTooltipActive:!1};c.setState(n),c.triggerSyncEvent(n);var r=c.props.onMouseMove;u()(r)&&r(n,t)}),en(t3(c),"handleItemMouseEnter",function(t){c.setState(function(){return{isTooltipActive:!0,activeItem:t,activePayload:t.tooltipPayload,activeCoordinate:t.tooltipPosition||{x:t.cx,y:t.cy}}})}),en(t3(c),"handleItemMouseLeave",function(){c.setState(function(){return{isTooltipActive:!1}})}),en(t3(c),"handleMouseMove",function(t){t.persist(),c.throttleTriggeredAfterMouseMove(t)}),en(t3(c),"handleMouseLeave",function(t){var e={isTooltipActive:!1};c.setState(e),c.triggerSyncEvent(e);var n=c.props.onMouseLeave;u()(n)&&n(e,t)}),en(t3(c),"handleOuterEvent",function(t){var e,n=(0,A.Bh)(t),r=f()(c.props,"".concat(n));n&&u()(r)&&r(null!==(e=/.*touch.*/i.test(n)?c.getMouseInfo(t.changedTouches[0]):c.getMouseInfo(t))&&void 0!==e?e:{},t)}),en(t3(c),"handleClick",function(t){var e=c.getMouseInfo(t);if(e){var n=ee(ee({},e),{},{isTooltipActive:!0});c.setState(n),c.triggerSyncEvent(n);var r=c.props.onClick;u()(r)&&r(n,t)}}),en(t3(c),"handleMouseDown",function(t){var e=c.props.onMouseDown;u()(e)&&e(c.getMouseInfo(t),t)}),en(t3(c),"handleMouseUp",function(t){var e=c.props.onMouseUp;u()(e)&&e(c.getMouseInfo(t),t)}),en(t3(c),"handleTouchMove",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&c.throttleTriggeredAfterMouseMove(t.changedTouches[0])}),en(t3(c),"handleTouchStart",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&c.handleMouseDown(t.changedTouches[0])}),en(t3(c),"handleTouchEnd",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&c.handleMouseUp(t.changedTouches[0])}),en(t3(c),"triggerSyncEvent",function(t){void 0!==c.props.syncId&&tC.emit(tN,c.props.syncId,t,c.eventEmitterSymbol)}),en(t3(c),"applySyncEvent",function(t){var e=c.props,n=e.layout,r=e.syncMethod,o=c.state.updateId,i=t.dataStartIndex,a=t.dataEndIndex;if(void 0!==t.dataStartIndex||void 0!==t.dataEndIndex)c.setState(ee({dataStartIndex:i,dataEndIndex:a},E({props:c.props,dataStartIndex:i,dataEndIndex:a,updateId:o},c.state)));else if(void 0!==t.activeTooltipIndex){var u=t.chartX,l=t.chartY,s=t.activeTooltipIndex,f=c.state,p=f.offset,h=f.tooltipTicks;if(!p)return;if("function"==typeof r)s=r(h,t);else if("value"===r){s=-1;for(var d=0;d=0){if(s.dataKey&&!s.allowDuplicatedCategory){var P="function"==typeof s.dataKey?function(t){return"function"==typeof s.dataKey?s.dataKey(t.payload):null}:"payload.".concat(s.dataKey.toString());_=(0,C.Ap)(v,P,p),N=m&&g&&(0,C.Ap)(g,P,p)}else _=null==v?void 0:v[f],N=m&&g&&g[f];if(j||w){var M=void 0!==t.props.activeIndex?t.props.activeIndex:f;return[(0,r.cloneElement)(t,ee(ee(ee({},o.props),E),{},{activeIndex:M})),null,null]}if(!i()(_))return[k].concat(t4(c.renderActivePoints({item:o,activePoint:_,basePoint:N,childIndex:f,isRange:m})))}else{var _,N,D,I=(null!==(D=c.getItemByXY(c.state.activeCoordinate))&&void 0!==D?D:{graphicalItem:k}).graphicalItem,L=I.item,B=void 0===L?t:L,R=I.childIndex,z=ee(ee(ee({},o.props),E),{},{activeIndex:R});return[(0,r.cloneElement)(B,z),null,null]}}return m?[k,null,null]:[k,null]}),en(t3(c),"renderCustomized",function(t,e,n){return(0,r.cloneElement)(t,ee(ee({key:"recharts-customized-".concat(n)},c.props),c.state))}),en(t3(c),"renderMap",{CartesianGrid:{handler:c.renderGrid,once:!0},ReferenceArea:{handler:c.renderReferenceElement},ReferenceLine:{handler:eu},ReferenceDot:{handler:c.renderReferenceElement},XAxis:{handler:eu},YAxis:{handler:eu},Brush:{handler:c.renderBrush,once:!0},Bar:{handler:c.renderGraphicChild},Line:{handler:c.renderGraphicChild},Area:{handler:c.renderGraphicChild},Radar:{handler:c.renderGraphicChild},RadialBar:{handler:c.renderGraphicChild},Scatter:{handler:c.renderGraphicChild},Pie:{handler:c.renderGraphicChild},Funnel:{handler:c.renderGraphicChild},Tooltip:{handler:c.renderCursor,once:!0},PolarGrid:{handler:c.renderPolarGrid,once:!0},PolarAngleAxis:{handler:c.renderPolarAxis},PolarRadiusAxis:{handler:c.renderPolarAxis},Customized:{handler:c.renderCustomized}}),c.clipPathId="".concat(null!==(e=t.id)&&void 0!==e?e:(0,C.EL)("recharts"),"-clip"),c.throttleTriggeredAfterMouseMove=y()(c.triggeredAfterMouseMove,null!==(o=t.throttleDelay)&&void 0!==o?o:1e3/60),c.state={},c}return o=[{key:"componentDidMount",value:function(){var t,e;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(t=this.props.margin.left)&&void 0!==t?t:0,top:null!==(e=this.props.margin.top)&&void 0!==e?e:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var t=this.props,e=t.children,n=t.data,r=t.height,o=t.layout,i=(0,A.sP)(e,S.u);if(i){var a=i.props.defaultIndex;if("number"==typeof a&&!(a<0)&&!(a>this.state.tooltipTicks.length)){var u=this.state.tooltipTicks[a]&&this.state.tooltipTicks[a].value,c=ef(this.state,n,a,u),l=this.state.tooltipTicks[a].coordinate,s=(this.state.offset.top+r)/2,f="horizontal"===o?{x:l,y:s}:{y:l,x:s},p=this.state.formattedGraphicalItems.find(function(t){return"Scatter"===t.item.type.name});p&&(f=ee(ee({},f),p.props.points[a].tooltipPosition),c=p.props.points[a].tooltipPayload);var h={activeTooltipIndex:a,isTooltipActive:!0,activeLabel:u,activePayload:c,activeCoordinate:f};this.setState(h),this.renderCursor(i),this.accessibilityManager.setIndex(a)}}}},{key:"getSnapshotBeforeUpdate",value:function(t,e){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==e.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==t.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==t.margin){var n,r;this.accessibilityManager.setDetails({offset:{left:null!==(n=this.props.margin.left)&&void 0!==n?n:0,top:null!==(r=this.props.margin.top)&&void 0!==r?r:0}})}return null}},{key:"componentDidUpdate",value:function(t){(0,A.rL)([(0,A.sP)(t.children,S.u)],[(0,A.sP)(this.props.children,S.u)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var t=(0,A.sP)(this.props.children,S.u);if(t&&"boolean"==typeof t.props.shared){var e=t.props.shared?"axis":"item";return s.indexOf(e)>=0?e:c}return c}},{key:"getMouseInfo",value:function(t){if(!this.container)return null;var e=this.container,n=e.getBoundingClientRect(),r=(0,J.os)(n),o={chartX:Math.round(t.pageX-r.left),chartY:Math.round(t.pageY-r.top)},i=n.width/e.offsetWidth||1,a=this.inRange(o.chartX,o.chartY,i);if(!a)return null;var u=this.state,c=u.xAxisMap,l=u.yAxisMap;if("axis"!==this.getTooltipEventType()&&c&&l){var s=(0,C.Kt)(c).scale,f=(0,C.Kt)(l).scale,p=s&&s.invert?s.invert(o.chartX):null,h=f&&f.invert?f.invert(o.chartY):null;return ee(ee({},o),{},{xValue:p,yValue:h})}var d=ep(this.state,this.props.data,this.props.layout,a);return d?ee(ee({},o),d):null}},{key:"inRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.props.layout,o=t/n,i=e/n;if("horizontal"===r||"vertical"===r){var a=this.state.offset;return o>=a.left&&o<=a.left+a.width&&i>=a.top&&i<=a.top+a.height?{x:o,y:i}:null}var u=this.state,c=u.angleAxisMap,l=u.radiusAxisMap;if(c&&l){var s=(0,C.Kt)(c);return(0,tM.z3)({x:o,y:i},s)}return null}},{key:"parseEventsOfWrapper",value:function(){var t=this.props.children,e=this.getTooltipEventType(),n=(0,A.sP)(t,S.u),r={};return n&&"axis"===e&&(r="click"===n.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),ee(ee({},(0,tD.Ym)(this.props,this.handleOuterEvent)),r)}},{key:"addListener",value:function(){tC.on(tN,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){tC.removeListener(tN,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(t,e,n){for(var r=this.state.formattedGraphicalItems,o=0,i=r.length;ot.length)&&(e=t.length);for(var n=0,r=Array(e);n=0?1:-1;"insideStart"===u?(o=g+S*l,a=O):"insideEnd"===u?(o=b-S*l,a=!O):"end"===u&&(o=b+S*l,a=O),a=j<=0?a:!a;var E=(0,d.op)(p,y,w,o),k=(0,d.op)(p,y,w,o+(a?1:-1)*359),P="M".concat(E.x,",").concat(E.y,"\n A").concat(w,",").concat(w,",0,1,").concat(a?0:1,",\n ").concat(k.x,",").concat(k.y),A=i()(t.id)?(0,h.EL)("recharts-radial-line-"):t.id;return r.createElement("text",x({},n,{dominantBaseline:"central",className:(0,s.Z)("recharts-radial-bar-label",f)}),r.createElement("defs",null,r.createElement("path",{id:A,d:P})),r.createElement("textPath",{xlinkHref:"#".concat(A)},e))},j=function(t){var e=t.viewBox,n=t.offset,r=t.position,o=e.cx,i=e.cy,a=e.innerRadius,u=e.outerRadius,c=(e.startAngle+e.endAngle)/2;if("outside"===r){var l=(0,d.op)(o,i,u+n,c),s=l.x;return{x:s,y:l.y,textAnchor:s>=o?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"end"};var f=(0,d.op)(o,i,(a+u)/2,c);return{x:f.x,y:f.y,textAnchor:"middle",verticalAnchor:"middle"}},S=function(t){var e=t.viewBox,n=t.parentViewBox,r=t.offset,o=t.position,i=e.x,a=e.y,u=e.width,c=e.height,s=c>=0?1:-1,f=s*r,p=s>0?"end":"start",d=s>0?"start":"end",y=u>=0?1:-1,v=y*r,m=y>0?"end":"start",g=y>0?"start":"end";if("top"===o)return b(b({},{x:i+u/2,y:a-s*r,textAnchor:"middle",verticalAnchor:p}),n?{height:Math.max(a-n.y,0),width:u}:{});if("bottom"===o)return b(b({},{x:i+u/2,y:a+c+f,textAnchor:"middle",verticalAnchor:d}),n?{height:Math.max(n.y+n.height-(a+c),0),width:u}:{});if("left"===o){var x={x:i-v,y:a+c/2,textAnchor:m,verticalAnchor:"middle"};return b(b({},x),n?{width:Math.max(x.x-n.x,0),height:c}:{})}if("right"===o){var O={x:i+u+v,y:a+c/2,textAnchor:g,verticalAnchor:"middle"};return b(b({},O),n?{width:Math.max(n.x+n.width-O.x,0),height:c}:{})}var w=n?{width:u,height:c}:{};return"insideLeft"===o?b({x:i+v,y:a+c/2,textAnchor:g,verticalAnchor:"middle"},w):"insideRight"===o?b({x:i+u-v,y:a+c/2,textAnchor:m,verticalAnchor:"middle"},w):"insideTop"===o?b({x:i+u/2,y:a+f,textAnchor:"middle",verticalAnchor:d},w):"insideBottom"===o?b({x:i+u/2,y:a+c-f,textAnchor:"middle",verticalAnchor:p},w):"insideTopLeft"===o?b({x:i+v,y:a+f,textAnchor:g,verticalAnchor:d},w):"insideTopRight"===o?b({x:i+u-v,y:a+f,textAnchor:m,verticalAnchor:d},w):"insideBottomLeft"===o?b({x:i+v,y:a+c-f,textAnchor:g,verticalAnchor:p},w):"insideBottomRight"===o?b({x:i+u-v,y:a+c-f,textAnchor:m,verticalAnchor:p},w):l()(o)&&((0,h.hj)(o.x)||(0,h.hU)(o.x))&&((0,h.hj)(o.y)||(0,h.hU)(o.y))?b({x:i+(0,h.h1)(o.x,u),y:a+(0,h.h1)(o.y,c),textAnchor:"end",verticalAnchor:"end"},w):b({x:i+u/2,y:a+c/2,textAnchor:"middle",verticalAnchor:"middle"},w)};function E(t){var e,n=t.offset,o=b({offset:void 0===n?5:n},function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,v)),a=o.viewBox,c=o.position,l=o.value,d=o.children,y=o.content,m=o.className,g=o.textBreakAll;if(!a||i()(l)&&i()(d)&&!(0,r.isValidElement)(y)&&!u()(y))return null;if((0,r.isValidElement)(y))return(0,r.cloneElement)(y,o);if(u()(y)){if(e=(0,r.createElement)(y,o),(0,r.isValidElement)(e))return e}else e=O(o);var E="cx"in a&&(0,h.hj)(a.cx),k=(0,p.L6)(o,!0);if(E&&("insideStart"===c||"insideEnd"===c||"end"===c))return w(o,e,k);var P=E?j(o):S(o);return r.createElement(f.x,x({className:(0,s.Z)("recharts-label",void 0===m?"":m)},k,P,{breakAll:g}),e)}E.displayName="Label";var k=function(t){var e=t.cx,n=t.cy,r=t.angle,o=t.startAngle,i=t.endAngle,a=t.r,u=t.radius,c=t.innerRadius,l=t.outerRadius,s=t.x,f=t.y,p=t.top,d=t.left,y=t.width,v=t.height,m=t.clockWise,g=t.labelViewBox;if(g)return g;if((0,h.hj)(y)&&(0,h.hj)(v)){if((0,h.hj)(s)&&(0,h.hj)(f))return{x:s,y:f,width:y,height:v};if((0,h.hj)(p)&&(0,h.hj)(d))return{x:p,y:d,width:y,height:v}}return(0,h.hj)(s)&&(0,h.hj)(f)?{x:s,y:f,width:0,height:0}:(0,h.hj)(e)&&(0,h.hj)(n)?{cx:e,cy:n,startAngle:o||r||0,endAngle:i||r||0,innerRadius:c||0,outerRadius:l||u||a||0,clockWise:m}:t.viewBox?t.viewBox:{}};E.parseViewBox=k,E.renderCallByParent=function(t,e){var n,o,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t||!t.children&&i&&!t.label)return null;var a=t.children,c=k(t),s=(0,p.NN)(a,E).map(function(t,n){return(0,r.cloneElement)(t,{viewBox:e||c,key:"label-".concat(n)})});return i?[(n=t.label,o=e||c,n?!0===n?r.createElement(E,{key:"label-implicit",viewBox:o}):(0,h.P2)(n)?r.createElement(E,{key:"label-implicit",viewBox:o,value:n}):(0,r.isValidElement)(n)?n.type===E?(0,r.cloneElement)(n,{key:"label-implicit",viewBox:o}):r.createElement(E,{key:"label-implicit",content:n,viewBox:o}):u()(n)?r.createElement(E,{key:"label-implicit",content:n,viewBox:o}):l()(n)?r.createElement(E,x({viewBox:o},n,{key:"label-implicit"})):null:null)].concat(function(t){if(Array.isArray(t))return m(t)}(s)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(s)||function(t,e){if(t){if("string"==typeof t)return m(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,void 0)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):s}},58772:function(t,e,n){"use strict";n.d(e,{e:function(){return E}});var r=n(2265),o=n(77571),i=n.n(o),a=n(28302),u=n.n(a),c=n(86757),l=n.n(c),s=n(86185),f=n.n(s),p=n(26680),h=n(9841),d=n(82944),y=n(85355);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var m=["valueAccessor"],g=["data","dataKey","clockWise","id","textBreakAll"];function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var S=function(t){return Array.isArray(t.value)?f()(t.value):t.value};function E(t){var e=t.valueAccessor,n=void 0===e?S:e,o=j(t,m),a=o.data,u=o.dataKey,c=o.clockWise,l=o.id,s=o.textBreakAll,f=j(o,g);return a&&a.length?r.createElement(h.m,{className:"recharts-label-list"},a.map(function(t,e){var o=i()(u)?n(t,e):(0,y.F$)(t&&t.payload,u),a=i()(l)?{}:{id:"".concat(l,"-").concat(e)};return r.createElement(p._,x({},(0,d.L6)(t,!0),f,a,{parentViewBox:t.parentViewBox,value:o,textBreakAll:s,viewBox:p._.parseViewBox(i()(c)?t:w(w({},t),{},{clockWise:c})),key:"label-".concat(e),index:e}))})):null}E.displayName="LabelList",E.renderCallByParent=function(t,e){var n,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t||!t.children&&o&&!t.label)return null;var i=t.children,a=(0,d.NN)(i,E).map(function(t,n){return(0,r.cloneElement)(t,{data:e,key:"labelList-".concat(n)})});return o?[(n=t.label)?!0===n?r.createElement(E,{key:"labelList-implicit",data:e}):r.isValidElement(n)||l()(n)?r.createElement(E,{key:"labelList-implicit",data:e,content:n}):u()(n)?r.createElement(E,x({data:e},n,{key:"labelList-implicit"})):null:null].concat(function(t){if(Array.isArray(t))return b(t)}(a)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return b(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,void 0)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):a}},22190:function(t,e,n){"use strict";n.d(e,{D:function(){return C}});var r=n(2265),o=n(86757),i=n.n(o),a=n(61994),u=n(1175),c=n(48777),l=n(14870),s=n(41637);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(){return(p=Object.assign?Object.assign.bind():function(t){for(var e=1;e');var O=e.inactive?h:e.color;return r.createElement("li",p({className:b,style:y,key:"legend-item-".concat(n)},(0,s.bw)(t.props,e,n)),r.createElement(c.T,{width:o,height:o,viewBox:d,style:m},t.renderIcon(e)),r.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},g?g(x,e,n):x))})}},{key:"render",value:function(){var t=this.props,e=t.payload,n=t.layout,o=t.align;return e&&e.length?r.createElement("ul",{className:"recharts-default-legend",style:{padding:0,margin:0,textAlign:"horizontal"===n?o:"left"}},this.renderItems()):null}}],function(t,e){for(var n=0;n1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height,t&&t(e))}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,t&&t(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?S({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(t){var e,n,r=this.props,o=r.layout,i=r.align,a=r.verticalAlign,u=r.margin,c=r.chartWidth,l=r.chartHeight;return t&&(void 0!==t.left&&null!==t.left||void 0!==t.right&&null!==t.right)||(e="center"===i&&"vertical"===o?{left:((c||0)-this.getBBoxSnapshot().width)/2}:"right"===i?{right:u&&u.right||0}:{left:u&&u.left||0}),t&&(void 0!==t.top&&null!==t.top||void 0!==t.bottom&&null!==t.bottom)||(n="middle"===a?{top:((l||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:u&&u.bottom||0}:{top:u&&u.top||0}),S(S({},e),n)}},{key:"render",value:function(){var t=this,e=this.props,n=e.content,o=e.width,i=e.height,a=e.wrapperStyle,u=e.payloadUniqBy,c=e.payload,l=S(S({position:"absolute",width:o||"auto",height:i||"auto"},this.getDefaultPosition(a)),a);return r.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(e){t.wrapperNode=e}},function(t,e){if(r.isValidElement(t))return r.cloneElement(t,e);if("function"==typeof t)return r.createElement(t,e);e.ref;var n=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,w);return r.createElement(g,n)}(n,S(S({},this.props),{},{payload:(0,x.z)(c,u,T)})))}}],o=[{key:"getWithHeight",value:function(t,e){var n=t.props.layout;return"vertical"===n&&(0,b.hj)(t.props.height)?{height:t.props.height}:"horizontal"===n?{width:t.props.width||e}:null}}],n&&E(a.prototype,n),o&&E(a,o),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);M(C,"displayName","Legend"),M(C,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"})},47625:function(t,e,n){"use strict";n.d(e,{h:function(){return y}});var r=n(61994),o=n(2265),i=n(37065),a=n.n(i),u=n(82558),c=n(16630),l=n(1175),s=n(82944);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&(t=a()(t,E,{trailing:!0,leading:!1}));var e=new ResizeObserver(t),n=_.current.getBoundingClientRect();return I(n.width,n.height),e.observe(_.current),function(){e.disconnect()}},[I,E]);var L=(0,o.useMemo)(function(){var t=N.containerWidth,e=N.containerHeight;if(t<0||e<0)return null;(0,l.Z)((0,c.hU)(v)||(0,c.hU)(g),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",v,g),(0,l.Z)(!i||i>0,"The aspect(%s) must be greater than zero.",i);var n=(0,c.hU)(v)?t:v,r=(0,c.hU)(g)?e:g;i&&i>0&&(n?r=n/i:r&&(n=r*i),w&&r>w&&(r=w)),(0,l.Z)(n>0||r>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,r,v,g,x,O,i);var a=!Array.isArray(j)&&(0,u.isElement)(j)&&(0,s.Gf)(j.type).endsWith("Chart");return o.Children.map(j,function(t){return(0,u.isElement)(t)?(0,o.cloneElement)(t,h({width:n,height:r},a?{style:h({height:"100%",width:"100%",maxHeight:r,maxWidth:n},t.props.style)}:{})):t})},[i,j,g,w,O,x,N,v]);return o.createElement("div",{id:k?"".concat(k):void 0,className:(0,r.Z)("recharts-responsive-container",P),style:h(h({},void 0===M?{}:M),{},{width:v,height:g,minWidth:x,minHeight:O,maxHeight:w}),ref:_},L)})},58811:function(t,e,n){"use strict";n.d(e,{x:function(){return B}});var r=n(2265),o=n(77571),i=n.n(o),a=n(61994),u=n(16630),c=n(34067),l=n(82944),s=n(4094);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function M(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&void 0!==arguments[0]?arguments[0]:[];return t.reduce(function(t,e){var i=e.word,a=e.width,u=t[t.length-1];return u&&(null==r||o||u.width+a+na||e.reduce(function(t,e){return t.width>e.width?t:e}).width>Number(r),e]},y=0,v=c.length-1,m=0;y<=v&&m<=c.length-1;){var g=Math.floor((y+v)/2),b=M(d(g-1),2),x=b[0],O=b[1],w=M(d(g),1)[0];if(x||w||(y=g+1),x&&w&&(v=g-1),!x&&w){i=O;break}m++}return i||h},D=function(t){return[{words:i()(t)?[]:t.toString().split(T)}]},I=function(t){var e=t.width,n=t.scaleToFit,r=t.children,o=t.style,i=t.breakAll,a=t.maxLines;if((e||n)&&!c.x.isSsr){var u=C({breakAll:i,children:r,style:o});return u?N({breakAll:i,children:r,maxLines:a,style:o},u.wordsWithComputedWidth,u.spaceWidth,e,n):D(r)}return D(r)},L="#808080",B=function(t){var e,n=t.x,o=void 0===n?0:n,i=t.y,c=void 0===i?0:i,s=t.lineHeight,f=void 0===s?"1em":s,p=t.capHeight,h=void 0===p?"0.71em":p,d=t.scaleToFit,y=void 0!==d&&d,v=t.textAnchor,m=t.verticalAnchor,g=t.fill,b=void 0===g?L:g,x=A(t,E),O=(0,r.useMemo)(function(){return I({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:y,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,y,x.style,x.width]),w=x.dx,j=x.dy,M=x.angle,_=x.className,T=x.breakAll,C=A(x,k);if(!(0,u.P2)(o)||!(0,u.P2)(c))return null;var N=o+((0,u.hj)(w)?w:0),D=c+((0,u.hj)(j)?j:0);switch(void 0===m?"end":m){case"start":e=S("calc(".concat(h,")"));break;case"middle":e=S("calc(".concat((O.length-1)/2," * -").concat(f," + (").concat(h," / 2))"));break;default:e=S("calc(".concat(O.length-1," * -").concat(f,")"))}var B=[];if(y){var R=O[0].width,z=x.width;B.push("scale(".concat(((0,u.hj)(z)?z/R:1)/R,")"))}return M&&B.push("rotate(".concat(M,", ").concat(N,", ").concat(D,")")),B.length&&(C.transform=B.join(" ")),r.createElement("text",P({},(0,l.L6)(C,!0),{x:N,y:D,className:(0,a.Z)("recharts-text",_),textAnchor:void 0===v?"start":v,fill:b.includes("url")?L:b}),O.map(function(t,n){var o=t.words.join(T?"":" ");return r.createElement("tspan",{x:N,dy:0===n?e:f,key:o},o)}))}},8147:function(t,e,n){"use strict";n.d(e,{u:function(){return F}});var r=n(2265),o=n(34935),i=n.n(o),a=n(77571),u=n.n(a),c=n(61994),l=n(16630);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nc[r]+s?Math.max(f,c[r]):Math.max(p,c[r])}function w(t){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function S(t){for(var e=1;e1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height)}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.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 t,e;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(t=this.props.coordinate)||void 0===t?void 0:t.x)!==this.state.dismissedAtCoordinate.x||(null===(e=this.props.coordinate)||void 0===e?void 0:e.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var t,e,n,o,i,a,u,s,f,p,h,d,y,m,w,j,E,k,P,A,M,_=this,T=this.props,C=T.active,N=T.allowEscapeViewBox,D=T.animationDuration,I=T.animationEasing,L=T.children,B=T.coordinate,R=T.hasPayload,z=T.isAnimationActive,U=T.offset,F=T.position,$=T.reverseDirection,q=T.useTranslate3d,Z=T.viewBox,W=T.wrapperStyle,G=(m=(t={allowEscapeViewBox:N,coordinate:B,offsetTopLeft:U,position:F,reverseDirection:$,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:q,viewBox:Z}).allowEscapeViewBox,w=t.coordinate,j=t.offsetTopLeft,E=t.position,k=t.reverseDirection,P=t.tooltipBox,A=t.useTranslate3d,M=t.viewBox,P.height>0&&P.width>0&&w?(n=(e={translateX:d=O({allowEscapeViewBox:m,coordinate:w,key:"x",offsetTopLeft:j,position:E,reverseDirection:k,tooltipDimension:P.width,viewBox:M,viewBoxDimension:M.width}),translateY:y=O({allowEscapeViewBox:m,coordinate:w,key:"y",offsetTopLeft:j,position:E,reverseDirection:k,tooltipDimension:P.height,viewBox:M,viewBoxDimension:M.height}),useTranslate3d:A}).translateX,o=e.translateY,i=e.useTranslate3d,h=(0,v.bO)({transform:i?"translate3d(".concat(n,"px, ").concat(o,"px, 0)"):"translate(".concat(n,"px, ").concat(o,"px)")})):h=x,{cssProperties:h,cssClasses:(s=(a={translateX:d,translateY:y,coordinate:w}).coordinate,f=a.translateX,p=a.translateY,(0,c.Z)(b,(g(u={},"".concat(b,"-right"),(0,l.hj)(f)&&s&&(0,l.hj)(s.x)&&f>=s.x),g(u,"".concat(b,"-left"),(0,l.hj)(f)&&s&&(0,l.hj)(s.x)&&f=s.y),g(u,"".concat(b,"-top"),(0,l.hj)(p)&&s&&(0,l.hj)(s.y)&&p0;return r.createElement(_,{allowEscapeViewBox:i,animationDuration:a,animationEasing:u,isAnimationActive:f,active:o,coordinate:l,hasPayload:w,offset:p,position:v,reverseDirection:m,useTranslate3d:g,viewBox:b,wrapperStyle:x},(t=I(I({},this.props),{},{payload:O}),r.isValidElement(c)?r.cloneElement(c,t):"function"==typeof c?r.createElement(c,t):r.createElement(y,t)))}}],function(t,e){for(var n=0;n=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,a),s=(0,o.Z)("recharts-layer",c);return r.createElement("g",u({className:s},(0,i.L6)(l,!0),{ref:e}),n)})},48777:function(t,e,n){"use strict";n.d(e,{T:function(){return c}});var r=n(2265),o=n(61994),i=n(82944),a=["children","width","height","viewBox","className","style","title","desc"];function u(){return(u=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,a),y=l||{width:n,height:c,x:0,y:0},v=(0,o.Z)("recharts-surface",s);return r.createElement("svg",u({},(0,i.L6)(d,!0,"svg"),{className:v,width:n,height:c,style:f,viewBox:"".concat(y.x," ").concat(y.y," ").concat(y.width," ").concat(y.height)}),r.createElement("title",null,p),r.createElement("desc",null,h),e)}},25739:function(t,e,n){"use strict";n.d(e,{br:function(){return d},Mw:function(){return O},zn:function(){return x},sp:function(){return y},qD:function(){return b},d2:function(){return g},bH:function(){return v},Ud:function(){return m}});var r=n(2265),o=n(69398),i=n(50967),a=n.n(i)()(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),u=(0,r.createContext)(void 0),c=(0,r.createContext)(void 0),l=(0,r.createContext)(void 0),s=(0,r.createContext)({}),f=(0,r.createContext)(void 0),p=(0,r.createContext)(0),h=(0,r.createContext)(0),d=function(t){var e=t.state,n=e.xAxisMap,o=e.yAxisMap,i=e.offset,d=t.clipPathId,y=t.children,v=t.width,m=t.height,g=a(i);return r.createElement(u.Provider,{value:n},r.createElement(c.Provider,{value:o},r.createElement(s.Provider,{value:i},r.createElement(l.Provider,{value:g},r.createElement(f.Provider,{value:d},r.createElement(p.Provider,{value:m},r.createElement(h.Provider,{value:v},y)))))))},y=function(){return(0,r.useContext)(f)},v=function(t){var e=(0,r.useContext)(u);null!=e||(0,o.Z)(!1);var n=e[t];return null!=n||(0,o.Z)(!1),n},m=function(t){var e=(0,r.useContext)(c);null!=e||(0,o.Z)(!1);var n=e[t];return null!=n||(0,o.Z)(!1),n},g=function(){return(0,r.useContext)(l)},b=function(){return(0,r.useContext)(s)},x=function(){return(0,r.useContext)(h)},O=function(){return(0,r.useContext)(p)}},57165:function(t,e,n){"use strict";n.d(e,{H:function(){return X}});var r=n(2265);function o(){}function i(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function a(t){this._context=t}function u(t){this._context=t}function c(t){this._context=t}a.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:i(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},u.prototype={areaStart:o,areaEnd:o,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)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},c.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};class l{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function s(t){this._context=t}function f(t){this._context=t}function p(t){return new f(t)}function h(t,e,n){var r=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(r||o<0&&-0),a=(n-t._y1)/(o||r<0&&-0);return((i<0?-1:1)+(a<0?-1:1))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs((i*o+a*r)/(r+o)))||0}function d(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function y(t,e,n){var r=t._x0,o=t._y0,i=t._x1,a=t._y1,u=(i-r)/3;t._context.bezierCurveTo(r+u,o+u*e,i-u,a-u*n,i,a)}function v(t){this._context=t}function m(t){this._context=new g(t)}function g(t){this._context=t}function b(t){this._context=t}function x(t){var e,n,r=t.length-1,o=Array(r),i=Array(r),a=Array(r);for(o[0]=0,i[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)o[e]=(a[e]-o[e+1])/i[e];for(e=0,i[r-1]=(t[r]+o[r-1])/2;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var w=n(22516),j=n(76115),S=n(67790);function E(t){return t[0]}function k(t){return t[1]}function P(t,e){var n=(0,j.Z)(!0),r=null,o=p,i=null,a=(0,S.d)(u);function u(u){var c,l,s,f=(u=(0,w.Z)(u)).length,p=!1;for(null==r&&(i=o(s=a())),c=0;c<=f;++c)!(c=f;--p)u.point(m[p],g[p]);u.lineEnd(),u.areaEnd()}}v&&(m[s]=+t(h,s,l),g[s]=+e(h,s,l),u.point(r?+r(h,s,l):m[s],n?+n(h,s,l):g[s]))}if(d)return u=null,d+""||null}function s(){return P().defined(o).curve(a).context(i)}return t="function"==typeof t?t:void 0===t?E:(0,j.Z)(+t),e="function"==typeof e?e:void 0===e?(0,j.Z)(0):(0,j.Z)(+e),n="function"==typeof n?n:void 0===n?k:(0,j.Z)(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:(0,j.Z)(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:(0,j.Z)(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:(0,j.Z)(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:(0,j.Z)(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:(0,j.Z)(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:(0,j.Z)(+t),l):n},l.lineX0=l.lineY0=function(){return s().x(t).y(e)},l.lineY1=function(){return s().x(t).y(n)},l.lineX1=function(){return s().x(r).y(e)},l.defined=function(t){return arguments.length?(o="function"==typeof t?t:(0,j.Z)(!!t),l):o},l.curve=function(t){return arguments.length?(a=t,null!=i&&(u=a(i)),l):a},l.context=function(t){return arguments.length?(null==t?i=u=null:u=a(i=t),l):i},l}var M=n(75551),_=n.n(M),T=n(86757),C=n.n(T),N=n(61994),D=n(41637),I=n(82944),L=n(16630);function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(){return(R=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n=0?1:-1,c=n>=0?1:-1,l=r>=0&&n>=0||r<0&&n<0?1:0;if(a>0&&o instanceof Array){for(var s=[0,0,0,0],f=0;f<4;f++)s[f]=o[f]>a?a:o[f];i="M".concat(t,",").concat(e+u*s[0]),s[0]>0&&(i+="A ".concat(s[0],",").concat(s[0],",0,0,").concat(l,",").concat(t+c*s[0],",").concat(e)),i+="L ".concat(t+n-c*s[1],",").concat(e),s[1]>0&&(i+="A ".concat(s[1],",").concat(s[1],",0,0,").concat(l,",\n ").concat(t+n,",").concat(e+u*s[1])),i+="L ".concat(t+n,",").concat(e+r-u*s[2]),s[2]>0&&(i+="A ".concat(s[2],",").concat(s[2],",0,0,").concat(l,",\n ").concat(t+n-c*s[2],",").concat(e+r)),i+="L ".concat(t+c*s[3],",").concat(e+r),s[3]>0&&(i+="A ".concat(s[3],",").concat(s[3],",0,0,").concat(l,",\n ").concat(t,",").concat(e+r-u*s[3])),i+="Z"}else if(a>0&&o===+o&&o>0){var p=Math.min(a,o);i="M ".concat(t,",").concat(e+u*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+c*p,",").concat(e,"\n L ").concat(t+n-c*p,",").concat(e,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+n,",").concat(e+u*p,"\n L ").concat(t+n,",").concat(e+r-u*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+n-c*p,",").concat(e+r,"\n L ").concat(t+c*p,",").concat(e+r,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t,",").concat(e+r-u*p," Z")}else i="M ".concat(t,",").concat(e," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return i},h=function(t,e){if(!t||!e)return!1;var n=t.x,r=t.y,o=e.x,i=e.y,a=e.width,u=e.height;return!!(Math.abs(a)>0&&Math.abs(u)>0)&&n>=Math.min(o,o+a)&&n<=Math.max(o,o+a)&&r>=Math.min(i,i+u)&&r<=Math.max(i,i+u)},d={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},y=function(t){var e,n=f(f({},d),t),u=(0,r.useRef)(),s=function(t){if(Array.isArray(t))return t}(e=(0,r.useState)(-1))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{for(i=(n=n.call(t)).next;!(c=(r=i.call(n)).done)&&(u.push(r.value),2!==u.length);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,2)||function(t,e){if(t){if("string"==typeof t)return l(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=s[0],y=s[1];(0,r.useEffect)(function(){if(u.current&&u.current.getTotalLength)try{var t=u.current.getTotalLength();t&&y(t)}catch(t){}},[]);var v=n.x,m=n.y,g=n.width,b=n.height,x=n.radius,O=n.className,w=n.animationEasing,j=n.animationDuration,S=n.animationBegin,E=n.isAnimationActive,k=n.isUpdateAnimationActive;if(v!==+v||m!==+m||g!==+g||b!==+b||0===g||0===b)return null;var P=(0,o.Z)("recharts-rectangle",O);return k?r.createElement(i.ZP,{canBegin:h>0,from:{width:g,height:b,x:v,y:m},to:{width:g,height:b,x:v,y:m},duration:j,animationEasing:w,isActive:k},function(t){var e=t.width,o=t.height,l=t.x,s=t.y;return r.createElement(i.ZP,{canBegin:h>0,from:"0px ".concat(-1===h?1:h,"px"),to:"".concat(h,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:j,isActive:E,easing:w},r.createElement("path",c({},(0,a.L6)(n,!0),{className:P,d:p(l,s,e,o,x),ref:u})))}):r.createElement("path",c({},(0,a.L6)(n,!0),{className:P,d:p(v,m,g,b,x)}))}},60474:function(t,e,n){"use strict";n.d(e,{L:function(){return v}});var r=n(2265),o=n(61994),i=n(82944),a=n(39206),u=n(16630);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(){return(l=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(c>s),",\n ").concat(p.x,",").concat(p.y,"\n ");if(o>0){var d=(0,a.op)(n,r,o,c),y=(0,a.op)(n,r,o,s);h+="L ".concat(y.x,",").concat(y.y,"\n A ").concat(o,",").concat(o,",0,\n ").concat(+(Math.abs(l)>180),",").concat(+(c<=s),",\n ").concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},d=function(t){var e=t.cx,n=t.cy,r=t.innerRadius,o=t.outerRadius,i=t.cornerRadius,a=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,s=t.endAngle,f=(0,u.uY)(s-l),d=p({cx:e,cy:n,radius:o,angle:l,sign:f,cornerRadius:i,cornerIsExternal:c}),y=d.circleTangency,v=d.lineTangency,m=d.theta,g=p({cx:e,cy:n,radius:o,angle:s,sign:-f,cornerRadius:i,cornerIsExternal:c}),b=g.circleTangency,x=g.lineTangency,O=g.theta,w=c?Math.abs(l-s):Math.abs(l-s)-m-O;if(w<0)return a?"M ".concat(v.x,",").concat(v.y,"\n a").concat(i,",").concat(i,",0,0,1,").concat(2*i,",0\n a").concat(i,",").concat(i,",0,0,1,").concat(-(2*i),",0\n "):h({cx:e,cy:n,innerRadius:r,outerRadius:o,startAngle:l,endAngle:s});var j="M ".concat(v.x,",").concat(v.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,"\n A").concat(o,",").concat(o,",0,").concat(+(w>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,"\n ");if(r>0){var S=p({cx:e,cy:n,radius:r,angle:l,sign:f,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),E=S.circleTangency,k=S.lineTangency,P=S.theta,A=p({cx:e,cy:n,radius:r,angle:s,sign:-f,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),M=A.circleTangency,_=A.lineTangency,T=A.theta,C=c?Math.abs(l-s):Math.abs(l-s)-P-T;if(C<0&&0===i)return"".concat(j,"L").concat(e,",").concat(n,"Z");j+="L".concat(_.x,",").concat(_.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(M.x,",").concat(M.y,"\n A").concat(r,",").concat(r,",0,").concat(+(C>180),",").concat(+(f>0),",").concat(E.x,",").concat(E.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(k.x,",").concat(k.y,"Z")}else j+="L".concat(e,",").concat(n,"Z");return j},y={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},v=function(t){var e,n=f(f({},y),t),a=n.cx,c=n.cy,s=n.innerRadius,p=n.outerRadius,v=n.cornerRadius,m=n.forceCornerRadius,g=n.cornerIsExternal,b=n.startAngle,x=n.endAngle,O=n.className;if(p0&&360>Math.abs(b-x)?d({cx:a,cy:c,innerRadius:s,outerRadius:p,cornerRadius:Math.min(S,j/2),forceCornerRadius:m,cornerIsExternal:g,startAngle:b,endAngle:x}):h({cx:a,cy:c,innerRadius:s,outerRadius:p,startAngle:b,endAngle:x}),r.createElement("path",l({},(0,i.L6)(n,!0),{className:w,d:e,role:"img"}))}},14870:function(t,e,n){"use strict";n.d(e,{v:function(){return N}});var r=n(2265),o=n(75551),i=n.n(o);let a=Math.cos,u=Math.sin,c=Math.sqrt,l=Math.PI,s=2*l;var f={draw(t,e){let n=c(e/l);t.moveTo(n,0),t.arc(0,0,n,0,s)}};let p=c(1/3),h=2*p,d=u(l/10)/u(7*l/10),y=u(s/10)*d,v=-a(s/10)*d,m=c(3),g=c(3)/2,b=1/c(12),x=(b/2+1)*3;var O=n(76115),w=n(67790);c(3),c(3);var j=n(61994),S=n(82944);function E(t){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var k=["type","size","sizeType"];function P(){return(P=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,k)),{},{type:o,size:u,sizeType:l}),p=s.className,h=s.cx,d=s.cy,y=(0,S.L6)(s,!0);return h===+h&&d===+d&&u===+u?r.createElement("path",P({},y,{className:(0,j.Z)("recharts-symbols",p),transform:"translate(".concat(h,", ").concat(d,")"),d:(e=_["symbol".concat(i()(o))]||f,(function(t,e){let n=null,r=(0,w.d)(o);function o(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return t="function"==typeof t?t:(0,O.Z)(t||f),e="function"==typeof e?e:(0,O.Z)(void 0===e?64:+e),o.type=function(e){return arguments.length?(t="function"==typeof e?e:(0,O.Z)(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:(0,O.Z)(+t),o):e},o.context=function(t){return arguments.length?(n=null==t?null:t,o):n},o})().type(e).size(C(u,l,o))())})):null};N.registerSymbol=function(t,e){_["symbol".concat(i()(t))]=e}},11638:function(t,e,n){"use strict";n.d(e,{bn:function(){return C},a3:function(){return z},lT:function(){return N},V$:function(){return D},w7:function(){return I}});var r=n(2265),o=n(86757),i=n.n(o),a=n(90231),u=n.n(a),c=n(24342),l=n.n(c),s=n(21652),f=n.n(s),p=n(73649),h=n(61994),d=n(59221),y=n(82944);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(){return(m=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:p,x:c,y:l},to:{upperWidth:s,lowerWidth:f,height:p,x:c,y:l},duration:j,animationEasing:b,isActive:E},function(t){var e=t.upperWidth,i=t.lowerWidth,u=t.height,c=t.x,l=t.y;return r.createElement(d.ZP,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:j,easing:b},r.createElement("path",m({},(0,y.L6)(n,!0),{className:k,d:O(c,l,e,i,u),ref:o})))}):r.createElement("g",null,r.createElement("path",m({},(0,y.L6)(n,!0),{className:k,d:O(c,l,s,f,p)})))},S=n(60474),E=n(9841),k=n(14870),P=["option","shapeType","propTransformer","activeClassName","isActive"];function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,P);if((0,r.isValidElement)(n))e=(0,r.cloneElement)(n,_(_({},f),(0,r.isValidElement)(n)?n.props:n));else if(i()(n))e=n(f);else if(u()(n)&&!l()(n)){var p=(void 0===a?function(t,e){return _(_({},e),t)}:a)(n,f);e=r.createElement(T,{shapeType:o,elementProps:p})}else e=r.createElement(T,{shapeType:o,elementProps:f});return s?r.createElement(E.m,{className:void 0===c?"recharts-active-shape":c},e):e}function N(t,e){return null!=e&&"trapezoids"in t.props}function D(t,e){return null!=e&&"sectors"in t.props}function I(t,e){return null!=e&&"points"in t.props}function L(t,e){var n,r,o=t.x===(null==e||null===(n=e.labelViewBox)||void 0===n?void 0:n.x)||t.x===e.x,i=t.y===(null==e||null===(r=e.labelViewBox)||void 0===r?void 0:r.y)||t.y===e.y;return o&&i}function B(t,e){var n=t.endAngle===e.endAngle,r=t.startAngle===e.startAngle;return n&&r}function R(t,e){var n=t.x===e.x,r=t.y===e.y,o=t.z===e.z;return n&&r&&o}function z(t){var e,n,r,o=t.activeTooltipItem,i=t.graphicalItem,a=t.itemData,u=(N(i,o)?e="trapezoids":D(i,o)?e="sectors":I(i,o)&&(e="points"),e),c=N(i,o)?null===(n=o.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:D(i,o)?null===(r=o.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:I(i,o)?o.payload:{},l=a.filter(function(t,e){var n=f()(c,t),r=i.props[u].filter(function(t){var e;return(N(i,o)?e=L:D(i,o)?e=B:I(i,o)&&(e=R),e)(t,o)}),a=i.props[u].indexOf(r[r.length-1]);return n&&e===a});return a.indexOf(l[l.length-1])}},25311:function(t,e,n){"use strict";n.d(e,{Ky:function(){return O},O1:function(){return g},_b:function(){return b},t9:function(){return m},xE:function(){return w}});var r=n(41443),o=n.n(r),i=n(32242),a=n.n(i),u=n(85355),c=n(82944),l=n(16630),s=n(31699);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){for(var n=0;n0&&(A=Math.min((t||0)-(M[e-1]||0),A))});var _=A/P,T="vertical"===b.layout?n.height:n.width;if("gap"===b.padding&&(c=_*T/2),"no-gap"===b.padding){var C=(0,l.h1)(t.barCategoryGap,_*T),N=_*T/2;c=N-C-(N-C)/T*C}}s="xAxis"===r?[n.left+(j.left||0)+(c||0),n.left+n.width-(j.right||0)-(c||0)]:"yAxis"===r?"horizontal"===f?[n.top+n.height-(j.bottom||0),n.top+(j.top||0)]:[n.top+(j.top||0)+(c||0),n.top+n.height-(j.bottom||0)-(c||0)]:b.range,E&&(s=[s[1],s[0]]);var D=(0,u.Hq)(b,o,m),I=D.scale,L=D.realScaleType;I.domain(O).range(s),(0,u.zF)(I);var B=(0,u.g$)(I,d(d({},b),{},{realScaleType:L}));"xAxis"===r?(g="top"===x&&!S||"bottom"===x&&S,p=n.left,h=v[k]-g*b.height):"yAxis"===r&&(g="left"===x&&!S||"right"===x&&S,p=v[k]-g*b.width,h=n.top);var R=d(d(d({},b),B),{},{realScaleType:L,x:p,y:h,scale:I,width:"xAxis"===r?n.width:b.width,height:"yAxis"===r?n.height:b.height});return R.bandSize=(0,u.zT)(R,B),b.hide||"xAxis"!==r?b.hide||(v[k]+=(g?-1:1)*R.width):v[k]+=(g?-1:1)*R.height,d(d({},i),{},y({},a,R))},{})},g=function(t,e){var n=t.x,r=t.y,o=e.x,i=e.y;return{x:Math.min(n,o),y:Math.min(r,i),width:Math.abs(o-n),height:Math.abs(i-r)}},b=function(t){return g({x:t.x1,y:t.y1},{x:t.x2,y:t.y2})},x=function(){var t,e;function n(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,n),this.scale=t}return t=[{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(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.bandAware,r=e.position;if(void 0!==t){if(r)switch(r){case"start":default:return this.scale(t);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+o;case"end":var i=this.bandwidth?this.bandwidth():0;return this.scale(t)+i}if(n){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+a}return this.scale(t)}}},{key:"isInRange",value:function(t){var e=this.range(),n=e[0],r=e[e.length-1];return n<=r?t>=n&&t<=r:t>=r&&t<=n}}],e=[{key:"create",value:function(t){return new n(t)}}],t&&p(n.prototype,t),e&&p(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}();y(x,"EPS",1e-4);var O=function(t){var e=Object.keys(t).reduce(function(e,n){return d(d({},e),{},y({},n,x.create(t[n])))},{});return d(d({},e),{},{apply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.bandAware,i=n.position;return o()(t,function(t,n){return e[n].apply(t,{bandAware:r,position:i})})},isInRange:function(t){return a()(t,function(t,n){return e[n].isInRange(t)})}})},w=function(t){var e=t.width,n=t.height,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(r%180+180)%180*Math.PI/180,i=Math.atan(n/e);return Math.abs(o>i&&otx(e,t()).base(e.base()),tj.o.apply(e,arguments),e}},scaleOrdinal:function(){return tY.Z},scalePoint:function(){return f.x},scalePow:function(){return tQ},scaleQuantile:function(){return function t(){var e,n=[],r=[],o=[];function i(){var t=0,e=Math.max(1,r.length);for(o=Array(e-1);++t=1)return+n(t[r-1],r-1,t);var r,o=(r-1)*e,i=Math.floor(o),a=+n(t[i],i,t);return a+(+n(t[i+1],i+1,t)-a)*(o-i)}}(n,t/e);return a}function a(t){return null==t||isNaN(t=+t)?e:r[E(o,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?o[e-1]:n[0],e=o?[i[o-1],r]:[i[e-1],i[e]]},u.unknown=function(t){return arguments.length&&(e=t),u},u.thresholds=function(){return i.slice()},u.copy=function(){return t().domain([n,r]).range(a).unknown(e)},tj.o.apply(tI(u),arguments)}},scaleRadial:function(){return function t(){var e,n=tw(),r=[0,1],o=!1;function i(t){var r,i=Math.sign(r=n(t))*Math.sqrt(Math.abs(r));return isNaN(i)?e:o?Math.round(i):i}return i.invert=function(t){return n.invert(t1(t))},i.domain=function(t){return arguments.length?(n.domain(t),i):n.domain()},i.range=function(t){return arguments.length?(n.range((r=Array.from(t,td)).map(t1)),i):r.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(o=!!t,i):o},i.clamp=function(t){return arguments.length?(n.clamp(t),i):n.clamp()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t(n.domain(),r).round(o).clamp(n.clamp()).unknown(e)},tj.o.apply(i,arguments),tI(i)}},scaleSequential:function(){return function t(){var e=tI(nY()(tv));return e.copy=function(){return nH(e,t())},tj.O.apply(e,arguments)}},scaleSequentialLog:function(){return function t(){var e=tZ(nY()).domain([1,10]);return e.copy=function(){return nH(e,t()).base(e.base())},tj.O.apply(e,arguments)}},scaleSequentialPow:function(){return nV},scaleSequentialQuantile:function(){return function t(){var e=[],n=tv;function r(t){if(null!=t&&!isNaN(t=+t))return n((E(e,t,1)-1)/(e.length-1))}return r.domain=function(t){if(!arguments.length)return e.slice();for(let n of(e=[],t))null==n||isNaN(n=+n)||e.push(n);return e.sort(b),r},r.interpolator=function(t){return arguments.length?(n=t,r):n},r.range=function(){return e.map((t,r)=>n(r/(e.length-1)))},r.quantiles=function(t){return Array.from({length:t+1},(n,r)=>(function(t,e,n){if(!(!(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,void 0))).length)||isNaN(e=+e))){if(e<=0||r<2)return t5(t);if(e>=1)return t2(t);var r,o=(r-1)*e,i=Math.floor(o),a=t2((function t(e,n,r=0,o=1/0,i){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),o=Math.floor(Math.min(e.length-1,o)),!(r<=n&&n<=o))return e;for(i=void 0===i?t6:function(t=b){if(t===b)return t6;if("function"!=typeof t)throw TypeError("compare is not a function");return(e,n)=>{let r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}(i);o>r;){if(o-r>600){let a=o-r+1,u=n-r+1,c=Math.log(a),l=.5*Math.exp(2*c/3),s=.5*Math.sqrt(c*l*(a-l)/a)*(u-a/2<0?-1:1),f=Math.max(r,Math.floor(n-u*l/a+s)),p=Math.min(o,Math.floor(n+(a-u)*l/a+s));t(e,n,f,p,i)}let a=e[n],u=r,c=o;for(t3(e,r,n),i(e[o],a)>0&&t3(e,r,o);ui(e[u],a);)++u;for(;i(e[c],a)>0;)--c}0===i(e[r],a)?t3(e,r,c):t3(e,++c,o),c<=n&&(r=c+1),n<=c&&(o=c-1)}return e})(t,i).subarray(0,i+1));return a+(t5(t.subarray(i+1))-a)*(o-i)}})(e,r/t))},r.copy=function(){return t(n).domain(e)},tj.O.apply(r,arguments)}},scaleSequentialSqrt:function(){return nK},scaleSequentialSymlog:function(){return function t(){var e=tX(nY());return e.copy=function(){return nH(e,t()).constant(e.constant())},tj.O.apply(e,arguments)}},scaleSqrt:function(){return t0},scaleSymlog:function(){return function t(){var e=tX(tO());return e.copy=function(){return tx(e,t()).constant(e.constant())},tj.o.apply(e,arguments)}},scaleThreshold:function(){return function t(){var e,n=[.5],r=[0,1],o=1;function i(t){return null!=t&&t<=t?r[E(n,t,0,o)]:e}return i.domain=function(t){return arguments.length?(o=Math.min((n=Array.from(t)).length,r.length-1),i):n.slice()},i.range=function(t){return arguments.length?(r=Array.from(t),o=Math.min(n.length,r.length-1),i):r.slice()},i.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t().domain(n).range(r).unknown(e)},tj.o.apply(i,arguments)}},scaleTime:function(){return nG},scaleUtc:function(){return nX},tickFormat:function(){return tD}});var f=n(55284);let p=Math.sqrt(50),h=Math.sqrt(10),d=Math.sqrt(2);function y(t,e,n){let r,o,i;let a=(e-t)/Math.max(0,n),u=Math.floor(Math.log10(a)),c=a/Math.pow(10,u),l=c>=p?10:c>=h?5:c>=d?2:1;return(u<0?(r=Math.round(t*(i=Math.pow(10,-u)/l)),o=Math.round(e*i),r/ie&&--o,i=-i):(r=Math.round(t/(i=Math.pow(10,u)*l)),o=Math.round(e/i),r*ie&&--o),o0))return[];if(t===e)return[t];let r=e=o))return[];let u=i-o+1,c=Array(u);if(r){if(a<0)for(let t=0;te?1:t>=e?0:NaN}function x(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function O(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o>>1;0>n(t[e],r)?o=e+1:i=e}while(ob(t(e),n),r=(e,n)=>t(e)-n):(e=t===b||t===x?t:w,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){let a=o(t,e,n,i-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,o=0,i=t.length){if(o>>1;0>=n(t[e],r)?o=e+1:i=e}while(o>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Z(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Z(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=N.exec(t))?new G(e[1],e[2],e[3],1):(e=D.exec(t))?new G(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=I.exec(t))?Z(e[1],e[2],e[3],e[4]):(e=L.exec(t))?Z(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=B.exec(t))?J(e[1],e[2]/100,e[3]/100,1):(e=R.exec(t))?J(e[1],e[2]/100,e[3]/100,e[4]):z.hasOwnProperty(t)?q(z[t]):"transparent"===t?new G(NaN,NaN,NaN,0):null}function q(t){return new G(t>>16&255,t>>8&255,255&t,1)}function Z(t,e,n,r){return r<=0&&(t=e=n=NaN),new G(t,e,n,r)}function W(t,e,n,r){var o;return 1==arguments.length?((o=t)instanceof A||(o=$(o)),o)?new G((o=o.rgb()).r,o.g,o.b,o.opacity):new G:new G(t,e,n,null==r?1:r)}function G(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function X(){return`#${K(this.r)}${K(this.g)}${K(this.b)}`}function Y(){let t=H(this.opacity);return`${1===t?"rgb(":"rgba("}${V(this.r)}, ${V(this.g)}, ${V(this.b)}${1===t?")":`, ${t})`}`}function H(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function V(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function K(t){return((t=V(t))<16?"0":"")+t.toString(16)}function J(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new tt(t,e,n,r)}function Q(t){if(t instanceof tt)return new tt(t.h,t.s,t.l,t.opacity);if(t instanceof A||(t=$(t)),!t)return new tt;if(t instanceof tt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,u=i-o,c=(i+o)/2;return u?(a=e===i?(n-r)/u+(n0&&c<1?0:a,new tt(a,u,c,t.opacity)}function tt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function te(t){return(t=(t||0)%360)<0?t+360:t}function tn(t){return Math.max(0,Math.min(1,t||0))}function tr(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function to(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}k(A,$,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:U,formatHex:U,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Q(this).formatHsl()},formatRgb:F,toString:F}),k(G,W,P(A,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new G(V(this.r),V(this.g),V(this.b),H(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:X,formatHex:X,formatHex8:function(){return`#${K(this.r)}${K(this.g)}${K(this.b)}${K((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:Y,toString:Y})),k(tt,function(t,e,n,r){return 1==arguments.length?Q(t):new tt(t,e,n,null==r?1:r)},P(A,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new tt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new tt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new G(tr(t>=240?t-240:t+120,o,r),tr(t,o,r),tr(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new tt(te(this.h),tn(this.s),tn(this.l),H(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(){let t=H(this.opacity);return`${1===t?"hsl(":"hsla("}${te(this.h)}, ${100*tn(this.s)}%, ${100*tn(this.l)}%${1===t?")":`, ${t})`}`}}));var ti=t=>()=>t;function ta(t,e){var n=e-t;return n?function(e){return t+e*n}:ti(isNaN(t)?e:t)}var tu=function t(e){var n,r=1==(n=+(n=e))?ta:function(t,e){var r,o,i;return e-t?(r=t,o=e,r=Math.pow(r,i=n),o=Math.pow(o,i)-r,i=1/i,function(t){return Math.pow(r+t*o,i)}):ti(isNaN(t)?e:t)};function o(t,e){var n=r((t=W(t)).r,(e=W(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=ta(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return o.gamma=t,o}(1);function tc(t){return function(e){var n,r,o=e.length,i=Array(o),a=Array(o),u=Array(o);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,u=ru&&(a=e.slice(u,a),l[c]?l[c]+=a:l[++c]=a),(o=o[0])===(i=i[0])?l[c]?l[c]+=i:l[++c]=i:(l[++c]=null,s.push({i:c,x:tl(o,i)})),u=tf.lastIndex;return ue&&(n=t,t=e,e=n),l=function(n){return Math.max(t,Math.min(e,n))}),r=c>2?tb:tg,o=i=null,f}function f(e){return null==e||isNaN(e=+e)?n:(o||(o=r(a.map(t),u,c)))(t(l(e)))}return f.invert=function(n){return l(e((i||(i=r(u,a.map(t),tl)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,td),s()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),s()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),c=th,s()},f.clamp=function(t){return arguments.length?(l=!!t||tv,s()):l!==tv},f.interpolate=function(t){return arguments.length?(c=t,s()):c},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,s()}}function tw(){return tO()(tv,tv)}var tj=n(89999),tS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tE(t){var e;if(!(e=tS.exec(t)))throw Error("invalid format: "+t);return new tk({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function tk(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function tP(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function tA(t){return(t=tP(Math.abs(t)))?t[1]:NaN}function tM(t,e){var n=tP(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+Array(o-r.length+2).join("0")}tE.prototype=tk.prototype,tk.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var t_={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>tM(100*t,e),r:tM,s:function(t,e){var n=tP(t,e);if(!n)return t+"";var o=n[0],i=n[1],a=i-(r=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=o.length;return a===u?o:a>u?o+Array(a-u+1).join("0"):a>0?o.slice(0,a)+"."+o.slice(a):"0."+Array(1-a).join("0")+tP(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function tT(t){return t}var tC=Array.prototype.map,tN=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function tD(t,e,n,r){var o,u,c=g(t,e,n);switch((r=tE(null==r?",f":r)).type){case"s":var l=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(u=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(tA(l)/3)))-tA(Math.abs(c))))||(r.precision=u),a(r,l);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(u=Math.max(0,tA(Math.abs(Math.max(Math.abs(t),Math.abs(e)))-(o=Math.abs(o=c)))-tA(o))+1)||(r.precision=u-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(u=Math.max(0,-tA(Math.abs(c))))||(r.precision=u-("%"===r.type)*2)}return i(r)}function tI(t){var e=t.domain;return t.ticks=function(t){var n=e();return v(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return tD(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,o,i=e(),a=0,u=i.length-1,c=i[a],l=i[u],s=10;for(l0;){if((o=m(c,l,n))===r)return i[a]=c,i[u]=l,e(i);if(o>0)c=Math.floor(c/o)*o,l=Math.ceil(l/o)*o;else if(o<0)c=Math.ceil(c*o)/o,l=Math.floor(l*o)/o;else break;r=o}return t},t}function tL(){var t=tw();return t.copy=function(){return tx(t,tL())},tj.o.apply(t,arguments),tI(t)}function tB(t,e){t=t.slice();var n,r=0,o=t.length-1,i=t[r],a=t[o];return a-t(-e,n)}function tZ(t){let e,n;let r=t(tR,tz),o=r.domain,a=10;function u(){var i,u;return e=(i=a)===Math.E?Math.log:10===i&&Math.log10||2===i&&Math.log2||(i=Math.log(i),t=>Math.log(t)/i),n=10===(u=a)?t$:u===Math.E?Math.exp:t=>Math.pow(u,t),o()[0]<0?(e=tq(e),n=tq(n),t(tU,tF)):t(tR,tz),r}return r.base=function(t){return arguments.length?(a=+t,u()):a},r.domain=function(t){return arguments.length?(o(t),u()):o()},r.ticks=t=>{let r,i;let u=o(),c=u[0],l=u[u.length-1],s=l0){for(;f<=p;++f)for(r=1;rl)break;d.push(i)}}else for(;f<=p;++f)for(r=a-1;r>=1;--r)if(!((i=f>0?r/n(-f):r*n(f))l)break;d.push(i)}2*d.length{if(null==t&&(t=10),null==o&&(o=10===a?"s":","),"function"!=typeof o&&(a%1||null!=(o=tE(o)).precision||(o.trim=!0),o=i(o)),t===1/0)return o;let u=Math.max(1,a*t/r.ticks().length);return t=>{let r=t/n(Math.round(e(t)));return r*ao(tB(o(),{floor:t=>n(Math.floor(e(t))),ceil:t=>n(Math.ceil(e(t)))})),r}function tW(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function tG(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function tX(t){var e=1,n=t(tW(1),tG(e));return n.constant=function(n){return arguments.length?t(tW(e=+n),tG(e)):e},tI(n)}i=(o=function(t){var e,n,o,i=void 0===t.grouping||void 0===t.thousands?tT:(e=tC.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var o=t.length,i=[],a=0,u=e[0],c=0;o>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),i.push(t.substring(o-=u,o+u)),!((c+=u+1)>r));)u=e[a=(a+1)%e.length];return i.reverse().join(n)}),a=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",c=void 0===t.decimal?".":t.decimal+"",l=void 0===t.numerals?tT:(o=tC.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return o[+t]})}),s=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"−":t.minus+"",p=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=tE(t)).fill,n=t.align,o=t.sign,h=t.symbol,d=t.zero,y=t.width,v=t.comma,m=t.precision,g=t.trim,b=t.type;"n"===b?(v=!0,b="g"):t_[b]||(void 0===m&&(m=12),g=!0,b="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var x="$"===h?a:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",O="$"===h?u:/[%p]/.test(b)?s:"",w=t_[b],j=/[defgprs%]/.test(b);function S(t){var a,u,s,h=x,S=O;if("c"===b)S=w(t)+S,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?p:w(Math.abs(t),m),g&&(t=function(t){e:for(var e,n=t.length,r=1,o=-1;r0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==o&&(E=!1),h=(E?"("===o?o:f:"-"===o||"("===o?"":o)+h,S=("s"===b?tN[8+r/3]:"")+S+(E&&"("===o?")":""),j){for(a=-1,u=t.length;++a(s=t.charCodeAt(a))||s>57){S=(46===s?c+t.slice(a+1):t.slice(a))+S,t=t.slice(0,a);break}}}v&&!d&&(t=i(t,1/0));var k=h.length+t.length+S.length,P=k>1)+h+t+S+P.slice(k);break;default:t=P+h+t+S}return l(t)}return m=void 0===m?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),S.toString=function(){return t+""},S}return{format:h,formatPrefix:function(t,e){var n=h(((t=tE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(tA(e)/3))),o=Math.pow(10,-r),i=tN[8+r/3];return function(t){return n(o*t)+i}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,a=o.formatPrefix;var tY=n(36967);function tH(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function tV(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function tK(t){return t<0?-t*t:t*t}function tJ(t){var e=t(tv,tv),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(tv,tv):.5===n?t(tV,tK):t(tH(n),tH(1/n)):n},tI(e)}function tQ(){var t=tJ(tO());return t.copy=function(){return tx(t,tQ()).exponent(t.exponent())},tj.o.apply(t,arguments),t}function t0(){return tQ.apply(null,arguments).exponent(.5)}function t1(t){return Math.sign(t)*t*t}function t2(t,e){let n;if(void 0===e)for(let e of t)null!=e&&(n=e)&&(n=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(n=o)&&(n=o)}return n}function t5(t,e){let n;if(void 0===e)for(let e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function t6(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function t3(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}let t7=new Date,t4=new Date;function t8(t,e,n,r){function o(e){return t(e=0==arguments.length?new Date:new Date(+e)),e}return o.floor=e=>(t(e=new Date(+e)),e),o.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),o.round=t=>{let e=o(t),n=o.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),o.range=(n,r,i)=>{let a;let u=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n0))return u;do u.push(a=new Date(+n)),e(n,i),t(n);while(at8(e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},(t,r)=>{if(t>=t){if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}}),n&&(o.count=(e,r)=>(t7.setTime(+e),t4.setTime(+r),t(t7),t(t4),Math.floor(n(t7,t4))),o.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?o.filter(r?e=>r(e)%t==0:e=>o.count(0,e)%t==0):o:null),o}let t9=t8(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);t9.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?t8(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):t9:null,t9.range;let et=t8(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+1e3*e)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds());et.range;let ee=t8(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getMinutes());ee.range;let en=t8(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes());en.range;let er=t8(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getHours());er.range;let eo=t8(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours());eo.range;let ei=t8(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1);ei.range;let ea=t8(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1);ea.range;let eu=t8(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5));function ec(t){return t8(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+7*e)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}eu.range;let el=ec(0),es=ec(1),ef=ec(2),ep=ec(3),eh=ec(4),ed=ec(5),ey=ec(6);function ev(t){return t8(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)},(t,e)=>(e-t)/6048e5)}el.range,es.range,ef.range,ep.range,eh.range,ed.range,ey.range;let em=ev(0),eg=ev(1),eb=ev(2),ex=ev(3),eO=ev(4),ew=ev(5),ej=ev(6);em.range,eg.range,eb.range,ex.range,eO.range,ew.range,ej.range;let eS=t8(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());eS.range;let eE=t8(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());eE.range;let ek=t8(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ek.every=t=>isFinite(t=Math.floor(t))&&t>0?t8(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)}):null,ek.range;let eP=t8(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function eA(t,e,n,r,o,i){let a=[[et,1,1e3],[et,5,5e3],[et,15,15e3],[et,30,3e4],[i,1,6e4],[i,5,3e5],[i,15,9e5],[i,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function u(e,n,r){let o=Math.abs(n-e)/r,i=O(([,,t])=>t).right(a,o);if(i===a.length)return t.every(g(e/31536e6,n/31536e6,r));if(0===i)return t9.every(Math.max(g(e,n,r),1));let[u,c]=a[o/a[i-1][2]isFinite(t=Math.floor(t))&&t>0?t8(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null,eP.range;let[eM,e_]=eA(eP,eE,em,eu,eo,en),[eT,eC]=eA(ek,eS,el,ei,er,ee);function eN(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function eD(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function eI(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var eL={"-":"",_:" ",0:"0"},eB=/^\s*\d+/,eR=/^%/,ez=/[\\^$*+?|[\]().{}]/g;function eU(t,e,n){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i[t.toLowerCase(),e]))}function eZ(t,e,n){var r=eB.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function eW(t,e,n){var r=eB.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function eG(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function eX(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function eY(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function eH(t,e,n){var r=eB.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function eV(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function eK(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function eJ(t,e,n){var r=eB.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function eQ(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function e0(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function e1(t,e,n){var r=eB.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function e2(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function e5(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function e6(t,e,n){var r=eB.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function e3(t,e,n){var r=eB.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function e7(t,e,n){var r=eB.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function e4(t,e,n){var r=eR.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function e8(t,e,n){var r=eB.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function e9(t,e,n){var r=eB.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function nt(t,e){return eU(t.getDate(),e,2)}function ne(t,e){return eU(t.getHours(),e,2)}function nn(t,e){return eU(t.getHours()%12||12,e,2)}function nr(t,e){return eU(1+ei.count(ek(t),t),e,3)}function no(t,e){return eU(t.getMilliseconds(),e,3)}function ni(t,e){return no(t,e)+"000"}function na(t,e){return eU(t.getMonth()+1,e,2)}function nu(t,e){return eU(t.getMinutes(),e,2)}function nc(t,e){return eU(t.getSeconds(),e,2)}function nl(t){var e=t.getDay();return 0===e?7:e}function ns(t,e){return eU(el.count(ek(t)-1,t),e,2)}function nf(t){var e=t.getDay();return e>=4||0===e?eh(t):eh.ceil(t)}function np(t,e){return t=nf(t),eU(eh.count(ek(t),t)+(4===ek(t).getDay()),e,2)}function nh(t){return t.getDay()}function nd(t,e){return eU(es.count(ek(t)-1,t),e,2)}function ny(t,e){return eU(t.getFullYear()%100,e,2)}function nv(t,e){return eU((t=nf(t)).getFullYear()%100,e,2)}function nm(t,e){return eU(t.getFullYear()%1e4,e,4)}function ng(t,e){var n=t.getDay();return eU((t=n>=4||0===n?eh(t):eh.ceil(t)).getFullYear()%1e4,e,4)}function nb(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+eU(e/60|0,"0",2)+eU(e%60,"0",2)}function nx(t,e){return eU(t.getUTCDate(),e,2)}function nO(t,e){return eU(t.getUTCHours(),e,2)}function nw(t,e){return eU(t.getUTCHours()%12||12,e,2)}function nj(t,e){return eU(1+ea.count(eP(t),t),e,3)}function nS(t,e){return eU(t.getUTCMilliseconds(),e,3)}function nE(t,e){return nS(t,e)+"000"}function nk(t,e){return eU(t.getUTCMonth()+1,e,2)}function nP(t,e){return eU(t.getUTCMinutes(),e,2)}function nA(t,e){return eU(t.getUTCSeconds(),e,2)}function nM(t){var e=t.getUTCDay();return 0===e?7:e}function n_(t,e){return eU(em.count(eP(t)-1,t),e,2)}function nT(t){var e=t.getUTCDay();return e>=4||0===e?eO(t):eO.ceil(t)}function nC(t,e){return t=nT(t),eU(eO.count(eP(t),t)+(4===eP(t).getUTCDay()),e,2)}function nN(t){return t.getUTCDay()}function nD(t,e){return eU(eg.count(eP(t)-1,t),e,2)}function nI(t,e){return eU(t.getUTCFullYear()%100,e,2)}function nL(t,e){return eU((t=nT(t)).getUTCFullYear()%100,e,2)}function nB(t,e){return eU(t.getUTCFullYear()%1e4,e,4)}function nR(t,e){var n=t.getUTCDay();return eU((t=n>=4||0===n?eO(t):eO.ceil(t)).getUTCFullYear()%1e4,e,4)}function nz(){return"+0000"}function nU(){return"%"}function nF(t){return+t}function n$(t){return Math.floor(+t/1e3)}function nq(t){return new Date(t)}function nZ(t){return t instanceof Date?+t:+new Date(+t)}function nW(t,e,n,r,o,i,a,u,c,l){var s=tw(),f=s.invert,p=s.domain,h=l(".%L"),d=l(":%S"),y=l("%I:%M"),v=l("%I %p"),m=l("%a %d"),g=l("%b %d"),b=l("%B"),x=l("%Y");function O(t){return(c(t)1)for(var n,r,o,i=1,a=t[e[0]],u=a.length;i=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:nF,s:n$,S:nc,u:nl,U:ns,V:np,w:nh,W:nd,x:null,X:null,y:ny,Y:nm,Z:nb,"%":nU},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:nx,e:nx,f:nE,g:nL,G:nR,H:nO,I:nw,j:nj,L:nS,m:nk,M:nP,p:function(t){return o[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:nF,s:n$,S:nA,u:nM,U:n_,V:nC,w:nN,W:nD,x:null,X:null,y:nI,Y:nB,Z:nz,"%":nU},O={a:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return S(t,e,n,r)},d:e0,e:e0,f:e7,g:eV,G:eH,H:e2,I:e2,j:e1,L:e3,m:eQ,M:e5,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=s.get(r[0].toLowerCase()),n+r[0].length):-1},q:eJ,Q:e8,s:e9,S:e6,u:eW,U:eG,V:eX,w:eZ,W:eY,x:function(t,e,r){return S(t,n,e,r)},X:function(t,e,n){return S(t,r,e,n)},y:eV,Y:eH,Z:eK,"%":e4};function w(t,e){return function(n){var r,o,i,a=[],u=-1,c=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in i||(i.w=1),"Z"in i?(r=(o=(r=eD(eI(i.y,0,1))).getUTCDay())>4||0===o?eg.ceil(r):eg(r),r=ea.offset(r,(i.V-1)*7),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(r=(o=(r=eN(eI(i.y,0,1))).getDay())>4||0===o?es.ceil(r):es(r),r=ei.offset(r,(i.V-1)*7),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?eD(eI(i.y,0,1)).getUTCDay():eN(eI(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,eD(i)):eN(i)}}function S(t,e,n,r){for(var o,i,a=0,u=e.length,c=n.length;a=c)return -1;if(37===(o=e.charCodeAt(a++))){if(!(i=O[(o=e.charAt(a++))in eL?e.charAt(a++):o])||(r=i(t,n,r))<0)return -1}else if(o!=n.charCodeAt(r++))return -1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=j(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=j(t+="",!0);return e.toString=function(){return t},e}}}({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"]})).format,u.parse,l=u.utcFormat,u.utcParse;var n2=n(22516),n5=n(76115);function n6(t){for(var e=t.length,n=Array(e);--e>=0;)n[e]=e;return n}function n3(t,e){return t[e]}function n7(t){let e=[];return e.key=t,e}var n4=n(95645),n8=n.n(n4),n9=n(99008),rt=n.n(n9),re=n(77571),rn=n.n(re),rr=n(86757),ro=n.n(rr),ri=n(42715),ra=n.n(ri),ru=n(13735),rc=n.n(ru),rl=n(11314),rs=n.n(rl),rf=n(82559),rp=n.n(rf),rh=n(75551),rd=n.n(rh),ry=n(21652),rv=n.n(ry),rm=n(34935),rg=n.n(rm),rb=n(61134),rx=n.n(rb);function rO(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=e?n.apply(void 0,o):t(e-a,rE(function(){for(var t=arguments.length,e=Array(t),r=0;rt.length)&&(e=t.length);for(var n=0,r=Array(e);nr&&(o=r,i=n),[o,i]}function rR(t,e,n){if(t.lte(0))return new(rx())(0);var r=rC.getDigitCount(t.toNumber()),o=new(rx())(10).pow(r),i=t.div(o),a=1!==r?.05:.1,u=new(rx())(Math.ceil(i.div(a).toNumber())).add(n).mul(a).mul(o);return e?u:new(rx())(Math.ceil(u))}function rz(t,e,n){var r=1,o=new(rx())(t);if(!o.isint()&&n){var i=Math.abs(t);i<1?(r=new(rx())(10).pow(rC.getDigitCount(t)-1),o=new(rx())(Math.floor(o.div(r).toNumber())).mul(r)):i>1&&(o=new(rx())(Math.floor(t)))}else 0===t?o=new(rx())(Math.floor((e-1)/2)):n||(o=new(rx())(Math.floor(t)));var a=Math.floor((e-1)/2);return rM(rA(function(t){return o.add(new(rx())(t-a).mul(r)).toNumber()}),rP)(0,e)}var rU=rT(function(t){var e=rD(t,2),n=e[0],r=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),u=rD(rB([n,r]),2),c=u[0],l=u[1];if(c===-1/0||l===1/0){var s=l===1/0?[c].concat(rN(rP(0,o-1).map(function(){return 1/0}))):[].concat(rN(rP(0,o-1).map(function(){return-1/0})),[l]);return n>r?r_(s):s}if(c===l)return rz(c,o,i);var f=function t(e,n,r,o){var i,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((n-e)/(r-1)))return{step:new(rx())(0),tickMin:new(rx())(0),tickMax:new(rx())(0)};var u=rR(new(rx())(n).sub(e).div(r-1),o,a),c=Math.ceil((i=e<=0&&n>=0?new(rx())(0):(i=new(rx())(e).add(n).div(2)).sub(new(rx())(i).mod(u))).sub(e).div(u).toNumber()),l=Math.ceil(new(rx())(n).sub(i).div(u).toNumber()),s=c+l+1;return s>r?t(e,n,r,o,a+1):(s0?l+(r-s):l,c=n>0?c:c+(r-s)),{step:u,tickMin:i.sub(new(rx())(c).mul(u)),tickMax:i.add(new(rx())(l).mul(u))})}(c,l,a,i),p=f.step,h=f.tickMin,d=f.tickMax,y=rC.rangeStep(h,d.add(new(rx())(.1).mul(p)),p);return n>r?r_(y):y});rT(function(t){var e=rD(t,2),n=e[0],r=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),u=rD(rB([n,r]),2),c=u[0],l=u[1];if(c===-1/0||l===1/0)return[n,r];if(c===l)return rz(c,o,i);var s=rR(new(rx())(l).sub(c).div(a-1),i,0),f=rM(rA(function(t){return new(rx())(c).add(new(rx())(t).mul(s)).toNumber()}),rP)(0,a).filter(function(t){return t>=c&&t<=l});return n>r?r_(f):f});var rF=rT(function(t,e){var n=rD(t,2),r=n[0],o=n[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=rD(rB([r,o]),2),u=a[0],c=a[1];if(u===-1/0||c===1/0)return[r,o];if(u===c)return[u];var l=rR(new(rx())(c).sub(u).div(Math.max(e,2)-1),i,0),s=[].concat(rN(rC.rangeStep(new(rx())(u),new(rx())(c).sub(new(rx())(.99).mul(l)),l)),[c]);return r>o?r_(s):s}),r$=n(13137),rq=n(16630),rZ=n(82944),rW=n(38569);function rG(t){return(rG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function rY(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=-1,a=null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0;if(a<=1)return 0;if(o&&"angleAxis"===o.axisType&&1e-6>=Math.abs(Math.abs(o.range[1]-o.range[0])-360))for(var u=o.range,c=0;c0?r[c-1].coordinate:r[a-1].coordinate,s=r[c].coordinate,f=c>=a-1?r[0].coordinate:r[c+1].coordinate,p=void 0;if((0,rq.uY)(s-l)!==(0,rq.uY)(f-s)){var h=[];if((0,rq.uY)(f-s)===(0,rq.uY)(u[1]-u[0])){p=f;var d=s+u[1]-u[0];h[0]=Math.min(d,(d+l)/2),h[1]=Math.max(d,(d+l)/2)}else{p=l;var y=f+u[1]-u[0];h[0]=Math.min(s,(y+s)/2),h[1]=Math.max(s,(y+s)/2)}var v=[Math.min(s,(p+s)/2),Math.max(s,(p+s)/2)];if(t>v[0]&&t<=v[1]||t>=h[0]&&t<=h[1]){i=r[c].index;break}}else{var m=Math.min(l,f),g=Math.max(l,f);if(t>(m+s)/2&&t<=(g+s)/2){i=r[c].index;break}}}else for(var b=0;b0&&b(n[b].coordinate+n[b-1].coordinate)/2&&t<=(n[b].coordinate+n[b+1].coordinate)/2||b===a-1&&t>(n[b].coordinate+n[b-1].coordinate)/2){i=n[b].index;break}return i},r1=function(t){var e,n=t.type.displayName,r=t.props,o=r.stroke,i=r.fill;switch(n){case"Line":e=o;break;case"Area":case"Radar":e=o&&"none"!==o?o:i;break;default:e=i}return e},r2=function(t){var e=t.barSize,n=t.stackGroups,r=void 0===n?{}:n;if(!r)return{};for(var o={},i=Object.keys(r),a=0,u=i.length;a=0});if(y&&y.length){var v=y[0].props.barSize,m=y[0].props[d];o[m]||(o[m]=[]),o[m].push({item:y[0],stackList:y.slice(1),barSize:rn()(v)?e:v})}}return o},r5=function(t){var e,n=t.barGap,r=t.barCategoryGap,o=t.bandSize,i=t.sizeList,a=void 0===i?[]:i,u=t.maxBarSize,c=a.length;if(c<1)return null;var l=(0,rq.h1)(n,o,0,!0),s=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=o/c,h=a.reduce(function(t,e){return t+e.barSize||0},0);(h+=(c-1)*l)>=o&&(h-=(c-1)*l,l=0),h>=o&&p>0&&(f=!0,p*=.9,h=c*p);var d={offset:((o-h)/2>>0)-l,size:0};e=a.reduce(function(t,e){var n={item:e.item,position:{offset:d.offset+d.size+l,size:f?p:e.barSize}},r=[].concat(rV(t),[n]);return d=r[r.length-1].position,e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){r.push({item:t,position:d})}),r},s)}else{var y=(0,rq.h1)(r,o,0,!0);o-2*y-(c-1)*l<=0&&(l=0);var v=(o-2*y-(c-1)*l)/c;v>1&&(v>>=0);var m=u===+u?Math.min(v,u):v;e=a.reduce(function(t,e,n){var r=[].concat(rV(t),[{item:e.item,position:{offset:y+(v+l)*n+(v-m)/2,size:m}}]);return e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){r.push({item:t,position:r[r.length-1].position})}),r},s)}return e},r6=function(t,e,n,r){var o=n.children,i=n.width,a=n.margin,u=i-(a.left||0)-(a.right||0),c=(0,rW.z)({children:o,legendWidth:u});if(c){var l=r||{},s=l.width,f=l.height,p=c.align,h=c.verticalAlign,d=c.layout;if(("vertical"===d||"horizontal"===d&&"middle"===h)&&"center"!==p&&(0,rq.hj)(t[p]))return rY(rY({},t),{},rH({},p,t[p]+(s||0)));if(("horizontal"===d||"vertical"===d&&"center"===p)&&"middle"!==h&&(0,rq.hj)(t[h]))return rY(rY({},t),{},rH({},h,t[h]+(f||0)))}return t},r3=function(t,e,n,r,o){var i=e.props.children,a=(0,rZ.NN)(i,r$.W).filter(function(t){var e;return e=t.props.direction,!!rn()(o)||("horizontal"===r?"yAxis"===o:"vertical"===r||"x"===e?"xAxis"===o:"y"!==e||"yAxis"===o)});if(a&&a.length){var u=a.map(function(t){return t.props.dataKey});return t.reduce(function(t,e){var r=rJ(e,n,0),o=Array.isArray(r)?[rt()(r),n8()(r)]:[r,r],i=u.reduce(function(t,n){var r=rJ(e,n,0),i=o[0]-Math.abs(Array.isArray(r)?r[0]:r),a=o[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(i,t[0]),Math.max(a,t[1])]},[1/0,-1/0]);return[Math.min(i[0],t[0]),Math.max(i[1],t[1])]},[1/0,-1/0])}return null},r7=function(t,e,n,r,o){var i=e.map(function(e){return r3(t,e,n,o,r)}).filter(function(t){return!rn()(t)});return i&&i.length?i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]):null},r4=function(t,e,n,r,o){var i=e.map(function(e){var i=e.props.dataKey;return"number"===n&&i&&r3(t,e,i,r)||rQ(t,i,n,o)});if("number"===n)return i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]);var a={};return i.reduce(function(t,e){for(var n=0,r=e.length;n=2?2*(0,rq.uY)(a[0]-a[1])*c:c,e&&(t.ticks||t.niceTicks))?(t.ticks||t.niceTicks).map(function(t){return{coordinate:r(o?o.indexOf(t):t)+c,value:t,offset:c}}).filter(function(t){return!rp()(t.coordinate)}):t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(t,e){return{coordinate:r(t)+c,value:t,index:e,offset:c}}):r.ticks&&!n?r.ticks(t.tickCount).map(function(t){return{coordinate:r(t)+c,value:t,offset:c}}):r.domain().map(function(t,e){return{coordinate:r(t)+c,value:o?o[t]:t,index:e,offset:c}})},oe=new WeakMap,on=function(t,e){if("function"!=typeof e)return t;oe.has(t)||oe.set(t,new WeakMap);var n=oe.get(t);if(n.has(e))return n.get(e);var r=function(){t.apply(void 0,arguments),e.apply(void 0,arguments)};return n.set(e,r),r},or=function(t,e,n){var r=t.scale,o=t.type,i=t.layout,a=t.axisType;if("auto"===r)return"radial"===i&&"radiusAxis"===a?{scale:f.Z(),realScaleType:"band"}:"radial"===i&&"angleAxis"===a?{scale:tL(),realScaleType:"linear"}:"category"===o&&e&&(e.indexOf("LineChart")>=0||e.indexOf("AreaChart")>=0||e.indexOf("ComposedChart")>=0&&!n)?{scale:f.x(),realScaleType:"point"}:"category"===o?{scale:f.Z(),realScaleType:"band"}:{scale:tL(),realScaleType:"linear"};if(ra()(r)){var u="scale".concat(rd()(r));return{scale:(s[u]||f.x)(),realScaleType:s[u]?u:"point"}}return ro()(r)?{scale:r}:{scale:f.x(),realScaleType:"point"}},oo=function(t){var e=t.domain();if(e&&!(e.length<=2)){var n=e.length,r=t.range(),o=Math.min(r[0],r[1])-1e-4,i=Math.max(r[0],r[1])+1e-4,a=t(e[0]),u=t(e[n-1]);(ai||ui)&&t.domain([e[0],e[n-1]])}},oi=function(t,e){if(!t)return null;for(var n=0,r=t.length;nr)&&(o[1]=r),o[0]>r&&(o[0]=r),o[1]=0?(t[a][n][0]=o,t[a][n][1]=o+u,o=t[a][n][1]):(t[a][n][0]=i,t[a][n][1]=i+u,i=t[a][n][1])}},expand:function(t,e){if((r=t.length)>0){for(var n,r,o,i=0,a=t[0].length;i0){for(var n,r=0,o=t[e[0]],i=o.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,o,i=0,a=1;a=0?(t[i][n][0]=o,t[i][n][1]=o+a,o=t[i][n][1]):(t[i][n][0]=0,t[i][n][1]=0)}}},oc=function(t,e,n){var r=e.map(function(t){return t.props.dataKey}),o=ou[n];return(function(){var t=(0,n5.Z)([]),e=n6,n=n1,r=n3;function o(o){var i,a,u=Array.from(t.apply(this,arguments),n7),c=u.length,l=-1;for(let t of o)for(i=0,++l;i=0?0:o<0?o:r}return n[0]},od=function(t,e){var n=t.props.stackId;if((0,rq.P2)(n)){var r=e[n];if(r){var o=r.items.indexOf(t);return o>=0?r.stackedData[o]:null}}return null},oy=function(t,e,n){return Object.keys(t).reduce(function(r,o){var i=t[o].stackedData.reduce(function(t,r){var o=r.slice(e,n+1).reduce(function(t,e){return[rt()(e.concat([t[0]]).filter(rq.hj)),n8()(e.concat([t[1]]).filter(rq.hj))]},[1/0,-1/0]);return[Math.min(t[0],o[0]),Math.max(t[1],o[1])]},[1/0,-1/0]);return[Math.min(i[0],r[0]),Math.max(i[1],r[1])]},[1/0,-1/0]).map(function(t){return t===1/0||t===-1/0?0:t})},ov=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,om=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,og=function(t,e,n){if(ro()(t))return t(e,n);if(!Array.isArray(t))return e;var r=[];if((0,rq.hj)(t[0]))r[0]=n?t[0]:Math.min(t[0],e[0]);else if(ov.test(t[0])){var o=+ov.exec(t[0])[1];r[0]=e[0]-o}else ro()(t[0])?r[0]=t[0](e[0]):r[0]=e[0];if((0,rq.hj)(t[1]))r[1]=n?t[1]:Math.max(t[1],e[1]);else if(om.test(t[1])){var i=+om.exec(t[1])[1];r[1]=e[1]+i}else ro()(t[1])?r[1]=t[1](e[1]):r[1]=e[1];return r},ob=function(t,e,n){if(t&&t.scale&&t.scale.bandwidth){var r=t.scale.bandwidth();if(!n||r>0)return r}if(t&&e&&e.length>=2){for(var o=rg()(e,function(t){return t.coordinate}),i=1/0,a=1,u=o.length;a1&&void 0!==arguments[1]?arguments[1]:{};if(null==t||r.x.isSsr)return{width:0,height:0};var o=(Object.keys(e=a({},n)).forEach(function(t){e[t]||delete e[t]}),e),i=JSON.stringify({text:t,copyStyle:o});if(u.widthCache[i])return u.widthCache[i];try{var s=document.getElementById(l);s||((s=document.createElement("span")).setAttribute("id",l),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var f=a(a({},c),o);Object.assign(s.style,f),s.textContent="".concat(t);var p=s.getBoundingClientRect(),h={width:p.width,height:p.height};return u.widthCache[i]=h,++u.cacheCount>2e3&&(u.cacheCount=0,u.widthCache={}),h}catch(t){return{width:0,height:0}}},f=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}}},16630:function(t,e,n){"use strict";n.d(e,{Ap:function(){return O},EL:function(){return v},Kt:function(){return g},P2:function(){return d},bv:function(){return b},h1:function(){return m},hU:function(){return p},hj:function(){return h},k4:function(){return x},uY:function(){return f}});var r=n(42715),o=n.n(r),i=n(82559),a=n.n(i),u=n(13735),c=n.n(u),l=n(22345),s=n.n(l),f=function(t){return 0===t?0:t>0?1:-1},p=function(t){return o()(t)&&t.indexOf("%")===t.length-1},h=function(t){return s()(t)&&!a()(t)},d=function(t){return h(t)||o()(t)},y=0,v=function(t){var e=++y;return"".concat(t||"").concat(e)},m=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!h(t)&&!o()(t))return r;if(p(t)){var u=t.indexOf("%");n=e*parseFloat(t.slice(0,u))/100}else n=+t;return a()(n)&&(n=r),i&&n>e&&(n=e),n},g=function(t){if(!t)return null;var e=Object.keys(t);return e&&e.length?t[e[0]]:null},b=function(t){if(!Array.isArray(t))return!1;for(var e=t.length,n={},r=0;r2?n-2:0),o=2;ot.length)&&(e=t.length);for(var n=0,r=Array(e);n2&&void 0!==arguments[2]?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(e-(n.top||0)-(n.bottom||0)))/2},y=function(t,e,n,r,u){var c=t.width,p=t.height,h=t.startAngle,y=t.endAngle,v=(0,i.h1)(t.cx,c,c/2),m=(0,i.h1)(t.cy,p,p/2),g=d(c,p,n),b=(0,i.h1)(t.innerRadius,g,0),x=(0,i.h1)(t.outerRadius,g,.8*g);return Object.keys(e).reduce(function(t,n){var i,c=e[n],p=c.domain,d=c.reversed;if(o()(c.range))"angleAxis"===r?i=[h,y]:"radiusAxis"===r&&(i=[b,x]),d&&(i=[i[1],i[0]]);else{var g,O=function(t){if(Array.isArray(t))return t}(g=i=c.range)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{for(i=(n=n.call(t)).next;!(c=(r=i.call(n)).done)&&(u.push(r.value),2!==u.length);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(g,2)||function(t,e){if(t){if("string"==typeof t)return f(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,2)}}(g,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();h=O[0],y=O[1]}var w=(0,a.Hq)(c,u),j=w.realScaleType,S=w.scale;S.domain(p).range(i),(0,a.zF)(S);var E=(0,a.g$)(S,l(l({},c),{},{realScaleType:j})),k=l(l(l({},c),E),{},{range:i,radius:x,realScaleType:j,scale:S,cx:v,cy:m,innerRadius:b,outerRadius:x,startAngle:h,endAngle:y});return l(l({},t),{},s({},n,k))},{})},v=function(t,e){var n=t.x,r=t.y;return Math.sqrt(Math.pow(n-e.x,2)+Math.pow(r-e.y,2))},m=function(t,e){var n=t.x,r=t.y,o=e.cx,i=e.cy,a=v({x:n,y:r},{x:o,y:i});if(a<=0)return{radius:a};var u=Math.acos((n-o)/a);return r>i&&(u=2*Math.PI-u),{radius:a,angle:180*u/Math.PI,angleInRadian:u}},g=function(t){var e=t.startAngle,n=t.endAngle,r=Math.min(Math.floor(e/360),Math.floor(n/360));return{startAngle:e-360*r,endAngle:n-360*r}},b=function(t,e){var n,r=m({x:t.x,y:t.y},e),o=r.radius,i=r.angle,a=e.innerRadius,u=e.outerRadius;if(ou)return!1;if(0===o)return!0;var c=g(e),s=c.startAngle,f=c.endAngle,p=i;if(s<=f){for(;p>f;)p-=360;for(;p=s&&p<=f}else{for(;p>s;)p-=360;for(;p=f&&p<=s}return n?l(l({},e),{},{radius:o,angle:p+360*Math.min(Math.floor(e.startAngle/360),Math.floor(e.endAngle/360))}):null}},82944:function(t,e,n){"use strict";n.d(e,{$R:function(){return R},$k:function(){return T},Bh:function(){return B},Gf:function(){return j},L6:function(){return N},NN:function(){return P},TT:function(){return M},eu:function(){return L},rL:function(){return D},sP:function(){return A}});var r=n(13735),o=n.n(r),i=n(77571),a=n.n(i),u=n(42715),c=n.n(u),l=n(86757),s=n.n(l),f=n(28302),p=n.n(f),h=n(2265),d=n(82558),y=n(16630),v=n(46485),m=n(41637),g=["children"],b=["children"];function x(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}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"},j=function(t){return"string"==typeof t?t:t?t.displayName||t.name||"Component":""},S=null,E=null,k=function t(e){if(e===S&&Array.isArray(E))return E;var n=[];return h.Children.forEach(e,function(e){a()(e)||((0,d.isFragment)(e)?n=n.concat(t(e.props.children)):n.push(e))}),E=n,S=e,n};function P(t,e){var n=[],r=[];return r=Array.isArray(e)?e.map(function(t){return j(t)}):[j(e)],k(t).forEach(function(t){var e=o()(t,"type.displayName")||o()(t,"type.name");-1!==r.indexOf(e)&&n.push(t)}),n}function A(t,e){var n=P(t,e);return n&&n[0]}var M=function(t){if(!t||!t.props)return!1;var e=t.props,n=e.width,r=e.height;return!!(0,y.hj)(n)&&!(n<=0)&&!!(0,y.hj)(r)&&!(r<=0)},_=["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"],T=function(t){return t&&"object"===O(t)&&"cx"in t&&"cy"in t&&"r"in t},C=function(t,e,n,r){var o,i=null!==(o=null===m.ry||void 0===m.ry?void 0:m.ry[r])&&void 0!==o?o:[];return!s()(t)&&(r&&i.includes(e)||m.Yh.includes(e))||n&&m.nv.includes(e)},N=function(t,e,n){if(!t||"function"==typeof t||"boolean"==typeof t)return null;var r=t;if((0,h.isValidElement)(t)&&(r=t.props),!p()(r))return null;var o={};return Object.keys(r).forEach(function(t){var i;C(null===(i=r)||void 0===i?void 0:i[t],t,e,n)&&(o[t]=r[t])}),o},D=function t(e,n){if(e===n)return!0;var r=h.Children.count(e);if(r!==h.Children.count(n))return!1;if(0===r)return!0;if(1===r)return I(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var o=0;o=0)n.push(t);else if(t){var i=j(t.type),a=e[i]||{},u=a.handler,l=a.once;if(u&&(!l||!r[i])){var s=u(t,i,o);n.push(s),r[i]=!0}}}),n},B=function(t){var e=t&&t.type;return e&&w[e]?w[e]:null},R=function(t,e){return k(e).indexOf(t)}},46485:function(t,e,n){"use strict";function r(t,e){for(var n in t)if(({}).hasOwnProperty.call(t,n)&&(!({}).hasOwnProperty.call(e,n)||t[n]!==e[n]))return!1;for(var r in e)if(({}).hasOwnProperty.call(e,r)&&!({}).hasOwnProperty.call(t,r))return!1;return!0}n.d(e,{w:function(){return r}})},38569:function(t,e,n){"use strict";n.d(e,{z:function(){return l}});var r=n(22190),o=n(85355),i=n(82944);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function c(t){for(var e=1;e=0))throw Error(`invalid digits: ${t}`);if(e>15)return a;let n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e1e-6){if(Math.abs(f*c-l*s)>1e-6&&i){let h=n-a,d=o-u,y=c*c+l*l,v=Math.sqrt(y),m=Math.sqrt(p),g=i*Math.tan((r-Math.acos((y+p-(h*h+d*d))/(2*v*m)))/2),b=g/m,x=g/v;Math.abs(b-1)>1e-6&&this._append`L${t+b*s},${e+b*f}`,this._append`A${i},${i},0,0,${+(f*h>s*d)},${this._x1=t+x*c},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`}}arc(t,e,n,a,u,c){if(t=+t,e=+e,c=!!c,(n=+n)<0)throw Error(`negative radius: ${n}`);let l=n*Math.cos(a),s=n*Math.sin(a),f=t+l,p=e+s,h=1^c,d=c?a-u:u-a;null===this._x1?this._append`M${f},${p}`:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-p)>1e-6)&&this._append`L${f},${p}`,n&&(d<0&&(d=d%o+o),d>i?this._append`A${n},${n},0,1,${h},${t-l},${e-s}A${n},${n},0,1,${h},${this._x1=f},${this._y1=p}`:d>1e-6&&this._append`A${n},${n},0,${+(d>=r)},${h},${this._x1=t+n*Math.cos(u)},${this._y1=e+n*Math.sin(u)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function c(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{let t=Math.floor(n);if(!(t>=0))throw RangeError(`invalid digits: ${n}`);e=t}return t},()=>new u(e)}u.prototype},69398:function(t,e,n){"use strict";function r(t,e){if(!t)throw Error("Invariant failed")}n.d(e,{Z:function(){return r}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3250-3256164511237d25.js b/litellm/proxy/_experimental/out/_next/static/chunks/3250-f8c476289792167a.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/3250-3256164511237d25.js rename to litellm/proxy/_experimental/out/_next/static/chunks/3250-f8c476289792167a.js index 3ef6d6d691..5274098fe2 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3250-3256164511237d25.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3250-f8c476289792167a.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3250],{49634:function(e,r,o){o.d(r,{Z:function(){return s}});var t=o(1119),a=o(2265),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},l=o(55015),s=a.forwardRef(function(e,r){return a.createElement(l.Z,(0,t.Z)({},e,{ref:r,icon:n}))})},94789:function(e,r,o){o.d(r,{Z:function(){return d}});var t=o(5853),a=o(2265),n=o(26898),l=o(97324),s=o(1153);let i=(0,s.fn)("Callout"),d=a.forwardRef((e,r)=>{let{title:o,icon:d,color:c,className:m,children:p}=e,u=(0,t._T)(e,["title","icon","color","className","children"]);return a.createElement("div",Object.assign({ref:r,className:(0,l.q)(i("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",c?(0,l.q)((0,s.bM)(c,n.K.background).bgColor,(0,s.bM)(c,n.K.darkBorder).borderColor,(0,s.bM)(c,n.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,l.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),m)},u),a.createElement("div",{className:(0,l.q)(i("header"),"flex items-start")},d?a.createElement(d,{className:(0,l.q)(i("icon"),"flex-none h-5 w-5 mr-1.5")}):null,a.createElement("h4",{className:(0,l.q)(i("title"),"font-semibold")},o)),a.createElement("p",{className:(0,l.q)(i("body"),"overflow-y-auto",p?"mt-2":"")},p))});d.displayName="Callout"},35829:function(e,r,o){o.d(r,{Z:function(){return i}});var t=o(5853),a=o(26898),n=o(97324),l=o(1153),s=o(2265);let i=s.forwardRef((e,r)=>{let{color:o,children:i,className:d}=e,c=(0,t._T)(e,["color","children","className"]);return s.createElement("p",Object.assign({ref:r,className:(0,n.q)("font-semibold text-tremor-metric",o?(0,l.bM)(o,a.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",d)},c),i)});i.displayName="Metric"},49096:function(e,r,o){o.d(r,{ZD:function(){return n}});var t=o(87602);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=e=>{let r=function(){for(var r,o,a=arguments.length,n=Array(a),l=0;l{let t=Object.fromEntries(Object.entries(e||{}).filter(e=>{let[r]=e;return!["class","className"].includes(r)}));return r(o.map(e=>e(t)),null==e?void 0:e.class,null==e?void 0:e.className)}},cva:e=>o=>{var t;if((null==e?void 0:e.variants)==null)return r(null==e?void 0:e.base,null==o?void 0:o.class,null==o?void 0:o.className);let{variants:n,defaultVariants:l}=e,s=Object.keys(n).map(e=>{let r=null==o?void 0:o[e],t=null==l?void 0:l[e],s=a(r)||a(t);return n[e][s]}),i={...l,...o&&Object.entries(o).reduce((e,r)=>{let[o,t]=r;return void 0===t?e:{...e,[o]:t}},{})},d=null==e?void 0:null===(t=e.compoundVariants)||void 0===t?void 0:t.reduce((e,r)=>{let{class:o,className:t,...a}=r;return Object.entries(a).every(e=>{let[r,o]=e,t=i[r];return Array.isArray(o)?o.includes(t):t===o})?[...e,o,t]:e},[]);return r(null==e?void 0:e.base,s,d,null==o?void 0:o.class,null==o?void 0:o.className)},cx:r}},{compose:l,cva:s,cx:i}=n()},53335:function(e,r,o){o.d(r,{m6:function(){return ed}});let t=e=>{let r=s(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:t}=e;return{getClassGroupId:e=>{let o=e.split("-");return""===o[0]&&1!==o.length&&o.shift(),a(o,r)||l(e)},getConflictingClassGroupIds:(e,r)=>{let a=o[e]||[];return r&&t[e]?[...a,...t[e]]:a}}},a=(e,r)=>{if(0===e.length)return r.classGroupId;let o=e[0],t=r.nextPart.get(o),n=t?a(e.slice(1),t):void 0;if(n)return n;if(0===r.validators.length)return;let l=e.join("-");return r.validators.find(({validator:e})=>e(l))?.classGroupId},n=/^\[(.+)\]$/,l=e=>{if(n.test(e)){let r=n.exec(e)[1],o=r?.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},s=e=>{let{theme:r,classGroups:o}=e,t={nextPart:new Map,validators:[]};for(let e in o)i(o[e],t,e,r);return t},i=(e,r,o,t)=>{e.forEach(e=>{if("string"==typeof e){(""===e?r:d(r,e)).classGroupId=o;return}if("function"==typeof e){if(c(e)){i(e(t),r,o,t);return}r.validators.push({validator:e,classGroupId:o});return}Object.entries(e).forEach(([e,a])=>{i(a,d(r,e),o,t)})})},d=(e,r)=>{let o=e;return r.split("-").forEach(e=>{o.nextPart.has(e)||o.nextPart.set(e,{nextPart:new Map,validators:[]}),o=o.nextPart.get(e)}),o},c=e=>e.isThemeGetter,m=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let r=0,o=new Map,t=new Map,a=(a,n)=>{o.set(a,n),++r>e&&(r=0,t=o,o=new Map)};return{get(e){let r=o.get(e);return void 0!==r?r:void 0!==(r=t.get(e))?(a(e,r),r):void 0},set(e,r){o.has(e)?o.set(e,r):a(e,r)}}},p=e=>{let{prefix:r,experimentalParseClassName:o}=e,t=e=>{let r;let o=[],t=0,a=0,n=0;for(let l=0;ln?r-n:void 0}};if(r){let e=r+":",o=t;t=r=>r.startsWith(e)?o(r.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:r,maybePostfixModifierPosition:void 0}}if(o){let e=t;t=r=>o({className:r,parseClassName:e})}return t},u=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,b=e=>{let r=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;let o=[],t=[];return e.forEach(e=>{"["===e[0]||r[e]?(o.push(...t.sort(),e),t=[]):t.push(e)}),o.push(...t.sort()),o}},f=e=>({cache:m(e.cacheSize),parseClassName:p(e),sortModifiers:b(e),...t(e)}),g=/\s+/,h=(e,r)=>{let{parseClassName:o,getClassGroupId:t,getConflictingClassGroupIds:a,sortModifiers:n}=r,l=[],s=e.trim().split(g),i="";for(let e=s.length-1;e>=0;e-=1){let r=s[e],{isExternal:d,modifiers:c,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:u}=o(r);if(d){i=r+(i.length>0?" "+i:i);continue}let b=!!u,f=t(b?p.substring(0,u):p);if(!f){if(!b||!(f=t(p))){i=r+(i.length>0?" "+i:i);continue}b=!1}let g=n(c).join(":"),h=m?g+"!":g,k=h+f;if(l.includes(k))continue;l.push(k);let v=a(f,b);for(let e=0;e0?" "+i:i)}return i};function k(){let e,r,o=0,t="";for(;o{let r;if("string"==typeof e)return e;let o="";for(let t=0;t{let r=r=>r[e]||[];return r.isThemeGetter=!0,r},w=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,y=/^\((?:(\w[\w-]*):)?(.+)\)$/i,z=/^\d+\/\d+$/,N=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,j=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,M=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,C=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,E=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,q=e=>z.test(e),G=e=>!!e&&!Number.isNaN(Number(e)),O=e=>!!e&&Number.isInteger(Number(e)),P=e=>e.endsWith("%")&&G(e.slice(0,-1)),$=e=>N.test(e),I=()=>!0,_=e=>j.test(e)&&!M.test(e),W=()=>!1,T=e=>C.test(e),Z=e=>E.test(e),H=e=>!K(e)&&!F(e),A=e=>ee(e,ea,W),K=e=>w.test(e),S=e=>ee(e,en,_),V=e=>ee(e,el,G),R=e=>ee(e,eo,W),B=e=>ee(e,et,Z),D=e=>ee(e,ei,T),F=e=>y.test(e),J=e=>er(e,en),L=e=>er(e,es),Q=e=>er(e,eo),U=e=>er(e,ea),X=e=>er(e,et),Y=e=>er(e,ei,!0),ee=(e,r,o)=>{let t=w.exec(e);return!!t&&(t[1]?r(t[1]):o(t[2]))},er=(e,r,o=!1)=>{let t=y.exec(e);return!!t&&(t[1]?r(t[1]):o)},eo=e=>"position"===e||"percentage"===e,et=e=>"image"===e||"url"===e,ea=e=>"length"===e||"size"===e||"bg-size"===e,en=e=>"length"===e,el=e=>"number"===e,es=e=>"family-name"===e,ei=e=>"shadow"===e,ed=function(e,...r){let o,t,a;let n=function(s){return t=(o=f(r.reduce((e,r)=>r(e),e()))).cache.get,a=o.cache.set,n=l,l(s)};function l(e){let r=t(e);if(r)return r;let n=h(e,o);return a(e,n),n}return function(){return n(k.apply(null,arguments))}}(()=>{let e=x("color"),r=x("font"),o=x("text"),t=x("font-weight"),a=x("tracking"),n=x("leading"),l=x("breakpoint"),s=x("container"),i=x("spacing"),d=x("radius"),c=x("shadow"),m=x("inset-shadow"),p=x("text-shadow"),u=x("drop-shadow"),b=x("blur"),f=x("perspective"),g=x("aspect"),h=x("ease"),k=x("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],y=()=>[...w(),F,K],z=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],j=()=>[F,K,i],M=()=>[q,"full","auto",...j()],C=()=>[O,"none","subgrid",F,K],E=()=>["auto",{span:["full",O,F,K]},O,F,K],_=()=>[O,"auto",F,K],W=()=>["auto","min","max","fr",F,K],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...j()],er=()=>[q,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],eo=()=>[e,F,K],et=()=>[...w(),Q,R,{position:[F,K]}],ea=()=>["no-repeat",{repeat:["","x","y","space","round"]}],en=()=>["auto","cover","contain",U,A,{size:[F,K]}],el=()=>[P,J,S],es=()=>["","none","full",d,F,K],ei=()=>["",G,J,S],ed=()=>["solid","dashed","dotted","double"],ec=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],em=()=>[G,P,Q,R],ep=()=>["","none",b,F,K],eu=()=>["none",G,F,K],eb=()=>["none",G,F,K],ef=()=>[G,F,K],eg=()=>[q,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$],breakpoint:[$],color:[I],container:[$],"drop-shadow":[$],ease:["in","out","in-out"],font:[H],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$],shadow:[$],spacing:["px",G],text:[$],"text-shadow":[$],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",q,K,F,g]}],container:["container"],columns:[{columns:[G,K,F,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[O,"auto",F,K]}],basis:[{basis:[q,"full","auto",s,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[G,q,"auto","initial","none",K]}],grow:[{grow:["",G,F,K]}],shrink:[{shrink:["",G,F,K]}],order:[{order:[O,"first","last","none",F,K]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:er()}],w:[{w:[s,"screen",...er()]}],"min-w":[{"min-w":[s,"screen","none",...er()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[l]},...er()]}],h:[{h:["screen",...er()]}],"min-h":[{"min-h":["screen","none",...er()]}],"max-h":[{"max-h":["screen",...er()]}],"font-size":[{text:["base",o,J,S]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[t,F,V]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",P,K]}],"font-family":[{font:[L,K,r]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,F,K]}],"line-clamp":[{"line-clamp":[G,"none",F,V]}],leading:[{leading:[n,...j()]}],"list-image":[{"list-image":["none",F,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",F,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:eo()}],"text-color":[{text:eo()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ed(),"wavy"]}],"text-decoration-thickness":[{decoration:[G,"from-font","auto",F,S]}],"text-decoration-color":[{decoration:eo()}],"underline-offset":[{"underline-offset":[G,"auto",F,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F,K]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F,K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:et()}],"bg-repeat":[{bg:ea()}],"bg-size":[{bg:en()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},O,F,K],radial:["",F,K],conic:[O,F,K]},X,B]}],"bg-color":[{bg:eo()}],"gradient-from-pos":[{from:el()}],"gradient-via-pos":[{via:el()}],"gradient-to-pos":[{to:el()}],"gradient-from":[{from:eo()}],"gradient-via":[{via:eo()}],"gradient-to":[{to:eo()}],rounded:[{rounded:es()}],"rounded-s":[{"rounded-s":es()}],"rounded-e":[{"rounded-e":es()}],"rounded-t":[{"rounded-t":es()}],"rounded-r":[{"rounded-r":es()}],"rounded-b":[{"rounded-b":es()}],"rounded-l":[{"rounded-l":es()}],"rounded-ss":[{"rounded-ss":es()}],"rounded-se":[{"rounded-se":es()}],"rounded-ee":[{"rounded-ee":es()}],"rounded-es":[{"rounded-es":es()}],"rounded-tl":[{"rounded-tl":es()}],"rounded-tr":[{"rounded-tr":es()}],"rounded-br":[{"rounded-br":es()}],"rounded-bl":[{"rounded-bl":es()}],"border-w":[{border:ei()}],"border-w-x":[{"border-x":ei()}],"border-w-y":[{"border-y":ei()}],"border-w-s":[{"border-s":ei()}],"border-w-e":[{"border-e":ei()}],"border-w-t":[{"border-t":ei()}],"border-w-r":[{"border-r":ei()}],"border-w-b":[{"border-b":ei()}],"border-w-l":[{"border-l":ei()}],"divide-x":[{"divide-x":ei()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ei()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ed(),"hidden","none"]}],"divide-style":[{divide:[...ed(),"hidden","none"]}],"border-color":[{border:eo()}],"border-color-x":[{"border-x":eo()}],"border-color-y":[{"border-y":eo()}],"border-color-s":[{"border-s":eo()}],"border-color-e":[{"border-e":eo()}],"border-color-t":[{"border-t":eo()}],"border-color-r":[{"border-r":eo()}],"border-color-b":[{"border-b":eo()}],"border-color-l":[{"border-l":eo()}],"divide-color":[{divide:eo()}],"outline-style":[{outline:[...ed(),"none","hidden"]}],"outline-offset":[{"outline-offset":[G,F,K]}],"outline-w":[{outline:["",G,J,S]}],"outline-color":[{outline:eo()}],shadow:[{shadow:["","none",c,Y,D]}],"shadow-color":[{shadow:eo()}],"inset-shadow":[{"inset-shadow":["none",m,Y,D]}],"inset-shadow-color":[{"inset-shadow":eo()}],"ring-w":[{ring:ei()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:eo()}],"ring-offset-w":[{"ring-offset":[G,S]}],"ring-offset-color":[{"ring-offset":eo()}],"inset-ring-w":[{"inset-ring":ei()}],"inset-ring-color":[{"inset-ring":eo()}],"text-shadow":[{"text-shadow":["none",p,Y,D]}],"text-shadow-color":[{"text-shadow":eo()}],opacity:[{opacity:[G,F,K]}],"mix-blend":[{"mix-blend":[...ec(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ec()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":em()}],"mask-image-linear-to-pos":[{"mask-linear-to":em()}],"mask-image-linear-from-color":[{"mask-linear-from":eo()}],"mask-image-linear-to-color":[{"mask-linear-to":eo()}],"mask-image-t-from-pos":[{"mask-t-from":em()}],"mask-image-t-to-pos":[{"mask-t-to":em()}],"mask-image-t-from-color":[{"mask-t-from":eo()}],"mask-image-t-to-color":[{"mask-t-to":eo()}],"mask-image-r-from-pos":[{"mask-r-from":em()}],"mask-image-r-to-pos":[{"mask-r-to":em()}],"mask-image-r-from-color":[{"mask-r-from":eo()}],"mask-image-r-to-color":[{"mask-r-to":eo()}],"mask-image-b-from-pos":[{"mask-b-from":em()}],"mask-image-b-to-pos":[{"mask-b-to":em()}],"mask-image-b-from-color":[{"mask-b-from":eo()}],"mask-image-b-to-color":[{"mask-b-to":eo()}],"mask-image-l-from-pos":[{"mask-l-from":em()}],"mask-image-l-to-pos":[{"mask-l-to":em()}],"mask-image-l-from-color":[{"mask-l-from":eo()}],"mask-image-l-to-color":[{"mask-l-to":eo()}],"mask-image-x-from-pos":[{"mask-x-from":em()}],"mask-image-x-to-pos":[{"mask-x-to":em()}],"mask-image-x-from-color":[{"mask-x-from":eo()}],"mask-image-x-to-color":[{"mask-x-to":eo()}],"mask-image-y-from-pos":[{"mask-y-from":em()}],"mask-image-y-to-pos":[{"mask-y-to":em()}],"mask-image-y-from-color":[{"mask-y-from":eo()}],"mask-image-y-to-color":[{"mask-y-to":eo()}],"mask-image-radial":[{"mask-radial":[F,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":em()}],"mask-image-radial-to-pos":[{"mask-radial-to":em()}],"mask-image-radial-from-color":[{"mask-radial-from":eo()}],"mask-image-radial-to-color":[{"mask-radial-to":eo()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":em()}],"mask-image-conic-to-pos":[{"mask-conic-to":em()}],"mask-image-conic-from-color":[{"mask-conic-from":eo()}],"mask-image-conic-to-color":[{"mask-conic-to":eo()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:et()}],"mask-repeat":[{mask:ea()}],"mask-size":[{mask:en()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",F,K]}],filter:[{filter:["","none",F,K]}],blur:[{blur:ep()}],brightness:[{brightness:[G,F,K]}],contrast:[{contrast:[G,F,K]}],"drop-shadow":[{"drop-shadow":["","none",u,Y,D]}],"drop-shadow-color":[{"drop-shadow":eo()}],grayscale:[{grayscale:["",G,F,K]}],"hue-rotate":[{"hue-rotate":[G,F,K]}],invert:[{invert:["",G,F,K]}],saturate:[{saturate:[G,F,K]}],sepia:[{sepia:["",G,F,K]}],"backdrop-filter":[{"backdrop-filter":["","none",F,K]}],"backdrop-blur":[{"backdrop-blur":ep()}],"backdrop-brightness":[{"backdrop-brightness":[G,F,K]}],"backdrop-contrast":[{"backdrop-contrast":[G,F,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",G,F,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,F,K]}],"backdrop-invert":[{"backdrop-invert":["",G,F,K]}],"backdrop-opacity":[{"backdrop-opacity":[G,F,K]}],"backdrop-saturate":[{"backdrop-saturate":[G,F,K]}],"backdrop-sepia":[{"backdrop-sepia":["",G,F,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",F,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[G,"initial",F,K]}],ease:[{ease:["linear","initial",h,F,K]}],delay:[{delay:[G,F,K]}],animate:[{animate:["none",k,F,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,F,K]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:eu()}],"rotate-x":[{"rotate-x":eu()}],"rotate-y":[{"rotate-y":eu()}],"rotate-z":[{"rotate-z":eu()}],scale:[{scale:eb()}],"scale-x":[{"scale-x":eb()}],"scale-y":[{"scale-y":eb()}],"scale-z":[{"scale-z":eb()}],"scale-3d":["scale-3d"],skew:[{skew:ef()}],"skew-x":[{"skew-x":ef()}],"skew-y":[{"skew-y":ef()}],transform:[{transform:[F,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:eg()}],"translate-x":[{"translate-x":eg()}],"translate-y":[{"translate-y":eg()}],"translate-z":[{"translate-z":eg()}],"translate-none":["translate-none"],accent:[{accent:eo()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:eo()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F,K]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F,K]}],fill:[{fill:["none",...eo()]}],"stroke-w":[{stroke:[G,J,S,V]}],stroke:[{stroke:["none",...eo()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3250],{49634:function(e,r,o){o.d(r,{Z:function(){return s}});var t=o(1119),a=o(2265),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},l=o(55015),s=a.forwardRef(function(e,r){return a.createElement(l.Z,(0,t.Z)({},e,{ref:r,icon:n}))})},94789:function(e,r,o){o.d(r,{Z:function(){return d}});var t=o(5853),a=o(2265),n=o(26898),l=o(97324),s=o(1153);let i=(0,s.fn)("Callout"),d=a.forwardRef((e,r)=>{let{title:o,icon:d,color:c,className:m,children:p}=e,u=(0,t._T)(e,["title","icon","color","className","children"]);return a.createElement("div",Object.assign({ref:r,className:(0,l.q)(i("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",c?(0,l.q)((0,s.bM)(c,n.K.background).bgColor,(0,s.bM)(c,n.K.darkBorder).borderColor,(0,s.bM)(c,n.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,l.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),m)},u),a.createElement("div",{className:(0,l.q)(i("header"),"flex items-start")},d?a.createElement(d,{className:(0,l.q)(i("icon"),"flex-none h-5 w-5 mr-1.5")}):null,a.createElement("h4",{className:(0,l.q)(i("title"),"font-semibold")},o)),a.createElement("p",{className:(0,l.q)(i("body"),"overflow-y-auto",p?"mt-2":"")},p))});d.displayName="Callout"},35829:function(e,r,o){o.d(r,{Z:function(){return i}});var t=o(5853),a=o(26898),n=o(97324),l=o(1153),s=o(2265);let i=s.forwardRef((e,r)=>{let{color:o,children:i,className:d}=e,c=(0,t._T)(e,["color","children","className"]);return s.createElement("p",Object.assign({ref:r,className:(0,n.q)("font-semibold text-tremor-metric",o?(0,l.bM)(o,a.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",d)},c),i)});i.displayName="Metric"},49096:function(e,r,o){o.d(r,{ZD:function(){return n}});var t=o(61994);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=e=>{let r=function(){for(var r,o,a=arguments.length,n=Array(a),l=0;l{let t=Object.fromEntries(Object.entries(e||{}).filter(e=>{let[r]=e;return!["class","className"].includes(r)}));return r(o.map(e=>e(t)),null==e?void 0:e.class,null==e?void 0:e.className)}},cva:e=>o=>{var t;if((null==e?void 0:e.variants)==null)return r(null==e?void 0:e.base,null==o?void 0:o.class,null==o?void 0:o.className);let{variants:n,defaultVariants:l}=e,s=Object.keys(n).map(e=>{let r=null==o?void 0:o[e],t=null==l?void 0:l[e],s=a(r)||a(t);return n[e][s]}),i={...l,...o&&Object.entries(o).reduce((e,r)=>{let[o,t]=r;return void 0===t?e:{...e,[o]:t}},{})},d=null==e?void 0:null===(t=e.compoundVariants)||void 0===t?void 0:t.reduce((e,r)=>{let{class:o,className:t,...a}=r;return Object.entries(a).every(e=>{let[r,o]=e,t=i[r];return Array.isArray(o)?o.includes(t):t===o})?[...e,o,t]:e},[]);return r(null==e?void 0:e.base,s,d,null==o?void 0:o.class,null==o?void 0:o.className)},cx:r}},{compose:l,cva:s,cx:i}=n()},53335:function(e,r,o){o.d(r,{m6:function(){return ed}});let t=e=>{let r=s(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:t}=e;return{getClassGroupId:e=>{let o=e.split("-");return""===o[0]&&1!==o.length&&o.shift(),a(o,r)||l(e)},getConflictingClassGroupIds:(e,r)=>{let a=o[e]||[];return r&&t[e]?[...a,...t[e]]:a}}},a=(e,r)=>{if(0===e.length)return r.classGroupId;let o=e[0],t=r.nextPart.get(o),n=t?a(e.slice(1),t):void 0;if(n)return n;if(0===r.validators.length)return;let l=e.join("-");return r.validators.find(({validator:e})=>e(l))?.classGroupId},n=/^\[(.+)\]$/,l=e=>{if(n.test(e)){let r=n.exec(e)[1],o=r?.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},s=e=>{let{theme:r,classGroups:o}=e,t={nextPart:new Map,validators:[]};for(let e in o)i(o[e],t,e,r);return t},i=(e,r,o,t)=>{e.forEach(e=>{if("string"==typeof e){(""===e?r:d(r,e)).classGroupId=o;return}if("function"==typeof e){if(c(e)){i(e(t),r,o,t);return}r.validators.push({validator:e,classGroupId:o});return}Object.entries(e).forEach(([e,a])=>{i(a,d(r,e),o,t)})})},d=(e,r)=>{let o=e;return r.split("-").forEach(e=>{o.nextPart.has(e)||o.nextPart.set(e,{nextPart:new Map,validators:[]}),o=o.nextPart.get(e)}),o},c=e=>e.isThemeGetter,m=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let r=0,o=new Map,t=new Map,a=(a,n)=>{o.set(a,n),++r>e&&(r=0,t=o,o=new Map)};return{get(e){let r=o.get(e);return void 0!==r?r:void 0!==(r=t.get(e))?(a(e,r),r):void 0},set(e,r){o.has(e)?o.set(e,r):a(e,r)}}},p=e=>{let{prefix:r,experimentalParseClassName:o}=e,t=e=>{let r;let o=[],t=0,a=0,n=0;for(let l=0;ln?r-n:void 0}};if(r){let e=r+":",o=t;t=r=>r.startsWith(e)?o(r.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:r,maybePostfixModifierPosition:void 0}}if(o){let e=t;t=r=>o({className:r,parseClassName:e})}return t},u=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,b=e=>{let r=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;let o=[],t=[];return e.forEach(e=>{"["===e[0]||r[e]?(o.push(...t.sort(),e),t=[]):t.push(e)}),o.push(...t.sort()),o}},f=e=>({cache:m(e.cacheSize),parseClassName:p(e),sortModifiers:b(e),...t(e)}),g=/\s+/,h=(e,r)=>{let{parseClassName:o,getClassGroupId:t,getConflictingClassGroupIds:a,sortModifiers:n}=r,l=[],s=e.trim().split(g),i="";for(let e=s.length-1;e>=0;e-=1){let r=s[e],{isExternal:d,modifiers:c,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:u}=o(r);if(d){i=r+(i.length>0?" "+i:i);continue}let b=!!u,f=t(b?p.substring(0,u):p);if(!f){if(!b||!(f=t(p))){i=r+(i.length>0?" "+i:i);continue}b=!1}let g=n(c).join(":"),h=m?g+"!":g,k=h+f;if(l.includes(k))continue;l.push(k);let v=a(f,b);for(let e=0;e0?" "+i:i)}return i};function k(){let e,r,o=0,t="";for(;o{let r;if("string"==typeof e)return e;let o="";for(let t=0;t{let r=r=>r[e]||[];return r.isThemeGetter=!0,r},w=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,y=/^\((?:(\w[\w-]*):)?(.+)\)$/i,z=/^\d+\/\d+$/,N=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,j=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,M=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,C=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,E=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,q=e=>z.test(e),G=e=>!!e&&!Number.isNaN(Number(e)),O=e=>!!e&&Number.isInteger(Number(e)),P=e=>e.endsWith("%")&&G(e.slice(0,-1)),$=e=>N.test(e),I=()=>!0,_=e=>j.test(e)&&!M.test(e),W=()=>!1,T=e=>C.test(e),Z=e=>E.test(e),H=e=>!K(e)&&!F(e),A=e=>ee(e,ea,W),K=e=>w.test(e),S=e=>ee(e,en,_),V=e=>ee(e,el,G),R=e=>ee(e,eo,W),B=e=>ee(e,et,Z),D=e=>ee(e,ei,T),F=e=>y.test(e),J=e=>er(e,en),L=e=>er(e,es),Q=e=>er(e,eo),U=e=>er(e,ea),X=e=>er(e,et),Y=e=>er(e,ei,!0),ee=(e,r,o)=>{let t=w.exec(e);return!!t&&(t[1]?r(t[1]):o(t[2]))},er=(e,r,o=!1)=>{let t=y.exec(e);return!!t&&(t[1]?r(t[1]):o)},eo=e=>"position"===e||"percentage"===e,et=e=>"image"===e||"url"===e,ea=e=>"length"===e||"size"===e||"bg-size"===e,en=e=>"length"===e,el=e=>"number"===e,es=e=>"family-name"===e,ei=e=>"shadow"===e,ed=function(e,...r){let o,t,a;let n=function(s){return t=(o=f(r.reduce((e,r)=>r(e),e()))).cache.get,a=o.cache.set,n=l,l(s)};function l(e){let r=t(e);if(r)return r;let n=h(e,o);return a(e,n),n}return function(){return n(k.apply(null,arguments))}}(()=>{let e=x("color"),r=x("font"),o=x("text"),t=x("font-weight"),a=x("tracking"),n=x("leading"),l=x("breakpoint"),s=x("container"),i=x("spacing"),d=x("radius"),c=x("shadow"),m=x("inset-shadow"),p=x("text-shadow"),u=x("drop-shadow"),b=x("blur"),f=x("perspective"),g=x("aspect"),h=x("ease"),k=x("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],y=()=>[...w(),F,K],z=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],j=()=>[F,K,i],M=()=>[q,"full","auto",...j()],C=()=>[O,"none","subgrid",F,K],E=()=>["auto",{span:["full",O,F,K]},O,F,K],_=()=>[O,"auto",F,K],W=()=>["auto","min","max","fr",F,K],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...j()],er=()=>[q,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],eo=()=>[e,F,K],et=()=>[...w(),Q,R,{position:[F,K]}],ea=()=>["no-repeat",{repeat:["","x","y","space","round"]}],en=()=>["auto","cover","contain",U,A,{size:[F,K]}],el=()=>[P,J,S],es=()=>["","none","full",d,F,K],ei=()=>["",G,J,S],ed=()=>["solid","dashed","dotted","double"],ec=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],em=()=>[G,P,Q,R],ep=()=>["","none",b,F,K],eu=()=>["none",G,F,K],eb=()=>["none",G,F,K],ef=()=>[G,F,K],eg=()=>[q,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$],breakpoint:[$],color:[I],container:[$],"drop-shadow":[$],ease:["in","out","in-out"],font:[H],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$],shadow:[$],spacing:["px",G],text:[$],"text-shadow":[$],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",q,K,F,g]}],container:["container"],columns:[{columns:[G,K,F,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[O,"auto",F,K]}],basis:[{basis:[q,"full","auto",s,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[G,q,"auto","initial","none",K]}],grow:[{grow:["",G,F,K]}],shrink:[{shrink:["",G,F,K]}],order:[{order:[O,"first","last","none",F,K]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:er()}],w:[{w:[s,"screen",...er()]}],"min-w":[{"min-w":[s,"screen","none",...er()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[l]},...er()]}],h:[{h:["screen",...er()]}],"min-h":[{"min-h":["screen","none",...er()]}],"max-h":[{"max-h":["screen",...er()]}],"font-size":[{text:["base",o,J,S]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[t,F,V]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",P,K]}],"font-family":[{font:[L,K,r]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,F,K]}],"line-clamp":[{"line-clamp":[G,"none",F,V]}],leading:[{leading:[n,...j()]}],"list-image":[{"list-image":["none",F,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",F,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:eo()}],"text-color":[{text:eo()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ed(),"wavy"]}],"text-decoration-thickness":[{decoration:[G,"from-font","auto",F,S]}],"text-decoration-color":[{decoration:eo()}],"underline-offset":[{"underline-offset":[G,"auto",F,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F,K]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F,K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:et()}],"bg-repeat":[{bg:ea()}],"bg-size":[{bg:en()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},O,F,K],radial:["",F,K],conic:[O,F,K]},X,B]}],"bg-color":[{bg:eo()}],"gradient-from-pos":[{from:el()}],"gradient-via-pos":[{via:el()}],"gradient-to-pos":[{to:el()}],"gradient-from":[{from:eo()}],"gradient-via":[{via:eo()}],"gradient-to":[{to:eo()}],rounded:[{rounded:es()}],"rounded-s":[{"rounded-s":es()}],"rounded-e":[{"rounded-e":es()}],"rounded-t":[{"rounded-t":es()}],"rounded-r":[{"rounded-r":es()}],"rounded-b":[{"rounded-b":es()}],"rounded-l":[{"rounded-l":es()}],"rounded-ss":[{"rounded-ss":es()}],"rounded-se":[{"rounded-se":es()}],"rounded-ee":[{"rounded-ee":es()}],"rounded-es":[{"rounded-es":es()}],"rounded-tl":[{"rounded-tl":es()}],"rounded-tr":[{"rounded-tr":es()}],"rounded-br":[{"rounded-br":es()}],"rounded-bl":[{"rounded-bl":es()}],"border-w":[{border:ei()}],"border-w-x":[{"border-x":ei()}],"border-w-y":[{"border-y":ei()}],"border-w-s":[{"border-s":ei()}],"border-w-e":[{"border-e":ei()}],"border-w-t":[{"border-t":ei()}],"border-w-r":[{"border-r":ei()}],"border-w-b":[{"border-b":ei()}],"border-w-l":[{"border-l":ei()}],"divide-x":[{"divide-x":ei()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ei()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ed(),"hidden","none"]}],"divide-style":[{divide:[...ed(),"hidden","none"]}],"border-color":[{border:eo()}],"border-color-x":[{"border-x":eo()}],"border-color-y":[{"border-y":eo()}],"border-color-s":[{"border-s":eo()}],"border-color-e":[{"border-e":eo()}],"border-color-t":[{"border-t":eo()}],"border-color-r":[{"border-r":eo()}],"border-color-b":[{"border-b":eo()}],"border-color-l":[{"border-l":eo()}],"divide-color":[{divide:eo()}],"outline-style":[{outline:[...ed(),"none","hidden"]}],"outline-offset":[{"outline-offset":[G,F,K]}],"outline-w":[{outline:["",G,J,S]}],"outline-color":[{outline:eo()}],shadow:[{shadow:["","none",c,Y,D]}],"shadow-color":[{shadow:eo()}],"inset-shadow":[{"inset-shadow":["none",m,Y,D]}],"inset-shadow-color":[{"inset-shadow":eo()}],"ring-w":[{ring:ei()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:eo()}],"ring-offset-w":[{"ring-offset":[G,S]}],"ring-offset-color":[{"ring-offset":eo()}],"inset-ring-w":[{"inset-ring":ei()}],"inset-ring-color":[{"inset-ring":eo()}],"text-shadow":[{"text-shadow":["none",p,Y,D]}],"text-shadow-color":[{"text-shadow":eo()}],opacity:[{opacity:[G,F,K]}],"mix-blend":[{"mix-blend":[...ec(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ec()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":em()}],"mask-image-linear-to-pos":[{"mask-linear-to":em()}],"mask-image-linear-from-color":[{"mask-linear-from":eo()}],"mask-image-linear-to-color":[{"mask-linear-to":eo()}],"mask-image-t-from-pos":[{"mask-t-from":em()}],"mask-image-t-to-pos":[{"mask-t-to":em()}],"mask-image-t-from-color":[{"mask-t-from":eo()}],"mask-image-t-to-color":[{"mask-t-to":eo()}],"mask-image-r-from-pos":[{"mask-r-from":em()}],"mask-image-r-to-pos":[{"mask-r-to":em()}],"mask-image-r-from-color":[{"mask-r-from":eo()}],"mask-image-r-to-color":[{"mask-r-to":eo()}],"mask-image-b-from-pos":[{"mask-b-from":em()}],"mask-image-b-to-pos":[{"mask-b-to":em()}],"mask-image-b-from-color":[{"mask-b-from":eo()}],"mask-image-b-to-color":[{"mask-b-to":eo()}],"mask-image-l-from-pos":[{"mask-l-from":em()}],"mask-image-l-to-pos":[{"mask-l-to":em()}],"mask-image-l-from-color":[{"mask-l-from":eo()}],"mask-image-l-to-color":[{"mask-l-to":eo()}],"mask-image-x-from-pos":[{"mask-x-from":em()}],"mask-image-x-to-pos":[{"mask-x-to":em()}],"mask-image-x-from-color":[{"mask-x-from":eo()}],"mask-image-x-to-color":[{"mask-x-to":eo()}],"mask-image-y-from-pos":[{"mask-y-from":em()}],"mask-image-y-to-pos":[{"mask-y-to":em()}],"mask-image-y-from-color":[{"mask-y-from":eo()}],"mask-image-y-to-color":[{"mask-y-to":eo()}],"mask-image-radial":[{"mask-radial":[F,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":em()}],"mask-image-radial-to-pos":[{"mask-radial-to":em()}],"mask-image-radial-from-color":[{"mask-radial-from":eo()}],"mask-image-radial-to-color":[{"mask-radial-to":eo()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":em()}],"mask-image-conic-to-pos":[{"mask-conic-to":em()}],"mask-image-conic-from-color":[{"mask-conic-from":eo()}],"mask-image-conic-to-color":[{"mask-conic-to":eo()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:et()}],"mask-repeat":[{mask:ea()}],"mask-size":[{mask:en()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",F,K]}],filter:[{filter:["","none",F,K]}],blur:[{blur:ep()}],brightness:[{brightness:[G,F,K]}],contrast:[{contrast:[G,F,K]}],"drop-shadow":[{"drop-shadow":["","none",u,Y,D]}],"drop-shadow-color":[{"drop-shadow":eo()}],grayscale:[{grayscale:["",G,F,K]}],"hue-rotate":[{"hue-rotate":[G,F,K]}],invert:[{invert:["",G,F,K]}],saturate:[{saturate:[G,F,K]}],sepia:[{sepia:["",G,F,K]}],"backdrop-filter":[{"backdrop-filter":["","none",F,K]}],"backdrop-blur":[{"backdrop-blur":ep()}],"backdrop-brightness":[{"backdrop-brightness":[G,F,K]}],"backdrop-contrast":[{"backdrop-contrast":[G,F,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",G,F,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,F,K]}],"backdrop-invert":[{"backdrop-invert":["",G,F,K]}],"backdrop-opacity":[{"backdrop-opacity":[G,F,K]}],"backdrop-saturate":[{"backdrop-saturate":[G,F,K]}],"backdrop-sepia":[{"backdrop-sepia":["",G,F,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",F,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[G,"initial",F,K]}],ease:[{ease:["linear","initial",h,F,K]}],delay:[{delay:[G,F,K]}],animate:[{animate:["none",k,F,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,F,K]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:eu()}],"rotate-x":[{"rotate-x":eu()}],"rotate-y":[{"rotate-y":eu()}],"rotate-z":[{"rotate-z":eu()}],scale:[{scale:eb()}],"scale-x":[{"scale-x":eb()}],"scale-y":[{"scale-y":eb()}],"scale-z":[{"scale-z":eb()}],"scale-3d":["scale-3d"],skew:[{skew:ef()}],"skew-x":[{"skew-x":ef()}],"skew-y":[{"skew-y":ef()}],transform:[{transform:[F,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:eg()}],"translate-x":[{"translate-x":eg()}],"translate-y":[{"translate-y":eg()}],"translate-z":[{"translate-z":eg()}],"translate-none":["translate-none"],accent:[{accent:eo()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:eo()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F,K]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F,K]}],fill:[{fill:["none",...eo()]}],"stroke-w":[{stroke:[G,J,S,V]}],stroke:[{stroke:["none",...eo()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3298-0debe247d04c451b.js b/litellm/proxy/_experimental/out/_next/static/chunks/3298-0debe247d04c451b.js new file mode 100644 index 0000000000..c672d48cfb --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3298-0debe247d04c451b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3298],{1309:function(e,l,a){a.d(l,{C:function(){return r.Z}});var r=a(41649)},63298:function(e,l,a){a.d(l,{Z:function(){return eG}});var r,i,t=a(57437),s=a(2265),n=a(16312),o=a(82680),d=a(19250),c=a(93192),u=a(52787),m=a(91810),p=a(13634),g=a(3810),x=a(64504);(r=i||(i={})).PresidioPII="Presidio PII",r.Bedrock="Bedrock Guardrail",r.Lakera="Lakera";let h={},f=e=>{let l={};return l.PresidioPII="Presidio PII",l.Bedrock="Bedrock Guardrail",l.Lakera="Lakera",Object.entries(e).forEach(e=>{let[a,r]=e;r&&"object"==typeof r&&"ui_friendly_name"in r&&(l[a.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=r.ui_friendly_name)}),h=l,l},j=()=>Object.keys(h).length>0?h:i,v={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2"},_=e=>{Object.entries(e).forEach(e=>{let[l,a]=e;a&&"object"==typeof a&&"ui_friendly_name"in a&&(v[l.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=l)})},y=e=>!!e&&"Presidio PII"===j()[e],b="../ui/assets/logos/",N={"Presidio PII":"".concat(b,"presidio.png"),"Bedrock Guardrail":"".concat(b,"bedrock.svg"),Lakera:"".concat(b,"lakeraai.jpeg"),"Azure Content Safety Prompt Shield":"".concat(b,"presidio.png"),"Azure Content Safety Text Moderation":"".concat(b,"presidio.png"),"Aporia AI":"".concat(b,"aporia.png"),"PANW Prisma AIRS":"".concat(b,"palo_alto_networks.jpeg"),"Noma Security":"".concat(b,"noma_security.png"),"Javelin Guardrails":"".concat(b,"javelin.png"),"Pillar Guardrail":"".concat(b,"pillar.jpeg"),"Google Cloud Model Armor":"".concat(b,"google.svg"),"Guardrails AI":"".concat(b,"guardrails_ai.jpeg"),"Lasso Guardrail":"".concat(b,"lasso.png"),"Pangea Guardrail":"".concat(b,"pangea.png"),"AIM Guardrail":"".concat(b,"aim_security.jpeg"),"OpenAI Moderation":"".concat(b,"openai_small.svg"),EnkryptAI:"".concat(b,"enkrypt_ai.avif")},S=e=>{if(!e)return{logo:"",displayName:"-"};let l=Object.keys(v).find(l=>v[l].toLowerCase()===e.toLowerCase());if(!l)return{logo:"",displayName:e};let a=j()[l];return{logo:N[a]||"",displayName:a||e}};var k=a(33866),w=a(89970),I=a(73002),P=a(4156),Z=a(97416),C=a(8881),O=a(10798),A=a(49638);let{Text:E}=c.default,{Option:G}=u.default,L=e=>e.replace(/_/g," "),F=e=>{switch(e){case"MASK":return(0,t.jsx)(Z.Z,{style:{marginRight:4}});case"BLOCK":return(0,t.jsx)(C.Z,{style:{marginRight:4}});default:return null}},z=e=>{let{categories:l,selectedCategories:a,onChange:r}=e;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center mb-2",children:[(0,t.jsx)(O.Z,{className:"text-gray-500 mr-1"}),(0,t.jsx)(E,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,t.jsx)(u.default,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:r,value:a,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,t.jsx)(g.Z,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:l.map(e=>(0,t.jsx)(G,{value:e.category,children:e.category},e.category))})]})},T=e=>{let{onSelectAll:l,onUnselectAll:a,hasSelectedEntities:r}=e;return(0,t.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(E,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,t.jsx)(w.Z,{title:"Apply action to all PII types at once",children:(0,t.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,t.jsx)(I.ZP,{type:"default",onClick:a,disabled:!r,icon:(0,t.jsx)(A.Z,{}),className:"border-gray-300 hover:text-red-600 hover:border-red-300",children:"Unselect All"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsx)(I.ZP,{type:"default",onClick:()=>l("MASK"),className:"flex items-center justify-center h-10 border-blue-200 hover:border-blue-300 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 text-blue-600",block:!0,icon:(0,t.jsx)(Z.Z,{}),children:"Select All & Mask"}),(0,t.jsx)(I.ZP,{type:"default",onClick:()=>l("BLOCK"),className:"flex items-center justify-center h-10 border-red-200 hover:border-red-300 hover:text-red-700 bg-red-50 hover:bg-red-100 text-red-600",block:!0,icon:(0,t.jsx)(C.Z,{}),children:"Select All & Block"})]})]})},M=e=>{let{entities:l,selectedEntities:a,selectedActions:r,actions:i,onEntitySelect:s,onActionSelect:n,entityToCategoryMap:o}=e;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,t.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,t.jsx)(E,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,t.jsx)(E,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,t.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===l.length?(0,t.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):l.map(e=>(0,t.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ".concat(a.includes(e)?"bg-blue-50":""),children:[(0,t.jsxs)("div",{className:"flex items-center flex-1",children:[(0,t.jsx)(P.Z,{checked:a.includes(e),onChange:()=>s(e),className:"mr-3"}),(0,t.jsx)(E,{className:a.includes(e)?"font-medium text-gray-900":"text-gray-700",children:L(e)}),o.get(e)&&(0,t.jsx)(g.Z,{className:"ml-2 text-xs",color:"blue",children:o.get(e)})]}),(0,t.jsx)("div",{className:"w-32",children:(0,t.jsx)(u.default,{value:a.includes(e)&&r[e]||"MASK",onChange:l=>n(e,l),style:{width:120},disabled:!a.includes(e),className:"".concat(a.includes(e)?"":"opacity-50"),dropdownMatchSelectWidth:!1,children:i.map(e=>(0,t.jsx)(G,{value:e,children:(0,t.jsxs)("div",{className:"flex items-center",children:[F(e),e]})},e))})})]},e))})]})},{Title:B,Text:J}=c.default;var D=e=>{let{entities:l,actions:a,selectedEntities:r,selectedActions:i,onEntitySelect:n,onActionSelect:o,entityCategories:d=[]}=e,[c,u]=(0,s.useState)([]),m=new Map;d.forEach(e=>{e.entities.forEach(l=>{m.set(l,e.category)})});let p=l.filter(e=>0===c.length||c.includes(m.get(e)||""));return(0,t.jsxs)("div",{className:"pii-configuration",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)(B,{level:4,className:"mb-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,t.jsx)(k.Z,{count:r.length,showZero:!0,style:{backgroundColor:r.length>0?"#4f46e5":"#d9d9d9"},overflowCount:999,children:(0,t.jsxs)(J,{className:"text-gray-500",children:[r.length," items selected"]})})]}),(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(z,{categories:d,selectedCategories:c,onChange:u}),(0,t.jsx)(T,{onSelectAll:e=>{l.forEach(l=>{r.includes(l)||n(l),o(l,e)})},onUnselectAll:()=>{r.forEach(e=>{n(e)})},hasSelectedEntities:r.length>0})]}),(0,t.jsx)(M,{entities:p,selectedEntities:r,selectedActions:i,actions:a,onEntitySelect:n,onActionSelect:o,entityToCategoryMap:m})]})},V=a(87908),K=a(31283),R=a(24199),U=e=>{var l;let{selectedProvider:a,accessToken:r,providerParams:i=null,value:n=null}=e,[o,c]=(0,s.useState)(!1),[m,g]=(0,s.useState)(i),[x,h]=(0,s.useState)(null);if((0,s.useEffect)(()=>{if(i){g(i);return}let e=async()=>{if(r){c(!0),h(null);try{let e=await (0,d.getGuardrailProviderSpecificParams)(r);console.log("Provider params API response:",e),g(e),f(e),_(e)}catch(e){console.error("Error fetching provider params:",e),h("Failed to load provider parameters")}finally{c(!1)}}};i||e()},[r,i]),!a)return null;if(o)return(0,t.jsx)(V.Z,{tip:"Loading provider parameters..."});if(x)return(0,t.jsx)("div",{className:"text-red-500",children:x});let j=null===(l=v[a])||void 0===l?void 0:l.toLowerCase(),y=m&&m[j];if(console.log("Provider key:",j),console.log("Provider fields:",y),!y||0===Object.keys(y).length)return(0,t.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",n);let b=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;return Object.entries(e).map(e=>{let[r,i]=e,s=l?"".concat(l,".").concat(r):r,o=a?a[r]:null==n?void 0:n[r];return(console.log("Field value:",o),"ui_friendly_name"===r||"optional_params"===r&&"nested"===i.type&&i.fields)?null:"nested"===i.type&&i.fields?(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"mb-2 font-medium",children:r}),(0,t.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:b(i.fields,s,o)})]},s):(0,t.jsx)(p.Z.Item,{name:s,label:r,tooltip:i.description,rules:i.required?[{required:!0,message:"".concat(r," is required")}]:void 0,children:"select"===i.type&&i.options?(0,t.jsx)(u.default,{placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}):"multiselect"===i.type&&i.options?(0,t.jsx)(u.default,{mode:"multiple",placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}):"bool"===i.type||"boolean"===i.type?(0,t.jsxs)(u.default,{placeholder:i.description,defaultValue:void 0!==o?String(o):i.default_value,children:[(0,t.jsx)(u.default.Option,{value:"true",children:"True"}),(0,t.jsx)(u.default.Option,{value:"false",children:"False"})]}):"number"===i.type?(0,t.jsx)(R.Z,{step:1,width:400,placeholder:i.description,defaultValue:void 0!==o?Number(o):void 0}):r.includes("password")||r.includes("secret")||r.includes("key")?(0,t.jsx)(K.o,{placeholder:i.description,type:"password",defaultValue:o||""}):(0,t.jsx)(K.o,{placeholder:i.description,type:"text",defaultValue:o||""})},s)})};return(0,t.jsx)(t.Fragment,{children:b(y)})};let{Title:q}=c.default,H=e=>{let{field:l,fieldKey:a,fullFieldKey:r,value:i}=e,[n,o]=s.useState([]),[d,c]=s.useState(l.dict_key_options||[]);s.useEffect(()=>{if(i&&"object"==typeof i){let e=Object.keys(i);o(e.map(e=>({key:e,id:"".concat(e,"_").concat(Date.now(),"_").concat(Math.random())}))),c((l.dict_key_options||[]).filter(l=>!e.includes(l)))}},[i,l.dict_key_options]);let m=e=>{e&&(o([...n,{key:e,id:"".concat(e,"_").concat(Date.now())}]),c(d.filter(l=>l!==e)))},g=(e,l)=>{o(n.filter(l=>l.id!==e)),c([...d,l].sort())};return(0,t.jsxs)("div",{className:"space-y-3",children:[n.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,t.jsx)("div",{className:"w-24 font-medium text-sm",children:e.key}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(p.Z.Item,{name:Array.isArray(r)?[...r,e.key]:[r,e.key],style:{marginBottom:0},initialValue:i&&"object"==typeof i?i[e.key]:void 0,normalize:"number"===l.dict_value_type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"number"===l.dict_value_type?(0,t.jsx)(R.Z,{step:1,width:200,placeholder:"Enter ".concat(e.key," value")}):"boolean"===l.dict_value_type?(0,t.jsxs)(u.default,{placeholder:"Select ".concat(e.key," value"),children:[(0,t.jsx)(u.default.Option,{value:!0,children:"True"}),(0,t.jsx)(u.default.Option,{value:!1,children:"False"})]}):(0,t.jsx)(K.o,{placeholder:"Enter ".concat(e.key," value"),type:"text"})})}),(0,t.jsx)("button",{type:"button",className:"text-red-500 hover:text-red-700 text-sm",onClick:()=>g(e.id,e.key),children:"Remove"})]},e.id)),d.length>0&&(0,t.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,t.jsx)(u.default,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&m(e),value:void 0,children:d.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})};var Y=e=>{let{optionalParams:l,parentFieldKey:a,values:r}=e,i=(e,l)=>{let i="".concat(a,".").concat(e),s=null==r?void 0:r[e];return(console.log("value",s),"dict"===l.type&&l.dict_key_options)?(0,t.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,t.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l.description}),(0,t.jsx)(H,{field:l,fieldKey:e,fullFieldKey:[a,e],value:s})]},i):(0,t.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,t.jsx)(p.Z.Item,{name:[a,e],label:(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:l.description})]}),rules:l.required?[{required:!0,message:"".concat(e," is required")}]:void 0,className:"mb-0",initialValue:void 0!==s?s:l.default_value,normalize:"number"===l.type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"select"===l.type&&l.options?(0,t.jsx)(u.default,{placeholder:l.description,children:l.options.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}):"multiselect"===l.type&&l.options?(0,t.jsx)(u.default,{mode:"multiple",placeholder:l.description,children:l.options.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}):"bool"===l.type||"boolean"===l.type?(0,t.jsxs)(u.default,{placeholder:l.description,children:[(0,t.jsx)(u.default.Option,{value:"true",children:"True"}),(0,t.jsx)(u.default.Option,{value:"false",children:"False"})]}):"number"===l.type?(0,t.jsx)(R.Z,{step:1,width:400,placeholder:l.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,t.jsx)(K.o,{placeholder:l.description,type:"password"}):(0,t.jsx)(K.o,{placeholder:l.description,type:"text"})})},i)};return l.fields&&0!==Object.keys(l.fields).length?(0,t.jsxs)("div",{className:"guardrail-optional-params",children:[(0,t.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,t.jsx)(q,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,t.jsx)("p",{className:"text-gray-600 text-sm",children:l.description||"Configure additional settings for this guardrail provider"})]}),(0,t.jsx)("div",{className:"space-y-8",children:Object.entries(l.fields).map(e=>{let[l,a]=e;return i(l,a)})})]}):null},Q=a(9114);let{Title:W,Text:X,Link:$}=c.default,{Option:ee}=u.default,{Step:el}=m.default,ea={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call",pre_mcp_call:"Before MCP Tool Call - Runs before MCP tool execution and validates tool calls",during_mcp_call:"During MCP Tool Call - Runs in parallel with MCP tool execution for monitoring"};var er=e=>{let{visible:l,onClose:a,accessToken:r,onSuccess:i}=e,[n]=p.Z.useForm(),[c,h]=(0,s.useState)(!1),[b,S]=(0,s.useState)(null),[k,w]=(0,s.useState)(null),[I,P]=(0,s.useState)([]),[Z,C]=(0,s.useState)({}),[O,A]=(0,s.useState)(0),[E,G]=(0,s.useState)(null),[L,F]=(0,s.useState)([]),[z,T]=(0,s.useState)(2),[M,B]=(0,s.useState)({});(0,s.useEffect)(()=>{r&&(async()=>{try{let[e,l]=await Promise.all([(0,d.getGuardrailUISettings)(r),(0,d.getGuardrailProviderSpecificParams)(r)]);w(e),G(l),f(l),_(l)}catch(e){console.error("Error fetching guardrail data:",e),Q.Z.fromBackend("Failed to load guardrail configuration")}})()},[r]);let J=e=>{S(e),n.setFieldsValue({config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0}),P([]),C({}),F([]),T(2),B({})},V=e=>{P(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},K=(e,l)=>{C(a=>({...a,[e]:l}))},R=async()=>{try{if(0===O&&(await n.validateFields(["guardrail_name","provider","mode","default_on"]),b)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===b&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await n.validateFields(e)}if(1===O&&y(b)&&0===I.length){Q.Z.fromBackend("Please select at least one PII entity to continue");return}A(O+1)}catch(e){console.error("Form validation failed:",e)}},q=()=>{n.resetFields(),S(null),P([]),C({}),F([]),T(2),B({}),A(0)},H=()=>{q(),a()},W=async()=>{try{h(!0),await n.validateFields();let l=n.getFieldsValue(!0),t=v[l.provider],s={guardrail_name:l.guardrail_name,litellm_params:{guardrail:t,mode:l.mode,default_on:l.default_on},guardrail_info:{}};if("PresidioPII"===l.provider&&I.length>0){let e={};I.forEach(l=>{e[l]=Z[l]||"MASK"}),s.litellm_params.pii_entities_config=e,l.presidio_analyzer_api_base&&(s.litellm_params.presidio_analyzer_api_base=l.presidio_analyzer_api_base),l.presidio_anonymizer_api_base&&(s.litellm_params.presidio_anonymizer_api_base=l.presidio_anonymizer_api_base)}else if(l.config)try{let e=JSON.parse(l.config);s.guardrail_info=e}catch(e){Q.Z.fromBackend("Invalid JSON in configuration"),h(!1);return}if(console.log("values: ",JSON.stringify(l)),E&&b){var e;let a=null===(e=v[b])||void 0===e?void 0:e.toLowerCase();console.log("providerKey: ",a);let r=E[a]||{},i=new Set;console.log("providerSpecificParams: ",JSON.stringify(r)),Object.keys(r).forEach(e=>{"optional_params"!==e&&i.add(e)}),r.optional_params&&r.optional_params.fields&&Object.keys(r.optional_params.fields).forEach(e=>{i.add(e)}),console.log("allowedParams: ",i),i.forEach(e=>{let a=l[e];if(null==a||""===a){var r;a=null===(r=l.optional_params)||void 0===r?void 0:r[e]}null!=a&&""!==a&&(s.litellm_params[e]=a)})}if(!r)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(s)),await (0,d.createGuardrailCall)(r,s),Q.Z.success("Guardrail created successfully"),q(),i(),a()}catch(e){console.error("Failed to create guardrail:",e),Q.Z.fromBackend("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{h(!1)}},X=()=>{var e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,t.jsx)(x.o,{placeholder:"Enter a name for this guardrail"})}),(0,t.jsx)(p.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,t.jsx)(u.default,{placeholder:"Select a guardrail provider",onChange:J,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(j()).map(e=>{let[l,a]=e;return(0,t.jsx)(ee,{value:l,label:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[N[a]&&(0,t.jsx)("img",{src:N[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,t.jsx)("span",{children:a})]}),children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[N[a]&&(0,t.jsx)("img",{src:N[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,t.jsx)("span",{children:a})]})},l)})})}),(0,t.jsx)(p.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,t.jsx)(u.default,{optionLabelProp:"label",mode:"multiple",children:(null==k?void 0:null===(e=k.supported_modes)||void 0===e?void 0:e.map(e=>(0,t.jsx)(ee,{value:e,label:e,children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:e}),"pre_call"===e&&(0,t.jsx)(g.Z,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea[e]})]})},e)))||(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ee,{value:"pre_call",label:"pre_call",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"pre_call"})," ",(0,t.jsx)(g.Z,{color:"green",children:"Recommended"})]}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea.pre_call})]})}),(0,t.jsx)(ee,{value:"during_call",label:"during_call",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:(0,t.jsx)("strong",{children:"during_call"})}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea.during_call})]})}),(0,t.jsx)(ee,{value:"post_call",label:"post_call",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:(0,t.jsx)("strong",{children:"post_call"})}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea.post_call})]})}),(0,t.jsx)(ee,{value:"logging_only",label:"logging_only",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:(0,t.jsx)("strong",{children:"logging_only"})}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea.logging_only})]})})]})})}),(0,t.jsx)(p.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,t.jsxs)(u.default,{children:[(0,t.jsx)(u.default.Option,{value:!0,children:"Yes"}),(0,t.jsx)(u.default.Option,{value:!1,children:"No"})]})}),(0,t.jsx)(U,{selectedProvider:b,accessToken:r,providerParams:E})]})},$=()=>k&&"PresidioPII"===b?(0,t.jsx)(D,{entities:k.supported_entities,actions:k.supported_actions,selectedEntities:I,selectedActions:Z,onEntitySelect:V,onActionSelect:K,entityCategories:k.pii_entity_categories}):null,er=()=>{var e;if(!b||!E)return null;console.log("guardrail_provider_map: ",v),console.log("selectedProvider: ",b);let l=null===(e=v[b])||void 0===e?void 0:e.toLowerCase(),a=E&&E[l];return a&&a.optional_params?(0,t.jsx)(Y,{optionalParams:a.optional_params,parentFieldKey:"optional_params"}):null};return(0,t.jsx)(o.Z,{title:"Add Guardrail",open:l,onCancel:H,footer:null,width:700,children:(0,t.jsxs)(p.Z,{form:n,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1},children:[(0,t.jsxs)(m.default,{current:O,className:"mb-6",children:[(0,t.jsx)(el,{title:"Basic Info"}),(0,t.jsx)(el,{title:y(b)?"PII Configuration":"Provider Configuration"})]}),(()=>{switch(O){case 0:return X();case 1:if(y(b))return $();return er();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[O>0&&(0,t.jsx)(x.z,{variant:"secondary",onClick:()=>{A(O-1)},children:"Previous"}),O<2&&(0,t.jsx)(x.z,{onClick:R,children:"Next"}),2===O&&(0,t.jsx)(x.z,{onClick:W,loading:c,children:"Create Guardrail"}),(0,t.jsx)(x.z,{variant:"secondary",onClick:H,children:"Cancel"})]})]})})},ei=a(20831),et=a(47323),es=a(21626),en=a(97214),eo=a(28241),ed=a(58834),ec=a(69552),eu=a(71876),em=a(74998),ep=a(44633),eg=a(86462),ex=a(49084),eh=a(1309),ef=a(71594),ej=a(24525),ev=a(64482),e_=a(63709);let{Title:ey,Text:eb}=c.default,{Option:eN}=u.default;var eS=e=>{var l;let{visible:a,onClose:r,accessToken:i,onSuccess:n,guardrailId:c,initialValues:m}=e,[g]=p.Z.useForm(),[h,f]=(0,s.useState)(!1),[_,y]=(0,s.useState)((null==m?void 0:m.provider)||null),[b,S]=(0,s.useState)(null),[k,w]=(0,s.useState)([]),[I,P]=(0,s.useState)({});(0,s.useEffect)(()=>{(async()=>{try{if(!i)return;let e=await (0,d.getGuardrailUISettings)(i);S(e)}catch(e){console.error("Error fetching guardrail settings:",e),Q.Z.fromBackend("Failed to load guardrail settings")}})()},[i]),(0,s.useEffect)(()=>{(null==m?void 0:m.pii_entities_config)&&Object.keys(m.pii_entities_config).length>0&&(w(Object.keys(m.pii_entities_config)),P(m.pii_entities_config))},[m]);let Z=e=>{w(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},C=(e,l)=>{P(a=>({...a,[e]:l}))},O=async()=>{try{f(!0);let e=await g.validateFields(),l=v[e.provider],a={guardrail_id:c,guardrail:{guardrail_name:e.guardrail_name,litellm_params:{guardrail:l,mode:e.mode,default_on:e.default_on},guardrail_info:{}}};if("PresidioPII"===e.provider&&k.length>0){let e={};k.forEach(l=>{e[l]=I[l]||"MASK"}),a.guardrail.litellm_params.pii_entities_config=e}else if(e.config)try{let l=JSON.parse(e.config);"Bedrock"===e.provider&&l?(l.guardrail_id&&(a.guardrail.litellm_params.guardrailIdentifier=l.guardrail_id),l.guardrail_version&&(a.guardrail.litellm_params.guardrailVersion=l.guardrail_version)):a.guardrail.guardrail_info=l}catch(e){Q.Z.fromBackend("Invalid JSON in configuration"),f(!1);return}if(!i)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(a));let t=await fetch("/guardrails/".concat(c),{method:"PUT",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(a)});if(!t.ok){let e=await t.text();throw Error(e||"Failed to update guardrail")}Q.Z.success("Guardrail updated successfully"),n(),r()}catch(e){console.error("Failed to update guardrail:",e),Q.Z.fromBackend("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}},A=()=>b&&_&&"PresidioPII"===_?(0,t.jsx)(D,{entities:b.supported_entities,actions:b.supported_actions,selectedEntities:k,selectedActions:I,onEntitySelect:Z,onActionSelect:C,entityCategories:b.pii_entity_categories}):null;return(0,t.jsx)(o.Z,{title:"Edit Guardrail",open:a,onCancel:r,footer:null,width:700,children:(0,t.jsxs)(p.Z,{form:g,layout:"vertical",initialValues:m,children:[(0,t.jsx)(p.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,t.jsx)(x.o,{placeholder:"Enter a name for this guardrail"})}),(0,t.jsx)(p.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,t.jsx)(u.default,{placeholder:"Select a guardrail provider",onChange:e=>{y(e),g.setFieldsValue({config:void 0}),w([]),P({})},disabled:!0,optionLabelProp:"label",children:Object.entries(j()).map(e=>{let[l,a]=e;return(0,t.jsx)(eN,{value:l,label:a,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[N[a]&&(0,t.jsx)("img",{src:N[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,t.jsx)("span",{children:a})]})},l)})})}),(0,t.jsx)(p.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,t.jsx)(u.default,{children:(null==b?void 0:null===(l=b.supported_modes)||void 0===l?void 0:l.map(e=>(0,t.jsx)(eN,{value:e,children:e},e)))||(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eN,{value:"pre_call",children:"pre_call"}),(0,t.jsx)(eN,{value:"post_call",children:"post_call"})]})})}),(0,t.jsx)(p.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,t.jsx)(e_.Z,{})}),(()=>{if(!_)return null;if("PresidioPII"===_)return A();switch(_){case"Aporia":return(0,t.jsx)(p.Z.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aporia_api_key",\n "project_name": "your_project_name"\n}'})});case"AimSecurity":return(0,t.jsx)(p.Z.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aim_api_key"\n}'})});case"Bedrock":return(0,t.jsx)(p.Z.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "guardrail_id": "your_guardrail_id",\n "guardrail_version": "your_guardrail_version"\n}'})});case"GuardrailsAI":return(0,t.jsx)(p.Z.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_guardrails_api_key",\n "guardrail_id": "your_guardrail_id"\n}'})});case"LakeraAI":return(0,t.jsx)(p.Z.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_lakera_api_key"\n}'})});case"PromptInjection":return(0,t.jsx)(p.Z.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "threshold": 0.8\n}'})});default:return(0,t.jsx)(p.Z.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "key1": "value1",\n "key2": "value2"\n}'})})}})(),(0,t.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,t.jsx)(x.z,{variant:"secondary",onClick:r,children:"Cancel"}),(0,t.jsx)(x.z,{onClick:O,loading:h,children:"Update Guardrail"})]})]})})},ek=e=>{let{guardrailsList:l,isLoading:a,onDeleteClick:r,accessToken:i,onGuardrailUpdated:n,isAdmin:o=!1,onGuardrailClick:d}=e,[c,u]=(0,s.useState)([{id:"created_at",desc:!0}]),[m,p]=(0,s.useState)(!1),[g,x]=(0,s.useState)(null),h=e=>e?new Date(e).toLocaleString():"-",f=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,t.jsx)(w.Z,{title:String(e.getValue()||""),children:(0,t.jsx)(ei.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&d(e.getValue()),children:e.getValue()?"".concat(String(e.getValue()).slice(0,7),"..."):""})})},{header:"Name",accessorKey:"guardrail_name",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)(w.Z,{title:a.guardrail_name,children:(0,t.jsx)("span",{className:"text-xs font-medium",children:a.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:e=>{let{row:l}=e,{logo:a,displayName:r}=S(l.original.litellm_params.guardrail);return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,t.jsx)("img",{src:a,alt:"".concat(r," logo"),className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("span",{className:"text-xs",children:r})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)("span",{className:"text-xs",children:a.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:e=>{var l,a;let{row:r}=e,i=r.original;return(0,t.jsx)(eh.C,{color:(null===(l=i.litellm_params)||void 0===l?void 0:l.default_on)?"green":"gray",className:"text-xs font-normal",size:"xs",children:(null===(a=i.litellm_params)||void 0===a?void 0:a.default_on)?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)(w.Z,{title:a.created_at,children:(0,t.jsx)("span",{className:"text-xs",children:h(a.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)(w.Z,{title:a.updated_at,children:(0,t.jsx)("span",{className:"text-xs",children:h(a.updated_at)})})}},{id:"actions",header:"",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)("div",{className:"flex space-x-2",children:(0,t.jsx)(et.Z,{icon:em.Z,size:"sm",onClick:()=>a.guardrail_id&&r(a.guardrail_id,a.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500",tooltip:"Delete guardrail"})})}}],j=(0,ef.b7)({data:l,columns:f,state:{sorting:c},onSortingChange:u,getCoreRowModel:(0,ej.sC)(),getSortedRowModel:(0,ej.tj)(),enableSorting:!0});return(0,t.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(es.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(ed.Z,{children:j.getHeaderGroups().map(e=>(0,t.jsx)(eu.Z,{children:e.headers.map(e=>(0,t.jsx)(ec.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,ef.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(ep.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(eg.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(ex.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,t.jsx)(en.Z,{children:a?(0,t.jsx)(eu.Z,{children:(0,t.jsx)(eo.Z,{colSpan:f.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"Loading..."})})})}):l.length>0?j.getRowModel().rows.map(e=>(0,t.jsx)(eu.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(eo.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,ef.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(eu.Z,{children:(0,t.jsx)(eo.Z,{colSpan:f.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No guardrails found"})})})})})]})}),g&&(0,t.jsx)(eS,{visible:m,onClose:()=>p(!1),accessToken:i,onSuccess:()=>{p(!1),x(null),n()},guardrailId:g.guardrail_id||"",initialValues:{guardrail_name:g.guardrail_name||"",provider:Object.keys(v).find(e=>v[e]===(null==g?void 0:g.litellm_params.guardrail))||"",mode:g.litellm_params.mode,default_on:g.litellm_params.default_on,pii_entities_config:g.litellm_params.pii_entities_config,...g.guardrail_info}})]})},ew=a(20347),eI=a(30078),eP=a(23496),eZ=a(10900),eC=a(59872),eO=a(30401),eA=a(78867),eE=e=>{var l,a,r,i,n,o,c,m,g,x,h;let{guardrailId:f,onClose:j,accessToken:_,isAdmin:y}=e,[b,N]=(0,s.useState)(null),[k,w]=(0,s.useState)(null),[P,Z]=(0,s.useState)(!0),[C,O]=(0,s.useState)(!1),[A]=p.Z.useForm(),[E,G]=(0,s.useState)([]),[L,F]=(0,s.useState)({}),[z,T]=(0,s.useState)(null),[M,B]=(0,s.useState)({}),J=async()=>{try{var e;if(Z(!0),!_)return;let l=await (0,d.getGuardrailInfo)(_,f);if(N(l),null===(e=l.litellm_params)||void 0===e?void 0:e.pii_entities_config){let e=l.litellm_params.pii_entities_config;if(G([]),F({}),Object.keys(e).length>0){let l=[],a={};Object.entries(e).forEach(e=>{let[r,i]=e;l.push(r),a[r]="string"==typeof i?i:"MASK"}),G(l),F(a)}}else G([]),F({})}catch(e){Q.Z.fromBackend("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{Z(!1)}},V=async()=>{try{if(!_)return;let e=await (0,d.getGuardrailProviderSpecificParams)(_);w(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},K=async()=>{try{if(!_)return;let e=await (0,d.getGuardrailUISettings)(_);T(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,s.useEffect)(()=>{V()},[_]),(0,s.useEffect)(()=>{J(),K()},[f,_]),(0,s.useEffect)(()=>{if(b&&A){var e;A.setFieldsValue({guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(e=b.litellm_params)||void 0===e?void 0:e.optional_params)&&{optional_params:b.litellm_params.optional_params}})}},[b,k,A]);let R=async e=>{try{var l,a,r;if(!_)return;let i={litellm_params:{}};e.guardrail_name!==b.guardrail_name&&(i.guardrail_name=e.guardrail_name),e.default_on!==(null===(l=b.litellm_params)||void 0===l?void 0:l.default_on)&&(i.litellm_params.default_on=e.default_on);let t=b.guardrail_info,s=e.guardrail_info?JSON.parse(e.guardrail_info):void 0;JSON.stringify(t)!==JSON.stringify(s)&&(i.guardrail_info=s);let n=(null===(a=b.litellm_params)||void 0===a?void 0:a.pii_entities_config)||{},o={};E.forEach(e=>{o[e]=L[e]||"MASK"}),JSON.stringify(n)!==JSON.stringify(o)&&(i.litellm_params.pii_entities_config=o);let c=Object.keys(v).find(e=>{var l;return v[e]===(null===(l=b.litellm_params)||void 0===l?void 0:l.guardrail)});if(console.log("values: ",JSON.stringify(e)),console.log("currentProvider: ",c),k&&c){let l=k[null===(r=v[c])||void 0===r?void 0:r.toLowerCase()]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(l)),Object.keys(l).forEach(e=>{"optional_params"!==e&&a.add(e)}),l.optional_params&&l.optional_params.fields&&Object.keys(l.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(l=>{var a,r;let t=e[l];(null==t||""===t)&&(t=null===(r=e.optional_params)||void 0===r?void 0:r[l]);let s=null===(a=b.litellm_params)||void 0===a?void 0:a[l];JSON.stringify(t)!==JSON.stringify(s)&&(null!=t&&""!==t?i.litellm_params[l]=t:null!=s&&""!==s&&(i.litellm_params[l]=null))})}if(0===Object.keys(i.litellm_params).length&&delete i.litellm_params,0===Object.keys(i).length){Q.Z.info("No changes detected"),O(!1);return}await (0,d.updateGuardrailCall)(_,f,i),Q.Z.success("Guardrail updated successfully"),J(),O(!1)}catch(e){console.error("Error updating guardrail:",e),Q.Z.fromBackend("Failed to update guardrail")}};if(P)return(0,t.jsx)("div",{className:"p-4",children:"Loading..."});if(!b)return(0,t.jsx)("div",{className:"p-4",children:"Guardrail not found"});let q=e=>e?new Date(e).toLocaleString():"-",{logo:H,displayName:W}=S((null===(l=b.litellm_params)||void 0===l?void 0:l.guardrail)||""),X=async(e,l)=>{await (0,eC.vQ)(e)&&(B(e=>({...e,[l]:!0})),setTimeout(()=>{B(e=>({...e,[l]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.zx,{icon:eZ.Z,variant:"light",onClick:j,className:"mb-4",children:"Back to Guardrails"}),(0,t.jsx)(eI.Dx,{children:b.guardrail_name||"Unnamed Guardrail"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(eI.xv,{className:"text-gray-500 font-mono",children:b.guardrail_id}),(0,t.jsx)(I.ZP,{type:"text",size:"small",icon:M["guardrail-id"]?(0,t.jsx)(eO.Z,{size:12}):(0,t.jsx)(eA.Z,{size:12}),onClick:()=>X(b.guardrail_id,"guardrail-id"),className:"left-2 z-10 transition-all duration-200 ".concat(M["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)(eI.v0,{children:[(0,t.jsxs)(eI.td,{className:"mb-4",children:[(0,t.jsx)(eI.OK,{children:"Overview"},"overview"),y?(0,t.jsx)(eI.OK,{children:"Settings"},"settings"):(0,t.jsx)(t.Fragment,{})]}),(0,t.jsxs)(eI.nP,{children:[(0,t.jsxs)(eI.x4,{children:[(0,t.jsxs)(eI.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(eI.Zb,{children:[(0,t.jsx)(eI.xv,{children:"Provider"}),(0,t.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[H&&(0,t.jsx)("img",{src:H,alt:"".concat(W," logo"),className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)(eI.Dx,{children:W})]})]}),(0,t.jsxs)(eI.Zb,{children:[(0,t.jsx)(eI.xv,{children:"Mode"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(eI.Dx,{children:(null===(a=b.litellm_params)||void 0===a?void 0:a.mode)||"-"}),(0,t.jsx)(eI.Ct,{color:(null===(r=b.litellm_params)||void 0===r?void 0:r.default_on)?"green":"gray",children:(null===(i=b.litellm_params)||void 0===i?void 0:i.default_on)?"Default On":"Default Off"})]})]}),(0,t.jsxs)(eI.Zb,{children:[(0,t.jsx)(eI.xv,{children:"Created At"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(eI.Dx,{children:q(b.created_at)}),(0,t.jsxs)(eI.xv,{children:["Last Updated: ",q(b.updated_at)]})]})]})]}),(null===(n=b.litellm_params)||void 0===n?void 0:n.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,t.jsx)(eI.Zb,{className:"mt-6",children:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"PII Protection"}),(0,t.jsxs)(eI.Ct,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),b.guardrail_info&&Object.keys(b.guardrail_info).length>0&&(0,t.jsxs)(eI.Zb,{className:"mt-6",children:[(0,t.jsx)(eI.xv,{children:"Guardrail Info"}),(0,t.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(b.guardrail_info).map(e=>{let[l,a]=e;return(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(eI.xv,{className:"font-medium w-1/3",children:l}),(0,t.jsx)(eI.xv,{className:"w-2/3",children:"object"==typeof a?JSON.stringify(a,null,2):String(a)})]},l)})})]})]}),y&&(0,t.jsx)(eI.x4,{children:(0,t.jsxs)(eI.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(eI.Dx,{children:"Guardrail Settings"}),!C&&(0,t.jsx)(eI.zx,{onClick:()=>O(!0),children:"Edit Settings"})]}),C?(0,t.jsxs)(p.Z,{form:A,onFinish:R,initialValues:{guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(o=b.litellm_params)||void 0===o?void 0:o.optional_params)&&{optional_params:b.litellm_params.optional_params}},layout:"vertical",children:[(0,t.jsx)(p.Z.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,t.jsx)(eI.oi,{})}),(0,t.jsx)(p.Z.Item,{label:"Default On",name:"default_on",children:(0,t.jsxs)(u.default,{children:[(0,t.jsx)(u.default.Option,{value:!0,children:"Yes"}),(0,t.jsx)(u.default.Option,{value:!1,children:"No"})]})}),(null===(c=b.litellm_params)||void 0===c?void 0:c.guardrail)==="presidio"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eP.Z,{orientation:"left",children:"PII Protection"}),(0,t.jsx)("div",{className:"mb-6",children:z&&(0,t.jsx)(D,{entities:z.supported_entities,actions:z.supported_actions,selectedEntities:E,selectedActions:L,onEntitySelect:e=>{G(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},onActionSelect:(e,l)=>{F(a=>({...a,[e]:l}))},entityCategories:z.pii_entity_categories})})]}),(0,t.jsx)(eP.Z,{orientation:"left",children:"Provider Settings"}),(0,t.jsx)(U,{selectedProvider:Object.keys(v).find(e=>{var l;return v[e]===(null===(l=b.litellm_params)||void 0===l?void 0:l.guardrail)})||null,accessToken:_,providerParams:k,value:b.litellm_params}),k&&(()=>{var e;let l=Object.keys(v).find(e=>{var l;return v[e]===(null===(l=b.litellm_params)||void 0===l?void 0:l.guardrail)});if(!l)return null;let a=k[null===(e=v[l])||void 0===e?void 0:e.toLowerCase()];return a&&a.optional_params?(0,t.jsx)(Y,{optionalParams:a.optional_params,parentFieldKey:"optional_params",values:b.litellm_params}):null})(),(0,t.jsx)(eP.Z,{orientation:"left",children:"Advanced Settings"}),(0,t.jsx)(p.Z.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,t.jsx)(ev.default.TextArea,{rows:5})}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,t.jsx)(I.ZP,{onClick:()=>O(!1),children:"Cancel"}),(0,t.jsx)(eI.zx,{children:"Save Changes"})]})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Guardrail ID"}),(0,t.jsx)("div",{className:"font-mono",children:b.guardrail_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Guardrail Name"}),(0,t.jsx)("div",{children:b.guardrail_name||"Unnamed Guardrail"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Provider"}),(0,t.jsx)("div",{children:W})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Mode"}),(0,t.jsx)("div",{children:(null===(m=b.litellm_params)||void 0===m?void 0:m.mode)||"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Default On"}),(0,t.jsx)(eI.Ct,{color:(null===(g=b.litellm_params)||void 0===g?void 0:g.default_on)?"green":"gray",children:(null===(x=b.litellm_params)||void 0===x?void 0:x.default_on)?"Yes":"No"})]}),(null===(h=b.litellm_params)||void 0===h?void 0:h.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"PII Protection"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsxs)(eI.Ct,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Created At"}),(0,t.jsx)("div",{children:q(b.created_at)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Last Updated"}),(0,t.jsx)("div",{children:q(b.updated_at)})]})]})]})})]})]})]})},eG=e=>{let{accessToken:l,userRole:a}=e,[r,i]=(0,s.useState)([]),[c,u]=(0,s.useState)(!1),[m,p]=(0,s.useState)(!1),[g,x]=(0,s.useState)(!1),[h,f]=(0,s.useState)(null),[j,v]=(0,s.useState)(null),_=!!a&&(0,ew.tY)(a),y=async()=>{if(l){p(!0);try{let e=await (0,d.getGuardrailsList)(l);console.log("guardrails: ".concat(JSON.stringify(e))),i(e.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{p(!1)}}};(0,s.useEffect)(()=>{y()},[l]);let b=async()=>{if(h&&l){x(!0);try{await (0,d.deleteGuardrailCall)(l,h.id),Q.Z.success('Guardrail "'.concat(h.name,'" deleted successfully')),y()}catch(e){console.error("Error deleting guardrail:",e),Q.Z.fromBackend("Failed to delete guardrail")}finally{x(!1),f(null)}}};return(0,t.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,t.jsx)(n.z,{onClick:()=>{j&&v(null),u(!0)},disabled:!l,children:"+ Add New Guardrail"})}),j?(0,t.jsx)(eE,{guardrailId:j,onClose:()=>v(null),accessToken:l,isAdmin:_}):(0,t.jsx)(ek,{guardrailsList:r,isLoading:m,onDeleteClick:(e,l)=>{f({id:e,name:l})},accessToken:l,onGuardrailUpdated:y,isAdmin:_,onGuardrailClick:e=>v(e)}),(0,t.jsx)(er,{visible:c,onClose:()=>{u(!1)},accessToken:l,onSuccess:()=>{y()}}),h&&(0,t.jsxs)(o.Z,{title:"Delete Guardrail",open:null!==h,onOk:b,onCancel:()=>{f(null)},confirmLoading:g,okText:"Delete",okButtonProps:{danger:!0},children:[(0,t.jsxs)("p",{children:["Are you sure you want to delete guardrail: ",h.name," ?"]}),(0,t.jsx)("p",{children:"This action cannot be undone."})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3298-ad776747b5eff3ae.js b/litellm/proxy/_experimental/out/_next/static/chunks/3298-ad776747b5eff3ae.js deleted file mode 100644 index 5b953a5bdf..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3298-ad776747b5eff3ae.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3298],{1309:function(e,l,a){a.d(l,{C:function(){return r.Z}});var r=a(41649)},63298:function(e,l,a){a.d(l,{Z:function(){return eG}});var r,i,t=a(57437),s=a(2265),n=a(16312),o=a(82680),d=a(19250),c=a(93192),u=a(52787),m=a(91810),p=a(13634),g=a(3810),x=a(64504);(r=i||(i={})).PresidioPII="Presidio PII",r.Bedrock="Bedrock Guardrail",r.Lakera="Lakera";let h={},f=e=>{let l={};return l.PresidioPII="Presidio PII",l.Bedrock="Bedrock Guardrail",l.Lakera="Lakera",Object.entries(e).forEach(e=>{let[a,r]=e;r&&"object"==typeof r&&"ui_friendly_name"in r&&(l[a.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=r.ui_friendly_name)}),h=l,l},j=()=>Object.keys(h).length>0?h:i,v={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2"},_=e=>{Object.entries(e).forEach(e=>{let[l,a]=e;a&&"object"==typeof a&&"ui_friendly_name"in a&&(v[l.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=l)})},y=e=>!!e&&"Presidio PII"===j()[e],b="../ui/assets/logos/",N={"Presidio PII":"".concat(b,"presidio.png"),"Bedrock Guardrail":"".concat(b,"bedrock.svg"),Lakera:"".concat(b,"lakeraai.jpeg"),"Azure Content Safety Prompt Shield":"".concat(b,"presidio.png"),"Azure Content Safety Text Moderation":"".concat(b,"presidio.png"),"Aporia AI":"".concat(b,"aporia.png"),"PANW Prisma AIRS":"".concat(b,"palo_alto_networks.jpeg"),"Noma Security":"".concat(b,"noma_security.png"),"Javelin Guardrails":"".concat(b,"javelin.png"),"Pillar Guardrail":"".concat(b,"pillar.jpeg"),"Google Cloud Model Armor":"".concat(b,"google.svg"),"Guardrails AI":"".concat(b,"guardrails_ai.jpeg"),"Lasso Guardrail":"".concat(b,"lasso.png"),"Pangea Guardrail":"".concat(b,"pangea.png"),"AIM Guardrail":"".concat(b,"aim_security.jpeg"),"OpenAI Moderation":"".concat(b,"openai_small.svg"),EnkryptAI:"".concat(b,"enkrypt_ai.avif")},S=e=>{if(!e)return{logo:"",displayName:"-"};let l=Object.keys(v).find(l=>v[l].toLowerCase()===e.toLowerCase());if(!l)return{logo:"",displayName:e};let a=j()[l];return{logo:N[a]||"",displayName:a||e}};var k=a(33866),w=a(89970),I=a(73002),P=a(61994),Z=a(97416),C=a(8881),O=a(10798),A=a(49638);let{Text:E}=c.default,{Option:G}=u.default,L=e=>e.replace(/_/g," "),F=e=>{switch(e){case"MASK":return(0,t.jsx)(Z.Z,{style:{marginRight:4}});case"BLOCK":return(0,t.jsx)(C.Z,{style:{marginRight:4}});default:return null}},z=e=>{let{categories:l,selectedCategories:a,onChange:r}=e;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center mb-2",children:[(0,t.jsx)(O.Z,{className:"text-gray-500 mr-1"}),(0,t.jsx)(E,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,t.jsx)(u.default,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:r,value:a,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,t.jsx)(g.Z,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:l.map(e=>(0,t.jsx)(G,{value:e.category,children:e.category},e.category))})]})},T=e=>{let{onSelectAll:l,onUnselectAll:a,hasSelectedEntities:r}=e;return(0,t.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(E,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,t.jsx)(w.Z,{title:"Apply action to all PII types at once",children:(0,t.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,t.jsx)(I.ZP,{type:"default",onClick:a,disabled:!r,icon:(0,t.jsx)(A.Z,{}),className:"border-gray-300 hover:text-red-600 hover:border-red-300",children:"Unselect All"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsx)(I.ZP,{type:"default",onClick:()=>l("MASK"),className:"flex items-center justify-center h-10 border-blue-200 hover:border-blue-300 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 text-blue-600",block:!0,icon:(0,t.jsx)(Z.Z,{}),children:"Select All & Mask"}),(0,t.jsx)(I.ZP,{type:"default",onClick:()=>l("BLOCK"),className:"flex items-center justify-center h-10 border-red-200 hover:border-red-300 hover:text-red-700 bg-red-50 hover:bg-red-100 text-red-600",block:!0,icon:(0,t.jsx)(C.Z,{}),children:"Select All & Block"})]})]})},M=e=>{let{entities:l,selectedEntities:a,selectedActions:r,actions:i,onEntitySelect:s,onActionSelect:n,entityToCategoryMap:o}=e;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,t.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,t.jsx)(E,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,t.jsx)(E,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,t.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===l.length?(0,t.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):l.map(e=>(0,t.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ".concat(a.includes(e)?"bg-blue-50":""),children:[(0,t.jsxs)("div",{className:"flex items-center flex-1",children:[(0,t.jsx)(P.Z,{checked:a.includes(e),onChange:()=>s(e),className:"mr-3"}),(0,t.jsx)(E,{className:a.includes(e)?"font-medium text-gray-900":"text-gray-700",children:L(e)}),o.get(e)&&(0,t.jsx)(g.Z,{className:"ml-2 text-xs",color:"blue",children:o.get(e)})]}),(0,t.jsx)("div",{className:"w-32",children:(0,t.jsx)(u.default,{value:a.includes(e)&&r[e]||"MASK",onChange:l=>n(e,l),style:{width:120},disabled:!a.includes(e),className:"".concat(a.includes(e)?"":"opacity-50"),dropdownMatchSelectWidth:!1,children:i.map(e=>(0,t.jsx)(G,{value:e,children:(0,t.jsxs)("div",{className:"flex items-center",children:[F(e),e]})},e))})})]},e))})]})},{Title:B,Text:J}=c.default;var D=e=>{let{entities:l,actions:a,selectedEntities:r,selectedActions:i,onEntitySelect:n,onActionSelect:o,entityCategories:d=[]}=e,[c,u]=(0,s.useState)([]),m=new Map;d.forEach(e=>{e.entities.forEach(l=>{m.set(l,e.category)})});let p=l.filter(e=>0===c.length||c.includes(m.get(e)||""));return(0,t.jsxs)("div",{className:"pii-configuration",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)(B,{level:4,className:"mb-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,t.jsx)(k.Z,{count:r.length,showZero:!0,style:{backgroundColor:r.length>0?"#4f46e5":"#d9d9d9"},overflowCount:999,children:(0,t.jsxs)(J,{className:"text-gray-500",children:[r.length," items selected"]})})]}),(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(z,{categories:d,selectedCategories:c,onChange:u}),(0,t.jsx)(T,{onSelectAll:e=>{l.forEach(l=>{r.includes(l)||n(l),o(l,e)})},onUnselectAll:()=>{r.forEach(e=>{n(e)})},hasSelectedEntities:r.length>0})]}),(0,t.jsx)(M,{entities:p,selectedEntities:r,selectedActions:i,actions:a,onEntitySelect:n,onActionSelect:o,entityToCategoryMap:m})]})},V=a(87908),K=a(31283),R=a(24199),U=e=>{var l;let{selectedProvider:a,accessToken:r,providerParams:i=null,value:n=null}=e,[o,c]=(0,s.useState)(!1),[m,g]=(0,s.useState)(i),[x,h]=(0,s.useState)(null);if((0,s.useEffect)(()=>{if(i){g(i);return}let e=async()=>{if(r){c(!0),h(null);try{let e=await (0,d.getGuardrailProviderSpecificParams)(r);console.log("Provider params API response:",e),g(e),f(e),_(e)}catch(e){console.error("Error fetching provider params:",e),h("Failed to load provider parameters")}finally{c(!1)}}};i||e()},[r,i]),!a)return null;if(o)return(0,t.jsx)(V.Z,{tip:"Loading provider parameters..."});if(x)return(0,t.jsx)("div",{className:"text-red-500",children:x});let j=null===(l=v[a])||void 0===l?void 0:l.toLowerCase(),y=m&&m[j];if(console.log("Provider key:",j),console.log("Provider fields:",y),!y||0===Object.keys(y).length)return(0,t.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",n);let b=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;return Object.entries(e).map(e=>{let[r,i]=e,s=l?"".concat(l,".").concat(r):r,o=a?a[r]:null==n?void 0:n[r];return(console.log("Field value:",o),"ui_friendly_name"===r||"optional_params"===r&&"nested"===i.type&&i.fields)?null:"nested"===i.type&&i.fields?(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"mb-2 font-medium",children:r}),(0,t.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:b(i.fields,s,o)})]},s):(0,t.jsx)(p.Z.Item,{name:s,label:r,tooltip:i.description,rules:i.required?[{required:!0,message:"".concat(r," is required")}]:void 0,children:"select"===i.type&&i.options?(0,t.jsx)(u.default,{placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}):"multiselect"===i.type&&i.options?(0,t.jsx)(u.default,{mode:"multiple",placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}):"bool"===i.type||"boolean"===i.type?(0,t.jsxs)(u.default,{placeholder:i.description,defaultValue:void 0!==o?String(o):i.default_value,children:[(0,t.jsx)(u.default.Option,{value:"true",children:"True"}),(0,t.jsx)(u.default.Option,{value:"false",children:"False"})]}):"number"===i.type?(0,t.jsx)(R.Z,{step:1,width:400,placeholder:i.description,defaultValue:void 0!==o?Number(o):void 0}):r.includes("password")||r.includes("secret")||r.includes("key")?(0,t.jsx)(K.o,{placeholder:i.description,type:"password",defaultValue:o||""}):(0,t.jsx)(K.o,{placeholder:i.description,type:"text",defaultValue:o||""})},s)})};return(0,t.jsx)(t.Fragment,{children:b(y)})};let{Title:q}=c.default,H=e=>{let{field:l,fieldKey:a,fullFieldKey:r,value:i}=e,[n,o]=s.useState([]),[d,c]=s.useState(l.dict_key_options||[]);s.useEffect(()=>{if(i&&"object"==typeof i){let e=Object.keys(i);o(e.map(e=>({key:e,id:"".concat(e,"_").concat(Date.now(),"_").concat(Math.random())}))),c((l.dict_key_options||[]).filter(l=>!e.includes(l)))}},[i,l.dict_key_options]);let m=e=>{e&&(o([...n,{key:e,id:"".concat(e,"_").concat(Date.now())}]),c(d.filter(l=>l!==e)))},g=(e,l)=>{o(n.filter(l=>l.id!==e)),c([...d,l].sort())};return(0,t.jsxs)("div",{className:"space-y-3",children:[n.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,t.jsx)("div",{className:"w-24 font-medium text-sm",children:e.key}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(p.Z.Item,{name:Array.isArray(r)?[...r,e.key]:[r,e.key],style:{marginBottom:0},initialValue:i&&"object"==typeof i?i[e.key]:void 0,normalize:"number"===l.dict_value_type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"number"===l.dict_value_type?(0,t.jsx)(R.Z,{step:1,width:200,placeholder:"Enter ".concat(e.key," value")}):"boolean"===l.dict_value_type?(0,t.jsxs)(u.default,{placeholder:"Select ".concat(e.key," value"),children:[(0,t.jsx)(u.default.Option,{value:!0,children:"True"}),(0,t.jsx)(u.default.Option,{value:!1,children:"False"})]}):(0,t.jsx)(K.o,{placeholder:"Enter ".concat(e.key," value"),type:"text"})})}),(0,t.jsx)("button",{type:"button",className:"text-red-500 hover:text-red-700 text-sm",onClick:()=>g(e.id,e.key),children:"Remove"})]},e.id)),d.length>0&&(0,t.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,t.jsx)(u.default,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&m(e),value:void 0,children:d.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})};var Y=e=>{let{optionalParams:l,parentFieldKey:a,values:r}=e,i=(e,l)=>{let i="".concat(a,".").concat(e),s=null==r?void 0:r[e];return(console.log("value",s),"dict"===l.type&&l.dict_key_options)?(0,t.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,t.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l.description}),(0,t.jsx)(H,{field:l,fieldKey:e,fullFieldKey:[a,e],value:s})]},i):(0,t.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,t.jsx)(p.Z.Item,{name:[a,e],label:(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:l.description})]}),rules:l.required?[{required:!0,message:"".concat(e," is required")}]:void 0,className:"mb-0",initialValue:void 0!==s?s:l.default_value,normalize:"number"===l.type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"select"===l.type&&l.options?(0,t.jsx)(u.default,{placeholder:l.description,children:l.options.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}):"multiselect"===l.type&&l.options?(0,t.jsx)(u.default,{mode:"multiple",placeholder:l.description,children:l.options.map(e=>(0,t.jsx)(u.default.Option,{value:e,children:e},e))}):"bool"===l.type||"boolean"===l.type?(0,t.jsxs)(u.default,{placeholder:l.description,children:[(0,t.jsx)(u.default.Option,{value:"true",children:"True"}),(0,t.jsx)(u.default.Option,{value:"false",children:"False"})]}):"number"===l.type?(0,t.jsx)(R.Z,{step:1,width:400,placeholder:l.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,t.jsx)(K.o,{placeholder:l.description,type:"password"}):(0,t.jsx)(K.o,{placeholder:l.description,type:"text"})})},i)};return l.fields&&0!==Object.keys(l.fields).length?(0,t.jsxs)("div",{className:"guardrail-optional-params",children:[(0,t.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,t.jsx)(q,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,t.jsx)("p",{className:"text-gray-600 text-sm",children:l.description||"Configure additional settings for this guardrail provider"})]}),(0,t.jsx)("div",{className:"space-y-8",children:Object.entries(l.fields).map(e=>{let[l,a]=e;return i(l,a)})})]}):null},Q=a(9114);let{Title:W,Text:X,Link:$}=c.default,{Option:ee}=u.default,{Step:el}=m.default,ea={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call",pre_mcp_call:"Before MCP Tool Call - Runs before MCP tool execution and validates tool calls",during_mcp_call:"During MCP Tool Call - Runs in parallel with MCP tool execution for monitoring"};var er=e=>{let{visible:l,onClose:a,accessToken:r,onSuccess:i}=e,[n]=p.Z.useForm(),[c,h]=(0,s.useState)(!1),[b,S]=(0,s.useState)(null),[k,w]=(0,s.useState)(null),[I,P]=(0,s.useState)([]),[Z,C]=(0,s.useState)({}),[O,A]=(0,s.useState)(0),[E,G]=(0,s.useState)(null),[L,F]=(0,s.useState)([]),[z,T]=(0,s.useState)(2),[M,B]=(0,s.useState)({});(0,s.useEffect)(()=>{r&&(async()=>{try{let[e,l]=await Promise.all([(0,d.getGuardrailUISettings)(r),(0,d.getGuardrailProviderSpecificParams)(r)]);w(e),G(l),f(l),_(l)}catch(e){console.error("Error fetching guardrail data:",e),Q.Z.fromBackend("Failed to load guardrail configuration")}})()},[r]);let J=e=>{S(e),n.setFieldsValue({config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0}),P([]),C({}),F([]),T(2),B({})},V=e=>{P(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},K=(e,l)=>{C(a=>({...a,[e]:l}))},R=async()=>{try{if(0===O&&(await n.validateFields(["guardrail_name","provider","mode","default_on"]),b)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===b&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await n.validateFields(e)}if(1===O&&y(b)&&0===I.length){Q.Z.fromBackend("Please select at least one PII entity to continue");return}A(O+1)}catch(e){console.error("Form validation failed:",e)}},q=()=>{n.resetFields(),S(null),P([]),C({}),F([]),T(2),B({}),A(0)},H=()=>{q(),a()},W=async()=>{try{h(!0),await n.validateFields();let l=n.getFieldsValue(!0),t=v[l.provider],s={guardrail_name:l.guardrail_name,litellm_params:{guardrail:t,mode:l.mode,default_on:l.default_on},guardrail_info:{}};if("PresidioPII"===l.provider&&I.length>0){let e={};I.forEach(l=>{e[l]=Z[l]||"MASK"}),s.litellm_params.pii_entities_config=e,l.presidio_analyzer_api_base&&(s.litellm_params.presidio_analyzer_api_base=l.presidio_analyzer_api_base),l.presidio_anonymizer_api_base&&(s.litellm_params.presidio_anonymizer_api_base=l.presidio_anonymizer_api_base)}else if(l.config)try{let e=JSON.parse(l.config);s.guardrail_info=e}catch(e){Q.Z.fromBackend("Invalid JSON in configuration"),h(!1);return}if(console.log("values: ",JSON.stringify(l)),E&&b){var e;let a=null===(e=v[b])||void 0===e?void 0:e.toLowerCase();console.log("providerKey: ",a);let r=E[a]||{},i=new Set;console.log("providerSpecificParams: ",JSON.stringify(r)),Object.keys(r).forEach(e=>{"optional_params"!==e&&i.add(e)}),r.optional_params&&r.optional_params.fields&&Object.keys(r.optional_params.fields).forEach(e=>{i.add(e)}),console.log("allowedParams: ",i),i.forEach(e=>{let a=l[e];if(null==a||""===a){var r;a=null===(r=l.optional_params)||void 0===r?void 0:r[e]}null!=a&&""!==a&&(s.litellm_params[e]=a)})}if(!r)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(s)),await (0,d.createGuardrailCall)(r,s),Q.Z.success("Guardrail created successfully"),q(),i(),a()}catch(e){console.error("Failed to create guardrail:",e),Q.Z.fromBackend("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{h(!1)}},X=()=>{var e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,t.jsx)(x.o,{placeholder:"Enter a name for this guardrail"})}),(0,t.jsx)(p.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,t.jsx)(u.default,{placeholder:"Select a guardrail provider",onChange:J,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(j()).map(e=>{let[l,a]=e;return(0,t.jsx)(ee,{value:l,label:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[N[a]&&(0,t.jsx)("img",{src:N[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,t.jsx)("span",{children:a})]}),children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[N[a]&&(0,t.jsx)("img",{src:N[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,t.jsx)("span",{children:a})]})},l)})})}),(0,t.jsx)(p.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,t.jsx)(u.default,{optionLabelProp:"label",mode:"multiple",children:(null==k?void 0:null===(e=k.supported_modes)||void 0===e?void 0:e.map(e=>(0,t.jsx)(ee,{value:e,label:e,children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:e}),"pre_call"===e&&(0,t.jsx)(g.Z,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea[e]})]})},e)))||(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ee,{value:"pre_call",label:"pre_call",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"pre_call"})," ",(0,t.jsx)(g.Z,{color:"green",children:"Recommended"})]}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea.pre_call})]})}),(0,t.jsx)(ee,{value:"during_call",label:"during_call",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:(0,t.jsx)("strong",{children:"during_call"})}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea.during_call})]})}),(0,t.jsx)(ee,{value:"post_call",label:"post_call",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:(0,t.jsx)("strong",{children:"post_call"})}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea.post_call})]})}),(0,t.jsx)(ee,{value:"logging_only",label:"logging_only",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:(0,t.jsx)("strong",{children:"logging_only"})}),(0,t.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ea.logging_only})]})})]})})}),(0,t.jsx)(p.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,t.jsxs)(u.default,{children:[(0,t.jsx)(u.default.Option,{value:!0,children:"Yes"}),(0,t.jsx)(u.default.Option,{value:!1,children:"No"})]})}),(0,t.jsx)(U,{selectedProvider:b,accessToken:r,providerParams:E})]})},$=()=>k&&"PresidioPII"===b?(0,t.jsx)(D,{entities:k.supported_entities,actions:k.supported_actions,selectedEntities:I,selectedActions:Z,onEntitySelect:V,onActionSelect:K,entityCategories:k.pii_entity_categories}):null,er=()=>{var e;if(!b||!E)return null;console.log("guardrail_provider_map: ",v),console.log("selectedProvider: ",b);let l=null===(e=v[b])||void 0===e?void 0:e.toLowerCase(),a=E&&E[l];return a&&a.optional_params?(0,t.jsx)(Y,{optionalParams:a.optional_params,parentFieldKey:"optional_params"}):null};return(0,t.jsx)(o.Z,{title:"Add Guardrail",open:l,onCancel:H,footer:null,width:700,children:(0,t.jsxs)(p.Z,{form:n,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1},children:[(0,t.jsxs)(m.default,{current:O,className:"mb-6",children:[(0,t.jsx)(el,{title:"Basic Info"}),(0,t.jsx)(el,{title:y(b)?"PII Configuration":"Provider Configuration"})]}),(()=>{switch(O){case 0:return X();case 1:if(y(b))return $();return er();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[O>0&&(0,t.jsx)(x.z,{variant:"secondary",onClick:()=>{A(O-1)},children:"Previous"}),O<2&&(0,t.jsx)(x.z,{onClick:R,children:"Next"}),2===O&&(0,t.jsx)(x.z,{onClick:W,loading:c,children:"Create Guardrail"}),(0,t.jsx)(x.z,{variant:"secondary",onClick:H,children:"Cancel"})]})]})})},ei=a(20831),et=a(47323),es=a(21626),en=a(97214),eo=a(28241),ed=a(58834),ec=a(69552),eu=a(71876),em=a(74998),ep=a(44633),eg=a(86462),ex=a(49084),eh=a(1309),ef=a(71594),ej=a(24525),ev=a(64482),e_=a(63709);let{Title:ey,Text:eb}=c.default,{Option:eN}=u.default;var eS=e=>{var l;let{visible:a,onClose:r,accessToken:i,onSuccess:n,guardrailId:c,initialValues:m}=e,[g]=p.Z.useForm(),[h,f]=(0,s.useState)(!1),[_,y]=(0,s.useState)((null==m?void 0:m.provider)||null),[b,S]=(0,s.useState)(null),[k,w]=(0,s.useState)([]),[I,P]=(0,s.useState)({});(0,s.useEffect)(()=>{(async()=>{try{if(!i)return;let e=await (0,d.getGuardrailUISettings)(i);S(e)}catch(e){console.error("Error fetching guardrail settings:",e),Q.Z.fromBackend("Failed to load guardrail settings")}})()},[i]),(0,s.useEffect)(()=>{(null==m?void 0:m.pii_entities_config)&&Object.keys(m.pii_entities_config).length>0&&(w(Object.keys(m.pii_entities_config)),P(m.pii_entities_config))},[m]);let Z=e=>{w(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},C=(e,l)=>{P(a=>({...a,[e]:l}))},O=async()=>{try{f(!0);let e=await g.validateFields(),l=v[e.provider],a={guardrail_id:c,guardrail:{guardrail_name:e.guardrail_name,litellm_params:{guardrail:l,mode:e.mode,default_on:e.default_on},guardrail_info:{}}};if("PresidioPII"===e.provider&&k.length>0){let e={};k.forEach(l=>{e[l]=I[l]||"MASK"}),a.guardrail.litellm_params.pii_entities_config=e}else if(e.config)try{let l=JSON.parse(e.config);"Bedrock"===e.provider&&l?(l.guardrail_id&&(a.guardrail.litellm_params.guardrailIdentifier=l.guardrail_id),l.guardrail_version&&(a.guardrail.litellm_params.guardrailVersion=l.guardrail_version)):a.guardrail.guardrail_info=l}catch(e){Q.Z.fromBackend("Invalid JSON in configuration"),f(!1);return}if(!i)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(a));let t=await fetch("/guardrails/".concat(c),{method:"PUT",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(a)});if(!t.ok){let e=await t.text();throw Error(e||"Failed to update guardrail")}Q.Z.success("Guardrail updated successfully"),n(),r()}catch(e){console.error("Failed to update guardrail:",e),Q.Z.fromBackend("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}},A=()=>b&&_&&"PresidioPII"===_?(0,t.jsx)(D,{entities:b.supported_entities,actions:b.supported_actions,selectedEntities:k,selectedActions:I,onEntitySelect:Z,onActionSelect:C,entityCategories:b.pii_entity_categories}):null;return(0,t.jsx)(o.Z,{title:"Edit Guardrail",open:a,onCancel:r,footer:null,width:700,children:(0,t.jsxs)(p.Z,{form:g,layout:"vertical",initialValues:m,children:[(0,t.jsx)(p.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,t.jsx)(x.o,{placeholder:"Enter a name for this guardrail"})}),(0,t.jsx)(p.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,t.jsx)(u.default,{placeholder:"Select a guardrail provider",onChange:e=>{y(e),g.setFieldsValue({config:void 0}),w([]),P({})},disabled:!0,optionLabelProp:"label",children:Object.entries(j()).map(e=>{let[l,a]=e;return(0,t.jsx)(eN,{value:l,label:a,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[N[a]&&(0,t.jsx)("img",{src:N[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,t.jsx)("span",{children:a})]})},l)})})}),(0,t.jsx)(p.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,t.jsx)(u.default,{children:(null==b?void 0:null===(l=b.supported_modes)||void 0===l?void 0:l.map(e=>(0,t.jsx)(eN,{value:e,children:e},e)))||(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eN,{value:"pre_call",children:"pre_call"}),(0,t.jsx)(eN,{value:"post_call",children:"post_call"})]})})}),(0,t.jsx)(p.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,t.jsx)(e_.Z,{})}),(()=>{if(!_)return null;if("PresidioPII"===_)return A();switch(_){case"Aporia":return(0,t.jsx)(p.Z.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aporia_api_key",\n "project_name": "your_project_name"\n}'})});case"AimSecurity":return(0,t.jsx)(p.Z.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aim_api_key"\n}'})});case"Bedrock":return(0,t.jsx)(p.Z.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "guardrail_id": "your_guardrail_id",\n "guardrail_version": "your_guardrail_version"\n}'})});case"GuardrailsAI":return(0,t.jsx)(p.Z.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_guardrails_api_key",\n "guardrail_id": "your_guardrail_id"\n}'})});case"LakeraAI":return(0,t.jsx)(p.Z.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_lakera_api_key"\n}'})});case"PromptInjection":return(0,t.jsx)(p.Z.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "threshold": 0.8\n}'})});default:return(0,t.jsx)(p.Z.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,t.jsx)(ev.default.TextArea,{rows:4,placeholder:'{\n "key1": "value1",\n "key2": "value2"\n}'})})}})(),(0,t.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,t.jsx)(x.z,{variant:"secondary",onClick:r,children:"Cancel"}),(0,t.jsx)(x.z,{onClick:O,loading:h,children:"Update Guardrail"})]})]})})},ek=e=>{let{guardrailsList:l,isLoading:a,onDeleteClick:r,accessToken:i,onGuardrailUpdated:n,isAdmin:o=!1,onGuardrailClick:d}=e,[c,u]=(0,s.useState)([{id:"created_at",desc:!0}]),[m,p]=(0,s.useState)(!1),[g,x]=(0,s.useState)(null),h=e=>e?new Date(e).toLocaleString():"-",f=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,t.jsx)(w.Z,{title:String(e.getValue()||""),children:(0,t.jsx)(ei.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&d(e.getValue()),children:e.getValue()?"".concat(String(e.getValue()).slice(0,7),"..."):""})})},{header:"Name",accessorKey:"guardrail_name",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)(w.Z,{title:a.guardrail_name,children:(0,t.jsx)("span",{className:"text-xs font-medium",children:a.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:e=>{let{row:l}=e,{logo:a,displayName:r}=S(l.original.litellm_params.guardrail);return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,t.jsx)("img",{src:a,alt:"".concat(r," logo"),className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("span",{className:"text-xs",children:r})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)("span",{className:"text-xs",children:a.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:e=>{var l,a;let{row:r}=e,i=r.original;return(0,t.jsx)(eh.C,{color:(null===(l=i.litellm_params)||void 0===l?void 0:l.default_on)?"green":"gray",className:"text-xs font-normal",size:"xs",children:(null===(a=i.litellm_params)||void 0===a?void 0:a.default_on)?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)(w.Z,{title:a.created_at,children:(0,t.jsx)("span",{className:"text-xs",children:h(a.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)(w.Z,{title:a.updated_at,children:(0,t.jsx)("span",{className:"text-xs",children:h(a.updated_at)})})}},{id:"actions",header:"",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsx)("div",{className:"flex space-x-2",children:(0,t.jsx)(et.Z,{icon:em.Z,size:"sm",onClick:()=>a.guardrail_id&&r(a.guardrail_id,a.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500",tooltip:"Delete guardrail"})})}}],j=(0,ef.b7)({data:l,columns:f,state:{sorting:c},onSortingChange:u,getCoreRowModel:(0,ej.sC)(),getSortedRowModel:(0,ej.tj)(),enableSorting:!0});return(0,t.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(es.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(ed.Z,{children:j.getHeaderGroups().map(e=>(0,t.jsx)(eu.Z,{children:e.headers.map(e=>(0,t.jsx)(ec.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,ef.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(ep.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(eg.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(ex.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,t.jsx)(en.Z,{children:a?(0,t.jsx)(eu.Z,{children:(0,t.jsx)(eo.Z,{colSpan:f.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"Loading..."})})})}):l.length>0?j.getRowModel().rows.map(e=>(0,t.jsx)(eu.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(eo.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,ef.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(eu.Z,{children:(0,t.jsx)(eo.Z,{colSpan:f.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No guardrails found"})})})})})]})}),g&&(0,t.jsx)(eS,{visible:m,onClose:()=>p(!1),accessToken:i,onSuccess:()=>{p(!1),x(null),n()},guardrailId:g.guardrail_id||"",initialValues:{guardrail_name:g.guardrail_name||"",provider:Object.keys(v).find(e=>v[e]===(null==g?void 0:g.litellm_params.guardrail))||"",mode:g.litellm_params.mode,default_on:g.litellm_params.default_on,pii_entities_config:g.litellm_params.pii_entities_config,...g.guardrail_info}})]})},ew=a(20347),eI=a(30078),eP=a(23496),eZ=a(10900),eC=a(59872),eO=a(30401),eA=a(78867),eE=e=>{var l,a,r,i,n,o,c,m,g,x,h;let{guardrailId:f,onClose:j,accessToken:_,isAdmin:y}=e,[b,N]=(0,s.useState)(null),[k,w]=(0,s.useState)(null),[P,Z]=(0,s.useState)(!0),[C,O]=(0,s.useState)(!1),[A]=p.Z.useForm(),[E,G]=(0,s.useState)([]),[L,F]=(0,s.useState)({}),[z,T]=(0,s.useState)(null),[M,B]=(0,s.useState)({}),J=async()=>{try{var e;if(Z(!0),!_)return;let l=await (0,d.getGuardrailInfo)(_,f);if(N(l),null===(e=l.litellm_params)||void 0===e?void 0:e.pii_entities_config){let e=l.litellm_params.pii_entities_config;if(G([]),F({}),Object.keys(e).length>0){let l=[],a={};Object.entries(e).forEach(e=>{let[r,i]=e;l.push(r),a[r]="string"==typeof i?i:"MASK"}),G(l),F(a)}}else G([]),F({})}catch(e){Q.Z.fromBackend("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{Z(!1)}},V=async()=>{try{if(!_)return;let e=await (0,d.getGuardrailProviderSpecificParams)(_);w(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},K=async()=>{try{if(!_)return;let e=await (0,d.getGuardrailUISettings)(_);T(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,s.useEffect)(()=>{V()},[_]),(0,s.useEffect)(()=>{J(),K()},[f,_]),(0,s.useEffect)(()=>{if(b&&A){var e;A.setFieldsValue({guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(e=b.litellm_params)||void 0===e?void 0:e.optional_params)&&{optional_params:b.litellm_params.optional_params}})}},[b,k,A]);let R=async e=>{try{var l,a,r;if(!_)return;let i={litellm_params:{}};e.guardrail_name!==b.guardrail_name&&(i.guardrail_name=e.guardrail_name),e.default_on!==(null===(l=b.litellm_params)||void 0===l?void 0:l.default_on)&&(i.litellm_params.default_on=e.default_on);let t=b.guardrail_info,s=e.guardrail_info?JSON.parse(e.guardrail_info):void 0;JSON.stringify(t)!==JSON.stringify(s)&&(i.guardrail_info=s);let n=(null===(a=b.litellm_params)||void 0===a?void 0:a.pii_entities_config)||{},o={};E.forEach(e=>{o[e]=L[e]||"MASK"}),JSON.stringify(n)!==JSON.stringify(o)&&(i.litellm_params.pii_entities_config=o);let c=Object.keys(v).find(e=>{var l;return v[e]===(null===(l=b.litellm_params)||void 0===l?void 0:l.guardrail)});if(console.log("values: ",JSON.stringify(e)),console.log("currentProvider: ",c),k&&c){let l=k[null===(r=v[c])||void 0===r?void 0:r.toLowerCase()]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(l)),Object.keys(l).forEach(e=>{"optional_params"!==e&&a.add(e)}),l.optional_params&&l.optional_params.fields&&Object.keys(l.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(l=>{var a,r;let t=e[l];(null==t||""===t)&&(t=null===(r=e.optional_params)||void 0===r?void 0:r[l]);let s=null===(a=b.litellm_params)||void 0===a?void 0:a[l];JSON.stringify(t)!==JSON.stringify(s)&&(null!=t&&""!==t?i.litellm_params[l]=t:null!=s&&""!==s&&(i.litellm_params[l]=null))})}if(0===Object.keys(i.litellm_params).length&&delete i.litellm_params,0===Object.keys(i).length){Q.Z.info("No changes detected"),O(!1);return}await (0,d.updateGuardrailCall)(_,f,i),Q.Z.success("Guardrail updated successfully"),J(),O(!1)}catch(e){console.error("Error updating guardrail:",e),Q.Z.fromBackend("Failed to update guardrail")}};if(P)return(0,t.jsx)("div",{className:"p-4",children:"Loading..."});if(!b)return(0,t.jsx)("div",{className:"p-4",children:"Guardrail not found"});let q=e=>e?new Date(e).toLocaleString():"-",{logo:H,displayName:W}=S((null===(l=b.litellm_params)||void 0===l?void 0:l.guardrail)||""),X=async(e,l)=>{await (0,eC.vQ)(e)&&(B(e=>({...e,[l]:!0})),setTimeout(()=>{B(e=>({...e,[l]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.zx,{icon:eZ.Z,variant:"light",onClick:j,className:"mb-4",children:"Back to Guardrails"}),(0,t.jsx)(eI.Dx,{children:b.guardrail_name||"Unnamed Guardrail"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(eI.xv,{className:"text-gray-500 font-mono",children:b.guardrail_id}),(0,t.jsx)(I.ZP,{type:"text",size:"small",icon:M["guardrail-id"]?(0,t.jsx)(eO.Z,{size:12}):(0,t.jsx)(eA.Z,{size:12}),onClick:()=>X(b.guardrail_id,"guardrail-id"),className:"left-2 z-10 transition-all duration-200 ".concat(M["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)(eI.v0,{children:[(0,t.jsxs)(eI.td,{className:"mb-4",children:[(0,t.jsx)(eI.OK,{children:"Overview"},"overview"),y?(0,t.jsx)(eI.OK,{children:"Settings"},"settings"):(0,t.jsx)(t.Fragment,{})]}),(0,t.jsxs)(eI.nP,{children:[(0,t.jsxs)(eI.x4,{children:[(0,t.jsxs)(eI.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(eI.Zb,{children:[(0,t.jsx)(eI.xv,{children:"Provider"}),(0,t.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[H&&(0,t.jsx)("img",{src:H,alt:"".concat(W," logo"),className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)(eI.Dx,{children:W})]})]}),(0,t.jsxs)(eI.Zb,{children:[(0,t.jsx)(eI.xv,{children:"Mode"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(eI.Dx,{children:(null===(a=b.litellm_params)||void 0===a?void 0:a.mode)||"-"}),(0,t.jsx)(eI.Ct,{color:(null===(r=b.litellm_params)||void 0===r?void 0:r.default_on)?"green":"gray",children:(null===(i=b.litellm_params)||void 0===i?void 0:i.default_on)?"Default On":"Default Off"})]})]}),(0,t.jsxs)(eI.Zb,{children:[(0,t.jsx)(eI.xv,{children:"Created At"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(eI.Dx,{children:q(b.created_at)}),(0,t.jsxs)(eI.xv,{children:["Last Updated: ",q(b.updated_at)]})]})]})]}),(null===(n=b.litellm_params)||void 0===n?void 0:n.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,t.jsx)(eI.Zb,{className:"mt-6",children:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"PII Protection"}),(0,t.jsxs)(eI.Ct,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),b.guardrail_info&&Object.keys(b.guardrail_info).length>0&&(0,t.jsxs)(eI.Zb,{className:"mt-6",children:[(0,t.jsx)(eI.xv,{children:"Guardrail Info"}),(0,t.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(b.guardrail_info).map(e=>{let[l,a]=e;return(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(eI.xv,{className:"font-medium w-1/3",children:l}),(0,t.jsx)(eI.xv,{className:"w-2/3",children:"object"==typeof a?JSON.stringify(a,null,2):String(a)})]},l)})})]})]}),y&&(0,t.jsx)(eI.x4,{children:(0,t.jsxs)(eI.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(eI.Dx,{children:"Guardrail Settings"}),!C&&(0,t.jsx)(eI.zx,{onClick:()=>O(!0),children:"Edit Settings"})]}),C?(0,t.jsxs)(p.Z,{form:A,onFinish:R,initialValues:{guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(o=b.litellm_params)||void 0===o?void 0:o.optional_params)&&{optional_params:b.litellm_params.optional_params}},layout:"vertical",children:[(0,t.jsx)(p.Z.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,t.jsx)(eI.oi,{})}),(0,t.jsx)(p.Z.Item,{label:"Default On",name:"default_on",children:(0,t.jsxs)(u.default,{children:[(0,t.jsx)(u.default.Option,{value:!0,children:"Yes"}),(0,t.jsx)(u.default.Option,{value:!1,children:"No"})]})}),(null===(c=b.litellm_params)||void 0===c?void 0:c.guardrail)==="presidio"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eP.Z,{orientation:"left",children:"PII Protection"}),(0,t.jsx)("div",{className:"mb-6",children:z&&(0,t.jsx)(D,{entities:z.supported_entities,actions:z.supported_actions,selectedEntities:E,selectedActions:L,onEntitySelect:e=>{G(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},onActionSelect:(e,l)=>{F(a=>({...a,[e]:l}))},entityCategories:z.pii_entity_categories})})]}),(0,t.jsx)(eP.Z,{orientation:"left",children:"Provider Settings"}),(0,t.jsx)(U,{selectedProvider:Object.keys(v).find(e=>{var l;return v[e]===(null===(l=b.litellm_params)||void 0===l?void 0:l.guardrail)})||null,accessToken:_,providerParams:k,value:b.litellm_params}),k&&(()=>{var e;let l=Object.keys(v).find(e=>{var l;return v[e]===(null===(l=b.litellm_params)||void 0===l?void 0:l.guardrail)});if(!l)return null;let a=k[null===(e=v[l])||void 0===e?void 0:e.toLowerCase()];return a&&a.optional_params?(0,t.jsx)(Y,{optionalParams:a.optional_params,parentFieldKey:"optional_params",values:b.litellm_params}):null})(),(0,t.jsx)(eP.Z,{orientation:"left",children:"Advanced Settings"}),(0,t.jsx)(p.Z.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,t.jsx)(ev.default.TextArea,{rows:5})}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,t.jsx)(I.ZP,{onClick:()=>O(!1),children:"Cancel"}),(0,t.jsx)(eI.zx,{children:"Save Changes"})]})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Guardrail ID"}),(0,t.jsx)("div",{className:"font-mono",children:b.guardrail_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Guardrail Name"}),(0,t.jsx)("div",{children:b.guardrail_name||"Unnamed Guardrail"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Provider"}),(0,t.jsx)("div",{children:W})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Mode"}),(0,t.jsx)("div",{children:(null===(m=b.litellm_params)||void 0===m?void 0:m.mode)||"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Default On"}),(0,t.jsx)(eI.Ct,{color:(null===(g=b.litellm_params)||void 0===g?void 0:g.default_on)?"green":"gray",children:(null===(x=b.litellm_params)||void 0===x?void 0:x.default_on)?"Yes":"No"})]}),(null===(h=b.litellm_params)||void 0===h?void 0:h.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"PII Protection"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsxs)(eI.Ct,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Created At"}),(0,t.jsx)("div",{children:q(b.created_at)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eI.xv,{className:"font-medium",children:"Last Updated"}),(0,t.jsx)("div",{children:q(b.updated_at)})]})]})]})})]})]})]})},eG=e=>{let{accessToken:l,userRole:a}=e,[r,i]=(0,s.useState)([]),[c,u]=(0,s.useState)(!1),[m,p]=(0,s.useState)(!1),[g,x]=(0,s.useState)(!1),[h,f]=(0,s.useState)(null),[j,v]=(0,s.useState)(null),_=!!a&&(0,ew.tY)(a),y=async()=>{if(l){p(!0);try{let e=await (0,d.getGuardrailsList)(l);console.log("guardrails: ".concat(JSON.stringify(e))),i(e.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{p(!1)}}};(0,s.useEffect)(()=>{y()},[l]);let b=async()=>{if(h&&l){x(!0);try{await (0,d.deleteGuardrailCall)(l,h.id),Q.Z.success('Guardrail "'.concat(h.name,'" deleted successfully')),y()}catch(e){console.error("Error deleting guardrail:",e),Q.Z.fromBackend("Failed to delete guardrail")}finally{x(!1),f(null)}}};return(0,t.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,t.jsx)(n.z,{onClick:()=>{j&&v(null),u(!0)},disabled:!l,children:"+ Add New Guardrail"})}),j?(0,t.jsx)(eE,{guardrailId:j,onClose:()=>v(null),accessToken:l,isAdmin:_}):(0,t.jsx)(ek,{guardrailsList:r,isLoading:m,onDeleteClick:(e,l)=>{f({id:e,name:l})},accessToken:l,onGuardrailUpdated:y,isAdmin:_,onGuardrailClick:e=>v(e)}),(0,t.jsx)(er,{visible:c,onClose:()=>{u(!1)},accessToken:l,onSuccess:()=>{y()}}),h&&(0,t.jsxs)(o.Z,{title:"Delete Guardrail",open:null!==h,onOk:b,onCancel:()=>{f(null)},confirmLoading:g,okText:"Delete",okButtonProps:{danger:!0},children:[(0,t.jsxs)("p",{children:["Are you sure you want to delete guardrail: ",h.name," ?"]}),(0,t.jsx)("p",{children:"This action cannot be undone."})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3603-b101c17ea3d68f19.js b/litellm/proxy/_experimental/out/_next/static/chunks/3603-dd19ac8e31e4bc25.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/3603-b101c17ea3d68f19.js rename to litellm/proxy/_experimental/out/_next/static/chunks/3603-dd19ac8e31e4bc25.js index b582cf54e3..537461fa29 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3603-b101c17ea3d68f19.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3603-dd19ac8e31e4bc25.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3603],{15327:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),c=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},r=n(55015),l=c.forwardRef(function(e,t){return c.createElement(r.Z,(0,o.Z)({},e,{ref:t,icon:a}))})},80795:function(e,t,n){n.d(t,{Z:function(){return X}});var o=n(2265),c=n(77565),a=n(36760),r=n.n(a),l=n(71030),i=n(74126),s=n(50506),d=n(18694),u=n(62236),m=n(92736),p=n(93942),g=n(19722),b=n(13613),f=n(95140),v=n(71744),h=n(45937),y=n(88208),w=n(29961),C=n(12918),I=n(18544),O=n(29382),x=n(691),S=n(88260),B=n(80669),j=n(3104),k=e=>{let{componentCls:t,menuCls:n,colorError:o,colorTextLightSolid:c}=e,a="".concat(n,"-item");return{["".concat(t,", ").concat(t,"-menu-submenu")]:{["".concat(n," ").concat(a)]:{["&".concat(a,"-danger:not(").concat(a,"-disabled)")]:{color:o,"&:hover":{color:c,backgroundColor:o}}}}}},E=n(34442),N=n(352);let z=e=>{let{componentCls:t,menuCls:n,zIndexPopup:o,dropdownArrowDistance:c,sizePopupArrow:a,antCls:r,iconCls:l,motionDurationMid:i,paddingBlock:s,fontSize:d,dropdownEdgeChildPadding:u,colorTextDisabled:m,fontSizeIcon:p,controlPaddingHorizontal:g,colorBgElevated:b}=e;return[{[t]:Object.assign(Object.assign({},(0,C.Wf)(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:o,display:"block","&::before":{position:"absolute",insetBlock:e.calc(a).div(2).sub(c).equal(),zIndex:-9999,opacity:1e-4,content:'""'},["&-trigger".concat(r,"-btn")]:{["& > ".concat(l,"-down, & > ").concat(r,"-btn-icon > ").concat(l,"-down")]:{fontSize:p}},["".concat(t,"-wrap")]:{position:"relative",["".concat(r,"-btn > ").concat(l,"-down")]:{fontSize:p},["".concat(l,"-down::before")]:{transition:"transform ".concat(i)}},["".concat(t,"-wrap-open")]:{["".concat(l,"-down::before")]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},["&".concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottomRight,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottomRight")]:{animationName:I.fJ},["&".concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-topRight,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-topRight")]:{animationName:I.Qt},["&".concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottomRight")]:{animationName:I.Uw},["&".concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-topRight")]:{animationName:I.ly}})},(0,S.ZP)(e,b,{arrowPlacement:{top:!0,bottom:!0}}),{["".concat(t," ").concat(n)]:{position:"relative",margin:0},["".concat(n,"-submenu-popup")]:{position:"absolute",zIndex:o,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},["".concat(t,", ").concat(t,"-menu-submenu")]:{[n]:Object.assign(Object.assign({padding:u,listStyleType:"none",backgroundColor:b,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},(0,C.Qy)(e)),{["".concat(n,"-item-group-title")]:{padding:"".concat((0,N.bf)(s)," ").concat((0,N.bf)(g)),color:e.colorTextDescription,transition:"all ".concat(i)},["".concat(n,"-item")]:{position:"relative",display:"flex",alignItems:"center"},["".concat(n,"-item-icon")]:{minWidth:d,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},["".concat(n,"-title-content")]:{flex:"auto","> a":{color:"inherit",transition:"all ".concat(i),"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},["".concat(n,"-item, ").concat(n,"-submenu-title")]:Object.assign(Object.assign({clear:"both",margin:0,padding:"".concat((0,N.bf)(s)," ").concat((0,N.bf)(g)),color:e.colorText,fontWeight:"normal",fontSize:d,lineHeight:e.lineHeight,cursor:"pointer",transition:"all ".concat(i),borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},(0,C.Qy)(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:m,cursor:"not-allowed","&:hover":{color:m,backgroundColor:b,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:"".concat((0,N.bf)(e.marginXXS)," 0"),overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},["".concat(t,"-menu-submenu-expand-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,["".concat(t,"-menu-submenu-arrow-icon")]:{marginInlineEnd:"0 !important",color:e.colorTextDescription,fontSize:p,fontStyle:"normal"}}}),["".concat(n,"-item-group-list")]:{margin:"0 ".concat((0,N.bf)(e.marginXS)),padding:0,listStyle:"none"},["".concat(n,"-submenu-title")]:{paddingInlineEnd:e.calc(g).add(e.fontSizeSM).equal()},["".concat(n,"-submenu-vertical")]:{position:"relative"},["".concat(n,"-submenu").concat(n,"-submenu-disabled ").concat(t,"-menu-submenu-title")]:{["&, ".concat(t,"-menu-submenu-arrow-icon")]:{color:m,backgroundColor:b,cursor:"not-allowed"}},["".concat(n,"-submenu-selected ").concat(t,"-menu-submenu-title")]:{color:e.colorPrimary}})}},[(0,I.oN)(e,"slide-up"),(0,I.oN)(e,"slide-down"),(0,O.Fm)(e,"move-up"),(0,O.Fm)(e,"move-down"),(0,x._y)(e,"zoom-big")]]};var H=(0,B.I$)("Dropdown",e=>{let{marginXXS:t,sizePopupArrow:n,paddingXXS:o,componentCls:c}=e,a=(0,j.TS)(e,{menuCls:"".concat(c,"-menu"),dropdownArrowDistance:e.calc(n).div(2).add(t).equal(),dropdownEdgeChildPadding:o});return[z(a),k(a)]},e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},(0,S.wZ)({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),(0,E.w)(e))),P=n(64024);let T=e=>{let t;let{menu:n,arrow:a,prefixCls:p,children:C,trigger:I,disabled:O,dropdownRender:x,getPopupContainer:S,overlayClassName:B,rootClassName:j,overlayStyle:k,open:E,onOpenChange:N,visible:z,onVisibleChange:T,mouseEnterDelay:R=.15,mouseLeaveDelay:Z=.1,autoAdjustOverflow:A=!0,placement:M="",overlay:D,transitionName:W}=e,{getPopupContainer:L,getPrefixCls:X,direction:_,dropdown:q}=o.useContext(v.E_);(0,b.ln)("Dropdown");let F=o.useMemo(()=>{let e=X();return void 0!==W?W:M.includes("top")?"".concat(e,"-slide-down"):"".concat(e,"-slide-up")},[X,M,W]),Y=o.useMemo(()=>M?M.includes("Center")?M.slice(0,M.indexOf("Center")):M:"rtl"===_?"bottomRight":"bottomLeft",[M,_]),G=X("dropdown",p),$=(0,P.Z)(G),[U,V,J]=H(G,$),[,Q]=(0,w.ZP)(),K=o.Children.only(C),ee=(0,g.Tm)(K,{className:r()("".concat(G,"-trigger"),{["".concat(G,"-rtl")]:"rtl"===_},K.props.className),disabled:O}),et=O?[]:I;et&&et.includes("contextMenu")&&(t=!0);let[en,eo]=(0,s.Z)(!1,{value:null!=E?E:z}),ec=(0,i.zX)(e=>{null==N||N(e,{source:"trigger"}),null==T||T(e),eo(e)}),ea=r()(B,j,V,J,$,null==q?void 0:q.className,{["".concat(G,"-rtl")]:"rtl"===_}),er=(0,m.Z)({arrowPointAtCenter:"object"==typeof a&&a.pointAtCenter,autoAdjustOverflow:A,offset:Q.marginXXS,arrowWidth:a?Q.sizePopupArrow:0,borderRadius:Q.borderRadius}),el=o.useCallback(()=>{null!=n&&n.selectable&&null!=n&&n.multiple||(null==N||N(!1,{source:"menu"}),eo(!1))},[null==n?void 0:n.selectable,null==n?void 0:n.multiple]),[ei,es]=(0,u.Cn)("Dropdown",null==k?void 0:k.zIndex),ed=o.createElement(l.Z,Object.assign({alignPoint:t},(0,d.Z)(e,["rootClassName"]),{mouseEnterDelay:R,mouseLeaveDelay:Z,visible:en,builtinPlacements:er,arrow:!!a,overlayClassName:ea,prefixCls:G,getPopupContainer:S||L,transitionName:F,trigger:et,overlay:()=>{let e;return e=(null==n?void 0:n.items)?o.createElement(h.Z,Object.assign({},n)):"function"==typeof D?D():D,x&&(e=x(e)),e=o.Children.only("string"==typeof e?o.createElement("span",null,e):e),o.createElement(y.J,{prefixCls:"".concat(G,"-menu"),rootClassName:r()(J,$),expandIcon:o.createElement("span",{className:"".concat(G,"-menu-submenu-arrow")},o.createElement(c.Z,{className:"".concat(G,"-menu-submenu-arrow-icon")})),mode:"vertical",selectable:!1,onClick:el,validator:e=>{let{mode:t}=e}},e)},placement:Y,onVisibleChange:ec,overlayStyle:Object.assign(Object.assign(Object.assign({},null==q?void 0:q.style),k),{zIndex:ei})}),ee);return ei&&(ed=o.createElement(f.Z.Provider,{value:es},ed)),U(ed)},R=(0,p.Z)(T,"dropdown",e=>e,function(e){return Object.assign(Object.assign({},e),{align:{overflow:{adjustX:!1,adjustY:!1}}})});T._InternalPanelDoNotUseOrYouWillBeFired=e=>o.createElement(R,Object.assign({},e),o.createElement("span",null));var Z=n(60440),A=n(73002),M=n(93142),D=n(65658),W=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let L=e=>{let{getPopupContainer:t,getPrefixCls:n,direction:c}=o.useContext(v.E_),{prefixCls:a,type:l="default",danger:i,disabled:s,loading:d,onClick:u,htmlType:m,children:p,className:g,menu:b,arrow:f,autoFocus:h,overlay:y,trigger:w,align:C,open:I,onOpenChange:O,placement:x,getPopupContainer:S,href:B,icon:j=o.createElement(Z.Z,null),title:k,buttonsRender:E=e=>e,mouseEnterDelay:N,mouseLeaveDelay:z,overlayClassName:H,overlayStyle:P,destroyPopupOnHide:R,dropdownRender:L}=e,X=W(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),_=n("dropdown",a),q={menu:b,arrow:f,autoFocus:h,align:C,disabled:s,trigger:s?[]:w,onOpenChange:O,getPopupContainer:S||t,mouseEnterDelay:N,mouseLeaveDelay:z,overlayClassName:H,overlayStyle:P,destroyPopupOnHide:R,dropdownRender:L},{compactSize:F,compactItemClassnames:Y}=(0,D.ri)(_,c),G=r()("".concat(_,"-button"),Y,g);"overlay"in e&&(q.overlay=y),"open"in e&&(q.open=I),"placement"in e?q.placement=x:q.placement="rtl"===c?"bottomLeft":"bottomRight";let[$,U]=E([o.createElement(A.ZP,{type:l,danger:i,disabled:s,loading:d,onClick:u,htmlType:m,href:B,title:k},p),o.createElement(A.ZP,{type:l,danger:i,icon:j})]);return o.createElement(M.Z.Compact,Object.assign({className:G,size:F,block:!0},X),$,o.createElement(T,Object.assign({},q),U))};L.__ANT_BUTTON=!0,T.Button=L;var X=T},92239:function(e,t,n){let o;n.d(t,{D:function(){return y},Z:function(){return C}});var c=n(2265),a=n(1119),r={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},l=n(55015),i=c.forwardRef(function(e,t){return c.createElement(l.Z,(0,a.Z)({},e,{ref:t,icon:r}))}),s=n(15327),d=n(77565),u=n(36760),m=n.n(u),p=n(18694),g=e=>!isNaN(parseFloat(e))&&isFinite(e),b=n(71744),f=n(80856),v=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let h={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},y=c.createContext({}),w=(o=0,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return o+=1,"".concat(e).concat(o)});var C=c.forwardRef((e,t)=>{let{prefixCls:n,className:o,trigger:a,children:r,defaultCollapsed:l=!1,theme:u="dark",style:C={},collapsible:I=!1,reverseArrow:O=!1,width:x=200,collapsedWidth:S=80,zeroWidthTriggerStyle:B,breakpoint:j,onCollapse:k,onBreakpoint:E}=e,N=v(e,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:z}=(0,c.useContext)(f.V),[H,P]=(0,c.useState)("collapsed"in e?e.collapsed:l),[T,R]=(0,c.useState)(!1);(0,c.useEffect)(()=>{"collapsed"in e&&P(e.collapsed)},[e.collapsed]);let Z=(t,n)=>{"collapsed"in e||P(t),null==k||k(t,n)},A=(0,c.useRef)();A.current=e=>{R(e.matches),null==E||E(e.matches),H!==e.matches&&Z(e.matches,"responsive")},(0,c.useEffect)(()=>{let e;function t(e){return A.current(e)}if("undefined"!=typeof window){let{matchMedia:n}=window;if(n&&j&&j in h){e=n("screen and (max-width: ".concat(h[j],")"));try{e.addEventListener("change",t)}catch(n){e.addListener(t)}t(e)}}return()=>{try{null==e||e.removeEventListener("change",t)}catch(n){null==e||e.removeListener(t)}}},[j]),(0,c.useEffect)(()=>{let e=w("ant-sider-");return z.addSider(e),()=>z.removeSider(e)},[]);let M=()=>{Z(!H,"clickTrigger")},{getPrefixCls:D}=(0,c.useContext)(b.E_),W=c.useMemo(()=>({siderCollapsed:H}),[H]);return c.createElement(y.Provider,{value:W},(()=>{let e=D("layout-sider",n),l=(0,p.Z)(N,["collapsed"]),b=H?S:x,f=g(b)?"".concat(b,"px"):String(b),v=0===parseFloat(String(S||0))?c.createElement("span",{onClick:M,className:m()("".concat(e,"-zero-width-trigger"),"".concat(e,"-zero-width-trigger-").concat(O?"right":"left")),style:B},a||c.createElement(i,null)):null,h={expanded:O?c.createElement(d.Z,null):c.createElement(s.Z,null),collapsed:O?c.createElement(s.Z,null):c.createElement(d.Z,null)}[H?"collapsed":"expanded"],y=null!==a?v||c.createElement("div",{className:"".concat(e,"-trigger"),onClick:M,style:{width:f}},a||h):null,w=Object.assign(Object.assign({},C),{flex:"0 0 ".concat(f),maxWidth:f,minWidth:f,width:f}),j=m()(e,"".concat(e,"-").concat(u),{["".concat(e,"-collapsed")]:!!H,["".concat(e,"-has-trigger")]:I&&null!==a&&!v,["".concat(e,"-below")]:!!T,["".concat(e,"-zero-width")]:0===parseFloat(f)},o);return c.createElement("aside",Object.assign({className:j},l,{style:w,ref:t}),c.createElement("div",{className:"".concat(e,"-children")},r),I||T&&v?y:null)})())})},80856:function(e,t,n){n.d(t,{V:function(){return o}});let o=n(2265).createContext({siderHook:{addSider:()=>null,removeSider:()=>null}})},88208:function(e,t,n){n.d(t,{J:function(){return i}});var o=n(2265),c=n(74126),a=n(65658),r=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let l=o.createContext(null),i=o.forwardRef((e,t)=>{let{children:n}=e,i=r(e,["children"]),s=o.useContext(l),d=o.useMemo(()=>Object.assign(Object.assign({},s),i),[s,i.prefixCls,i.mode,i.selectable,i.rootClassName]),u=(0,c.t4)(n),m=(0,c.x1)(t,u?n.ref:null);return o.createElement(l.Provider,{value:d},o.createElement(a.BR,null,u?o.cloneElement(n,{ref:m}):n))});t.Z=l},45937:function(e,t,n){n.d(t,{Z:function(){return Y}});var o=n(2265),c=n(33082),a=n(92239),r=n(60440),l=n(36760),i=n.n(l),s=n(74126),d=n(18694),u=n(68710),m=n(19722),p=n(71744),g=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n},b=e=>{let{prefixCls:t,className:n,dashed:a}=e,r=g(e,["prefixCls","className","dashed"]),{getPrefixCls:l}=o.useContext(p.E_),s=l("menu",t),d=i()({["".concat(s,"-item-divider-dashed")]:!!a},n);return o.createElement(c.iz,Object.assign({className:d},r))},f=n(45287),v=n(89970);let h=(0,o.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var y=e=>{var t;let{className:n,children:r,icon:l,title:s,danger:u}=e,{prefixCls:p,firstLevel:g,direction:b,disableMenuItemTitleTooltip:y,inlineCollapsed:w}=o.useContext(h),{siderCollapsed:C}=o.useContext(a.D),I=s;void 0===s?I=g?r:"":!1===s&&(I="");let O={title:I};C||w||(O.title=null,O.open=!1);let x=(0,f.Z)(r).length,S=o.createElement(c.ck,Object.assign({},(0,d.Z)(e,["title","icon","danger"]),{className:i()({["".concat(p,"-item-danger")]:u,["".concat(p,"-item-only-child")]:(l?x+1:x)===1},n),title:"string"==typeof s?s:void 0}),(0,m.Tm)(l,{className:i()((0,m.l$)(l)?null===(t=l.props)||void 0===t?void 0:t.className:"","".concat(p,"-item-icon"))}),(e=>{let t=o.createElement("span",{className:"".concat(p,"-title-content")},r);return(!l||(0,m.l$)(r)&&"span"===r.type)&&r&&e&&g&&"string"==typeof r?o.createElement("div",{className:"".concat(p,"-inline-collapsed-noicon")},r.charAt(0)):t})(w));return y||(S=o.createElement(v.Z,Object.assign({},O,{placement:"rtl"===b?"left":"right",overlayClassName:"".concat(p,"-inline-collapsed-tooltip")}),S)),S},w=n(62236),C=e=>{var t;let n;let{popupClassName:a,icon:r,title:l,theme:s}=e,u=o.useContext(h),{prefixCls:p,inlineCollapsed:g,theme:b}=u,f=(0,c.Xl)();if(r){let e=(0,m.l$)(l)&&"span"===l.type;n=o.createElement(o.Fragment,null,(0,m.Tm)(r,{className:i()((0,m.l$)(r)?null===(t=r.props)||void 0===t?void 0:t.className:"","".concat(p,"-item-icon"))}),e?l:o.createElement("span",{className:"".concat(p,"-title-content")},l))}else n=g&&!f.length&&l&&"string"==typeof l?o.createElement("div",{className:"".concat(p,"-inline-collapsed-noicon")},l.charAt(0)):o.createElement("span",{className:"".concat(p,"-title-content")},l);let v=o.useMemo(()=>Object.assign(Object.assign({},u),{firstLevel:!1}),[u]),[y]=(0,w.Cn)("Menu");return o.createElement(h.Provider,{value:v},o.createElement(c.Wd,Object.assign({},(0,d.Z)(e,["icon"]),{title:n,popupClassName:i()(p,a,"".concat(p,"-").concat(s||b)),popupStyle:{zIndex:y}})))},I=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n},O=n(88208),x=n(352),S=n(36360),B=n(12918),j=n(63074),k=n(18544),E=n(691),N=n(80669),z=n(3104),H=e=>{let{componentCls:t,motionDurationSlow:n,horizontalLineHeight:o,colorSplit:c,lineWidth:a,lineType:r,itemPaddingInline:l}=e;return{["".concat(t,"-horizontal")]:{lineHeight:o,border:0,borderBottom:"".concat((0,x.bf)(a)," ").concat(r," ").concat(c),boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},["".concat(t,"-item, ").concat(t,"-submenu")]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},["> ".concat(t,"-item:hover,\n > ").concat(t,"-item-active,\n > ").concat(t,"-submenu ").concat(t,"-submenu-title:hover")]:{backgroundColor:"transparent"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{transition:["border-color ".concat(n),"background ".concat(n)].join(",")},["".concat(t,"-submenu-arrow")]:{display:"none"}}}},P=e=>{let{componentCls:t,menuArrowOffset:n,calc:o}=e;return{["".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-submenu-rtl")]:{transformOrigin:"100% 0"},["".concat(t,"-rtl").concat(t,"-vertical,\n ").concat(t,"-submenu-rtl ").concat(t,"-vertical")]:{["".concat(t,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateY(".concat((0,x.bf)(o(n).mul(-1).equal()),")")},"&::after":{transform:"rotate(45deg) translateY(".concat((0,x.bf)(n),")")}}}}};let T=e=>Object.assign({},(0,B.oN)(e));var R=(e,t)=>{let{componentCls:n,itemColor:o,itemSelectedColor:c,groupTitleColor:a,itemBg:r,subMenuItemBg:l,itemSelectedBg:i,activeBarHeight:s,activeBarWidth:d,activeBarBorderWidth:u,motionDurationSlow:m,motionEaseInOut:p,motionEaseOut:g,itemPaddingInline:b,motionDurationMid:f,itemHoverColor:v,lineType:h,colorSplit:y,itemDisabledColor:w,dangerItemColor:C,dangerItemHoverColor:I,dangerItemSelectedColor:O,dangerItemActiveBg:S,dangerItemSelectedBg:B,popupBg:j,itemHoverBg:k,itemActiveBg:E,menuSubMenuBg:N,horizontalItemSelectedColor:z,horizontalItemSelectedBg:H,horizontalItemBorderRadius:P,horizontalItemHoverBg:R}=e;return{["".concat(n,"-").concat(t,", ").concat(n,"-").concat(t," > ").concat(n)]:{color:o,background:r,["&".concat(n,"-root:focus-visible")]:Object.assign({},T(e)),["".concat(n,"-item-group-title")]:{color:a},["".concat(n,"-submenu-selected")]:{["> ".concat(n,"-submenu-title")]:{color:c}},["".concat(n,"-item-disabled, ").concat(n,"-submenu-disabled")]:{color:"".concat(w," !important")},["".concat(n,"-item:not(").concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{["&:hover, > ".concat(n,"-submenu-title:hover")]:{color:v}},["&:not(".concat(n,"-horizontal)")]:{["".concat(n,"-item:not(").concat(n,"-item-selected)")]:{"&:hover":{backgroundColor:k},"&:active":{backgroundColor:E}},["".concat(n,"-submenu-title")]:{"&:hover":{backgroundColor:k},"&:active":{backgroundColor:E}}},["".concat(n,"-item-danger")]:{color:C,["&".concat(n,"-item:hover")]:{["&:not(".concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{color:I}},["&".concat(n,"-item:active")]:{background:S}},["".concat(n,"-item a")]:{"&, &:hover":{color:"inherit"}},["".concat(n,"-item-selected")]:{color:c,["&".concat(n,"-item-danger")]:{color:O},"a, a:hover":{color:"inherit"}},["& ".concat(n,"-item-selected")]:{backgroundColor:i,["&".concat(n,"-item-danger")]:{backgroundColor:B}},["".concat(n,"-item, ").concat(n,"-submenu-title")]:{["&:not(".concat(n,"-item-disabled):focus-visible")]:Object.assign({},T(e))},["&".concat(n,"-submenu > ").concat(n)]:{backgroundColor:N},["&".concat(n,"-popup > ").concat(n)]:{backgroundColor:j},["&".concat(n,"-submenu-popup > ").concat(n)]:{backgroundColor:j},["&".concat(n,"-horizontal")]:Object.assign(Object.assign({},"dark"===t?{borderBottom:0}:{}),{["> ".concat(n,"-item, > ").concat(n,"-submenu")]:{top:u,marginTop:e.calc(u).mul(-1).equal(),marginBottom:0,borderRadius:P,"&::after":{position:"absolute",insetInline:b,bottom:0,borderBottom:"".concat((0,x.bf)(s)," solid transparent"),transition:"border-color ".concat(m," ").concat(p),content:'""'},"&:hover, &-active, &-open":{background:R,"&::after":{borderBottomWidth:s,borderBottomColor:z}},"&-selected":{color:z,backgroundColor:H,"&:hover":{backgroundColor:H},"&::after":{borderBottomWidth:s,borderBottomColor:z}}}}),["&".concat(n,"-root")]:{["&".concat(n,"-inline, &").concat(n,"-vertical")]:{borderInlineEnd:"".concat((0,x.bf)(u)," ").concat(h," ").concat(y)}},["&".concat(n,"-inline")]:{["".concat(n,"-sub").concat(n,"-inline")]:{background:l},["".concat(n,"-item")]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:"".concat((0,x.bf)(d)," solid ").concat(c),transform:"scaleY(0.0001)",opacity:0,transition:["transform ".concat(f," ").concat(g),"opacity ".concat(f," ").concat(g)].join(","),content:'""'},["&".concat(n,"-item-danger")]:{"&::after":{borderInlineEndColor:O}}},["".concat(n,"-selected, ").concat(n,"-item-selected")]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:["transform ".concat(f," ").concat(p),"opacity ".concat(f," ").concat(p)].join(",")}}}}}};let Z=e=>{let{componentCls:t,itemHeight:n,itemMarginInline:o,padding:c,menuArrowSize:a,marginXS:r,itemMarginBlock:l,itemWidth:i}=e,s=e.calc(a).add(c).add(r).equal();return{["".concat(t,"-item")]:{position:"relative",overflow:"hidden"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,x.bf)(n),paddingInline:c,overflow:"hidden",textOverflow:"ellipsis",marginInline:o,marginBlock:l,width:i},["> ".concat(t,"-item,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,x.bf)(n)},["".concat(t,"-item-group-list ").concat(t,"-submenu-title,\n ").concat(t,"-submenu-title")]:{paddingInlineEnd:s}}};var A=e=>{let{componentCls:t,iconCls:n,itemHeight:o,colorTextLightSolid:c,dropdownWidth:a,controlHeightLG:r,motionDurationMid:l,motionEaseOut:i,paddingXL:s,itemMarginInline:d,fontSizeLG:u,motionDurationSlow:m,paddingXS:p,boxShadowSecondary:g,collapsedWidth:b,collapsedIconSize:f}=e,v={height:o,lineHeight:(0,x.bf)(o),listStylePosition:"inside",listStyleType:"disc"};return[{[t]:{"&-inline, &-vertical":Object.assign({["&".concat(t,"-root")]:{boxShadow:"none"}},Z(e))},["".concat(t,"-submenu-popup")]:{["".concat(t,"-vertical")]:Object.assign(Object.assign({},Z(e)),{boxShadow:g})}},{["".concat(t,"-submenu-popup ").concat(t,"-vertical").concat(t,"-sub")]:{minWidth:a,maxHeight:"calc(100vh - ".concat((0,x.bf)(e.calc(r).mul(2.5).equal()),")"),padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{["".concat(t,"-inline")]:{width:"100%",["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{display:"flex",alignItems:"center",transition:["border-color ".concat(m),"background ".concat(m),"padding ".concat(l," ").concat(i)].join(","),["> ".concat(t,"-title-content")]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},["".concat(t,"-sub").concat(t,"-inline")]:{padding:0,border:0,borderRadius:0,boxShadow:"none",["& > ".concat(t,"-submenu > ").concat(t,"-submenu-title")]:v,["& ".concat(t,"-item-group-title")]:{paddingInlineStart:s}},["".concat(t,"-item")]:v}},{["".concat(t,"-inline-collapsed")]:{width:b,["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu ").concat(t,"-submenu-title")]:{["> ".concat(t,"-inline-collapsed-noicon")]:{fontSize:u,textAlign:"center"}}},["> ".concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-submenu > ").concat(t,"-submenu-title,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{insetInlineStart:0,paddingInline:"calc(50% - ".concat((0,x.bf)(e.calc(u).div(2).equal())," - ").concat((0,x.bf)(d),")"),textOverflow:"clip",["\n ".concat(t,"-submenu-arrow,\n ").concat(t,"-submenu-expand-icon\n ")]:{opacity:0},["".concat(t,"-item-icon, ").concat(n)]:{margin:0,fontSize:f,lineHeight:(0,x.bf)(o),"+ span":{display:"inline-block",opacity:0}}},["".concat(t,"-item-icon, ").concat(n)]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",["".concat(t,"-item-icon, ").concat(n)]:{display:"none"},"a, a:hover":{color:c}},["".concat(t,"-item-group-title")]:Object.assign(Object.assign({},B.vS),{paddingInline:p})}}]};let M=e=>{let{componentCls:t,motionDurationSlow:n,motionDurationMid:o,motionEaseInOut:c,motionEaseOut:a,iconCls:r,iconSize:l,iconMarginInlineEnd:i}=e;return{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:["border-color ".concat(n),"background ".concat(n),"padding ".concat(n," ").concat(c)].join(","),["".concat(t,"-item-icon, ").concat(r)]:{minWidth:l,fontSize:l,transition:["font-size ".concat(o," ").concat(a),"margin ".concat(n," ").concat(c),"color ".concat(n)].join(","),"+ span":{marginInlineStart:i,opacity:1,transition:["opacity ".concat(n," ").concat(c),"margin ".concat(n),"color ".concat(n)].join(",")}},["".concat(t,"-item-icon")]:Object.assign({},(0,B.Ro)()),["&".concat(t,"-item-only-child")]:{["> ".concat(r,", > ").concat(t,"-item-icon")]:{marginInlineEnd:0}}},["".concat(t,"-item-disabled, ").concat(t,"-submenu-disabled")]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},["> ".concat(t,"-submenu-title")]:{color:"inherit !important",cursor:"not-allowed"}}}},D=e=>{let{componentCls:t,motionDurationSlow:n,motionEaseInOut:o,borderRadius:c,menuArrowSize:a,menuArrowOffset:r}=e;return{["".concat(t,"-submenu")]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:a,color:"currentcolor",transform:"translateY(-50%)",transition:"transform ".concat(n," ").concat(o,", opacity ").concat(n)},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(a).mul(.6).equal(),height:e.calc(a).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:c,transition:["background ".concat(n," ").concat(o),"transform ".concat(n," ").concat(o),"top ".concat(n," ").concat(o),"color ".concat(n," ").concat(o)].join(","),content:'""'},"&::before":{transform:"rotate(45deg) translateY(".concat((0,x.bf)(e.calc(r).mul(-1).equal()),")")},"&::after":{transform:"rotate(-45deg) translateY(".concat((0,x.bf)(r),")")}}}}},W=e=>{let{antCls:t,componentCls:n,fontSize:o,motionDurationSlow:c,motionDurationMid:a,motionEaseInOut:r,paddingXS:l,padding:i,colorSplit:s,lineWidth:d,zIndexPopup:u,borderRadiusLG:m,subMenuItemBorderRadius:p,menuArrowSize:g,menuArrowOffset:b,lineType:f,menuPanelMaskInset:v,groupTitleLineHeight:h,groupTitleFontSize:y}=e;return[{"":{["".concat(n)]:Object.assign(Object.assign({},(0,B.dF)()),{"&-hidden":{display:"none"}})},["".concat(n,"-submenu-hidden")]:{display:"none"}},{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,B.Wf)(e)),(0,B.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:o,lineHeight:0,listStyle:"none",outline:"none",transition:"width ".concat(c," cubic-bezier(0.2, 0, 0, 1) 0s"),"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",["".concat(n,"-item")]:{flex:"none"}},["".concat(n,"-item, ").concat(n,"-submenu, ").concat(n,"-submenu-title")]:{borderRadius:e.itemBorderRadius},["".concat(n,"-item-group-title")]:{padding:"".concat((0,x.bf)(l)," ").concat((0,x.bf)(i)),fontSize:y,lineHeight:h,transition:"all ".concat(c)},["&-horizontal ".concat(n,"-submenu")]:{transition:["border-color ".concat(c," ").concat(r),"background ".concat(c," ").concat(r)].join(",")},["".concat(n,"-submenu, ").concat(n,"-submenu-inline")]:{transition:["border-color ".concat(c," ").concat(r),"background ".concat(c," ").concat(r),"padding ".concat(a," ").concat(r)].join(",")},["".concat(n,"-submenu ").concat(n,"-sub")]:{cursor:"initial",transition:["background ".concat(c," ").concat(r),"padding ".concat(c," ").concat(r)].join(",")},["".concat(n,"-title-content")]:{transition:"color ".concat(c),["> ".concat(t,"-typography-ellipsis-single-line")]:{display:"inline",verticalAlign:"unset"}},["".concat(n,"-item a")]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},["".concat(n,"-item-divider")]:{overflow:"hidden",lineHeight:0,borderColor:s,borderStyle:f,borderWidth:0,borderTopWidth:d,marginBlock:d,padding:0,"&-dashed":{borderStyle:"dashed"}}}),M(e)),{["".concat(n,"-item-group")]:{["".concat(n,"-item-group-list")]:{margin:0,padding:0,["".concat(n,"-item, ").concat(n,"-submenu-title")]:{paddingInline:"".concat((0,x.bf)(e.calc(o).mul(2).equal())," ").concat((0,x.bf)(i))}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:u,borderRadius:m,boxShadow:"none",transformOrigin:"0 0",["&".concat(n,"-submenu")]:{background:"transparent"},"&::before":{position:"absolute",inset:"".concat((0,x.bf)(v)," 0 0"),zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:v},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS},["> ".concat(n)]:Object.assign(Object.assign(Object.assign({borderRadius:m},M(e)),D(e)),{["".concat(n,"-item, ").concat(n,"-submenu > ").concat(n,"-submenu-title")]:{borderRadius:p},["".concat(n,"-submenu-title::after")]:{transition:"transform ".concat(c," ").concat(r)}})}}),D(e)),{["&-inline-collapsed ".concat(n,"-submenu-arrow,\n &-inline ").concat(n,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateX(".concat((0,x.bf)(b),")")},"&::after":{transform:"rotate(45deg) translateX(".concat((0,x.bf)(e.calc(b).mul(-1).equal()),")")}},["".concat(n,"-submenu-open").concat(n,"-submenu-inline > ").concat(n,"-submenu-title > ").concat(n,"-submenu-arrow")]:{transform:"translateY(".concat((0,x.bf)(e.calc(g).mul(.2).mul(-1).equal()),")"),"&::after":{transform:"rotate(-45deg) translateX(".concat((0,x.bf)(e.calc(b).mul(-1).equal()),")")},"&::before":{transform:"rotate(45deg) translateX(".concat((0,x.bf)(b),")")}}})},{["".concat(t,"-layout-header")]:{[n]:{lineHeight:"inherit"}}}]},L=e=>{var t,n,o;let{colorPrimary:c,colorError:a,colorTextDisabled:r,colorErrorBg:l,colorText:i,colorTextDescription:s,colorBgContainer:d,colorFillAlter:u,colorFillContent:m,lineWidth:p,lineWidthBold:g,controlItemBgActive:b,colorBgTextHover:f,controlHeightLG:v,lineHeight:h,colorBgElevated:y,marginXXS:w,padding:C,fontSize:I,controlHeightSM:O,fontSizeLG:x,colorTextLightSolid:B,colorErrorHover:j}=e,k=null!==(t=e.activeBarWidth)&&void 0!==t?t:0,E=null!==(n=e.activeBarBorderWidth)&&void 0!==n?n:p,N=null!==(o=e.itemMarginInline)&&void 0!==o?o:e.marginXXS,z=new S.C(B).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:i,itemColor:i,colorItemTextHover:i,itemHoverColor:i,colorItemTextHoverHorizontal:c,horizontalItemHoverColor:c,colorGroupTitle:s,groupTitleColor:s,colorItemTextSelected:c,itemSelectedColor:c,colorItemTextSelectedHorizontal:c,horizontalItemSelectedColor:c,colorItemBg:d,itemBg:d,colorItemBgHover:f,itemHoverBg:f,colorItemBgActive:m,itemActiveBg:b,colorSubItemBg:u,subMenuItemBg:u,colorItemBgSelected:b,itemSelectedBg:b,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:k,colorActiveBarHeight:g,activeBarHeight:g,colorActiveBarBorderSize:p,activeBarBorderWidth:E,colorItemTextDisabled:r,itemDisabledColor:r,colorDangerItemText:a,dangerItemColor:a,colorDangerItemTextHover:a,dangerItemHoverColor:a,colorDangerItemTextSelected:a,dangerItemSelectedColor:a,colorDangerItemBgActive:l,dangerItemActiveBg:l,colorDangerItemBgSelected:l,dangerItemSelectedBg:l,itemMarginInline:N,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:v,groupTitleLineHeight:h,collapsedWidth:2*v,popupBg:y,itemMarginBlock:w,itemPaddingInline:C,horizontalLineHeight:"".concat(1.15*v,"px"),iconSize:I,iconMarginInlineEnd:O-I,collapsedIconSize:x,groupTitleFontSize:I,darkItemDisabledColor:new S.C(B).setAlpha(.25).toRgbString(),darkItemColor:z,darkDangerItemColor:a,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:B,darkItemSelectedBg:c,darkDangerItemSelectedBg:a,darkItemHoverBg:"transparent",darkGroupTitleColor:z,darkItemHoverColor:B,darkDangerItemHoverColor:j,darkDangerItemSelectedColor:B,darkDangerItemActiveBg:a,itemWidth:k?"calc(100% + ".concat(E,"px)"):"calc(100% - ".concat(2*N,"px)")}};var X=n(64024),_=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let q=(0,o.forwardRef)((e,t)=>{var n,a;let l;let g=o.useContext(O.Z),f=g||{},{getPrefixCls:v,getPopupContainer:w,direction:x,menu:S}=o.useContext(p.E_),B=v(),{prefixCls:T,className:Z,style:M,theme:D="light",expandIcon:q,_internalDisableMenuItemTitleTooltip:F,inlineCollapsed:Y,siderCollapsed:G,items:$,children:U,rootClassName:V,mode:J,selectable:Q,onClick:K,overflowedIndicatorPopupClassName:ee}=e,et=_(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),en=(0,d.Z)(et,["collapsedWidth"]),eo=o.useMemo(()=>$?function e(t){return(t||[]).map((t,n)=>{if(t&&"object"==typeof t){let{label:a,children:r,key:l,type:i}=t,s=I(t,["label","children","key","type"]),d=null!=l?l:"tmp-".concat(n);return r||"group"===i?"group"===i?o.createElement(c.BW,Object.assign({key:d},s,{title:a}),e(r)):o.createElement(C,Object.assign({key:d},s,{title:a}),e(r)):"divider"===i?o.createElement(b,Object.assign({key:d},s)):o.createElement(y,Object.assign({key:d},s),a)}return null}).filter(e=>e)}($):$,[$])||U;null===(n=f.validator)||void 0===n||n.call(f,{mode:J});let ec=(0,s.zX)(function(){var e;null==K||K.apply(void 0,arguments),null===(e=f.onClick)||void 0===e||e.call(f)}),ea=f.mode||J,er=null!=Q?Q:f.selectable,el=o.useMemo(()=>void 0!==G?G:Y,[Y,G]),ei={horizontal:{motionName:"".concat(B,"-slide-up")},inline:(0,u.Z)(B),other:{motionName:"".concat(B,"-zoom-big")}},es=v("menu",T||f.prefixCls),ed=(0,X.Z)(es),[eu,em,ep]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return(0,N.I$)("Menu",e=>{let{colorBgElevated:t,colorPrimary:n,colorTextLightSolid:o,controlHeightLG:c,fontSize:a,darkItemColor:r,darkDangerItemColor:l,darkItemBg:i,darkSubMenuItemBg:s,darkItemSelectedColor:d,darkItemSelectedBg:u,darkDangerItemSelectedBg:m,darkItemHoverBg:p,darkGroupTitleColor:g,darkItemHoverColor:b,darkItemDisabledColor:f,darkDangerItemHoverColor:v,darkDangerItemSelectedColor:h,darkDangerItemActiveBg:y,popupBg:w,darkPopupBg:C}=e,I=e.calc(a).div(7).mul(5).equal(),O=(0,z.TS)(e,{menuArrowSize:I,menuHorizontalHeight:e.calc(c).mul(1.15).equal(),menuArrowOffset:e.calc(I).mul(.25).equal(),menuPanelMaskInset:-7,menuSubMenuBg:t,calc:e.calc,popupBg:w}),x=(0,z.TS)(O,{itemColor:r,itemHoverColor:b,groupTitleColor:g,itemSelectedColor:d,itemBg:i,popupBg:C,subMenuItemBg:s,itemActiveBg:"transparent",itemSelectedBg:u,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:p,itemDisabledColor:f,dangerItemColor:l,dangerItemHoverColor:v,dangerItemSelectedColor:h,dangerItemActiveBg:y,dangerItemSelectedBg:m,menuSubMenuBg:s,horizontalItemSelectedColor:o,horizontalItemSelectedBg:n});return[W(O),H(O),A(O),R(O,"light"),R(x,"dark"),P(O),(0,j.Z)(O),(0,k.oN)(O,"slide-up"),(0,k.oN)(O,"slide-down"),(0,E._y)(O,"zoom-big")]},L,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:n,unitless:{groupTitleLineHeight:!0}})(e,t)}(es,ed,!g),eg=i()("".concat(es,"-").concat(D),null==S?void 0:S.className,Z);if("function"==typeof q)l=q;else if(null===q||!1===q)l=null;else if(null===f.expandIcon||!1===f.expandIcon)l=null;else{let e=null!=q?q:f.expandIcon;l=(0,m.Tm)(e,{className:i()("".concat(es,"-submenu-expand-icon"),(0,m.l$)(e)?null===(a=e.props)||void 0===a?void 0:a.className:"")})}let eb=o.useMemo(()=>({prefixCls:es,inlineCollapsed:el||!1,direction:x,firstLevel:!0,theme:D,mode:ea,disableMenuItemTitleTooltip:F}),[es,el,x,F,D]);return eu(o.createElement(O.Z.Provider,{value:null},o.createElement(h.Provider,{value:eb},o.createElement(c.ZP,Object.assign({getPopupContainer:w,overflowedIndicator:o.createElement(r.Z,null),overflowedIndicatorPopupClassName:i()(es,"".concat(es,"-").concat(D),ee),mode:ea,selectable:er,onClick:ec},en,{inlineCollapsed:el,style:Object.assign(Object.assign({},null==S?void 0:S.style),M),className:eg,prefixCls:es,direction:x,defaultMotions:ei,expandIcon:l,ref:t,rootClassName:i()(V,em,f.rootClassName,ep,ed)}),eo))))}),F=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null),c=o.useContext(a.D);return(0,o.useImperativeHandle)(t,()=>({menu:n.current,focus:e=>{var t;null===(t=n.current)||void 0===t||t.focus(e)}})),o.createElement(q,Object.assign({ref:n},e,c))});F.Item=y,F.SubMenu=C,F.Divider=b,F.ItemGroup=c.BW;var Y=F},93142:function(e,t,n){n.d(t,{Z:function(){return v}});var o=n(2265),c=n(36760),a=n.n(c),r=n(45287);function l(e){return["small","middle","large"].includes(e)}function i(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}var s=n(71744),d=n(65658);let u=o.createContext({latestIndex:0}),m=u.Provider;var p=e=>{let{className:t,index:n,children:c,split:a,style:r}=e,{latestIndex:l}=o.useContext(u);return null==c?null:o.createElement(o.Fragment,null,o.createElement("div",{className:t,style:r},c),nt.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let f=o.forwardRef((e,t)=>{var n,c;let{getPrefixCls:d,space:u,direction:f}=o.useContext(s.E_),{size:v=(null==u?void 0:u.size)||"small",align:h,className:y,rootClassName:w,children:C,direction:I="horizontal",prefixCls:O,split:x,style:S,wrap:B=!1,classNames:j,styles:k}=e,E=b(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[N,z]=Array.isArray(v)?v:[v,v],H=l(z),P=l(N),T=i(z),R=i(N),Z=(0,r.Z)(C,{keepEmpty:!0}),A=void 0===h&&"horizontal"===I?"center":h,M=d("space",O),[D,W,L]=(0,g.Z)(M),X=a()(M,null==u?void 0:u.className,W,"".concat(M,"-").concat(I),{["".concat(M,"-rtl")]:"rtl"===f,["".concat(M,"-align-").concat(A)]:A,["".concat(M,"-gap-row-").concat(z)]:H,["".concat(M,"-gap-col-").concat(N)]:P},y,w,L),_=a()("".concat(M,"-item"),null!==(n=null==j?void 0:j.item)&&void 0!==n?n:null===(c=null==u?void 0:u.classNames)||void 0===c?void 0:c.item),q=0,F=Z.map((e,t)=>{var n,c;null!=e&&(q=t);let a=e&&e.key||"".concat(_,"-").concat(t);return o.createElement(p,{className:_,key:a,index:t,split:x,style:null!==(n=null==k?void 0:k.item)&&void 0!==n?n:null===(c=null==u?void 0:u.styles)||void 0===c?void 0:c.item},e)}),Y=o.useMemo(()=>({latestIndex:q}),[q]);if(0===Z.length)return null;let G={};return B&&(G.flexWrap="wrap"),!P&&R&&(G.columnGap=N),!H&&T&&(G.rowGap=z),D(o.createElement("div",Object.assign({ref:t,className:X,style:Object.assign(Object.assign(Object.assign({},G),null==u?void 0:u.style),S)},E),o.createElement(m,{value:Y},F)))});f.Compact=d.ZP;var v=f},79205:function(e,t,n){n.d(t,{Z:function(){return u}});var o=n(2265);let c=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),r=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=function(){for(var e=arguments.length,t=Array(e),n=0;n!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()},i=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var s={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"};let d=(0,o.forwardRef)((e,t)=>{let{color:n="currentColor",size:c=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:d="",children:u,iconNode:m,...p}=e;return(0,o.createElement)("svg",{ref:t,...s,width:c,height:c,stroke:n,strokeWidth:r?24*Number(a)/Number(c):a,className:l("lucide",d),...!u&&!i(p)&&{"aria-hidden":"true"},...p},[...m.map(e=>{let[t,n]=e;return(0,o.createElement)(t,n)}),...Array.isArray(u)?u:[u]])}),u=(e,t)=>{let n=(0,o.forwardRef)((n,a)=>{let{className:i,...s}=n;return(0,o.createElement)(d,{ref:a,iconNode:t,className:l("lucide-".concat(c(r(e))),"lucide-".concat(e),i),...s})});return n.displayName=r(e),n}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3603],{15327:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),c=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},r=n(55015),l=c.forwardRef(function(e,t){return c.createElement(r.Z,(0,o.Z)({},e,{ref:t,icon:a}))})},80795:function(e,t,n){n.d(t,{Z:function(){return X}});var o=n(2265),c=n(77565),a=n(36760),r=n.n(a),l=n(71030),i=n(74126),s=n(50506),d=n(18694),u=n(62236),m=n(92736),p=n(93942),g=n(19722),b=n(13613),f=n(95140),v=n(71744),h=n(45937),y=n(88208),w=n(29961),C=n(12918),I=n(18544),O=n(29382),x=n(691),S=n(88260),B=n(80669),j=n(3104),k=e=>{let{componentCls:t,menuCls:n,colorError:o,colorTextLightSolid:c}=e,a="".concat(n,"-item");return{["".concat(t,", ").concat(t,"-menu-submenu")]:{["".concat(n," ").concat(a)]:{["&".concat(a,"-danger:not(").concat(a,"-disabled)")]:{color:o,"&:hover":{color:c,backgroundColor:o}}}}}},E=n(34442),N=n(352);let z=e=>{let{componentCls:t,menuCls:n,zIndexPopup:o,dropdownArrowDistance:c,sizePopupArrow:a,antCls:r,iconCls:l,motionDurationMid:i,paddingBlock:s,fontSize:d,dropdownEdgeChildPadding:u,colorTextDisabled:m,fontSizeIcon:p,controlPaddingHorizontal:g,colorBgElevated:b}=e;return[{[t]:Object.assign(Object.assign({},(0,C.Wf)(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:o,display:"block","&::before":{position:"absolute",insetBlock:e.calc(a).div(2).sub(c).equal(),zIndex:-9999,opacity:1e-4,content:'""'},["&-trigger".concat(r,"-btn")]:{["& > ".concat(l,"-down, & > ").concat(r,"-btn-icon > ").concat(l,"-down")]:{fontSize:p}},["".concat(t,"-wrap")]:{position:"relative",["".concat(r,"-btn > ").concat(l,"-down")]:{fontSize:p},["".concat(l,"-down::before")]:{transition:"transform ".concat(i)}},["".concat(t,"-wrap-open")]:{["".concat(l,"-down::before")]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},["&".concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottomRight,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottomRight")]:{animationName:I.fJ},["&".concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-topRight,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-topRight")]:{animationName:I.Qt},["&".concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottomRight")]:{animationName:I.Uw},["&".concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-topRight")]:{animationName:I.ly}})},(0,S.ZP)(e,b,{arrowPlacement:{top:!0,bottom:!0}}),{["".concat(t," ").concat(n)]:{position:"relative",margin:0},["".concat(n,"-submenu-popup")]:{position:"absolute",zIndex:o,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},["".concat(t,", ").concat(t,"-menu-submenu")]:{[n]:Object.assign(Object.assign({padding:u,listStyleType:"none",backgroundColor:b,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},(0,C.Qy)(e)),{["".concat(n,"-item-group-title")]:{padding:"".concat((0,N.bf)(s)," ").concat((0,N.bf)(g)),color:e.colorTextDescription,transition:"all ".concat(i)},["".concat(n,"-item")]:{position:"relative",display:"flex",alignItems:"center"},["".concat(n,"-item-icon")]:{minWidth:d,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},["".concat(n,"-title-content")]:{flex:"auto","> a":{color:"inherit",transition:"all ".concat(i),"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},["".concat(n,"-item, ").concat(n,"-submenu-title")]:Object.assign(Object.assign({clear:"both",margin:0,padding:"".concat((0,N.bf)(s)," ").concat((0,N.bf)(g)),color:e.colorText,fontWeight:"normal",fontSize:d,lineHeight:e.lineHeight,cursor:"pointer",transition:"all ".concat(i),borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},(0,C.Qy)(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:m,cursor:"not-allowed","&:hover":{color:m,backgroundColor:b,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:"".concat((0,N.bf)(e.marginXXS)," 0"),overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},["".concat(t,"-menu-submenu-expand-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,["".concat(t,"-menu-submenu-arrow-icon")]:{marginInlineEnd:"0 !important",color:e.colorTextDescription,fontSize:p,fontStyle:"normal"}}}),["".concat(n,"-item-group-list")]:{margin:"0 ".concat((0,N.bf)(e.marginXS)),padding:0,listStyle:"none"},["".concat(n,"-submenu-title")]:{paddingInlineEnd:e.calc(g).add(e.fontSizeSM).equal()},["".concat(n,"-submenu-vertical")]:{position:"relative"},["".concat(n,"-submenu").concat(n,"-submenu-disabled ").concat(t,"-menu-submenu-title")]:{["&, ".concat(t,"-menu-submenu-arrow-icon")]:{color:m,backgroundColor:b,cursor:"not-allowed"}},["".concat(n,"-submenu-selected ").concat(t,"-menu-submenu-title")]:{color:e.colorPrimary}})}},[(0,I.oN)(e,"slide-up"),(0,I.oN)(e,"slide-down"),(0,O.Fm)(e,"move-up"),(0,O.Fm)(e,"move-down"),(0,x._y)(e,"zoom-big")]]};var H=(0,B.I$)("Dropdown",e=>{let{marginXXS:t,sizePopupArrow:n,paddingXXS:o,componentCls:c}=e,a=(0,j.TS)(e,{menuCls:"".concat(c,"-menu"),dropdownArrowDistance:e.calc(n).div(2).add(t).equal(),dropdownEdgeChildPadding:o});return[z(a),k(a)]},e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},(0,S.wZ)({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),(0,E.w)(e))),P=n(64024);let T=e=>{let t;let{menu:n,arrow:a,prefixCls:p,children:C,trigger:I,disabled:O,dropdownRender:x,getPopupContainer:S,overlayClassName:B,rootClassName:j,overlayStyle:k,open:E,onOpenChange:N,visible:z,onVisibleChange:T,mouseEnterDelay:R=.15,mouseLeaveDelay:Z=.1,autoAdjustOverflow:A=!0,placement:M="",overlay:D,transitionName:W}=e,{getPopupContainer:L,getPrefixCls:X,direction:_,dropdown:q}=o.useContext(v.E_);(0,b.ln)("Dropdown");let F=o.useMemo(()=>{let e=X();return void 0!==W?W:M.includes("top")?"".concat(e,"-slide-down"):"".concat(e,"-slide-up")},[X,M,W]),Y=o.useMemo(()=>M?M.includes("Center")?M.slice(0,M.indexOf("Center")):M:"rtl"===_?"bottomRight":"bottomLeft",[M,_]),G=X("dropdown",p),$=(0,P.Z)(G),[U,V,J]=H(G,$),[,Q]=(0,w.ZP)(),K=o.Children.only(C),ee=(0,g.Tm)(K,{className:r()("".concat(G,"-trigger"),{["".concat(G,"-rtl")]:"rtl"===_},K.props.className),disabled:O}),et=O?[]:I;et&&et.includes("contextMenu")&&(t=!0);let[en,eo]=(0,s.Z)(!1,{value:null!=E?E:z}),ec=(0,i.zX)(e=>{null==N||N(e,{source:"trigger"}),null==T||T(e),eo(e)}),ea=r()(B,j,V,J,$,null==q?void 0:q.className,{["".concat(G,"-rtl")]:"rtl"===_}),er=(0,m.Z)({arrowPointAtCenter:"object"==typeof a&&a.pointAtCenter,autoAdjustOverflow:A,offset:Q.marginXXS,arrowWidth:a?Q.sizePopupArrow:0,borderRadius:Q.borderRadius}),el=o.useCallback(()=>{null!=n&&n.selectable&&null!=n&&n.multiple||(null==N||N(!1,{source:"menu"}),eo(!1))},[null==n?void 0:n.selectable,null==n?void 0:n.multiple]),[ei,es]=(0,u.Cn)("Dropdown",null==k?void 0:k.zIndex),ed=o.createElement(l.Z,Object.assign({alignPoint:t},(0,d.Z)(e,["rootClassName"]),{mouseEnterDelay:R,mouseLeaveDelay:Z,visible:en,builtinPlacements:er,arrow:!!a,overlayClassName:ea,prefixCls:G,getPopupContainer:S||L,transitionName:F,trigger:et,overlay:()=>{let e;return e=(null==n?void 0:n.items)?o.createElement(h.Z,Object.assign({},n)):"function"==typeof D?D():D,x&&(e=x(e)),e=o.Children.only("string"==typeof e?o.createElement("span",null,e):e),o.createElement(y.J,{prefixCls:"".concat(G,"-menu"),rootClassName:r()(J,$),expandIcon:o.createElement("span",{className:"".concat(G,"-menu-submenu-arrow")},o.createElement(c.Z,{className:"".concat(G,"-menu-submenu-arrow-icon")})),mode:"vertical",selectable:!1,onClick:el,validator:e=>{let{mode:t}=e}},e)},placement:Y,onVisibleChange:ec,overlayStyle:Object.assign(Object.assign(Object.assign({},null==q?void 0:q.style),k),{zIndex:ei})}),ee);return ei&&(ed=o.createElement(f.Z.Provider,{value:es},ed)),U(ed)},R=(0,p.Z)(T,"dropdown",e=>e,function(e){return Object.assign(Object.assign({},e),{align:{overflow:{adjustX:!1,adjustY:!1}}})});T._InternalPanelDoNotUseOrYouWillBeFired=e=>o.createElement(R,Object.assign({},e),o.createElement("span",null));var Z=n(39760),A=n(73002),M=n(93142),D=n(65658),W=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let L=e=>{let{getPopupContainer:t,getPrefixCls:n,direction:c}=o.useContext(v.E_),{prefixCls:a,type:l="default",danger:i,disabled:s,loading:d,onClick:u,htmlType:m,children:p,className:g,menu:b,arrow:f,autoFocus:h,overlay:y,trigger:w,align:C,open:I,onOpenChange:O,placement:x,getPopupContainer:S,href:B,icon:j=o.createElement(Z.Z,null),title:k,buttonsRender:E=e=>e,mouseEnterDelay:N,mouseLeaveDelay:z,overlayClassName:H,overlayStyle:P,destroyPopupOnHide:R,dropdownRender:L}=e,X=W(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),_=n("dropdown",a),q={menu:b,arrow:f,autoFocus:h,align:C,disabled:s,trigger:s?[]:w,onOpenChange:O,getPopupContainer:S||t,mouseEnterDelay:N,mouseLeaveDelay:z,overlayClassName:H,overlayStyle:P,destroyPopupOnHide:R,dropdownRender:L},{compactSize:F,compactItemClassnames:Y}=(0,D.ri)(_,c),G=r()("".concat(_,"-button"),Y,g);"overlay"in e&&(q.overlay=y),"open"in e&&(q.open=I),"placement"in e?q.placement=x:q.placement="rtl"===c?"bottomLeft":"bottomRight";let[$,U]=E([o.createElement(A.ZP,{type:l,danger:i,disabled:s,loading:d,onClick:u,htmlType:m,href:B,title:k},p),o.createElement(A.ZP,{type:l,danger:i,icon:j})]);return o.createElement(M.Z.Compact,Object.assign({className:G,size:F,block:!0},X),$,o.createElement(T,Object.assign({},q),U))};L.__ANT_BUTTON=!0,T.Button=L;var X=T},92239:function(e,t,n){let o;n.d(t,{D:function(){return y},Z:function(){return C}});var c=n(2265),a=n(1119),r={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},l=n(55015),i=c.forwardRef(function(e,t){return c.createElement(l.Z,(0,a.Z)({},e,{ref:t,icon:r}))}),s=n(15327),d=n(77565),u=n(36760),m=n.n(u),p=n(18694),g=e=>!isNaN(parseFloat(e))&&isFinite(e),b=n(71744),f=n(80856),v=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let h={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},y=c.createContext({}),w=(o=0,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return o+=1,"".concat(e).concat(o)});var C=c.forwardRef((e,t)=>{let{prefixCls:n,className:o,trigger:a,children:r,defaultCollapsed:l=!1,theme:u="dark",style:C={},collapsible:I=!1,reverseArrow:O=!1,width:x=200,collapsedWidth:S=80,zeroWidthTriggerStyle:B,breakpoint:j,onCollapse:k,onBreakpoint:E}=e,N=v(e,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:z}=(0,c.useContext)(f.V),[H,P]=(0,c.useState)("collapsed"in e?e.collapsed:l),[T,R]=(0,c.useState)(!1);(0,c.useEffect)(()=>{"collapsed"in e&&P(e.collapsed)},[e.collapsed]);let Z=(t,n)=>{"collapsed"in e||P(t),null==k||k(t,n)},A=(0,c.useRef)();A.current=e=>{R(e.matches),null==E||E(e.matches),H!==e.matches&&Z(e.matches,"responsive")},(0,c.useEffect)(()=>{let e;function t(e){return A.current(e)}if("undefined"!=typeof window){let{matchMedia:n}=window;if(n&&j&&j in h){e=n("screen and (max-width: ".concat(h[j],")"));try{e.addEventListener("change",t)}catch(n){e.addListener(t)}t(e)}}return()=>{try{null==e||e.removeEventListener("change",t)}catch(n){null==e||e.removeListener(t)}}},[j]),(0,c.useEffect)(()=>{let e=w("ant-sider-");return z.addSider(e),()=>z.removeSider(e)},[]);let M=()=>{Z(!H,"clickTrigger")},{getPrefixCls:D}=(0,c.useContext)(b.E_),W=c.useMemo(()=>({siderCollapsed:H}),[H]);return c.createElement(y.Provider,{value:W},(()=>{let e=D("layout-sider",n),l=(0,p.Z)(N,["collapsed"]),b=H?S:x,f=g(b)?"".concat(b,"px"):String(b),v=0===parseFloat(String(S||0))?c.createElement("span",{onClick:M,className:m()("".concat(e,"-zero-width-trigger"),"".concat(e,"-zero-width-trigger-").concat(O?"right":"left")),style:B},a||c.createElement(i,null)):null,h={expanded:O?c.createElement(d.Z,null):c.createElement(s.Z,null),collapsed:O?c.createElement(s.Z,null):c.createElement(d.Z,null)}[H?"collapsed":"expanded"],y=null!==a?v||c.createElement("div",{className:"".concat(e,"-trigger"),onClick:M,style:{width:f}},a||h):null,w=Object.assign(Object.assign({},C),{flex:"0 0 ".concat(f),maxWidth:f,minWidth:f,width:f}),j=m()(e,"".concat(e,"-").concat(u),{["".concat(e,"-collapsed")]:!!H,["".concat(e,"-has-trigger")]:I&&null!==a&&!v,["".concat(e,"-below")]:!!T,["".concat(e,"-zero-width")]:0===parseFloat(f)},o);return c.createElement("aside",Object.assign({className:j},l,{style:w,ref:t}),c.createElement("div",{className:"".concat(e,"-children")},r),I||T&&v?y:null)})())})},80856:function(e,t,n){n.d(t,{V:function(){return o}});let o=n(2265).createContext({siderHook:{addSider:()=>null,removeSider:()=>null}})},88208:function(e,t,n){n.d(t,{J:function(){return i}});var o=n(2265),c=n(74126),a=n(65658),r=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let l=o.createContext(null),i=o.forwardRef((e,t)=>{let{children:n}=e,i=r(e,["children"]),s=o.useContext(l),d=o.useMemo(()=>Object.assign(Object.assign({},s),i),[s,i.prefixCls,i.mode,i.selectable,i.rootClassName]),u=(0,c.t4)(n),m=(0,c.x1)(t,u?n.ref:null);return o.createElement(l.Provider,{value:d},o.createElement(a.BR,null,u?o.cloneElement(n,{ref:m}):n))});t.Z=l},45937:function(e,t,n){n.d(t,{Z:function(){return Y}});var o=n(2265),c=n(33082),a=n(92239),r=n(39760),l=n(36760),i=n.n(l),s=n(74126),d=n(18694),u=n(68710),m=n(19722),p=n(71744),g=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n},b=e=>{let{prefixCls:t,className:n,dashed:a}=e,r=g(e,["prefixCls","className","dashed"]),{getPrefixCls:l}=o.useContext(p.E_),s=l("menu",t),d=i()({["".concat(s,"-item-divider-dashed")]:!!a},n);return o.createElement(c.iz,Object.assign({className:d},r))},f=n(45287),v=n(89970);let h=(0,o.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var y=e=>{var t;let{className:n,children:r,icon:l,title:s,danger:u}=e,{prefixCls:p,firstLevel:g,direction:b,disableMenuItemTitleTooltip:y,inlineCollapsed:w}=o.useContext(h),{siderCollapsed:C}=o.useContext(a.D),I=s;void 0===s?I=g?r:"":!1===s&&(I="");let O={title:I};C||w||(O.title=null,O.open=!1);let x=(0,f.Z)(r).length,S=o.createElement(c.ck,Object.assign({},(0,d.Z)(e,["title","icon","danger"]),{className:i()({["".concat(p,"-item-danger")]:u,["".concat(p,"-item-only-child")]:(l?x+1:x)===1},n),title:"string"==typeof s?s:void 0}),(0,m.Tm)(l,{className:i()((0,m.l$)(l)?null===(t=l.props)||void 0===t?void 0:t.className:"","".concat(p,"-item-icon"))}),(e=>{let t=o.createElement("span",{className:"".concat(p,"-title-content")},r);return(!l||(0,m.l$)(r)&&"span"===r.type)&&r&&e&&g&&"string"==typeof r?o.createElement("div",{className:"".concat(p,"-inline-collapsed-noicon")},r.charAt(0)):t})(w));return y||(S=o.createElement(v.Z,Object.assign({},O,{placement:"rtl"===b?"left":"right",overlayClassName:"".concat(p,"-inline-collapsed-tooltip")}),S)),S},w=n(62236),C=e=>{var t;let n;let{popupClassName:a,icon:r,title:l,theme:s}=e,u=o.useContext(h),{prefixCls:p,inlineCollapsed:g,theme:b}=u,f=(0,c.Xl)();if(r){let e=(0,m.l$)(l)&&"span"===l.type;n=o.createElement(o.Fragment,null,(0,m.Tm)(r,{className:i()((0,m.l$)(r)?null===(t=r.props)||void 0===t?void 0:t.className:"","".concat(p,"-item-icon"))}),e?l:o.createElement("span",{className:"".concat(p,"-title-content")},l))}else n=g&&!f.length&&l&&"string"==typeof l?o.createElement("div",{className:"".concat(p,"-inline-collapsed-noicon")},l.charAt(0)):o.createElement("span",{className:"".concat(p,"-title-content")},l);let v=o.useMemo(()=>Object.assign(Object.assign({},u),{firstLevel:!1}),[u]),[y]=(0,w.Cn)("Menu");return o.createElement(h.Provider,{value:v},o.createElement(c.Wd,Object.assign({},(0,d.Z)(e,["icon"]),{title:n,popupClassName:i()(p,a,"".concat(p,"-").concat(s||b)),popupStyle:{zIndex:y}})))},I=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n},O=n(88208),x=n(352),S=n(36360),B=n(12918),j=n(63074),k=n(18544),E=n(691),N=n(80669),z=n(3104),H=e=>{let{componentCls:t,motionDurationSlow:n,horizontalLineHeight:o,colorSplit:c,lineWidth:a,lineType:r,itemPaddingInline:l}=e;return{["".concat(t,"-horizontal")]:{lineHeight:o,border:0,borderBottom:"".concat((0,x.bf)(a)," ").concat(r," ").concat(c),boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},["".concat(t,"-item, ").concat(t,"-submenu")]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},["> ".concat(t,"-item:hover,\n > ").concat(t,"-item-active,\n > ").concat(t,"-submenu ").concat(t,"-submenu-title:hover")]:{backgroundColor:"transparent"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{transition:["border-color ".concat(n),"background ".concat(n)].join(",")},["".concat(t,"-submenu-arrow")]:{display:"none"}}}},P=e=>{let{componentCls:t,menuArrowOffset:n,calc:o}=e;return{["".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-submenu-rtl")]:{transformOrigin:"100% 0"},["".concat(t,"-rtl").concat(t,"-vertical,\n ").concat(t,"-submenu-rtl ").concat(t,"-vertical")]:{["".concat(t,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateY(".concat((0,x.bf)(o(n).mul(-1).equal()),")")},"&::after":{transform:"rotate(45deg) translateY(".concat((0,x.bf)(n),")")}}}}};let T=e=>Object.assign({},(0,B.oN)(e));var R=(e,t)=>{let{componentCls:n,itemColor:o,itemSelectedColor:c,groupTitleColor:a,itemBg:r,subMenuItemBg:l,itemSelectedBg:i,activeBarHeight:s,activeBarWidth:d,activeBarBorderWidth:u,motionDurationSlow:m,motionEaseInOut:p,motionEaseOut:g,itemPaddingInline:b,motionDurationMid:f,itemHoverColor:v,lineType:h,colorSplit:y,itemDisabledColor:w,dangerItemColor:C,dangerItemHoverColor:I,dangerItemSelectedColor:O,dangerItemActiveBg:S,dangerItemSelectedBg:B,popupBg:j,itemHoverBg:k,itemActiveBg:E,menuSubMenuBg:N,horizontalItemSelectedColor:z,horizontalItemSelectedBg:H,horizontalItemBorderRadius:P,horizontalItemHoverBg:R}=e;return{["".concat(n,"-").concat(t,", ").concat(n,"-").concat(t," > ").concat(n)]:{color:o,background:r,["&".concat(n,"-root:focus-visible")]:Object.assign({},T(e)),["".concat(n,"-item-group-title")]:{color:a},["".concat(n,"-submenu-selected")]:{["> ".concat(n,"-submenu-title")]:{color:c}},["".concat(n,"-item-disabled, ").concat(n,"-submenu-disabled")]:{color:"".concat(w," !important")},["".concat(n,"-item:not(").concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{["&:hover, > ".concat(n,"-submenu-title:hover")]:{color:v}},["&:not(".concat(n,"-horizontal)")]:{["".concat(n,"-item:not(").concat(n,"-item-selected)")]:{"&:hover":{backgroundColor:k},"&:active":{backgroundColor:E}},["".concat(n,"-submenu-title")]:{"&:hover":{backgroundColor:k},"&:active":{backgroundColor:E}}},["".concat(n,"-item-danger")]:{color:C,["&".concat(n,"-item:hover")]:{["&:not(".concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{color:I}},["&".concat(n,"-item:active")]:{background:S}},["".concat(n,"-item a")]:{"&, &:hover":{color:"inherit"}},["".concat(n,"-item-selected")]:{color:c,["&".concat(n,"-item-danger")]:{color:O},"a, a:hover":{color:"inherit"}},["& ".concat(n,"-item-selected")]:{backgroundColor:i,["&".concat(n,"-item-danger")]:{backgroundColor:B}},["".concat(n,"-item, ").concat(n,"-submenu-title")]:{["&:not(".concat(n,"-item-disabled):focus-visible")]:Object.assign({},T(e))},["&".concat(n,"-submenu > ").concat(n)]:{backgroundColor:N},["&".concat(n,"-popup > ").concat(n)]:{backgroundColor:j},["&".concat(n,"-submenu-popup > ").concat(n)]:{backgroundColor:j},["&".concat(n,"-horizontal")]:Object.assign(Object.assign({},"dark"===t?{borderBottom:0}:{}),{["> ".concat(n,"-item, > ").concat(n,"-submenu")]:{top:u,marginTop:e.calc(u).mul(-1).equal(),marginBottom:0,borderRadius:P,"&::after":{position:"absolute",insetInline:b,bottom:0,borderBottom:"".concat((0,x.bf)(s)," solid transparent"),transition:"border-color ".concat(m," ").concat(p),content:'""'},"&:hover, &-active, &-open":{background:R,"&::after":{borderBottomWidth:s,borderBottomColor:z}},"&-selected":{color:z,backgroundColor:H,"&:hover":{backgroundColor:H},"&::after":{borderBottomWidth:s,borderBottomColor:z}}}}),["&".concat(n,"-root")]:{["&".concat(n,"-inline, &").concat(n,"-vertical")]:{borderInlineEnd:"".concat((0,x.bf)(u)," ").concat(h," ").concat(y)}},["&".concat(n,"-inline")]:{["".concat(n,"-sub").concat(n,"-inline")]:{background:l},["".concat(n,"-item")]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:"".concat((0,x.bf)(d)," solid ").concat(c),transform:"scaleY(0.0001)",opacity:0,transition:["transform ".concat(f," ").concat(g),"opacity ".concat(f," ").concat(g)].join(","),content:'""'},["&".concat(n,"-item-danger")]:{"&::after":{borderInlineEndColor:O}}},["".concat(n,"-selected, ").concat(n,"-item-selected")]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:["transform ".concat(f," ").concat(p),"opacity ".concat(f," ").concat(p)].join(",")}}}}}};let Z=e=>{let{componentCls:t,itemHeight:n,itemMarginInline:o,padding:c,menuArrowSize:a,marginXS:r,itemMarginBlock:l,itemWidth:i}=e,s=e.calc(a).add(c).add(r).equal();return{["".concat(t,"-item")]:{position:"relative",overflow:"hidden"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,x.bf)(n),paddingInline:c,overflow:"hidden",textOverflow:"ellipsis",marginInline:o,marginBlock:l,width:i},["> ".concat(t,"-item,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,x.bf)(n)},["".concat(t,"-item-group-list ").concat(t,"-submenu-title,\n ").concat(t,"-submenu-title")]:{paddingInlineEnd:s}}};var A=e=>{let{componentCls:t,iconCls:n,itemHeight:o,colorTextLightSolid:c,dropdownWidth:a,controlHeightLG:r,motionDurationMid:l,motionEaseOut:i,paddingXL:s,itemMarginInline:d,fontSizeLG:u,motionDurationSlow:m,paddingXS:p,boxShadowSecondary:g,collapsedWidth:b,collapsedIconSize:f}=e,v={height:o,lineHeight:(0,x.bf)(o),listStylePosition:"inside",listStyleType:"disc"};return[{[t]:{"&-inline, &-vertical":Object.assign({["&".concat(t,"-root")]:{boxShadow:"none"}},Z(e))},["".concat(t,"-submenu-popup")]:{["".concat(t,"-vertical")]:Object.assign(Object.assign({},Z(e)),{boxShadow:g})}},{["".concat(t,"-submenu-popup ").concat(t,"-vertical").concat(t,"-sub")]:{minWidth:a,maxHeight:"calc(100vh - ".concat((0,x.bf)(e.calc(r).mul(2.5).equal()),")"),padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{["".concat(t,"-inline")]:{width:"100%",["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{display:"flex",alignItems:"center",transition:["border-color ".concat(m),"background ".concat(m),"padding ".concat(l," ").concat(i)].join(","),["> ".concat(t,"-title-content")]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},["".concat(t,"-sub").concat(t,"-inline")]:{padding:0,border:0,borderRadius:0,boxShadow:"none",["& > ".concat(t,"-submenu > ").concat(t,"-submenu-title")]:v,["& ".concat(t,"-item-group-title")]:{paddingInlineStart:s}},["".concat(t,"-item")]:v}},{["".concat(t,"-inline-collapsed")]:{width:b,["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu ").concat(t,"-submenu-title")]:{["> ".concat(t,"-inline-collapsed-noicon")]:{fontSize:u,textAlign:"center"}}},["> ".concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-submenu > ").concat(t,"-submenu-title,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{insetInlineStart:0,paddingInline:"calc(50% - ".concat((0,x.bf)(e.calc(u).div(2).equal())," - ").concat((0,x.bf)(d),")"),textOverflow:"clip",["\n ".concat(t,"-submenu-arrow,\n ").concat(t,"-submenu-expand-icon\n ")]:{opacity:0},["".concat(t,"-item-icon, ").concat(n)]:{margin:0,fontSize:f,lineHeight:(0,x.bf)(o),"+ span":{display:"inline-block",opacity:0}}},["".concat(t,"-item-icon, ").concat(n)]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",["".concat(t,"-item-icon, ").concat(n)]:{display:"none"},"a, a:hover":{color:c}},["".concat(t,"-item-group-title")]:Object.assign(Object.assign({},B.vS),{paddingInline:p})}}]};let M=e=>{let{componentCls:t,motionDurationSlow:n,motionDurationMid:o,motionEaseInOut:c,motionEaseOut:a,iconCls:r,iconSize:l,iconMarginInlineEnd:i}=e;return{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:["border-color ".concat(n),"background ".concat(n),"padding ".concat(n," ").concat(c)].join(","),["".concat(t,"-item-icon, ").concat(r)]:{minWidth:l,fontSize:l,transition:["font-size ".concat(o," ").concat(a),"margin ".concat(n," ").concat(c),"color ".concat(n)].join(","),"+ span":{marginInlineStart:i,opacity:1,transition:["opacity ".concat(n," ").concat(c),"margin ".concat(n),"color ".concat(n)].join(",")}},["".concat(t,"-item-icon")]:Object.assign({},(0,B.Ro)()),["&".concat(t,"-item-only-child")]:{["> ".concat(r,", > ").concat(t,"-item-icon")]:{marginInlineEnd:0}}},["".concat(t,"-item-disabled, ").concat(t,"-submenu-disabled")]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},["> ".concat(t,"-submenu-title")]:{color:"inherit !important",cursor:"not-allowed"}}}},D=e=>{let{componentCls:t,motionDurationSlow:n,motionEaseInOut:o,borderRadius:c,menuArrowSize:a,menuArrowOffset:r}=e;return{["".concat(t,"-submenu")]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:a,color:"currentcolor",transform:"translateY(-50%)",transition:"transform ".concat(n," ").concat(o,", opacity ").concat(n)},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(a).mul(.6).equal(),height:e.calc(a).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:c,transition:["background ".concat(n," ").concat(o),"transform ".concat(n," ").concat(o),"top ".concat(n," ").concat(o),"color ".concat(n," ").concat(o)].join(","),content:'""'},"&::before":{transform:"rotate(45deg) translateY(".concat((0,x.bf)(e.calc(r).mul(-1).equal()),")")},"&::after":{transform:"rotate(-45deg) translateY(".concat((0,x.bf)(r),")")}}}}},W=e=>{let{antCls:t,componentCls:n,fontSize:o,motionDurationSlow:c,motionDurationMid:a,motionEaseInOut:r,paddingXS:l,padding:i,colorSplit:s,lineWidth:d,zIndexPopup:u,borderRadiusLG:m,subMenuItemBorderRadius:p,menuArrowSize:g,menuArrowOffset:b,lineType:f,menuPanelMaskInset:v,groupTitleLineHeight:h,groupTitleFontSize:y}=e;return[{"":{["".concat(n)]:Object.assign(Object.assign({},(0,B.dF)()),{"&-hidden":{display:"none"}})},["".concat(n,"-submenu-hidden")]:{display:"none"}},{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,B.Wf)(e)),(0,B.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:o,lineHeight:0,listStyle:"none",outline:"none",transition:"width ".concat(c," cubic-bezier(0.2, 0, 0, 1) 0s"),"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",["".concat(n,"-item")]:{flex:"none"}},["".concat(n,"-item, ").concat(n,"-submenu, ").concat(n,"-submenu-title")]:{borderRadius:e.itemBorderRadius},["".concat(n,"-item-group-title")]:{padding:"".concat((0,x.bf)(l)," ").concat((0,x.bf)(i)),fontSize:y,lineHeight:h,transition:"all ".concat(c)},["&-horizontal ".concat(n,"-submenu")]:{transition:["border-color ".concat(c," ").concat(r),"background ".concat(c," ").concat(r)].join(",")},["".concat(n,"-submenu, ").concat(n,"-submenu-inline")]:{transition:["border-color ".concat(c," ").concat(r),"background ".concat(c," ").concat(r),"padding ".concat(a," ").concat(r)].join(",")},["".concat(n,"-submenu ").concat(n,"-sub")]:{cursor:"initial",transition:["background ".concat(c," ").concat(r),"padding ".concat(c," ").concat(r)].join(",")},["".concat(n,"-title-content")]:{transition:"color ".concat(c),["> ".concat(t,"-typography-ellipsis-single-line")]:{display:"inline",verticalAlign:"unset"}},["".concat(n,"-item a")]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},["".concat(n,"-item-divider")]:{overflow:"hidden",lineHeight:0,borderColor:s,borderStyle:f,borderWidth:0,borderTopWidth:d,marginBlock:d,padding:0,"&-dashed":{borderStyle:"dashed"}}}),M(e)),{["".concat(n,"-item-group")]:{["".concat(n,"-item-group-list")]:{margin:0,padding:0,["".concat(n,"-item, ").concat(n,"-submenu-title")]:{paddingInline:"".concat((0,x.bf)(e.calc(o).mul(2).equal())," ").concat((0,x.bf)(i))}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:u,borderRadius:m,boxShadow:"none",transformOrigin:"0 0",["&".concat(n,"-submenu")]:{background:"transparent"},"&::before":{position:"absolute",inset:"".concat((0,x.bf)(v)," 0 0"),zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:v},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS},["> ".concat(n)]:Object.assign(Object.assign(Object.assign({borderRadius:m},M(e)),D(e)),{["".concat(n,"-item, ").concat(n,"-submenu > ").concat(n,"-submenu-title")]:{borderRadius:p},["".concat(n,"-submenu-title::after")]:{transition:"transform ".concat(c," ").concat(r)}})}}),D(e)),{["&-inline-collapsed ".concat(n,"-submenu-arrow,\n &-inline ").concat(n,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateX(".concat((0,x.bf)(b),")")},"&::after":{transform:"rotate(45deg) translateX(".concat((0,x.bf)(e.calc(b).mul(-1).equal()),")")}},["".concat(n,"-submenu-open").concat(n,"-submenu-inline > ").concat(n,"-submenu-title > ").concat(n,"-submenu-arrow")]:{transform:"translateY(".concat((0,x.bf)(e.calc(g).mul(.2).mul(-1).equal()),")"),"&::after":{transform:"rotate(-45deg) translateX(".concat((0,x.bf)(e.calc(b).mul(-1).equal()),")")},"&::before":{transform:"rotate(45deg) translateX(".concat((0,x.bf)(b),")")}}})},{["".concat(t,"-layout-header")]:{[n]:{lineHeight:"inherit"}}}]},L=e=>{var t,n,o;let{colorPrimary:c,colorError:a,colorTextDisabled:r,colorErrorBg:l,colorText:i,colorTextDescription:s,colorBgContainer:d,colorFillAlter:u,colorFillContent:m,lineWidth:p,lineWidthBold:g,controlItemBgActive:b,colorBgTextHover:f,controlHeightLG:v,lineHeight:h,colorBgElevated:y,marginXXS:w,padding:C,fontSize:I,controlHeightSM:O,fontSizeLG:x,colorTextLightSolid:B,colorErrorHover:j}=e,k=null!==(t=e.activeBarWidth)&&void 0!==t?t:0,E=null!==(n=e.activeBarBorderWidth)&&void 0!==n?n:p,N=null!==(o=e.itemMarginInline)&&void 0!==o?o:e.marginXXS,z=new S.C(B).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:i,itemColor:i,colorItemTextHover:i,itemHoverColor:i,colorItemTextHoverHorizontal:c,horizontalItemHoverColor:c,colorGroupTitle:s,groupTitleColor:s,colorItemTextSelected:c,itemSelectedColor:c,colorItemTextSelectedHorizontal:c,horizontalItemSelectedColor:c,colorItemBg:d,itemBg:d,colorItemBgHover:f,itemHoverBg:f,colorItemBgActive:m,itemActiveBg:b,colorSubItemBg:u,subMenuItemBg:u,colorItemBgSelected:b,itemSelectedBg:b,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:k,colorActiveBarHeight:g,activeBarHeight:g,colorActiveBarBorderSize:p,activeBarBorderWidth:E,colorItemTextDisabled:r,itemDisabledColor:r,colorDangerItemText:a,dangerItemColor:a,colorDangerItemTextHover:a,dangerItemHoverColor:a,colorDangerItemTextSelected:a,dangerItemSelectedColor:a,colorDangerItemBgActive:l,dangerItemActiveBg:l,colorDangerItemBgSelected:l,dangerItemSelectedBg:l,itemMarginInline:N,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:v,groupTitleLineHeight:h,collapsedWidth:2*v,popupBg:y,itemMarginBlock:w,itemPaddingInline:C,horizontalLineHeight:"".concat(1.15*v,"px"),iconSize:I,iconMarginInlineEnd:O-I,collapsedIconSize:x,groupTitleFontSize:I,darkItemDisabledColor:new S.C(B).setAlpha(.25).toRgbString(),darkItemColor:z,darkDangerItemColor:a,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:B,darkItemSelectedBg:c,darkDangerItemSelectedBg:a,darkItemHoverBg:"transparent",darkGroupTitleColor:z,darkItemHoverColor:B,darkDangerItemHoverColor:j,darkDangerItemSelectedColor:B,darkDangerItemActiveBg:a,itemWidth:k?"calc(100% + ".concat(E,"px)"):"calc(100% - ".concat(2*N,"px)")}};var X=n(64024),_=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let q=(0,o.forwardRef)((e,t)=>{var n,a;let l;let g=o.useContext(O.Z),f=g||{},{getPrefixCls:v,getPopupContainer:w,direction:x,menu:S}=o.useContext(p.E_),B=v(),{prefixCls:T,className:Z,style:M,theme:D="light",expandIcon:q,_internalDisableMenuItemTitleTooltip:F,inlineCollapsed:Y,siderCollapsed:G,items:$,children:U,rootClassName:V,mode:J,selectable:Q,onClick:K,overflowedIndicatorPopupClassName:ee}=e,et=_(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),en=(0,d.Z)(et,["collapsedWidth"]),eo=o.useMemo(()=>$?function e(t){return(t||[]).map((t,n)=>{if(t&&"object"==typeof t){let{label:a,children:r,key:l,type:i}=t,s=I(t,["label","children","key","type"]),d=null!=l?l:"tmp-".concat(n);return r||"group"===i?"group"===i?o.createElement(c.BW,Object.assign({key:d},s,{title:a}),e(r)):o.createElement(C,Object.assign({key:d},s,{title:a}),e(r)):"divider"===i?o.createElement(b,Object.assign({key:d},s)):o.createElement(y,Object.assign({key:d},s),a)}return null}).filter(e=>e)}($):$,[$])||U;null===(n=f.validator)||void 0===n||n.call(f,{mode:J});let ec=(0,s.zX)(function(){var e;null==K||K.apply(void 0,arguments),null===(e=f.onClick)||void 0===e||e.call(f)}),ea=f.mode||J,er=null!=Q?Q:f.selectable,el=o.useMemo(()=>void 0!==G?G:Y,[Y,G]),ei={horizontal:{motionName:"".concat(B,"-slide-up")},inline:(0,u.Z)(B),other:{motionName:"".concat(B,"-zoom-big")}},es=v("menu",T||f.prefixCls),ed=(0,X.Z)(es),[eu,em,ep]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return(0,N.I$)("Menu",e=>{let{colorBgElevated:t,colorPrimary:n,colorTextLightSolid:o,controlHeightLG:c,fontSize:a,darkItemColor:r,darkDangerItemColor:l,darkItemBg:i,darkSubMenuItemBg:s,darkItemSelectedColor:d,darkItemSelectedBg:u,darkDangerItemSelectedBg:m,darkItemHoverBg:p,darkGroupTitleColor:g,darkItemHoverColor:b,darkItemDisabledColor:f,darkDangerItemHoverColor:v,darkDangerItemSelectedColor:h,darkDangerItemActiveBg:y,popupBg:w,darkPopupBg:C}=e,I=e.calc(a).div(7).mul(5).equal(),O=(0,z.TS)(e,{menuArrowSize:I,menuHorizontalHeight:e.calc(c).mul(1.15).equal(),menuArrowOffset:e.calc(I).mul(.25).equal(),menuPanelMaskInset:-7,menuSubMenuBg:t,calc:e.calc,popupBg:w}),x=(0,z.TS)(O,{itemColor:r,itemHoverColor:b,groupTitleColor:g,itemSelectedColor:d,itemBg:i,popupBg:C,subMenuItemBg:s,itemActiveBg:"transparent",itemSelectedBg:u,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:p,itemDisabledColor:f,dangerItemColor:l,dangerItemHoverColor:v,dangerItemSelectedColor:h,dangerItemActiveBg:y,dangerItemSelectedBg:m,menuSubMenuBg:s,horizontalItemSelectedColor:o,horizontalItemSelectedBg:n});return[W(O),H(O),A(O),R(O,"light"),R(x,"dark"),P(O),(0,j.Z)(O),(0,k.oN)(O,"slide-up"),(0,k.oN)(O,"slide-down"),(0,E._y)(O,"zoom-big")]},L,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:n,unitless:{groupTitleLineHeight:!0}})(e,t)}(es,ed,!g),eg=i()("".concat(es,"-").concat(D),null==S?void 0:S.className,Z);if("function"==typeof q)l=q;else if(null===q||!1===q)l=null;else if(null===f.expandIcon||!1===f.expandIcon)l=null;else{let e=null!=q?q:f.expandIcon;l=(0,m.Tm)(e,{className:i()("".concat(es,"-submenu-expand-icon"),(0,m.l$)(e)?null===(a=e.props)||void 0===a?void 0:a.className:"")})}let eb=o.useMemo(()=>({prefixCls:es,inlineCollapsed:el||!1,direction:x,firstLevel:!0,theme:D,mode:ea,disableMenuItemTitleTooltip:F}),[es,el,x,F,D]);return eu(o.createElement(O.Z.Provider,{value:null},o.createElement(h.Provider,{value:eb},o.createElement(c.ZP,Object.assign({getPopupContainer:w,overflowedIndicator:o.createElement(r.Z,null),overflowedIndicatorPopupClassName:i()(es,"".concat(es,"-").concat(D),ee),mode:ea,selectable:er,onClick:ec},en,{inlineCollapsed:el,style:Object.assign(Object.assign({},null==S?void 0:S.style),M),className:eg,prefixCls:es,direction:x,defaultMotions:ei,expandIcon:l,ref:t,rootClassName:i()(V,em,f.rootClassName,ep,ed)}),eo))))}),F=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null),c=o.useContext(a.D);return(0,o.useImperativeHandle)(t,()=>({menu:n.current,focus:e=>{var t;null===(t=n.current)||void 0===t||t.focus(e)}})),o.createElement(q,Object.assign({ref:n},e,c))});F.Item=y,F.SubMenu=C,F.Divider=b,F.ItemGroup=c.BW;var Y=F},93142:function(e,t,n){n.d(t,{Z:function(){return v}});var o=n(2265),c=n(36760),a=n.n(c),r=n(45287);function l(e){return["small","middle","large"].includes(e)}function i(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}var s=n(71744),d=n(65658);let u=o.createContext({latestIndex:0}),m=u.Provider;var p=e=>{let{className:t,index:n,children:c,split:a,style:r}=e,{latestIndex:l}=o.useContext(u);return null==c?null:o.createElement(o.Fragment,null,o.createElement("div",{className:t,style:r},c),nt.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,o=Object.getOwnPropertySymbols(e);ct.indexOf(o[c])&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(n[o[c]]=e[o[c]]);return n};let f=o.forwardRef((e,t)=>{var n,c;let{getPrefixCls:d,space:u,direction:f}=o.useContext(s.E_),{size:v=(null==u?void 0:u.size)||"small",align:h,className:y,rootClassName:w,children:C,direction:I="horizontal",prefixCls:O,split:x,style:S,wrap:B=!1,classNames:j,styles:k}=e,E=b(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[N,z]=Array.isArray(v)?v:[v,v],H=l(z),P=l(N),T=i(z),R=i(N),Z=(0,r.Z)(C,{keepEmpty:!0}),A=void 0===h&&"horizontal"===I?"center":h,M=d("space",O),[D,W,L]=(0,g.Z)(M),X=a()(M,null==u?void 0:u.className,W,"".concat(M,"-").concat(I),{["".concat(M,"-rtl")]:"rtl"===f,["".concat(M,"-align-").concat(A)]:A,["".concat(M,"-gap-row-").concat(z)]:H,["".concat(M,"-gap-col-").concat(N)]:P},y,w,L),_=a()("".concat(M,"-item"),null!==(n=null==j?void 0:j.item)&&void 0!==n?n:null===(c=null==u?void 0:u.classNames)||void 0===c?void 0:c.item),q=0,F=Z.map((e,t)=>{var n,c;null!=e&&(q=t);let a=e&&e.key||"".concat(_,"-").concat(t);return o.createElement(p,{className:_,key:a,index:t,split:x,style:null!==(n=null==k?void 0:k.item)&&void 0!==n?n:null===(c=null==u?void 0:u.styles)||void 0===c?void 0:c.item},e)}),Y=o.useMemo(()=>({latestIndex:q}),[q]);if(0===Z.length)return null;let G={};return B&&(G.flexWrap="wrap"),!P&&R&&(G.columnGap=N),!H&&T&&(G.rowGap=z),D(o.createElement("div",Object.assign({ref:t,className:X,style:Object.assign(Object.assign(Object.assign({},G),null==u?void 0:u.style),S)},E),o.createElement(m,{value:Y},F)))});f.Compact=d.ZP;var v=f},79205:function(e,t,n){n.d(t,{Z:function(){return u}});var o=n(2265);let c=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),r=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=function(){for(var e=arguments.length,t=Array(e),n=0;n!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()},i=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var s={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"};let d=(0,o.forwardRef)((e,t)=>{let{color:n="currentColor",size:c=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:d="",children:u,iconNode:m,...p}=e;return(0,o.createElement)("svg",{ref:t,...s,width:c,height:c,stroke:n,strokeWidth:r?24*Number(a)/Number(c):a,className:l("lucide",d),...!u&&!i(p)&&{"aria-hidden":"true"},...p},[...m.map(e=>{let[t,n]=e;return(0,o.createElement)(t,n)}),...Array.isArray(u)?u:[u]])}),u=(e,t)=>{let n=(0,o.forwardRef)((n,a)=>{let{className:i,...s}=n;return(0,o.createElement)(d,{ref:a,iconNode:t,className:l("lucide-".concat(c(r(e))),"lucide-".concat(e),i),...s})});return n.displayName=r(e),n}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3669-cbf664b1e9c58f8a.js b/litellm/proxy/_experimental/out/_next/static/chunks/3669-6e17d59477ade8ac.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/3669-cbf664b1e9c58f8a.js rename to litellm/proxy/_experimental/out/_next/static/chunks/3669-6e17d59477ade8ac.js index c6edf9f1ef..a7414a0ecd 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3669-cbf664b1e9c58f8a.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3669-6e17d59477ade8ac.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3669],{96473:function(t,e,n){n.d(e,{Z:function(){return i}});var a=n(1119),o=n(2265),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},r=n(55015),i=o.forwardRef(function(t,e){return o.createElement(r.Z,(0,a.Z)({},t,{ref:e,icon:c}))})},47323:function(t,e,n){n.d(e,{Z:function(){return p}});var a=n(5853),o=n(2265),c=n(1526),r=n(7084),i=n(97324),l=n(1153),d=n(26898);let s={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},u={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},b={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},g=(t,e)=>{switch(t){case"simple":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:e?(0,i.q)((0,l.bM)(e,d.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:e?(0,i.q)((0,l.bM)(e,d.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:e?(0,i.q)((0,l.bM)(e,d.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:e?(0,i.q)((0,l.bM)(e,d.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:e?(0,l.bM)(e,d.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:e?(0,i.q)((0,l.bM)(e,d.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},f=(0,l.fn)("Icon"),p=o.forwardRef((t,e)=>{let{icon:n,variant:d="simple",tooltip:p,size:m=r.u8.SM,color:v,className:h}=t,y=(0,a._T)(t,["icon","variant","tooltip","size","color","className"]),k=g(d,v),{tooltipProps:x,getReferenceProps:w}=(0,c.l)();return o.createElement("span",Object.assign({ref:(0,l.lq)([e,x.refs.setReference]),className:(0,i.q)(f("root"),"inline-flex flex-shrink-0 items-center",k.bgColor,k.textColor,k.borderColor,k.ringColor,b[d].rounded,b[d].border,b[d].shadow,b[d].ring,s[m].paddingX,s[m].paddingY,h)},w,y),o.createElement(c.Z,Object.assign({text:p},x)),o.createElement(n,{className:(0,i.q)(f("icon"),"shrink-0",u[m].height,u[m].width)}))});p.displayName="Icon"},67960:function(t,e,n){n.d(e,{Z:function(){return t6}});var a=n(2265),o=n(36760),c=n.n(o),r=n(18694),i=n(71744),l=n(33759),d=t=>{let{prefixCls:e,className:n,style:o,size:r,shape:i}=t,l=c()({["".concat(e,"-lg")]:"large"===r,["".concat(e,"-sm")]:"small"===r}),d=c()({["".concat(e,"-circle")]:"circle"===i,["".concat(e,"-square")]:"square"===i,["".concat(e,"-round")]:"round"===i}),s=a.useMemo(()=>"number"==typeof r?{width:r,height:r,lineHeight:"".concat(r,"px")}:{},[r]);return a.createElement("span",{className:c()(e,l,d,n),style:Object.assign(Object.assign({},s),o)})},s=n(352),u=n(80669),b=n(3104);let g=new s.E4("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),f=t=>({height:t,lineHeight:(0,s.bf)(t)}),p=t=>Object.assign({width:t},f(t)),m=t=>({background:t.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:g,animationDuration:t.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),v=(t,e)=>Object.assign({width:e(t).mul(5).equal(),minWidth:e(t).mul(5).equal()},f(t)),h=t=>{let{skeletonAvatarCls:e,gradientFromColor:n,controlHeight:a,controlHeightLG:o,controlHeightSM:c}=t;return{["".concat(e)]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},p(a)),["".concat(e).concat(e,"-circle")]:{borderRadius:"50%"},["".concat(e).concat(e,"-lg")]:Object.assign({},p(o)),["".concat(e).concat(e,"-sm")]:Object.assign({},p(c))}},y=t=>{let{controlHeight:e,borderRadiusSM:n,skeletonInputCls:a,controlHeightLG:o,controlHeightSM:c,gradientFromColor:r,calc:i}=t;return{["".concat(a)]:Object.assign({display:"inline-block",verticalAlign:"top",background:r,borderRadius:n},v(e,i)),["".concat(a,"-lg")]:Object.assign({},v(o,i)),["".concat(a,"-sm")]:Object.assign({},v(c,i))}},k=t=>Object.assign({width:t},f(t)),x=t=>{let{skeletonImageCls:e,imageSizeBase:n,gradientFromColor:a,borderRadiusSM:o,calc:c}=t;return{["".concat(e)]:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:a,borderRadius:o},k(c(n).mul(2).equal())),{["".concat(e,"-path")]:{fill:"#bfbfbf"},["".concat(e,"-svg")]:Object.assign(Object.assign({},k(n)),{maxWidth:c(n).mul(4).equal(),maxHeight:c(n).mul(4).equal()}),["".concat(e,"-svg").concat(e,"-svg-circle")]:{borderRadius:"50%"}}),["".concat(e).concat(e,"-circle")]:{borderRadius:"50%"}}},w=(t,e,n)=>{let{skeletonButtonCls:a}=t;return{["".concat(n).concat(a,"-circle")]:{width:e,minWidth:e,borderRadius:"50%"},["".concat(n).concat(a,"-round")]:{borderRadius:e}}},S=(t,e)=>Object.assign({width:e(t).mul(2).equal(),minWidth:e(t).mul(2).equal()},f(t)),C=t=>{let{borderRadiusSM:e,skeletonButtonCls:n,controlHeight:a,controlHeightLG:o,controlHeightSM:c,gradientFromColor:r,calc:i}=t;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:r,borderRadius:e,width:i(a).mul(2).equal(),minWidth:i(a).mul(2).equal()},S(a,i))},w(t,a,n)),{["".concat(n,"-lg")]:Object.assign({},S(o,i))}),w(t,o,"".concat(n,"-lg"))),{["".concat(n,"-sm")]:Object.assign({},S(c,i))}),w(t,c,"".concat(n,"-sm")))},E=t=>{let{componentCls:e,skeletonAvatarCls:n,skeletonTitleCls:a,skeletonParagraphCls:o,skeletonButtonCls:c,skeletonInputCls:r,skeletonImageCls:i,controlHeight:l,controlHeightLG:d,controlHeightSM:s,gradientFromColor:u,padding:b,marginSM:g,borderRadius:f,titleHeight:v,blockRadius:k,paragraphLiHeight:w,controlHeightXS:S,paragraphMarginTop:E}=t;return{["".concat(e)]:{display:"table",width:"100%",["".concat(e,"-header")]:{display:"table-cell",paddingInlineEnd:b,verticalAlign:"top",["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:u},p(l)),["".concat(n,"-circle")]:{borderRadius:"50%"},["".concat(n,"-lg")]:Object.assign({},p(d)),["".concat(n,"-sm")]:Object.assign({},p(s))},["".concat(e,"-content")]:{display:"table-cell",width:"100%",verticalAlign:"top",["".concat(a)]:{width:"100%",height:v,background:u,borderRadius:k,["+ ".concat(o)]:{marginBlockStart:s}},["".concat(o)]:{padding:0,"> li":{width:"100%",height:w,listStyle:"none",background:u,borderRadius:k,"+ li":{marginBlockStart:S}}},["".concat(o,"> li:last-child:not(:first-child):not(:nth-child(2))")]:{width:"61%"}},["&-round ".concat(e,"-content")]:{["".concat(a,", ").concat(o," > li")]:{borderRadius:f}}},["".concat(e,"-with-avatar ").concat(e,"-content")]:{["".concat(a)]:{marginBlockStart:g,["+ ".concat(o)]:{marginBlockStart:E}}},["".concat(e).concat(e,"-element")]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},C(t)),h(t)),y(t)),x(t)),["".concat(e).concat(e,"-block")]:{width:"100%",["".concat(c)]:{width:"100%"},["".concat(r)]:{width:"100%"}},["".concat(e).concat(e,"-active")]:{["\n ".concat(a,",\n ").concat(o," > li,\n ").concat(n,",\n ").concat(c,",\n ").concat(r,",\n ").concat(i,"\n ")]:Object.assign({},m(t))}}};var O=(0,u.I$)("Skeleton",t=>{let{componentCls:e,calc:n}=t;return[E((0,b.TS)(t,{skeletonAvatarCls:"".concat(e,"-avatar"),skeletonTitleCls:"".concat(e,"-title"),skeletonParagraphCls:"".concat(e,"-paragraph"),skeletonButtonCls:"".concat(e,"-button"),skeletonInputCls:"".concat(e,"-input"),skeletonImageCls:"".concat(e,"-image"),imageSizeBase:n(t.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:"linear-gradient(90deg, ".concat(t.gradientFromColor," 25%, ").concat(t.gradientToColor," 37%, ").concat(t.gradientFromColor," 63%)"),skeletonLoadingMotionDuration:"1.4s"}))]},t=>{let{colorFillContent:e,colorFill:n}=t;return{color:e,colorGradientEnd:n,gradientFromColor:e,gradientToColor:n,titleHeight:t.controlHeight/2,blockRadius:t.borderRadiusSM,paragraphMarginTop:t.marginLG+t.marginXXS,paragraphLiHeight:t.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),_=n(1119),j={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},R=n(55015),Z=a.forwardRef(function(t,e){return a.createElement(R.Z,(0,_.Z)({},t,{ref:e,icon:j}))}),T=n(83145),N=t=>{let e=e=>{let{width:n,rows:a=2}=t;return Array.isArray(n)?n[e]:a-1===e?n:void 0},{prefixCls:n,className:o,style:r,rows:i}=t,l=(0,T.Z)(Array(i)).map((t,n)=>a.createElement("li",{key:n,style:{width:e(n)}}));return a.createElement("ul",{className:c()(n,o),style:r},l)},z=t=>{let{prefixCls:e,className:n,width:o,style:r}=t;return a.createElement("h3",{className:c()(e,n),style:Object.assign({width:o},r)})};function P(t){return t&&"object"==typeof t?t:{}}let M=t=>{let{prefixCls:e,loading:n,className:o,rootClassName:r,style:l,children:s,avatar:u=!1,title:b=!0,paragraph:g=!0,active:f,round:p}=t,{getPrefixCls:m,direction:v,skeleton:h}=a.useContext(i.E_),y=m("skeleton",e),[k,x,w]=O(y);if(n||!("loading"in t)){let t,e;let n=!!u,i=!!b,s=!!g;if(n){let e=Object.assign(Object.assign({prefixCls:"".concat(y,"-avatar")},i&&!s?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),P(u));t=a.createElement("div",{className:"".concat(y,"-header")},a.createElement(d,Object.assign({},e)))}if(i||s){let t,o;if(i){let e=Object.assign(Object.assign({prefixCls:"".concat(y,"-title")},!n&&s?{width:"38%"}:n&&s?{width:"50%"}:{}),P(b));t=a.createElement(z,Object.assign({},e))}if(s){let t=Object.assign(Object.assign({prefixCls:"".concat(y,"-paragraph")},function(t,e){let n={};return t&&e||(n.width="61%"),!t&&e?n.rows=3:n.rows=2,n}(n,i)),P(g));o=a.createElement(N,Object.assign({},t))}e=a.createElement("div",{className:"".concat(y,"-content")},t,o)}let m=c()(y,{["".concat(y,"-with-avatar")]:n,["".concat(y,"-active")]:f,["".concat(y,"-rtl")]:"rtl"===v,["".concat(y,"-round")]:p},null==h?void 0:h.className,o,r,x,w);return k(a.createElement("div",{className:m,style:Object.assign(Object.assign({},null==h?void 0:h.style),l)},t,e))}return void 0!==s?s:null};M.Button=t=>{let{prefixCls:e,className:n,rootClassName:o,active:l,block:s=!1,size:u="default"}=t,{getPrefixCls:b}=a.useContext(i.E_),g=b("skeleton",e),[f,p,m]=O(g),v=(0,r.Z)(t,["prefixCls"]),h=c()(g,"".concat(g,"-element"),{["".concat(g,"-active")]:l,["".concat(g,"-block")]:s},n,o,p,m);return f(a.createElement("div",{className:h},a.createElement(d,Object.assign({prefixCls:"".concat(g,"-button"),size:u},v))))},M.Avatar=t=>{let{prefixCls:e,className:n,rootClassName:o,active:l,shape:s="circle",size:u="default"}=t,{getPrefixCls:b}=a.useContext(i.E_),g=b("skeleton",e),[f,p,m]=O(g),v=(0,r.Z)(t,["prefixCls","className"]),h=c()(g,"".concat(g,"-element"),{["".concat(g,"-active")]:l},n,o,p,m);return f(a.createElement("div",{className:h},a.createElement(d,Object.assign({prefixCls:"".concat(g,"-avatar"),shape:s,size:u},v))))},M.Input=t=>{let{prefixCls:e,className:n,rootClassName:o,active:l,block:s,size:u="default"}=t,{getPrefixCls:b}=a.useContext(i.E_),g=b("skeleton",e),[f,p,m]=O(g),v=(0,r.Z)(t,["prefixCls"]),h=c()(g,"".concat(g,"-element"),{["".concat(g,"-active")]:l,["".concat(g,"-block")]:s},n,o,p,m);return f(a.createElement("div",{className:h},a.createElement(d,Object.assign({prefixCls:"".concat(g,"-input"),size:u},v))))},M.Image=t=>{let{prefixCls:e,className:n,rootClassName:o,style:r,active:l}=t,{getPrefixCls:d}=a.useContext(i.E_),s=d("skeleton",e),[u,b,g]=O(s),f=c()(s,"".concat(s,"-element"),{["".concat(s,"-active")]:l},n,o,b,g);return u(a.createElement("div",{className:f},a.createElement("div",{className:c()("".concat(s,"-image"),n),style:r},a.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(s,"-image-svg")},a.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(s,"-image-path")})))))},M.Node=t=>{let{prefixCls:e,className:n,rootClassName:o,style:r,active:l,children:d}=t,{getPrefixCls:s}=a.useContext(i.E_),u=s("skeleton",e),[b,g,f]=O(u),p=c()(u,"".concat(u,"-element"),{["".concat(u,"-active")]:l},g,n,o,f),m=null!=d?d:a.createElement(Z,null);return b(a.createElement("div",{className:p},a.createElement("div",{className:c()("".concat(u,"-image"),n),style:r},m)))};var I=n(49638),L=n(60440),B=n(96473),D=n(11993),W=n(31686),q=n(26365),G=n(41154),H=n(6989),A=n(50506),X=n(79267),K=(0,a.createContext)(null),F=n(31474),Y=n(58525),V=n(28791),Q=n(53346),$=function(t){var e=t.activeTabOffset,n=t.horizontal,o=t.rtl,c=t.indicator,r=void 0===c?{}:c,i=r.size,l=r.align,d=void 0===l?"center":l,s=(0,a.useState)(),u=(0,q.Z)(s,2),b=u[0],g=u[1],f=(0,a.useRef)(),p=a.useCallback(function(t){return"function"==typeof i?i(t):"number"==typeof i?i:t},[i]);function m(){Q.Z.cancel(f.current)}return(0,a.useEffect)(function(){var t={};if(e){if(n){t.width=p(e.width);var a=o?"right":"left";"start"===d&&(t[a]=e[a]),"center"===d&&(t[a]=e[a]+e.width/2,t.transform=o?"translateX(50%)":"translateX(-50%)"),"end"===d&&(t[a]=e[a]+e.width,t.transform="translateX(-100%)")}else t.height=p(e.height),"start"===d&&(t.top=e.top),"center"===d&&(t.top=e.top+e.height/2,t.transform="translateY(-50%)"),"end"===d&&(t.top=e.top+e.height,t.transform="translateY(-100%)")}return m(),f.current=(0,Q.Z)(function(){g(t)}),m},[e,n,o,d,p]),{style:b}},J={width:0,height:0,left:0,top:0};function U(t,e){var n=a.useRef(t),o=a.useState({}),c=(0,q.Z)(o,2)[1];return[n.current,function(t){var a="function"==typeof t?t(n.current):t;a!==n.current&&e(a,n.current),n.current=a,c({})}]}var tt=n(27380);function te(t){var e=(0,a.useState)(0),n=(0,q.Z)(e,2),o=n[0],c=n[1],r=(0,a.useRef)(0),i=(0,a.useRef)();return i.current=t,(0,tt.o)(function(){var t;null===(t=i.current)||void 0===t||t.call(i)},[o]),function(){r.current===o&&(r.current+=1,c(r.current))}}var tn={width:0,height:0,left:0,top:0,right:0};function ta(t){var e;return t instanceof Map?(e={},t.forEach(function(t,n){e[n]=t})):e=t,JSON.stringify(e)}function to(t){return String(t).replace(/"/g,"TABS_DQ")}function tc(t,e,n,a){return!!n&&!a&&!1!==t&&(void 0!==t||!1!==e&&null!==e)}var tr=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.editable,c=t.locale,r=t.style;return o&&!1!==o.showAdd?a.createElement("button",{ref:e,type:"button",className:"".concat(n,"-nav-add"),style:r,"aria-label":(null==c?void 0:c.addAriaLabel)||"Add tab",onClick:function(t){o.onEdit("add",{event:t})}},o.addIcon||"+"):null}),ti=a.forwardRef(function(t,e){var n,o=t.position,c=t.prefixCls,r=t.extra;if(!r)return null;var i={};return"object"!==(0,G.Z)(r)||a.isValidElement(r)?i.right=r:i=r,"right"===o&&(n=i.right),"left"===o&&(n=i.left),n?a.createElement("div",{className:"".concat(c,"-extra-content"),ref:e},n):null}),tl=n(71030),td=n(33082),ts=n(95814),tu=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.id,r=t.tabs,i=t.locale,l=t.mobile,d=t.moreIcon,s=t.moreTransitionName,u=t.style,b=t.className,g=t.editable,f=t.tabBarGutter,p=t.rtl,m=t.removeAriaLabel,v=t.onTabClick,h=t.getPopupContainer,y=t.popupClassName,k=(0,a.useState)(!1),x=(0,q.Z)(k,2),w=x[0],S=x[1],C=(0,a.useState)(null),E=(0,q.Z)(C,2),O=E[0],_=E[1],j="".concat(o,"-more-popup"),R="".concat(n,"-dropdown"),Z=null!==O?"".concat(j,"-").concat(O):null,T=null==i?void 0:i.dropdownAriaLabel,N=a.createElement(td.ZP,{onClick:function(t){v(t.key,t.domEvent),S(!1)},prefixCls:"".concat(R,"-menu"),id:j,tabIndex:-1,role:"listbox","aria-activedescendant":Z,selectedKeys:[O],"aria-label":void 0!==T?T:"expanded dropdown"},r.map(function(t){var e=t.closable,n=t.disabled,c=t.closeIcon,r=t.key,i=t.label,l=tc(e,c,g,n);return a.createElement(td.sN,{key:r,id:"".concat(j,"-").concat(r),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(r),disabled:n},a.createElement("span",null,i),l&&a.createElement("button",{type:"button","aria-label":m||"remove",tabIndex:0,className:"".concat(R,"-menu-item-remove"),onClick:function(t){t.stopPropagation(),t.preventDefault(),t.stopPropagation(),g.onEdit("remove",{key:r,event:t})}},c||g.removeIcon||"\xd7"))}));function z(t){for(var e=r.filter(function(t){return!t.disabled}),n=e.findIndex(function(t){return t.key===O})||0,a=e.length,o=0;oMath.abs(i-n)?[i,l,d-e.x,s-e.y]:[n,a,c,o]},tp=function(t){var e=t.current||{},n=e.offsetWidth,a=void 0===n?0:n,o=e.offsetHeight;if(t.current){var c=t.current.getBoundingClientRect(),r=c.width,i=c.height;if(1>Math.abs(r-a))return[r,i]}return[a,void 0===o?0:o]},tm=function(t,e){return t[e?0:1]},tv=a.forwardRef(function(t,e){var n,o,r,i,l,d,s,u,b,g,f,p,m,v,h,y,k,x,w,S,C,E,O,j,R,Z,N,z,P,M,I,L,B,G,H,A,X,Q,tt,tc=t.className,tl=t.style,td=t.id,ts=t.animated,tu=t.activeKey,tv=t.rtl,th=t.extra,ty=t.editable,tk=t.locale,tx=t.tabPosition,tw=t.tabBarGutter,tS=t.children,tC=t.onTabClick,tE=t.onTabScroll,tO=t.indicator,t_=a.useContext(K),tj=t_.prefixCls,tR=t_.tabs,tZ=(0,a.useRef)(null),tT=(0,a.useRef)(null),tN=(0,a.useRef)(null),tz=(0,a.useRef)(null),tP=(0,a.useRef)(null),tM=(0,a.useRef)(null),tI=(0,a.useRef)(null),tL="top"===tx||"bottom"===tx,tB=U(0,function(t,e){tL&&tE&&tE({direction:t>e?"left":"right"})}),tD=(0,q.Z)(tB,2),tW=tD[0],tq=tD[1],tG=U(0,function(t,e){!tL&&tE&&tE({direction:t>e?"top":"bottom"})}),tH=(0,q.Z)(tG,2),tA=tH[0],tX=tH[1],tK=(0,a.useState)([0,0]),tF=(0,q.Z)(tK,2),tY=tF[0],tV=tF[1],tQ=(0,a.useState)([0,0]),t$=(0,q.Z)(tQ,2),tJ=t$[0],tU=t$[1],t0=(0,a.useState)([0,0]),t1=(0,q.Z)(t0,2),t2=t1[0],t4=t1[1],t5=(0,a.useState)([0,0]),t8=(0,q.Z)(t5,2),t7=t8[0],t6=t8[1],t3=(n=new Map,o=(0,a.useRef)([]),r=(0,a.useState)({}),i=(0,q.Z)(r,2)[1],l=(0,a.useRef)("function"==typeof n?n():n),d=te(function(){var t=l.current;o.current.forEach(function(e){t=e(t)}),o.current=[],l.current=t,i({})}),[l.current,function(t){o.current.push(t),d()}]),t9=(0,q.Z)(t3,2),et=t9[0],ee=t9[1],en=(s=tJ[0],(0,a.useMemo)(function(){for(var t=new Map,e=et.get(null===(o=tR[0])||void 0===o?void 0:o.key)||J,n=e.left+e.width,a=0;aeu?eu:t}tL&&tv?(es=0,eu=Math.max(0,eo-el)):(es=Math.min(0,el-eo),eu=0);var eg=(0,a.useRef)(null),ef=(0,a.useState)(),ep=(0,q.Z)(ef,2),em=ep[0],ev=ep[1];function eh(){ev(Date.now())}function ey(){eg.current&&clearTimeout(eg.current)}u=function(t,e){function n(t,e){t(function(t){return eb(t+e)})}return!!ei&&(tL?n(tq,t):n(tX,e),ey(),eh(),!0)},b=(0,a.useState)(),f=(g=(0,q.Z)(b,2))[0],p=g[1],m=(0,a.useState)(0),h=(v=(0,q.Z)(m,2))[0],y=v[1],k=(0,a.useState)(0),w=(x=(0,q.Z)(k,2))[0],S=x[1],C=(0,a.useState)(),O=(E=(0,q.Z)(C,2))[0],j=E[1],R=(0,a.useRef)(),Z=(0,a.useRef)(),(N=(0,a.useRef)(null)).current={onTouchStart:function(t){var e=t.touches[0];p({x:e.screenX,y:e.screenY}),window.clearInterval(R.current)},onTouchMove:function(t){if(f){t.preventDefault();var e=t.touches[0],n=e.screenX,a=e.screenY;p({x:n,y:a});var o=n-f.x,c=a-f.y;u(o,c);var r=Date.now();y(r),S(r-h),j({x:o,y:c})}},onTouchEnd:function(){if(f&&(p(null),j(null),O)){var t=O.x/w,e=O.y/w;if(!(.1>Math.max(Math.abs(t),Math.abs(e)))){var n=t,a=e;R.current=window.setInterval(function(){if(.01>Math.abs(n)&&.01>Math.abs(a)){window.clearInterval(R.current);return}n*=.9046104802746175,a*=.9046104802746175,u(20*n,20*a)},20)}}},onWheel:function(t){var e=t.deltaX,n=t.deltaY,a=0,o=Math.abs(e),c=Math.abs(n);o===c?a="x"===Z.current?e:n:o>c?(a=e,Z.current="x"):(a=n,Z.current="y"),u(-a,-a)&&t.preventDefault()}},a.useEffect(function(){function t(t){N.current.onTouchMove(t)}function e(t){N.current.onTouchEnd(t)}return document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("touchend",e,{passive:!1}),tz.current.addEventListener("touchstart",function(t){N.current.onTouchStart(t)},{passive:!1}),tz.current.addEventListener("wheel",function(t){N.current.onWheel(t)}),function(){document.removeEventListener("touchmove",t),document.removeEventListener("touchend",e)}},[]),(0,a.useEffect)(function(){return ey(),em&&(eg.current=setTimeout(function(){ev(0)},100)),ey},[em]);var ek=(z=tL?tW:tA,B=(P=(0,W.Z)((0,W.Z)({},t),{},{tabs:tR})).tabs,G=P.tabPosition,H=P.rtl,["top","bottom"].includes(G)?(M="width",I=H?"right":"left",L=Math.abs(z)):(M="height",I="top",L=-z),(0,a.useMemo)(function(){if(!B.length)return[0,0];for(var t=B.length,e=t,n=0;nL+el){e=n-1;break}}for(var o=0,c=t-1;c>=0;c-=1)if((en.get(B[c].key)||tn)[I]=e?[0,0]:[o,e]},[en,el,eo,ec,er,L,G,B.map(function(t){return t.key}).join("_"),H])),ex=(0,q.Z)(ek,2),ew=ex[0],eS=ex[1],eC=(0,Y.Z)(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tu,e=en.get(t)||{width:0,height:0,left:0,right:0,top:0};if(tL){var n=tW;tv?e.righttW+el&&(n=e.right+e.width-el):e.left<-tW?n=-e.left:e.left+e.width>-tW+el&&(n=-(e.left+e.width-el)),tX(0),tq(eb(n))}else{var a=tA;e.top<-tA?a=-e.top:e.top+e.height>-tA+el&&(a=-(e.top+e.height-el)),tq(0),tX(eb(a))}}),eE={};"top"===tx||"bottom"===tx?eE[tv?"marginRight":"marginLeft"]=tw:eE.marginTop=tw;var eO=tR.map(function(t,e){var n=t.key;return a.createElement(tg,{id:td,prefixCls:tj,key:n,tab:t,style:0===e?void 0:eE,closable:t.closable,editable:ty,active:n===tu,renderWrapper:tS,removeAriaLabel:null==tk?void 0:tk.removeAriaLabel,onClick:function(t){tC(n,t)},onFocus:function(){eC(n),eh(),tz.current&&(tv||(tz.current.scrollLeft=0),tz.current.scrollTop=0)}})}),e_=function(){return ee(function(){var t,e=new Map,n=null===(t=tP.current)||void 0===t?void 0:t.getBoundingClientRect();return tR.forEach(function(t){var a,o=t.key,c=null===(a=tP.current)||void 0===a?void 0:a.querySelector('[data-node-key="'.concat(to(o),'"]'));if(c){var r=tf(c,n),i=(0,q.Z)(r,4),l=i[0],d=i[1],s=i[2],u=i[3];e.set(o,{width:l,height:d,left:s,top:u})}}),e})};(0,a.useEffect)(function(){e_()},[tR.map(function(t){return t.key}).join("_")]);var ej=te(function(){var t=tp(tZ),e=tp(tT),n=tp(tN);tV([t[0]-e[0]-n[0],t[1]-e[1]-n[1]]);var a=tp(tI);t4(a),t6(tp(tM));var o=tp(tP);tU([o[0]-a[0],o[1]-a[1]]),e_()}),eR=tR.slice(0,ew),eZ=tR.slice(eS+1),eT=[].concat((0,T.Z)(eR),(0,T.Z)(eZ)),eN=en.get(tu),ez=$({activeTabOffset:eN,horizontal:tL,indicator:tO,rtl:tv}).style;(0,a.useEffect)(function(){eC()},[tu,es,eu,ta(eN),ta(en),tL]),(0,a.useEffect)(function(){ej()},[tv]);var eP=!!eT.length,eM="".concat(tj,"-nav-wrap");return tL?tv?(X=tW>0,A=tW!==eu):(A=tW<0,X=tW!==es):(Q=tA<0,tt=tA!==es),a.createElement(F.Z,{onResize:ej},a.createElement("div",{ref:(0,V.x1)(e,tZ),role:"tablist",className:c()("".concat(tj,"-nav"),tc),style:tl,onKeyDown:function(){eh()}},a.createElement(ti,{ref:tT,position:"left",extra:th,prefixCls:tj}),a.createElement(F.Z,{onResize:ej},a.createElement("div",{className:c()(eM,(0,D.Z)((0,D.Z)((0,D.Z)((0,D.Z)({},"".concat(eM,"-ping-left"),A),"".concat(eM,"-ping-right"),X),"".concat(eM,"-ping-top"),Q),"".concat(eM,"-ping-bottom"),tt)),ref:tz},a.createElement(F.Z,{onResize:ej},a.createElement("div",{ref:tP,className:"".concat(tj,"-nav-list"),style:{transform:"translate(".concat(tW,"px, ").concat(tA,"px)"),transition:em?"none":void 0}},eO,a.createElement(tr,{ref:tI,prefixCls:tj,locale:tk,editable:ty,style:(0,W.Z)((0,W.Z)({},0===eO.length?void 0:eE),{},{visibility:eP?"hidden":null})}),a.createElement("div",{className:c()("".concat(tj,"-ink-bar"),(0,D.Z)({},"".concat(tj,"-ink-bar-animated"),ts.inkBar)),style:ez}))))),a.createElement(tb,(0,_.Z)({},t,{removeAriaLabel:null==tk?void 0:tk.removeAriaLabel,ref:tM,prefixCls:tj,tabs:eT,className:!eP&&ed,tabMoving:!!em})),a.createElement(ti,{ref:tN,position:"right",extra:th,prefixCls:tj})))}),th=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.className,r=t.style,i=t.id,l=t.active,d=t.tabKey,s=t.children;return a.createElement("div",{id:i&&"".concat(i,"-panel-").concat(d),role:"tabpanel",tabIndex:l?0:-1,"aria-labelledby":i&&"".concat(i,"-tab-").concat(d),"aria-hidden":!l,style:r,className:c()(n,l&&"".concat(n,"-active"),o),ref:e},s)}),ty=["renderTabBar"],tk=["label","key"],tx=function(t){var e=t.renderTabBar,n=(0,H.Z)(t,ty),o=a.useContext(K).tabs;return e?e((0,W.Z)((0,W.Z)({},n),{},{panes:o.map(function(t){var e=t.label,n=t.key,o=(0,H.Z)(t,tk);return a.createElement(th,(0,_.Z)({tab:e,key:n,tabKey:n},o))})}),tv):a.createElement(tv,n)},tw=n(47970),tS=["key","forceRender","style","className","destroyInactiveTabPane"],tC=function(t){var e=t.id,n=t.activeKey,o=t.animated,r=t.tabPosition,i=t.destroyInactiveTabPane,l=a.useContext(K),d=l.prefixCls,s=l.tabs,u=o.tabPane,b="".concat(d,"-tabpane");return a.createElement("div",{className:c()("".concat(d,"-content-holder"))},a.createElement("div",{className:c()("".concat(d,"-content"),"".concat(d,"-content-").concat(r),(0,D.Z)({},"".concat(d,"-content-animated"),u))},s.map(function(t){var r=t.key,l=t.forceRender,d=t.style,s=t.className,g=t.destroyInactiveTabPane,f=(0,H.Z)(t,tS),p=r===n;return a.createElement(tw.ZP,(0,_.Z)({key:r,visible:p,forceRender:l,removeOnLeave:!!(i||g),leavedClassName:"".concat(b,"-hidden")},o.tabPaneMotion),function(t,n){var o=t.style,i=t.className;return a.createElement(th,(0,_.Z)({},f,{prefixCls:b,id:e,tabKey:r,animated:u,active:p,style:(0,W.Z)((0,W.Z)({},d),o),className:c()(s,i),ref:n}))})})))};n(32559);var tE=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],tO=0,t_=a.forwardRef(function(t,e){var n=t.id,o=t.prefixCls,r=void 0===o?"rc-tabs":o,i=t.className,l=t.items,d=t.direction,s=t.activeKey,u=t.defaultActiveKey,b=t.editable,g=t.animated,f=t.tabPosition,p=void 0===f?"top":f,m=t.tabBarGutter,v=t.tabBarStyle,h=t.tabBarExtraContent,y=t.locale,k=t.moreIcon,x=t.moreTransitionName,w=t.destroyInactiveTabPane,S=t.renderTabBar,C=t.onChange,E=t.onTabClick,O=t.onTabScroll,j=t.getPopupContainer,R=t.popupClassName,Z=t.indicator,T=(0,H.Z)(t,tE),N=a.useMemo(function(){return(l||[]).filter(function(t){return t&&"object"===(0,G.Z)(t)&&"key"in t})},[l]),z="rtl"===d,P=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{inkBar:!0,tabPane:!1};return(t=!1===e?{inkBar:!1,tabPane:!1}:!0===e?{inkBar:!0,tabPane:!1}:(0,W.Z)({inkBar:!0},"object"===(0,G.Z)(e)?e:{})).tabPaneMotion&&void 0===t.tabPane&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(t.tabPane=!1),t}(g),M=(0,a.useState)(!1),I=(0,q.Z)(M,2),L=I[0],B=I[1];(0,a.useEffect)(function(){B((0,X.Z)())},[]);var F=(0,A.Z)(function(){var t;return null===(t=N[0])||void 0===t?void 0:t.key},{value:s,defaultValue:u}),Y=(0,q.Z)(F,2),V=Y[0],Q=Y[1],$=(0,a.useState)(function(){return N.findIndex(function(t){return t.key===V})}),J=(0,q.Z)($,2),U=J[0],tt=J[1];(0,a.useEffect)(function(){var t,e=N.findIndex(function(t){return t.key===V});-1===e&&(e=Math.max(0,Math.min(U,N.length-1)),Q(null===(t=N[e])||void 0===t?void 0:t.key)),tt(e)},[N.map(function(t){return t.key}).join("_"),V,U]);var te=(0,A.Z)(null,{value:n}),tn=(0,q.Z)(te,2),ta=tn[0],to=tn[1];(0,a.useEffect)(function(){n||(to("rc-tabs-".concat(tO)),tO+=1)},[]);var tc={id:ta,activeKey:V,animated:P,tabPosition:p,rtl:z,mobile:L},tr=(0,W.Z)((0,W.Z)({},tc),{},{editable:b,locale:y,moreIcon:k,moreTransitionName:x,tabBarGutter:m,onTabClick:function(t,e){null==E||E(t,e);var n=t!==V;Q(t),n&&(null==C||C(t))},onTabScroll:O,extra:h,style:v,panes:null,getPopupContainer:j,popupClassName:R,indicator:Z});return a.createElement(K.Provider,{value:{tabs:N,prefixCls:r}},a.createElement("div",(0,_.Z)({ref:e,id:n,className:c()(r,"".concat(r,"-").concat(p),(0,D.Z)((0,D.Z)((0,D.Z)({},"".concat(r,"-mobile"),L),"".concat(r,"-editable"),b),"".concat(r,"-rtl"),z),i)},T),a.createElement(tx,(0,_.Z)({},tr,{renderTabBar:S})),a.createElement(tC,(0,_.Z)({destroyInactiveTabPane:w},tc,{animated:P}))))}),tj=n(64024),tR=n(68710);let tZ={motionAppear:!1,motionEnter:!0,motionLeave:!0};var tT=n(45287),tN=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n},tz=n(12918),tP=n(18544),tM=t=>{let{componentCls:e,motionDurationSlow:n}=t;return[{[e]:{["".concat(e,"-switch")]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:"opacity ".concat(n)}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:"opacity ".concat(n)}}}}},[(0,tP.oN)(t,"slide-up"),(0,tP.oN)(t,"slide-down")]]};let tI=t=>{let{componentCls:e,tabsCardPadding:n,cardBg:a,cardGutter:o,colorBorderSecondary:c,itemSelectedColor:r}=t;return{["".concat(e,"-card")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{margin:0,padding:n,background:a,border:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c),transition:"all ".concat(t.motionDurationSlow," ").concat(t.motionEaseInOut)},["".concat(e,"-tab-active")]:{color:r,background:t.colorBgContainer},["".concat(e,"-ink-bar")]:{visibility:"hidden"}},["&".concat(e,"-top, &").concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginLeft:{_skip_check_:!0,value:(0,s.bf)(o)}}}},["&".concat(e,"-top")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0")},["".concat(e,"-tab-active")]:{borderBottomColor:t.colorBgContainer}}},["&".concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:"0 0 ".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG))},["".concat(e,"-tab-active")]:{borderTopColor:t.colorBgContainer}}},["&".concat(e,"-left, &").concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginTop:(0,s.bf)(o)}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,s.bf)(t.borderRadiusLG)," 0 0 ").concat((0,s.bf)(t.borderRadiusLG))}},["".concat(e,"-tab-active")]:{borderRightColor:{_skip_check_:!0,value:t.colorBgContainer}}}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0")}},["".concat(e,"-tab-active")]:{borderLeftColor:{_skip_check_:!0,value:t.colorBgContainer}}}}}}},tL=t=>{let{componentCls:e,itemHoverColor:n,dropdownEdgeChildVerticalPadding:a}=t;return{["".concat(e,"-dropdown")]:Object.assign(Object.assign({},(0,tz.Wf)(t)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:t.zIndexPopup,display:"block","&-hidden":{display:"none"},["".concat(e,"-dropdown-menu")]:{maxHeight:t.tabsDropdownHeight,margin:0,padding:"".concat((0,s.bf)(a)," 0"),overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:t.colorBgContainer,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,"&-item":Object.assign(Object.assign({},tz.vS),{display:"flex",alignItems:"center",minWidth:t.tabsDropdownWidth,margin:0,padding:"".concat((0,s.bf)(t.paddingXXS)," ").concat((0,s.bf)(t.paddingSM)),color:t.colorText,fontWeight:"normal",fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:"pointer",transition:"all ".concat(t.motionDurationSlow),"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:t.marginSM},color:t.colorTextDescription,fontSize:t.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:t.controlItemBgHover},"&-disabled":{"&, &:hover":{color:t.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},tB=t=>{let{componentCls:e,margin:n,colorBorderSecondary:a,horizontalMargin:o,verticalItemPadding:c,verticalItemMargin:r,calc:i}=t;return{["".concat(e,"-top, ").concat(e,"-bottom")]:{flexDirection:"column",["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(a),content:"''"},["".concat(e,"-ink-bar")]:{height:t.lineWidthBold,"&-animated":{transition:"width ".concat(t.motionDurationSlow,", left ").concat(t.motionDurationSlow,",\n right ").concat(t.motionDurationSlow)}},["".concat(e,"-nav-wrap")]:{"&::before, &::after":{top:0,bottom:0,width:t.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowRight},["&".concat(e,"-nav-wrap-ping-left::before")]:{opacity:1},["&".concat(e,"-nav-wrap-ping-right::after")]:{opacity:1}}}},["".concat(e,"-top")]:{["> ".concat(e,"-nav,\n > div > ").concat(e,"-nav")]:{"&::before":{bottom:0},["".concat(e,"-ink-bar")]:{bottom:0}}},["".concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},["".concat(e,"-ink-bar")]:{top:0}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{order:0}},["".concat(e,"-left, ").concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{flexDirection:"column",minWidth:i(t.controlHeight).mul(1.25).equal(),["".concat(e,"-tab")]:{padding:c,textAlign:"center"},["".concat(e,"-tab + ").concat(e,"-tab")]:{margin:r},["".concat(e,"-nav-wrap")]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:t.controlHeight},"&::before":{top:0,boxShadow:t.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:t.boxShadowTabsOverflowBottom},["&".concat(e,"-nav-wrap-ping-top::before")]:{opacity:1},["&".concat(e,"-nav-wrap-ping-bottom::after")]:{opacity:1}},["".concat(e,"-ink-bar")]:{width:t.lineWidthBold,"&-animated":{transition:"height ".concat(t.motionDurationSlow,", top ").concat(t.motionDurationSlow)}},["".concat(e,"-nav-list, ").concat(e,"-nav-operations")]:{flex:"1 0 auto",flexDirection:"column"}}},["".concat(e,"-left")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-ink-bar")]:{right:{_skip_check_:!0,value:0}}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{marginLeft:{_skip_check_:!0,value:(0,s.bf)(i(t.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorder)},["> ".concat(e,"-content > ").concat(e,"-tabpane")]:{paddingLeft:{_skip_check_:!0,value:t.paddingLG}}}},["".concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{order:1,["".concat(e,"-ink-bar")]:{left:{_skip_check_:!0,value:0}}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{order:0,marginRight:{_skip_check_:!0,value:i(t.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorder)},["> ".concat(e,"-content > ").concat(e,"-tabpane")]:{paddingRight:{_skip_check_:!0,value:t.paddingLG}}}}}},tD=t=>{let{componentCls:e,cardPaddingSM:n,cardPaddingLG:a,horizontalItemPaddingSM:o,horizontalItemPaddingLG:c}=t;return{[e]:{"&-small":{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:o,fontSize:t.titleFontSizeSM}}},"&-large":{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:c,fontSize:t.titleFontSizeLG}}}},["".concat(e,"-card")]:{["&".concat(e,"-small")]:{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:n}},["&".concat(e,"-bottom")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:"0 0 ".concat((0,s.bf)(t.borderRadius)," ").concat((0,s.bf)(t.borderRadius))}},["&".concat(e,"-top")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:"".concat((0,s.bf)(t.borderRadius)," ").concat((0,s.bf)(t.borderRadius)," 0 0")}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,s.bf)(t.borderRadius)," ").concat((0,s.bf)(t.borderRadius)," 0")}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,s.bf)(t.borderRadius)," 0 0 ").concat((0,s.bf)(t.borderRadius))}}}},["&".concat(e,"-large")]:{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:a}}}}}},tW=t=>{let{componentCls:e,itemActiveColor:n,itemHoverColor:a,iconCls:o,tabsHorizontalItemMargin:c,horizontalItemPadding:r,itemSelectedColor:i,itemColor:l}=t,d="".concat(e,"-tab");return{[d]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:r,fontSize:t.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:n}},(0,tz.Qy)(t)),"&-btn":{outline:"none",transition:"all 0.3s",["".concat(d,"-icon:not(:last-child)")]:{marginInlineEnd:t.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:t.calc(t.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:t.marginXS},color:t.colorTextDescription,fontSize:t.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:"all ".concat(t.motionDurationSlow),"&:hover":{color:t.colorTextHeading}},"&:hover":{color:a},["&".concat(d,"-active ").concat(d,"-btn")]:{color:i,textShadow:t.tabsActiveTextShadow},["&".concat(d,"-disabled")]:{color:t.colorTextDisabled,cursor:"not-allowed"},["&".concat(d,"-disabled ").concat(d,"-btn, &").concat(d,"-disabled ").concat(e,"-remove")]:{"&:focus, &:active":{color:t.colorTextDisabled}},["& ".concat(d,"-remove ").concat(o)]:{margin:0},["".concat(o,":not(:last-child)")]:{marginRight:{_skip_check_:!0,value:t.marginSM}}},["".concat(d," + ").concat(d)]:{margin:{_skip_check_:!0,value:c}}}},tq=t=>{let{componentCls:e,tabsHorizontalItemMarginRTL:n,iconCls:a,cardGutter:o,calc:c}=t;return{["".concat(e,"-rtl")]:{direction:"rtl",["".concat(e,"-nav")]:{["".concat(e,"-tab")]:{margin:{_skip_check_:!0,value:n},["".concat(e,"-tab:last-of-type")]:{marginLeft:{_skip_check_:!0,value:0}},[a]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:(0,s.bf)(t.marginSM)}},["".concat(e,"-tab-remove")]:{marginRight:{_skip_check_:!0,value:(0,s.bf)(t.marginXS)},marginLeft:{_skip_check_:!0,value:(0,s.bf)(c(t.marginXXS).mul(-1).equal())},[a]:{margin:0}}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav")]:{order:1},["> ".concat(e,"-content-holder")]:{order:0}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav")]:{order:0},["> ".concat(e,"-content-holder")]:{order:1}},["&".concat(e,"-card").concat(e,"-top, &").concat(e,"-card").concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},["".concat(e,"-dropdown-rtl")]:{direction:"rtl"},["".concat(e,"-menu-item")]:{["".concat(e,"-dropdown-rtl")]:{textAlign:{_skip_check_:!0,value:"right"}}}}},tG=t=>{let{componentCls:e,tabsCardPadding:n,cardHeight:a,cardGutter:o,itemHoverColor:c,itemActiveColor:r,colorBorderSecondary:i}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,tz.Wf)(t)),{display:"flex",["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{position:"relative",display:"flex",flex:"none",alignItems:"center",["".concat(e,"-nav-wrap")]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:"opacity ".concat(t.motionDurationSlow),content:"''",pointerEvents:"none"}},["".concat(e,"-nav-list")]:{position:"relative",display:"flex",transition:"opacity ".concat(t.motionDurationSlow)},["".concat(e,"-nav-operations")]:{display:"flex",alignSelf:"stretch"},["".concat(e,"-nav-operations-hidden")]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},["".concat(e,"-nav-more")]:{position:"relative",padding:n,background:"transparent",border:0,color:t.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:t.calc(t.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},["".concat(e,"-nav-add")]:Object.assign({minWidth:a,minHeight:a,marginLeft:{_skip_check_:!0,value:o},padding:"0 ".concat((0,s.bf)(t.paddingXS)),background:"transparent",border:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(i),borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0"),outline:"none",cursor:"pointer",color:t.colorText,transition:"all ".concat(t.motionDurationSlow," ").concat(t.motionEaseInOut),"&:hover":{color:c},"&:active, &:focus:not(:focus-visible)":{color:r}},(0,tz.Qy)(t))},["".concat(e,"-extra-content")]:{flex:"none"},["".concat(e,"-ink-bar")]:{position:"absolute",background:t.inkBarColor,pointerEvents:"none"}}),tW(t)),{["".concat(e,"-content")]:{position:"relative",width:"100%"},["".concat(e,"-content-holder")]:{flex:"auto",minWidth:0,minHeight:0},["".concat(e,"-tabpane")]:{outline:"none","&-hidden":{display:"none"}}}),["".concat(e,"-centered")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-nav-wrap")]:{["&:not([class*='".concat(e,"-nav-wrap-ping'])")]:{justifyContent:"center"}}}}}};var tH=(0,u.I$)("Tabs",t=>{let e=(0,b.TS)(t,{tabsCardPadding:t.cardPadding,dropdownEdgeChildVerticalPadding:t.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:"0 0 0 ".concat((0,s.bf)(t.horizontalItemGutter)),tabsHorizontalItemMarginRTL:"0 0 0 ".concat((0,s.bf)(t.horizontalItemGutter))});return[tD(e),tq(e),tB(e),tL(e),tI(e),tG(e),tM(e)]},t=>{let e=t.controlHeightLG;return{zIndexPopup:t.zIndexPopupBase+50,cardBg:t.colorFillAlter,cardHeight:e,cardPadding:"".concat((e-Math.round(t.fontSize*t.lineHeight))/2-t.lineWidth,"px ").concat(t.padding,"px"),cardPaddingSM:"".concat(1.5*t.paddingXXS,"px ").concat(t.padding,"px"),cardPaddingLG:"".concat(t.paddingXS,"px ").concat(t.padding,"px ").concat(1.5*t.paddingXXS,"px"),titleFontSize:t.fontSize,titleFontSizeLG:t.fontSizeLG,titleFontSizeSM:t.fontSize,inkBarColor:t.colorPrimary,horizontalMargin:"0 0 ".concat(t.margin,"px 0"),horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:"".concat(t.paddingSM,"px 0"),horizontalItemPaddingSM:"".concat(t.paddingXS,"px 0"),horizontalItemPaddingLG:"".concat(t.padding,"px 0"),verticalItemPadding:"".concat(t.paddingXS,"px ").concat(t.paddingLG,"px"),verticalItemMargin:"".concat(t.margin,"px 0 0 0"),itemColor:t.colorText,itemSelectedColor:t.colorPrimary,itemHoverColor:t.colorPrimaryHover,itemActiveColor:t.colorPrimaryActive,cardGutter:t.marginXXS/2}}),tA=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n};let tX=t=>{var e,n,o,r,d,s;let u;let{type:b,className:g,rootClassName:f,size:p,onEdit:m,hideAdd:v,centered:h,addIcon:y,popupClassName:k,children:x,items:w,animated:S,style:C,indicatorSize:E,indicator:O}=t,_=tA(t,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:j,moreIcon:R=a.createElement(L.Z,null)}=_,{direction:Z,tabs:T,getPrefixCls:N,getPopupContainer:z}=a.useContext(i.E_),P=N("tabs",j),M=(0,tj.Z)(P),[D,W,q]=tH(P,M);"editable-card"===b&&(u={onEdit:(t,e)=>{let{key:n,event:a}=e;null==m||m("add"===t?a:n,t)},removeIcon:a.createElement(I.Z,null),addIcon:y||a.createElement(B.Z,null),showAdd:!0!==v});let G=N(),H=(0,l.Z)(p),A=w||(0,tT.Z)(x).map(t=>{if(a.isValidElement(t)){let{key:e,props:n}=t,a=n||{},{tab:o}=a,c=tN(a,["tab"]);return Object.assign(Object.assign({key:String(e)},c),{label:o})}return null}).filter(t=>t),X=function(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inkBar:!0,tabPane:!1};return(e=!1===n?{inkBar:!1,tabPane:!1}:!0===n?{inkBar:!0,tabPane:!0}:Object.assign({inkBar:!0},"object"==typeof n?n:{})).tabPane&&(e.tabPaneMotion=Object.assign(Object.assign({},tZ),{motionName:(0,tR.m)(t,"switch")})),e}(P,S),K=Object.assign(Object.assign({},null==T?void 0:T.style),C),F={align:null!==(e=null==O?void 0:O.align)&&void 0!==e?e:null===(n=null==T?void 0:T.indicator)||void 0===n?void 0:n.align,size:null!==(s=null!==(r=null!==(o=null==O?void 0:O.size)&&void 0!==o?o:E)&&void 0!==r?r:null===(d=null==T?void 0:T.indicator)||void 0===d?void 0:d.size)&&void 0!==s?s:null==T?void 0:T.indicatorSize};return D(a.createElement(t_,Object.assign({direction:Z,getPopupContainer:z,moreTransitionName:"".concat(G,"-slide-up")},_,{items:A,className:c()({["".concat(P,"-").concat(H)]:H,["".concat(P,"-card")]:["card","editable-card"].includes(b),["".concat(P,"-editable-card")]:"editable-card"===b,["".concat(P,"-centered")]:h},null==T?void 0:T.className,g,f,W,q,M),popupClassName:c()(k,W,q,M),style:K,editable:u,moreIcon:R,prefixCls:P,animated:X,indicator:F})))};tX.TabPane=()=>null;var tK=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n},tF=t=>{var{prefixCls:e,className:n,hoverable:o=!0}=t,r=tK(t,["prefixCls","className","hoverable"]);let{getPrefixCls:l}=a.useContext(i.E_),d=l("card",e),s=c()("".concat(d,"-grid"),n,{["".concat(d,"-grid-hoverable")]:o});return a.createElement("div",Object.assign({},r,{className:s}))};let tY=t=>{let{antCls:e,componentCls:n,headerHeight:a,cardPaddingBase:o,tabsMarginBottom:c}=t;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:a,marginBottom:-1,padding:"0 ".concat((0,s.bf)(o)),color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:t.headerFontSize,background:t.headerBg,borderBottom:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorderSecondary),borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0")},(0,tz.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},tz.vS),{["\n > ".concat(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(e,"-tabs-top")]:{clear:"both",marginBottom:c,color:t.colorText,fontWeight:"normal",fontSize:t.fontSize,"&-bar":{borderBottom:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorderSecondary)}}})},tV=t=>{let{cardPaddingBase:e,colorBorderSecondary:n,cardShadow:a,lineWidth:o}=t;return{width:"33.33%",padding:e,border:0,borderRadius:0,boxShadow:"\n ".concat((0,s.bf)(o)," 0 0 0 ").concat(n,",\n 0 ").concat((0,s.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,s.bf)(o)," ").concat((0,s.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,s.bf)(o)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,s.bf)(o)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(t.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:a}}},tQ=t=>{let{componentCls:e,iconCls:n,actionsLiMargin:a,cardActionsIconSize:o,colorBorderSecondary:c,actionsBg:r}=t;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:r,borderTop:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c),display:"flex",borderRadius:"0 0 ".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG))},(0,tz.dF)()),{"& > li":{margin:a,color:t.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:t.calc(t.cardActionsIconSize).mul(2).equal(),fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:"pointer","&:hover":{color:t.colorPrimary,transition:"color ".concat(t.motionDurationMid)},["a:not(".concat(e,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:t.colorTextDescription,lineHeight:(0,s.bf)(t.fontHeight),transition:"color ".concat(t.motionDurationMid),"&:hover":{color:t.colorPrimary}},["> ".concat(n)]:{fontSize:o,lineHeight:(0,s.bf)(t.calc(o).mul(t.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c)}}})},t$=t=>Object.assign(Object.assign({margin:"".concat((0,s.bf)(t.calc(t.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,tz.dF)()),{"&-avatar":{paddingInlineEnd:t.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:t.marginXS}},"&-title":Object.assign({color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:t.fontSizeLG},tz.vS),"&-description":{color:t.colorTextDescription}}),tJ=t=>{let{componentCls:e,cardPaddingBase:n,colorFillAlter:a}=t;return{["".concat(e,"-head")]:{padding:"0 ".concat((0,s.bf)(n)),background:a,"&-title":{fontSize:t.fontSize}},["".concat(e,"-body")]:{padding:"".concat((0,s.bf)(t.padding)," ").concat((0,s.bf)(n))}}},tU=t=>{let{componentCls:e}=t;return{overflow:"hidden",["".concat(e,"-body")]:{userSelect:"none"}}},t0=t=>{let{antCls:e,componentCls:n,cardShadow:a,cardHeadPadding:o,colorBorderSecondary:c,boxShadowTertiary:r,cardPaddingBase:i,extraColor:l}=t;return{[n]:Object.assign(Object.assign({},(0,tz.Wf)(t)),{position:"relative",background:t.colorBgContainer,borderRadius:t.borderRadiusLG,["&:not(".concat(n,"-bordered)")]:{boxShadow:r},["".concat(n,"-head")]:tY(t),["".concat(n,"-extra")]:{marginInlineStart:"auto",color:l,fontWeight:"normal",fontSize:t.fontSize},["".concat(n,"-body")]:Object.assign({padding:i,borderRadius:" 0 0 ".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG))},(0,tz.dF)()),["".concat(n,"-grid")]:tV(t),["".concat(n,"-cover")]:{"> *":{display:"block",width:"100%"},["img, img + ".concat(e,"-image-mask")]:{borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0")}},["".concat(n,"-actions")]:tQ(t),["".concat(n,"-meta")]:t$(t)}),["".concat(n,"-bordered")]:{border:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c),["".concat(n,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(n,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(t.motionDurationMid,", border-color ").concat(t.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:a}},["".concat(n,"-contain-grid")]:{borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0 "),["".concat(n,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(n,"-loading) ").concat(n,"-body")]:{marginBlockStart:t.calc(t.lineWidth).mul(-1).equal(),marginInlineStart:t.calc(t.lineWidth).mul(-1).equal(),padding:0}},["".concat(n,"-contain-tabs")]:{["> ".concat(n,"-head")]:{minHeight:0,["".concat(n,"-head-title, ").concat(n,"-extra")]:{paddingTop:o}}},["".concat(n,"-type-inner")]:tJ(t),["".concat(n,"-loading")]:tU(t),["".concat(n,"-rtl")]:{direction:"rtl"}}},t1=t=>{let{componentCls:e,cardPaddingSM:n,headerHeightSM:a,headerFontSizeSM:o}=t;return{["".concat(e,"-small")]:{["> ".concat(e,"-head")]:{minHeight:a,padding:"0 ".concat((0,s.bf)(n)),fontSize:o,["> ".concat(e,"-head-wrapper")]:{["> ".concat(e,"-extra")]:{fontSize:t.fontSize}}},["> ".concat(e,"-body")]:{padding:n}},["".concat(e,"-small").concat(e,"-contain-tabs")]:{["> ".concat(e,"-head")]:{["".concat(e,"-head-title, ").concat(e,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var t2=(0,u.I$)("Card",t=>{let e=(0,b.TS)(t,{cardShadow:t.boxShadowCard,cardHeadPadding:t.padding,cardPaddingBase:t.paddingLG,cardActionsIconSize:t.fontSize,cardPaddingSM:12});return[t0(e),t1(e)]},t=>({headerBg:"transparent",headerFontSize:t.fontSizeLG,headerFontSizeSM:t.fontSize,headerHeight:t.fontSizeLG*t.lineHeightLG+2*t.padding,headerHeightSM:t.fontSize*t.lineHeight+2*t.paddingXS,actionsBg:t.colorBgContainer,actionsLiMargin:"".concat(t.paddingSM,"px 0"),tabsMarginBottom:-t.padding-t.lineWidth,extraColor:t.colorText})),t4=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n};let t5=t=>{let{prefixCls:e,actions:n=[]}=t;return a.createElement("ul",{className:"".concat(e,"-actions")},n.map((t,e)=>a.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(e)},a.createElement("span",null,t))))},t8=a.forwardRef((t,e)=>{let n;let{prefixCls:o,className:d,rootClassName:s,style:u,extra:b,headStyle:g={},bodyStyle:f={},title:p,loading:m,bordered:v=!0,size:h,type:y,cover:k,actions:x,tabList:w,children:S,activeTabKey:C,defaultActiveTabKey:E,tabBarExtraContent:O,hoverable:_,tabProps:j={}}=t,R=t4(t,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:Z,direction:T,card:N}=a.useContext(i.E_),z=a.useMemo(()=>{let t=!1;return a.Children.forEach(S,e=>{e&&e.type&&e.type===tF&&(t=!0)}),t},[S]),P=Z("card",o),[I,L,B]=t2(P),D=a.createElement(M,{loading:!0,active:!0,paragraph:{rows:4},title:!1},S),W=void 0!==C,q=Object.assign(Object.assign({},j),{[W?"activeKey":"defaultActiveKey"]:W?C:E,tabBarExtraContent:O}),G=(0,l.Z)(h),H=G&&"default"!==G?G:"large",A=w?a.createElement(tX,Object.assign({size:H},q,{className:"".concat(P,"-head-tabs"),onChange:e=>{var n;null===(n=t.onTabChange)||void 0===n||n.call(t,e)},items:w.map(t=>{var{tab:e}=t;return Object.assign({label:e},t4(t,["tab"]))})})):null;(p||b||A)&&(n=a.createElement("div",{className:"".concat(P,"-head"),style:g},a.createElement("div",{className:"".concat(P,"-head-wrapper")},p&&a.createElement("div",{className:"".concat(P,"-head-title")},p),b&&a.createElement("div",{className:"".concat(P,"-extra")},b)),A));let X=k?a.createElement("div",{className:"".concat(P,"-cover")},k):null,K=a.createElement("div",{className:"".concat(P,"-body"),style:f},m?D:S),F=x&&x.length?a.createElement(t5,{prefixCls:P,actions:x}):null,Y=(0,r.Z)(R,["onTabChange"]),V=c()(P,null==N?void 0:N.className,{["".concat(P,"-loading")]:m,["".concat(P,"-bordered")]:v,["".concat(P,"-hoverable")]:_,["".concat(P,"-contain-grid")]:z,["".concat(P,"-contain-tabs")]:w&&w.length,["".concat(P,"-").concat(G)]:G,["".concat(P,"-type-").concat(y)]:!!y,["".concat(P,"-rtl")]:"rtl"===T},d,s,L,B),Q=Object.assign(Object.assign({},null==N?void 0:N.style),u);return I(a.createElement("div",Object.assign({ref:e},Y,{className:V,style:Q}),n,X,K,F))});var t7=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n};t8.Grid=tF,t8.Meta=t=>{let{prefixCls:e,className:n,avatar:o,title:r,description:l}=t,d=t7(t,["prefixCls","className","avatar","title","description"]),{getPrefixCls:s}=a.useContext(i.E_),u=s("card",e),b=c()("".concat(u,"-meta"),n),g=o?a.createElement("div",{className:"".concat(u,"-meta-avatar")},o):null,f=r?a.createElement("div",{className:"".concat(u,"-meta-title")},r):null,p=l?a.createElement("div",{className:"".concat(u,"-meta-description")},l):null,m=f||p?a.createElement("div",{className:"".concat(u,"-meta-detail")},f,p):null;return a.createElement("div",Object.assign({},d,{className:b}),g,m)};var t6=t8},53410:function(t,e,n){var a=n(2265);let o=a.forwardRef(function(t,e){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});e.Z=o}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3669],{96473:function(t,e,n){n.d(e,{Z:function(){return i}});var a=n(1119),o=n(2265),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},r=n(55015),i=o.forwardRef(function(t,e){return o.createElement(r.Z,(0,a.Z)({},t,{ref:e,icon:c}))})},47323:function(t,e,n){n.d(e,{Z:function(){return p}});var a=n(5853),o=n(2265),c=n(1526),r=n(7084),i=n(97324),l=n(1153),d=n(26898);let s={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},u={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},b={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},g=(t,e)=>{switch(t){case"simple":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:e?(0,i.q)((0,l.bM)(e,d.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:e?(0,i.q)((0,l.bM)(e,d.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:e?(0,i.q)((0,l.bM)(e,d.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:e?(0,l.bM)(e,d.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:e?(0,i.q)((0,l.bM)(e,d.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:e?(0,l.bM)(e,d.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:e?(0,i.q)((0,l.bM)(e,d.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},f=(0,l.fn)("Icon"),p=o.forwardRef((t,e)=>{let{icon:n,variant:d="simple",tooltip:p,size:m=r.u8.SM,color:v,className:h}=t,y=(0,a._T)(t,["icon","variant","tooltip","size","color","className"]),k=g(d,v),{tooltipProps:x,getReferenceProps:w}=(0,c.l)();return o.createElement("span",Object.assign({ref:(0,l.lq)([e,x.refs.setReference]),className:(0,i.q)(f("root"),"inline-flex flex-shrink-0 items-center",k.bgColor,k.textColor,k.borderColor,k.ringColor,b[d].rounded,b[d].border,b[d].shadow,b[d].ring,s[m].paddingX,s[m].paddingY,h)},w,y),o.createElement(c.Z,Object.assign({text:p},x)),o.createElement(n,{className:(0,i.q)(f("icon"),"shrink-0",u[m].height,u[m].width)}))});p.displayName="Icon"},67960:function(t,e,n){n.d(e,{Z:function(){return t6}});var a=n(2265),o=n(36760),c=n.n(o),r=n(18694),i=n(71744),l=n(33759),d=t=>{let{prefixCls:e,className:n,style:o,size:r,shape:i}=t,l=c()({["".concat(e,"-lg")]:"large"===r,["".concat(e,"-sm")]:"small"===r}),d=c()({["".concat(e,"-circle")]:"circle"===i,["".concat(e,"-square")]:"square"===i,["".concat(e,"-round")]:"round"===i}),s=a.useMemo(()=>"number"==typeof r?{width:r,height:r,lineHeight:"".concat(r,"px")}:{},[r]);return a.createElement("span",{className:c()(e,l,d,n),style:Object.assign(Object.assign({},s),o)})},s=n(352),u=n(80669),b=n(3104);let g=new s.E4("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),f=t=>({height:t,lineHeight:(0,s.bf)(t)}),p=t=>Object.assign({width:t},f(t)),m=t=>({background:t.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:g,animationDuration:t.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),v=(t,e)=>Object.assign({width:e(t).mul(5).equal(),minWidth:e(t).mul(5).equal()},f(t)),h=t=>{let{skeletonAvatarCls:e,gradientFromColor:n,controlHeight:a,controlHeightLG:o,controlHeightSM:c}=t;return{["".concat(e)]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},p(a)),["".concat(e).concat(e,"-circle")]:{borderRadius:"50%"},["".concat(e).concat(e,"-lg")]:Object.assign({},p(o)),["".concat(e).concat(e,"-sm")]:Object.assign({},p(c))}},y=t=>{let{controlHeight:e,borderRadiusSM:n,skeletonInputCls:a,controlHeightLG:o,controlHeightSM:c,gradientFromColor:r,calc:i}=t;return{["".concat(a)]:Object.assign({display:"inline-block",verticalAlign:"top",background:r,borderRadius:n},v(e,i)),["".concat(a,"-lg")]:Object.assign({},v(o,i)),["".concat(a,"-sm")]:Object.assign({},v(c,i))}},k=t=>Object.assign({width:t},f(t)),x=t=>{let{skeletonImageCls:e,imageSizeBase:n,gradientFromColor:a,borderRadiusSM:o,calc:c}=t;return{["".concat(e)]:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:a,borderRadius:o},k(c(n).mul(2).equal())),{["".concat(e,"-path")]:{fill:"#bfbfbf"},["".concat(e,"-svg")]:Object.assign(Object.assign({},k(n)),{maxWidth:c(n).mul(4).equal(),maxHeight:c(n).mul(4).equal()}),["".concat(e,"-svg").concat(e,"-svg-circle")]:{borderRadius:"50%"}}),["".concat(e).concat(e,"-circle")]:{borderRadius:"50%"}}},w=(t,e,n)=>{let{skeletonButtonCls:a}=t;return{["".concat(n).concat(a,"-circle")]:{width:e,minWidth:e,borderRadius:"50%"},["".concat(n).concat(a,"-round")]:{borderRadius:e}}},S=(t,e)=>Object.assign({width:e(t).mul(2).equal(),minWidth:e(t).mul(2).equal()},f(t)),C=t=>{let{borderRadiusSM:e,skeletonButtonCls:n,controlHeight:a,controlHeightLG:o,controlHeightSM:c,gradientFromColor:r,calc:i}=t;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:r,borderRadius:e,width:i(a).mul(2).equal(),minWidth:i(a).mul(2).equal()},S(a,i))},w(t,a,n)),{["".concat(n,"-lg")]:Object.assign({},S(o,i))}),w(t,o,"".concat(n,"-lg"))),{["".concat(n,"-sm")]:Object.assign({},S(c,i))}),w(t,c,"".concat(n,"-sm")))},E=t=>{let{componentCls:e,skeletonAvatarCls:n,skeletonTitleCls:a,skeletonParagraphCls:o,skeletonButtonCls:c,skeletonInputCls:r,skeletonImageCls:i,controlHeight:l,controlHeightLG:d,controlHeightSM:s,gradientFromColor:u,padding:b,marginSM:g,borderRadius:f,titleHeight:v,blockRadius:k,paragraphLiHeight:w,controlHeightXS:S,paragraphMarginTop:E}=t;return{["".concat(e)]:{display:"table",width:"100%",["".concat(e,"-header")]:{display:"table-cell",paddingInlineEnd:b,verticalAlign:"top",["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:u},p(l)),["".concat(n,"-circle")]:{borderRadius:"50%"},["".concat(n,"-lg")]:Object.assign({},p(d)),["".concat(n,"-sm")]:Object.assign({},p(s))},["".concat(e,"-content")]:{display:"table-cell",width:"100%",verticalAlign:"top",["".concat(a)]:{width:"100%",height:v,background:u,borderRadius:k,["+ ".concat(o)]:{marginBlockStart:s}},["".concat(o)]:{padding:0,"> li":{width:"100%",height:w,listStyle:"none",background:u,borderRadius:k,"+ li":{marginBlockStart:S}}},["".concat(o,"> li:last-child:not(:first-child):not(:nth-child(2))")]:{width:"61%"}},["&-round ".concat(e,"-content")]:{["".concat(a,", ").concat(o," > li")]:{borderRadius:f}}},["".concat(e,"-with-avatar ").concat(e,"-content")]:{["".concat(a)]:{marginBlockStart:g,["+ ".concat(o)]:{marginBlockStart:E}}},["".concat(e).concat(e,"-element")]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},C(t)),h(t)),y(t)),x(t)),["".concat(e).concat(e,"-block")]:{width:"100%",["".concat(c)]:{width:"100%"},["".concat(r)]:{width:"100%"}},["".concat(e).concat(e,"-active")]:{["\n ".concat(a,",\n ").concat(o," > li,\n ").concat(n,",\n ").concat(c,",\n ").concat(r,",\n ").concat(i,"\n ")]:Object.assign({},m(t))}}};var O=(0,u.I$)("Skeleton",t=>{let{componentCls:e,calc:n}=t;return[E((0,b.TS)(t,{skeletonAvatarCls:"".concat(e,"-avatar"),skeletonTitleCls:"".concat(e,"-title"),skeletonParagraphCls:"".concat(e,"-paragraph"),skeletonButtonCls:"".concat(e,"-button"),skeletonInputCls:"".concat(e,"-input"),skeletonImageCls:"".concat(e,"-image"),imageSizeBase:n(t.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:"linear-gradient(90deg, ".concat(t.gradientFromColor," 25%, ").concat(t.gradientToColor," 37%, ").concat(t.gradientFromColor," 63%)"),skeletonLoadingMotionDuration:"1.4s"}))]},t=>{let{colorFillContent:e,colorFill:n}=t;return{color:e,colorGradientEnd:n,gradientFromColor:e,gradientToColor:n,titleHeight:t.controlHeight/2,blockRadius:t.borderRadiusSM,paragraphMarginTop:t.marginLG+t.marginXXS,paragraphLiHeight:t.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),_=n(1119),j={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},R=n(55015),Z=a.forwardRef(function(t,e){return a.createElement(R.Z,(0,_.Z)({},t,{ref:e,icon:j}))}),T=n(83145),N=t=>{let e=e=>{let{width:n,rows:a=2}=t;return Array.isArray(n)?n[e]:a-1===e?n:void 0},{prefixCls:n,className:o,style:r,rows:i}=t,l=(0,T.Z)(Array(i)).map((t,n)=>a.createElement("li",{key:n,style:{width:e(n)}}));return a.createElement("ul",{className:c()(n,o),style:r},l)},z=t=>{let{prefixCls:e,className:n,width:o,style:r}=t;return a.createElement("h3",{className:c()(e,n),style:Object.assign({width:o},r)})};function P(t){return t&&"object"==typeof t?t:{}}let M=t=>{let{prefixCls:e,loading:n,className:o,rootClassName:r,style:l,children:s,avatar:u=!1,title:b=!0,paragraph:g=!0,active:f,round:p}=t,{getPrefixCls:m,direction:v,skeleton:h}=a.useContext(i.E_),y=m("skeleton",e),[k,x,w]=O(y);if(n||!("loading"in t)){let t,e;let n=!!u,i=!!b,s=!!g;if(n){let e=Object.assign(Object.assign({prefixCls:"".concat(y,"-avatar")},i&&!s?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),P(u));t=a.createElement("div",{className:"".concat(y,"-header")},a.createElement(d,Object.assign({},e)))}if(i||s){let t,o;if(i){let e=Object.assign(Object.assign({prefixCls:"".concat(y,"-title")},!n&&s?{width:"38%"}:n&&s?{width:"50%"}:{}),P(b));t=a.createElement(z,Object.assign({},e))}if(s){let t=Object.assign(Object.assign({prefixCls:"".concat(y,"-paragraph")},function(t,e){let n={};return t&&e||(n.width="61%"),!t&&e?n.rows=3:n.rows=2,n}(n,i)),P(g));o=a.createElement(N,Object.assign({},t))}e=a.createElement("div",{className:"".concat(y,"-content")},t,o)}let m=c()(y,{["".concat(y,"-with-avatar")]:n,["".concat(y,"-active")]:f,["".concat(y,"-rtl")]:"rtl"===v,["".concat(y,"-round")]:p},null==h?void 0:h.className,o,r,x,w);return k(a.createElement("div",{className:m,style:Object.assign(Object.assign({},null==h?void 0:h.style),l)},t,e))}return void 0!==s?s:null};M.Button=t=>{let{prefixCls:e,className:n,rootClassName:o,active:l,block:s=!1,size:u="default"}=t,{getPrefixCls:b}=a.useContext(i.E_),g=b("skeleton",e),[f,p,m]=O(g),v=(0,r.Z)(t,["prefixCls"]),h=c()(g,"".concat(g,"-element"),{["".concat(g,"-active")]:l,["".concat(g,"-block")]:s},n,o,p,m);return f(a.createElement("div",{className:h},a.createElement(d,Object.assign({prefixCls:"".concat(g,"-button"),size:u},v))))},M.Avatar=t=>{let{prefixCls:e,className:n,rootClassName:o,active:l,shape:s="circle",size:u="default"}=t,{getPrefixCls:b}=a.useContext(i.E_),g=b("skeleton",e),[f,p,m]=O(g),v=(0,r.Z)(t,["prefixCls","className"]),h=c()(g,"".concat(g,"-element"),{["".concat(g,"-active")]:l},n,o,p,m);return f(a.createElement("div",{className:h},a.createElement(d,Object.assign({prefixCls:"".concat(g,"-avatar"),shape:s,size:u},v))))},M.Input=t=>{let{prefixCls:e,className:n,rootClassName:o,active:l,block:s,size:u="default"}=t,{getPrefixCls:b}=a.useContext(i.E_),g=b("skeleton",e),[f,p,m]=O(g),v=(0,r.Z)(t,["prefixCls"]),h=c()(g,"".concat(g,"-element"),{["".concat(g,"-active")]:l,["".concat(g,"-block")]:s},n,o,p,m);return f(a.createElement("div",{className:h},a.createElement(d,Object.assign({prefixCls:"".concat(g,"-input"),size:u},v))))},M.Image=t=>{let{prefixCls:e,className:n,rootClassName:o,style:r,active:l}=t,{getPrefixCls:d}=a.useContext(i.E_),s=d("skeleton",e),[u,b,g]=O(s),f=c()(s,"".concat(s,"-element"),{["".concat(s,"-active")]:l},n,o,b,g);return u(a.createElement("div",{className:f},a.createElement("div",{className:c()("".concat(s,"-image"),n),style:r},a.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(s,"-image-svg")},a.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(s,"-image-path")})))))},M.Node=t=>{let{prefixCls:e,className:n,rootClassName:o,style:r,active:l,children:d}=t,{getPrefixCls:s}=a.useContext(i.E_),u=s("skeleton",e),[b,g,f]=O(u),p=c()(u,"".concat(u,"-element"),{["".concat(u,"-active")]:l},g,n,o,f),m=null!=d?d:a.createElement(Z,null);return b(a.createElement("div",{className:p},a.createElement("div",{className:c()("".concat(u,"-image"),n),style:r},m)))};var I=n(49638),L=n(39760),B=n(96473),D=n(11993),W=n(31686),q=n(26365),G=n(41154),H=n(6989),A=n(50506),X=n(79267),K=(0,a.createContext)(null),F=n(31474),Y=n(58525),V=n(28791),Q=n(53346),$=function(t){var e=t.activeTabOffset,n=t.horizontal,o=t.rtl,c=t.indicator,r=void 0===c?{}:c,i=r.size,l=r.align,d=void 0===l?"center":l,s=(0,a.useState)(),u=(0,q.Z)(s,2),b=u[0],g=u[1],f=(0,a.useRef)(),p=a.useCallback(function(t){return"function"==typeof i?i(t):"number"==typeof i?i:t},[i]);function m(){Q.Z.cancel(f.current)}return(0,a.useEffect)(function(){var t={};if(e){if(n){t.width=p(e.width);var a=o?"right":"left";"start"===d&&(t[a]=e[a]),"center"===d&&(t[a]=e[a]+e.width/2,t.transform=o?"translateX(50%)":"translateX(-50%)"),"end"===d&&(t[a]=e[a]+e.width,t.transform="translateX(-100%)")}else t.height=p(e.height),"start"===d&&(t.top=e.top),"center"===d&&(t.top=e.top+e.height/2,t.transform="translateY(-50%)"),"end"===d&&(t.top=e.top+e.height,t.transform="translateY(-100%)")}return m(),f.current=(0,Q.Z)(function(){g(t)}),m},[e,n,o,d,p]),{style:b}},J={width:0,height:0,left:0,top:0};function U(t,e){var n=a.useRef(t),o=a.useState({}),c=(0,q.Z)(o,2)[1];return[n.current,function(t){var a="function"==typeof t?t(n.current):t;a!==n.current&&e(a,n.current),n.current=a,c({})}]}var tt=n(27380);function te(t){var e=(0,a.useState)(0),n=(0,q.Z)(e,2),o=n[0],c=n[1],r=(0,a.useRef)(0),i=(0,a.useRef)();return i.current=t,(0,tt.o)(function(){var t;null===(t=i.current)||void 0===t||t.call(i)},[o]),function(){r.current===o&&(r.current+=1,c(r.current))}}var tn={width:0,height:0,left:0,top:0,right:0};function ta(t){var e;return t instanceof Map?(e={},t.forEach(function(t,n){e[n]=t})):e=t,JSON.stringify(e)}function to(t){return String(t).replace(/"/g,"TABS_DQ")}function tc(t,e,n,a){return!!n&&!a&&!1!==t&&(void 0!==t||!1!==e&&null!==e)}var tr=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.editable,c=t.locale,r=t.style;return o&&!1!==o.showAdd?a.createElement("button",{ref:e,type:"button",className:"".concat(n,"-nav-add"),style:r,"aria-label":(null==c?void 0:c.addAriaLabel)||"Add tab",onClick:function(t){o.onEdit("add",{event:t})}},o.addIcon||"+"):null}),ti=a.forwardRef(function(t,e){var n,o=t.position,c=t.prefixCls,r=t.extra;if(!r)return null;var i={};return"object"!==(0,G.Z)(r)||a.isValidElement(r)?i.right=r:i=r,"right"===o&&(n=i.right),"left"===o&&(n=i.left),n?a.createElement("div",{className:"".concat(c,"-extra-content"),ref:e},n):null}),tl=n(71030),td=n(33082),ts=n(95814),tu=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.id,r=t.tabs,i=t.locale,l=t.mobile,d=t.moreIcon,s=t.moreTransitionName,u=t.style,b=t.className,g=t.editable,f=t.tabBarGutter,p=t.rtl,m=t.removeAriaLabel,v=t.onTabClick,h=t.getPopupContainer,y=t.popupClassName,k=(0,a.useState)(!1),x=(0,q.Z)(k,2),w=x[0],S=x[1],C=(0,a.useState)(null),E=(0,q.Z)(C,2),O=E[0],_=E[1],j="".concat(o,"-more-popup"),R="".concat(n,"-dropdown"),Z=null!==O?"".concat(j,"-").concat(O):null,T=null==i?void 0:i.dropdownAriaLabel,N=a.createElement(td.ZP,{onClick:function(t){v(t.key,t.domEvent),S(!1)},prefixCls:"".concat(R,"-menu"),id:j,tabIndex:-1,role:"listbox","aria-activedescendant":Z,selectedKeys:[O],"aria-label":void 0!==T?T:"expanded dropdown"},r.map(function(t){var e=t.closable,n=t.disabled,c=t.closeIcon,r=t.key,i=t.label,l=tc(e,c,g,n);return a.createElement(td.sN,{key:r,id:"".concat(j,"-").concat(r),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(r),disabled:n},a.createElement("span",null,i),l&&a.createElement("button",{type:"button","aria-label":m||"remove",tabIndex:0,className:"".concat(R,"-menu-item-remove"),onClick:function(t){t.stopPropagation(),t.preventDefault(),t.stopPropagation(),g.onEdit("remove",{key:r,event:t})}},c||g.removeIcon||"\xd7"))}));function z(t){for(var e=r.filter(function(t){return!t.disabled}),n=e.findIndex(function(t){return t.key===O})||0,a=e.length,o=0;oMath.abs(i-n)?[i,l,d-e.x,s-e.y]:[n,a,c,o]},tp=function(t){var e=t.current||{},n=e.offsetWidth,a=void 0===n?0:n,o=e.offsetHeight;if(t.current){var c=t.current.getBoundingClientRect(),r=c.width,i=c.height;if(1>Math.abs(r-a))return[r,i]}return[a,void 0===o?0:o]},tm=function(t,e){return t[e?0:1]},tv=a.forwardRef(function(t,e){var n,o,r,i,l,d,s,u,b,g,f,p,m,v,h,y,k,x,w,S,C,E,O,j,R,Z,N,z,P,M,I,L,B,G,H,A,X,Q,tt,tc=t.className,tl=t.style,td=t.id,ts=t.animated,tu=t.activeKey,tv=t.rtl,th=t.extra,ty=t.editable,tk=t.locale,tx=t.tabPosition,tw=t.tabBarGutter,tS=t.children,tC=t.onTabClick,tE=t.onTabScroll,tO=t.indicator,t_=a.useContext(K),tj=t_.prefixCls,tR=t_.tabs,tZ=(0,a.useRef)(null),tT=(0,a.useRef)(null),tN=(0,a.useRef)(null),tz=(0,a.useRef)(null),tP=(0,a.useRef)(null),tM=(0,a.useRef)(null),tI=(0,a.useRef)(null),tL="top"===tx||"bottom"===tx,tB=U(0,function(t,e){tL&&tE&&tE({direction:t>e?"left":"right"})}),tD=(0,q.Z)(tB,2),tW=tD[0],tq=tD[1],tG=U(0,function(t,e){!tL&&tE&&tE({direction:t>e?"top":"bottom"})}),tH=(0,q.Z)(tG,2),tA=tH[0],tX=tH[1],tK=(0,a.useState)([0,0]),tF=(0,q.Z)(tK,2),tY=tF[0],tV=tF[1],tQ=(0,a.useState)([0,0]),t$=(0,q.Z)(tQ,2),tJ=t$[0],tU=t$[1],t0=(0,a.useState)([0,0]),t1=(0,q.Z)(t0,2),t2=t1[0],t4=t1[1],t5=(0,a.useState)([0,0]),t8=(0,q.Z)(t5,2),t7=t8[0],t6=t8[1],t3=(n=new Map,o=(0,a.useRef)([]),r=(0,a.useState)({}),i=(0,q.Z)(r,2)[1],l=(0,a.useRef)("function"==typeof n?n():n),d=te(function(){var t=l.current;o.current.forEach(function(e){t=e(t)}),o.current=[],l.current=t,i({})}),[l.current,function(t){o.current.push(t),d()}]),t9=(0,q.Z)(t3,2),et=t9[0],ee=t9[1],en=(s=tJ[0],(0,a.useMemo)(function(){for(var t=new Map,e=et.get(null===(o=tR[0])||void 0===o?void 0:o.key)||J,n=e.left+e.width,a=0;aeu?eu:t}tL&&tv?(es=0,eu=Math.max(0,eo-el)):(es=Math.min(0,el-eo),eu=0);var eg=(0,a.useRef)(null),ef=(0,a.useState)(),ep=(0,q.Z)(ef,2),em=ep[0],ev=ep[1];function eh(){ev(Date.now())}function ey(){eg.current&&clearTimeout(eg.current)}u=function(t,e){function n(t,e){t(function(t){return eb(t+e)})}return!!ei&&(tL?n(tq,t):n(tX,e),ey(),eh(),!0)},b=(0,a.useState)(),f=(g=(0,q.Z)(b,2))[0],p=g[1],m=(0,a.useState)(0),h=(v=(0,q.Z)(m,2))[0],y=v[1],k=(0,a.useState)(0),w=(x=(0,q.Z)(k,2))[0],S=x[1],C=(0,a.useState)(),O=(E=(0,q.Z)(C,2))[0],j=E[1],R=(0,a.useRef)(),Z=(0,a.useRef)(),(N=(0,a.useRef)(null)).current={onTouchStart:function(t){var e=t.touches[0];p({x:e.screenX,y:e.screenY}),window.clearInterval(R.current)},onTouchMove:function(t){if(f){t.preventDefault();var e=t.touches[0],n=e.screenX,a=e.screenY;p({x:n,y:a});var o=n-f.x,c=a-f.y;u(o,c);var r=Date.now();y(r),S(r-h),j({x:o,y:c})}},onTouchEnd:function(){if(f&&(p(null),j(null),O)){var t=O.x/w,e=O.y/w;if(!(.1>Math.max(Math.abs(t),Math.abs(e)))){var n=t,a=e;R.current=window.setInterval(function(){if(.01>Math.abs(n)&&.01>Math.abs(a)){window.clearInterval(R.current);return}n*=.9046104802746175,a*=.9046104802746175,u(20*n,20*a)},20)}}},onWheel:function(t){var e=t.deltaX,n=t.deltaY,a=0,o=Math.abs(e),c=Math.abs(n);o===c?a="x"===Z.current?e:n:o>c?(a=e,Z.current="x"):(a=n,Z.current="y"),u(-a,-a)&&t.preventDefault()}},a.useEffect(function(){function t(t){N.current.onTouchMove(t)}function e(t){N.current.onTouchEnd(t)}return document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("touchend",e,{passive:!1}),tz.current.addEventListener("touchstart",function(t){N.current.onTouchStart(t)},{passive:!1}),tz.current.addEventListener("wheel",function(t){N.current.onWheel(t)}),function(){document.removeEventListener("touchmove",t),document.removeEventListener("touchend",e)}},[]),(0,a.useEffect)(function(){return ey(),em&&(eg.current=setTimeout(function(){ev(0)},100)),ey},[em]);var ek=(z=tL?tW:tA,B=(P=(0,W.Z)((0,W.Z)({},t),{},{tabs:tR})).tabs,G=P.tabPosition,H=P.rtl,["top","bottom"].includes(G)?(M="width",I=H?"right":"left",L=Math.abs(z)):(M="height",I="top",L=-z),(0,a.useMemo)(function(){if(!B.length)return[0,0];for(var t=B.length,e=t,n=0;nL+el){e=n-1;break}}for(var o=0,c=t-1;c>=0;c-=1)if((en.get(B[c].key)||tn)[I]=e?[0,0]:[o,e]},[en,el,eo,ec,er,L,G,B.map(function(t){return t.key}).join("_"),H])),ex=(0,q.Z)(ek,2),ew=ex[0],eS=ex[1],eC=(0,Y.Z)(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tu,e=en.get(t)||{width:0,height:0,left:0,right:0,top:0};if(tL){var n=tW;tv?e.righttW+el&&(n=e.right+e.width-el):e.left<-tW?n=-e.left:e.left+e.width>-tW+el&&(n=-(e.left+e.width-el)),tX(0),tq(eb(n))}else{var a=tA;e.top<-tA?a=-e.top:e.top+e.height>-tA+el&&(a=-(e.top+e.height-el)),tq(0),tX(eb(a))}}),eE={};"top"===tx||"bottom"===tx?eE[tv?"marginRight":"marginLeft"]=tw:eE.marginTop=tw;var eO=tR.map(function(t,e){var n=t.key;return a.createElement(tg,{id:td,prefixCls:tj,key:n,tab:t,style:0===e?void 0:eE,closable:t.closable,editable:ty,active:n===tu,renderWrapper:tS,removeAriaLabel:null==tk?void 0:tk.removeAriaLabel,onClick:function(t){tC(n,t)},onFocus:function(){eC(n),eh(),tz.current&&(tv||(tz.current.scrollLeft=0),tz.current.scrollTop=0)}})}),e_=function(){return ee(function(){var t,e=new Map,n=null===(t=tP.current)||void 0===t?void 0:t.getBoundingClientRect();return tR.forEach(function(t){var a,o=t.key,c=null===(a=tP.current)||void 0===a?void 0:a.querySelector('[data-node-key="'.concat(to(o),'"]'));if(c){var r=tf(c,n),i=(0,q.Z)(r,4),l=i[0],d=i[1],s=i[2],u=i[3];e.set(o,{width:l,height:d,left:s,top:u})}}),e})};(0,a.useEffect)(function(){e_()},[tR.map(function(t){return t.key}).join("_")]);var ej=te(function(){var t=tp(tZ),e=tp(tT),n=tp(tN);tV([t[0]-e[0]-n[0],t[1]-e[1]-n[1]]);var a=tp(tI);t4(a),t6(tp(tM));var o=tp(tP);tU([o[0]-a[0],o[1]-a[1]]),e_()}),eR=tR.slice(0,ew),eZ=tR.slice(eS+1),eT=[].concat((0,T.Z)(eR),(0,T.Z)(eZ)),eN=en.get(tu),ez=$({activeTabOffset:eN,horizontal:tL,indicator:tO,rtl:tv}).style;(0,a.useEffect)(function(){eC()},[tu,es,eu,ta(eN),ta(en),tL]),(0,a.useEffect)(function(){ej()},[tv]);var eP=!!eT.length,eM="".concat(tj,"-nav-wrap");return tL?tv?(X=tW>0,A=tW!==eu):(A=tW<0,X=tW!==es):(Q=tA<0,tt=tA!==es),a.createElement(F.Z,{onResize:ej},a.createElement("div",{ref:(0,V.x1)(e,tZ),role:"tablist",className:c()("".concat(tj,"-nav"),tc),style:tl,onKeyDown:function(){eh()}},a.createElement(ti,{ref:tT,position:"left",extra:th,prefixCls:tj}),a.createElement(F.Z,{onResize:ej},a.createElement("div",{className:c()(eM,(0,D.Z)((0,D.Z)((0,D.Z)((0,D.Z)({},"".concat(eM,"-ping-left"),A),"".concat(eM,"-ping-right"),X),"".concat(eM,"-ping-top"),Q),"".concat(eM,"-ping-bottom"),tt)),ref:tz},a.createElement(F.Z,{onResize:ej},a.createElement("div",{ref:tP,className:"".concat(tj,"-nav-list"),style:{transform:"translate(".concat(tW,"px, ").concat(tA,"px)"),transition:em?"none":void 0}},eO,a.createElement(tr,{ref:tI,prefixCls:tj,locale:tk,editable:ty,style:(0,W.Z)((0,W.Z)({},0===eO.length?void 0:eE),{},{visibility:eP?"hidden":null})}),a.createElement("div",{className:c()("".concat(tj,"-ink-bar"),(0,D.Z)({},"".concat(tj,"-ink-bar-animated"),ts.inkBar)),style:ez}))))),a.createElement(tb,(0,_.Z)({},t,{removeAriaLabel:null==tk?void 0:tk.removeAriaLabel,ref:tM,prefixCls:tj,tabs:eT,className:!eP&&ed,tabMoving:!!em})),a.createElement(ti,{ref:tN,position:"right",extra:th,prefixCls:tj})))}),th=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.className,r=t.style,i=t.id,l=t.active,d=t.tabKey,s=t.children;return a.createElement("div",{id:i&&"".concat(i,"-panel-").concat(d),role:"tabpanel",tabIndex:l?0:-1,"aria-labelledby":i&&"".concat(i,"-tab-").concat(d),"aria-hidden":!l,style:r,className:c()(n,l&&"".concat(n,"-active"),o),ref:e},s)}),ty=["renderTabBar"],tk=["label","key"],tx=function(t){var e=t.renderTabBar,n=(0,H.Z)(t,ty),o=a.useContext(K).tabs;return e?e((0,W.Z)((0,W.Z)({},n),{},{panes:o.map(function(t){var e=t.label,n=t.key,o=(0,H.Z)(t,tk);return a.createElement(th,(0,_.Z)({tab:e,key:n,tabKey:n},o))})}),tv):a.createElement(tv,n)},tw=n(47970),tS=["key","forceRender","style","className","destroyInactiveTabPane"],tC=function(t){var e=t.id,n=t.activeKey,o=t.animated,r=t.tabPosition,i=t.destroyInactiveTabPane,l=a.useContext(K),d=l.prefixCls,s=l.tabs,u=o.tabPane,b="".concat(d,"-tabpane");return a.createElement("div",{className:c()("".concat(d,"-content-holder"))},a.createElement("div",{className:c()("".concat(d,"-content"),"".concat(d,"-content-").concat(r),(0,D.Z)({},"".concat(d,"-content-animated"),u))},s.map(function(t){var r=t.key,l=t.forceRender,d=t.style,s=t.className,g=t.destroyInactiveTabPane,f=(0,H.Z)(t,tS),p=r===n;return a.createElement(tw.ZP,(0,_.Z)({key:r,visible:p,forceRender:l,removeOnLeave:!!(i||g),leavedClassName:"".concat(b,"-hidden")},o.tabPaneMotion),function(t,n){var o=t.style,i=t.className;return a.createElement(th,(0,_.Z)({},f,{prefixCls:b,id:e,tabKey:r,animated:u,active:p,style:(0,W.Z)((0,W.Z)({},d),o),className:c()(s,i),ref:n}))})})))};n(32559);var tE=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],tO=0,t_=a.forwardRef(function(t,e){var n=t.id,o=t.prefixCls,r=void 0===o?"rc-tabs":o,i=t.className,l=t.items,d=t.direction,s=t.activeKey,u=t.defaultActiveKey,b=t.editable,g=t.animated,f=t.tabPosition,p=void 0===f?"top":f,m=t.tabBarGutter,v=t.tabBarStyle,h=t.tabBarExtraContent,y=t.locale,k=t.moreIcon,x=t.moreTransitionName,w=t.destroyInactiveTabPane,S=t.renderTabBar,C=t.onChange,E=t.onTabClick,O=t.onTabScroll,j=t.getPopupContainer,R=t.popupClassName,Z=t.indicator,T=(0,H.Z)(t,tE),N=a.useMemo(function(){return(l||[]).filter(function(t){return t&&"object"===(0,G.Z)(t)&&"key"in t})},[l]),z="rtl"===d,P=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{inkBar:!0,tabPane:!1};return(t=!1===e?{inkBar:!1,tabPane:!1}:!0===e?{inkBar:!0,tabPane:!1}:(0,W.Z)({inkBar:!0},"object"===(0,G.Z)(e)?e:{})).tabPaneMotion&&void 0===t.tabPane&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(t.tabPane=!1),t}(g),M=(0,a.useState)(!1),I=(0,q.Z)(M,2),L=I[0],B=I[1];(0,a.useEffect)(function(){B((0,X.Z)())},[]);var F=(0,A.Z)(function(){var t;return null===(t=N[0])||void 0===t?void 0:t.key},{value:s,defaultValue:u}),Y=(0,q.Z)(F,2),V=Y[0],Q=Y[1],$=(0,a.useState)(function(){return N.findIndex(function(t){return t.key===V})}),J=(0,q.Z)($,2),U=J[0],tt=J[1];(0,a.useEffect)(function(){var t,e=N.findIndex(function(t){return t.key===V});-1===e&&(e=Math.max(0,Math.min(U,N.length-1)),Q(null===(t=N[e])||void 0===t?void 0:t.key)),tt(e)},[N.map(function(t){return t.key}).join("_"),V,U]);var te=(0,A.Z)(null,{value:n}),tn=(0,q.Z)(te,2),ta=tn[0],to=tn[1];(0,a.useEffect)(function(){n||(to("rc-tabs-".concat(tO)),tO+=1)},[]);var tc={id:ta,activeKey:V,animated:P,tabPosition:p,rtl:z,mobile:L},tr=(0,W.Z)((0,W.Z)({},tc),{},{editable:b,locale:y,moreIcon:k,moreTransitionName:x,tabBarGutter:m,onTabClick:function(t,e){null==E||E(t,e);var n=t!==V;Q(t),n&&(null==C||C(t))},onTabScroll:O,extra:h,style:v,panes:null,getPopupContainer:j,popupClassName:R,indicator:Z});return a.createElement(K.Provider,{value:{tabs:N,prefixCls:r}},a.createElement("div",(0,_.Z)({ref:e,id:n,className:c()(r,"".concat(r,"-").concat(p),(0,D.Z)((0,D.Z)((0,D.Z)({},"".concat(r,"-mobile"),L),"".concat(r,"-editable"),b),"".concat(r,"-rtl"),z),i)},T),a.createElement(tx,(0,_.Z)({},tr,{renderTabBar:S})),a.createElement(tC,(0,_.Z)({destroyInactiveTabPane:w},tc,{animated:P}))))}),tj=n(64024),tR=n(68710);let tZ={motionAppear:!1,motionEnter:!0,motionLeave:!0};var tT=n(45287),tN=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n},tz=n(12918),tP=n(18544),tM=t=>{let{componentCls:e,motionDurationSlow:n}=t;return[{[e]:{["".concat(e,"-switch")]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:"opacity ".concat(n)}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:"opacity ".concat(n)}}}}},[(0,tP.oN)(t,"slide-up"),(0,tP.oN)(t,"slide-down")]]};let tI=t=>{let{componentCls:e,tabsCardPadding:n,cardBg:a,cardGutter:o,colorBorderSecondary:c,itemSelectedColor:r}=t;return{["".concat(e,"-card")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{margin:0,padding:n,background:a,border:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c),transition:"all ".concat(t.motionDurationSlow," ").concat(t.motionEaseInOut)},["".concat(e,"-tab-active")]:{color:r,background:t.colorBgContainer},["".concat(e,"-ink-bar")]:{visibility:"hidden"}},["&".concat(e,"-top, &").concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginLeft:{_skip_check_:!0,value:(0,s.bf)(o)}}}},["&".concat(e,"-top")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0")},["".concat(e,"-tab-active")]:{borderBottomColor:t.colorBgContainer}}},["&".concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:"0 0 ".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG))},["".concat(e,"-tab-active")]:{borderTopColor:t.colorBgContainer}}},["&".concat(e,"-left, &").concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginTop:(0,s.bf)(o)}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,s.bf)(t.borderRadiusLG)," 0 0 ").concat((0,s.bf)(t.borderRadiusLG))}},["".concat(e,"-tab-active")]:{borderRightColor:{_skip_check_:!0,value:t.colorBgContainer}}}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0")}},["".concat(e,"-tab-active")]:{borderLeftColor:{_skip_check_:!0,value:t.colorBgContainer}}}}}}},tL=t=>{let{componentCls:e,itemHoverColor:n,dropdownEdgeChildVerticalPadding:a}=t;return{["".concat(e,"-dropdown")]:Object.assign(Object.assign({},(0,tz.Wf)(t)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:t.zIndexPopup,display:"block","&-hidden":{display:"none"},["".concat(e,"-dropdown-menu")]:{maxHeight:t.tabsDropdownHeight,margin:0,padding:"".concat((0,s.bf)(a)," 0"),overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:t.colorBgContainer,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,"&-item":Object.assign(Object.assign({},tz.vS),{display:"flex",alignItems:"center",minWidth:t.tabsDropdownWidth,margin:0,padding:"".concat((0,s.bf)(t.paddingXXS)," ").concat((0,s.bf)(t.paddingSM)),color:t.colorText,fontWeight:"normal",fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:"pointer",transition:"all ".concat(t.motionDurationSlow),"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:t.marginSM},color:t.colorTextDescription,fontSize:t.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:t.controlItemBgHover},"&-disabled":{"&, &:hover":{color:t.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},tB=t=>{let{componentCls:e,margin:n,colorBorderSecondary:a,horizontalMargin:o,verticalItemPadding:c,verticalItemMargin:r,calc:i}=t;return{["".concat(e,"-top, ").concat(e,"-bottom")]:{flexDirection:"column",["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(a),content:"''"},["".concat(e,"-ink-bar")]:{height:t.lineWidthBold,"&-animated":{transition:"width ".concat(t.motionDurationSlow,", left ").concat(t.motionDurationSlow,",\n right ").concat(t.motionDurationSlow)}},["".concat(e,"-nav-wrap")]:{"&::before, &::after":{top:0,bottom:0,width:t.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowRight},["&".concat(e,"-nav-wrap-ping-left::before")]:{opacity:1},["&".concat(e,"-nav-wrap-ping-right::after")]:{opacity:1}}}},["".concat(e,"-top")]:{["> ".concat(e,"-nav,\n > div > ").concat(e,"-nav")]:{"&::before":{bottom:0},["".concat(e,"-ink-bar")]:{bottom:0}}},["".concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},["".concat(e,"-ink-bar")]:{top:0}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{order:0}},["".concat(e,"-left, ").concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{flexDirection:"column",minWidth:i(t.controlHeight).mul(1.25).equal(),["".concat(e,"-tab")]:{padding:c,textAlign:"center"},["".concat(e,"-tab + ").concat(e,"-tab")]:{margin:r},["".concat(e,"-nav-wrap")]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:t.controlHeight},"&::before":{top:0,boxShadow:t.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:t.boxShadowTabsOverflowBottom},["&".concat(e,"-nav-wrap-ping-top::before")]:{opacity:1},["&".concat(e,"-nav-wrap-ping-bottom::after")]:{opacity:1}},["".concat(e,"-ink-bar")]:{width:t.lineWidthBold,"&-animated":{transition:"height ".concat(t.motionDurationSlow,", top ").concat(t.motionDurationSlow)}},["".concat(e,"-nav-list, ").concat(e,"-nav-operations")]:{flex:"1 0 auto",flexDirection:"column"}}},["".concat(e,"-left")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-ink-bar")]:{right:{_skip_check_:!0,value:0}}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{marginLeft:{_skip_check_:!0,value:(0,s.bf)(i(t.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorder)},["> ".concat(e,"-content > ").concat(e,"-tabpane")]:{paddingLeft:{_skip_check_:!0,value:t.paddingLG}}}},["".concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{order:1,["".concat(e,"-ink-bar")]:{left:{_skip_check_:!0,value:0}}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{order:0,marginRight:{_skip_check_:!0,value:i(t.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorder)},["> ".concat(e,"-content > ").concat(e,"-tabpane")]:{paddingRight:{_skip_check_:!0,value:t.paddingLG}}}}}},tD=t=>{let{componentCls:e,cardPaddingSM:n,cardPaddingLG:a,horizontalItemPaddingSM:o,horizontalItemPaddingLG:c}=t;return{[e]:{"&-small":{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:o,fontSize:t.titleFontSizeSM}}},"&-large":{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:c,fontSize:t.titleFontSizeLG}}}},["".concat(e,"-card")]:{["&".concat(e,"-small")]:{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:n}},["&".concat(e,"-bottom")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:"0 0 ".concat((0,s.bf)(t.borderRadius)," ").concat((0,s.bf)(t.borderRadius))}},["&".concat(e,"-top")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:"".concat((0,s.bf)(t.borderRadius)," ").concat((0,s.bf)(t.borderRadius)," 0 0")}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,s.bf)(t.borderRadius)," ").concat((0,s.bf)(t.borderRadius)," 0")}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,s.bf)(t.borderRadius)," 0 0 ").concat((0,s.bf)(t.borderRadius))}}}},["&".concat(e,"-large")]:{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:a}}}}}},tW=t=>{let{componentCls:e,itemActiveColor:n,itemHoverColor:a,iconCls:o,tabsHorizontalItemMargin:c,horizontalItemPadding:r,itemSelectedColor:i,itemColor:l}=t,d="".concat(e,"-tab");return{[d]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:r,fontSize:t.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:n}},(0,tz.Qy)(t)),"&-btn":{outline:"none",transition:"all 0.3s",["".concat(d,"-icon:not(:last-child)")]:{marginInlineEnd:t.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:t.calc(t.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:t.marginXS},color:t.colorTextDescription,fontSize:t.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:"all ".concat(t.motionDurationSlow),"&:hover":{color:t.colorTextHeading}},"&:hover":{color:a},["&".concat(d,"-active ").concat(d,"-btn")]:{color:i,textShadow:t.tabsActiveTextShadow},["&".concat(d,"-disabled")]:{color:t.colorTextDisabled,cursor:"not-allowed"},["&".concat(d,"-disabled ").concat(d,"-btn, &").concat(d,"-disabled ").concat(e,"-remove")]:{"&:focus, &:active":{color:t.colorTextDisabled}},["& ".concat(d,"-remove ").concat(o)]:{margin:0},["".concat(o,":not(:last-child)")]:{marginRight:{_skip_check_:!0,value:t.marginSM}}},["".concat(d," + ").concat(d)]:{margin:{_skip_check_:!0,value:c}}}},tq=t=>{let{componentCls:e,tabsHorizontalItemMarginRTL:n,iconCls:a,cardGutter:o,calc:c}=t;return{["".concat(e,"-rtl")]:{direction:"rtl",["".concat(e,"-nav")]:{["".concat(e,"-tab")]:{margin:{_skip_check_:!0,value:n},["".concat(e,"-tab:last-of-type")]:{marginLeft:{_skip_check_:!0,value:0}},[a]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:(0,s.bf)(t.marginSM)}},["".concat(e,"-tab-remove")]:{marginRight:{_skip_check_:!0,value:(0,s.bf)(t.marginXS)},marginLeft:{_skip_check_:!0,value:(0,s.bf)(c(t.marginXXS).mul(-1).equal())},[a]:{margin:0}}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav")]:{order:1},["> ".concat(e,"-content-holder")]:{order:0}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav")]:{order:0},["> ".concat(e,"-content-holder")]:{order:1}},["&".concat(e,"-card").concat(e,"-top, &").concat(e,"-card").concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},["".concat(e,"-dropdown-rtl")]:{direction:"rtl"},["".concat(e,"-menu-item")]:{["".concat(e,"-dropdown-rtl")]:{textAlign:{_skip_check_:!0,value:"right"}}}}},tG=t=>{let{componentCls:e,tabsCardPadding:n,cardHeight:a,cardGutter:o,itemHoverColor:c,itemActiveColor:r,colorBorderSecondary:i}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,tz.Wf)(t)),{display:"flex",["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{position:"relative",display:"flex",flex:"none",alignItems:"center",["".concat(e,"-nav-wrap")]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:"opacity ".concat(t.motionDurationSlow),content:"''",pointerEvents:"none"}},["".concat(e,"-nav-list")]:{position:"relative",display:"flex",transition:"opacity ".concat(t.motionDurationSlow)},["".concat(e,"-nav-operations")]:{display:"flex",alignSelf:"stretch"},["".concat(e,"-nav-operations-hidden")]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},["".concat(e,"-nav-more")]:{position:"relative",padding:n,background:"transparent",border:0,color:t.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:t.calc(t.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},["".concat(e,"-nav-add")]:Object.assign({minWidth:a,minHeight:a,marginLeft:{_skip_check_:!0,value:o},padding:"0 ".concat((0,s.bf)(t.paddingXS)),background:"transparent",border:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(i),borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0"),outline:"none",cursor:"pointer",color:t.colorText,transition:"all ".concat(t.motionDurationSlow," ").concat(t.motionEaseInOut),"&:hover":{color:c},"&:active, &:focus:not(:focus-visible)":{color:r}},(0,tz.Qy)(t))},["".concat(e,"-extra-content")]:{flex:"none"},["".concat(e,"-ink-bar")]:{position:"absolute",background:t.inkBarColor,pointerEvents:"none"}}),tW(t)),{["".concat(e,"-content")]:{position:"relative",width:"100%"},["".concat(e,"-content-holder")]:{flex:"auto",minWidth:0,minHeight:0},["".concat(e,"-tabpane")]:{outline:"none","&-hidden":{display:"none"}}}),["".concat(e,"-centered")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-nav-wrap")]:{["&:not([class*='".concat(e,"-nav-wrap-ping'])")]:{justifyContent:"center"}}}}}};var tH=(0,u.I$)("Tabs",t=>{let e=(0,b.TS)(t,{tabsCardPadding:t.cardPadding,dropdownEdgeChildVerticalPadding:t.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:"0 0 0 ".concat((0,s.bf)(t.horizontalItemGutter)),tabsHorizontalItemMarginRTL:"0 0 0 ".concat((0,s.bf)(t.horizontalItemGutter))});return[tD(e),tq(e),tB(e),tL(e),tI(e),tG(e),tM(e)]},t=>{let e=t.controlHeightLG;return{zIndexPopup:t.zIndexPopupBase+50,cardBg:t.colorFillAlter,cardHeight:e,cardPadding:"".concat((e-Math.round(t.fontSize*t.lineHeight))/2-t.lineWidth,"px ").concat(t.padding,"px"),cardPaddingSM:"".concat(1.5*t.paddingXXS,"px ").concat(t.padding,"px"),cardPaddingLG:"".concat(t.paddingXS,"px ").concat(t.padding,"px ").concat(1.5*t.paddingXXS,"px"),titleFontSize:t.fontSize,titleFontSizeLG:t.fontSizeLG,titleFontSizeSM:t.fontSize,inkBarColor:t.colorPrimary,horizontalMargin:"0 0 ".concat(t.margin,"px 0"),horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:"".concat(t.paddingSM,"px 0"),horizontalItemPaddingSM:"".concat(t.paddingXS,"px 0"),horizontalItemPaddingLG:"".concat(t.padding,"px 0"),verticalItemPadding:"".concat(t.paddingXS,"px ").concat(t.paddingLG,"px"),verticalItemMargin:"".concat(t.margin,"px 0 0 0"),itemColor:t.colorText,itemSelectedColor:t.colorPrimary,itemHoverColor:t.colorPrimaryHover,itemActiveColor:t.colorPrimaryActive,cardGutter:t.marginXXS/2}}),tA=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n};let tX=t=>{var e,n,o,r,d,s;let u;let{type:b,className:g,rootClassName:f,size:p,onEdit:m,hideAdd:v,centered:h,addIcon:y,popupClassName:k,children:x,items:w,animated:S,style:C,indicatorSize:E,indicator:O}=t,_=tA(t,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:j,moreIcon:R=a.createElement(L.Z,null)}=_,{direction:Z,tabs:T,getPrefixCls:N,getPopupContainer:z}=a.useContext(i.E_),P=N("tabs",j),M=(0,tj.Z)(P),[D,W,q]=tH(P,M);"editable-card"===b&&(u={onEdit:(t,e)=>{let{key:n,event:a}=e;null==m||m("add"===t?a:n,t)},removeIcon:a.createElement(I.Z,null),addIcon:y||a.createElement(B.Z,null),showAdd:!0!==v});let G=N(),H=(0,l.Z)(p),A=w||(0,tT.Z)(x).map(t=>{if(a.isValidElement(t)){let{key:e,props:n}=t,a=n||{},{tab:o}=a,c=tN(a,["tab"]);return Object.assign(Object.assign({key:String(e)},c),{label:o})}return null}).filter(t=>t),X=function(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inkBar:!0,tabPane:!1};return(e=!1===n?{inkBar:!1,tabPane:!1}:!0===n?{inkBar:!0,tabPane:!0}:Object.assign({inkBar:!0},"object"==typeof n?n:{})).tabPane&&(e.tabPaneMotion=Object.assign(Object.assign({},tZ),{motionName:(0,tR.m)(t,"switch")})),e}(P,S),K=Object.assign(Object.assign({},null==T?void 0:T.style),C),F={align:null!==(e=null==O?void 0:O.align)&&void 0!==e?e:null===(n=null==T?void 0:T.indicator)||void 0===n?void 0:n.align,size:null!==(s=null!==(r=null!==(o=null==O?void 0:O.size)&&void 0!==o?o:E)&&void 0!==r?r:null===(d=null==T?void 0:T.indicator)||void 0===d?void 0:d.size)&&void 0!==s?s:null==T?void 0:T.indicatorSize};return D(a.createElement(t_,Object.assign({direction:Z,getPopupContainer:z,moreTransitionName:"".concat(G,"-slide-up")},_,{items:A,className:c()({["".concat(P,"-").concat(H)]:H,["".concat(P,"-card")]:["card","editable-card"].includes(b),["".concat(P,"-editable-card")]:"editable-card"===b,["".concat(P,"-centered")]:h},null==T?void 0:T.className,g,f,W,q,M),popupClassName:c()(k,W,q,M),style:K,editable:u,moreIcon:R,prefixCls:P,animated:X,indicator:F})))};tX.TabPane=()=>null;var tK=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n},tF=t=>{var{prefixCls:e,className:n,hoverable:o=!0}=t,r=tK(t,["prefixCls","className","hoverable"]);let{getPrefixCls:l}=a.useContext(i.E_),d=l("card",e),s=c()("".concat(d,"-grid"),n,{["".concat(d,"-grid-hoverable")]:o});return a.createElement("div",Object.assign({},r,{className:s}))};let tY=t=>{let{antCls:e,componentCls:n,headerHeight:a,cardPaddingBase:o,tabsMarginBottom:c}=t;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:a,marginBottom:-1,padding:"0 ".concat((0,s.bf)(o)),color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:t.headerFontSize,background:t.headerBg,borderBottom:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorderSecondary),borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0")},(0,tz.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},tz.vS),{["\n > ".concat(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(e,"-tabs-top")]:{clear:"both",marginBottom:c,color:t.colorText,fontWeight:"normal",fontSize:t.fontSize,"&-bar":{borderBottom:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorderSecondary)}}})},tV=t=>{let{cardPaddingBase:e,colorBorderSecondary:n,cardShadow:a,lineWidth:o}=t;return{width:"33.33%",padding:e,border:0,borderRadius:0,boxShadow:"\n ".concat((0,s.bf)(o)," 0 0 0 ").concat(n,",\n 0 ").concat((0,s.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,s.bf)(o)," ").concat((0,s.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,s.bf)(o)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,s.bf)(o)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(t.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:a}}},tQ=t=>{let{componentCls:e,iconCls:n,actionsLiMargin:a,cardActionsIconSize:o,colorBorderSecondary:c,actionsBg:r}=t;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:r,borderTop:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c),display:"flex",borderRadius:"0 0 ".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG))},(0,tz.dF)()),{"& > li":{margin:a,color:t.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:t.calc(t.cardActionsIconSize).mul(2).equal(),fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:"pointer","&:hover":{color:t.colorPrimary,transition:"color ".concat(t.motionDurationMid)},["a:not(".concat(e,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:t.colorTextDescription,lineHeight:(0,s.bf)(t.fontHeight),transition:"color ".concat(t.motionDurationMid),"&:hover":{color:t.colorPrimary}},["> ".concat(n)]:{fontSize:o,lineHeight:(0,s.bf)(t.calc(o).mul(t.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c)}}})},t$=t=>Object.assign(Object.assign({margin:"".concat((0,s.bf)(t.calc(t.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,tz.dF)()),{"&-avatar":{paddingInlineEnd:t.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:t.marginXS}},"&-title":Object.assign({color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:t.fontSizeLG},tz.vS),"&-description":{color:t.colorTextDescription}}),tJ=t=>{let{componentCls:e,cardPaddingBase:n,colorFillAlter:a}=t;return{["".concat(e,"-head")]:{padding:"0 ".concat((0,s.bf)(n)),background:a,"&-title":{fontSize:t.fontSize}},["".concat(e,"-body")]:{padding:"".concat((0,s.bf)(t.padding)," ").concat((0,s.bf)(n))}}},tU=t=>{let{componentCls:e}=t;return{overflow:"hidden",["".concat(e,"-body")]:{userSelect:"none"}}},t0=t=>{let{antCls:e,componentCls:n,cardShadow:a,cardHeadPadding:o,colorBorderSecondary:c,boxShadowTertiary:r,cardPaddingBase:i,extraColor:l}=t;return{[n]:Object.assign(Object.assign({},(0,tz.Wf)(t)),{position:"relative",background:t.colorBgContainer,borderRadius:t.borderRadiusLG,["&:not(".concat(n,"-bordered)")]:{boxShadow:r},["".concat(n,"-head")]:tY(t),["".concat(n,"-extra")]:{marginInlineStart:"auto",color:l,fontWeight:"normal",fontSize:t.fontSize},["".concat(n,"-body")]:Object.assign({padding:i,borderRadius:" 0 0 ".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG))},(0,tz.dF)()),["".concat(n,"-grid")]:tV(t),["".concat(n,"-cover")]:{"> *":{display:"block",width:"100%"},["img, img + ".concat(e,"-image-mask")]:{borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0")}},["".concat(n,"-actions")]:tQ(t),["".concat(n,"-meta")]:t$(t)}),["".concat(n,"-bordered")]:{border:"".concat((0,s.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c),["".concat(n,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(n,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(t.motionDurationMid,", border-color ").concat(t.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:a}},["".concat(n,"-contain-grid")]:{borderRadius:"".concat((0,s.bf)(t.borderRadiusLG)," ").concat((0,s.bf)(t.borderRadiusLG)," 0 0 "),["".concat(n,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(n,"-loading) ").concat(n,"-body")]:{marginBlockStart:t.calc(t.lineWidth).mul(-1).equal(),marginInlineStart:t.calc(t.lineWidth).mul(-1).equal(),padding:0}},["".concat(n,"-contain-tabs")]:{["> ".concat(n,"-head")]:{minHeight:0,["".concat(n,"-head-title, ").concat(n,"-extra")]:{paddingTop:o}}},["".concat(n,"-type-inner")]:tJ(t),["".concat(n,"-loading")]:tU(t),["".concat(n,"-rtl")]:{direction:"rtl"}}},t1=t=>{let{componentCls:e,cardPaddingSM:n,headerHeightSM:a,headerFontSizeSM:o}=t;return{["".concat(e,"-small")]:{["> ".concat(e,"-head")]:{minHeight:a,padding:"0 ".concat((0,s.bf)(n)),fontSize:o,["> ".concat(e,"-head-wrapper")]:{["> ".concat(e,"-extra")]:{fontSize:t.fontSize}}},["> ".concat(e,"-body")]:{padding:n}},["".concat(e,"-small").concat(e,"-contain-tabs")]:{["> ".concat(e,"-head")]:{["".concat(e,"-head-title, ").concat(e,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var t2=(0,u.I$)("Card",t=>{let e=(0,b.TS)(t,{cardShadow:t.boxShadowCard,cardHeadPadding:t.padding,cardPaddingBase:t.paddingLG,cardActionsIconSize:t.fontSize,cardPaddingSM:12});return[t0(e),t1(e)]},t=>({headerBg:"transparent",headerFontSize:t.fontSizeLG,headerFontSizeSM:t.fontSize,headerHeight:t.fontSizeLG*t.lineHeightLG+2*t.padding,headerHeightSM:t.fontSize*t.lineHeight+2*t.paddingXS,actionsBg:t.colorBgContainer,actionsLiMargin:"".concat(t.paddingSM,"px 0"),tabsMarginBottom:-t.padding-t.lineWidth,extraColor:t.colorText})),t4=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n};let t5=t=>{let{prefixCls:e,actions:n=[]}=t;return a.createElement("ul",{className:"".concat(e,"-actions")},n.map((t,e)=>a.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(e)},a.createElement("span",null,t))))},t8=a.forwardRef((t,e)=>{let n;let{prefixCls:o,className:d,rootClassName:s,style:u,extra:b,headStyle:g={},bodyStyle:f={},title:p,loading:m,bordered:v=!0,size:h,type:y,cover:k,actions:x,tabList:w,children:S,activeTabKey:C,defaultActiveTabKey:E,tabBarExtraContent:O,hoverable:_,tabProps:j={}}=t,R=t4(t,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:Z,direction:T,card:N}=a.useContext(i.E_),z=a.useMemo(()=>{let t=!1;return a.Children.forEach(S,e=>{e&&e.type&&e.type===tF&&(t=!0)}),t},[S]),P=Z("card",o),[I,L,B]=t2(P),D=a.createElement(M,{loading:!0,active:!0,paragraph:{rows:4},title:!1},S),W=void 0!==C,q=Object.assign(Object.assign({},j),{[W?"activeKey":"defaultActiveKey"]:W?C:E,tabBarExtraContent:O}),G=(0,l.Z)(h),H=G&&"default"!==G?G:"large",A=w?a.createElement(tX,Object.assign({size:H},q,{className:"".concat(P,"-head-tabs"),onChange:e=>{var n;null===(n=t.onTabChange)||void 0===n||n.call(t,e)},items:w.map(t=>{var{tab:e}=t;return Object.assign({label:e},t4(t,["tab"]))})})):null;(p||b||A)&&(n=a.createElement("div",{className:"".concat(P,"-head"),style:g},a.createElement("div",{className:"".concat(P,"-head-wrapper")},p&&a.createElement("div",{className:"".concat(P,"-head-title")},p),b&&a.createElement("div",{className:"".concat(P,"-extra")},b)),A));let X=k?a.createElement("div",{className:"".concat(P,"-cover")},k):null,K=a.createElement("div",{className:"".concat(P,"-body"),style:f},m?D:S),F=x&&x.length?a.createElement(t5,{prefixCls:P,actions:x}):null,Y=(0,r.Z)(R,["onTabChange"]),V=c()(P,null==N?void 0:N.className,{["".concat(P,"-loading")]:m,["".concat(P,"-bordered")]:v,["".concat(P,"-hoverable")]:_,["".concat(P,"-contain-grid")]:z,["".concat(P,"-contain-tabs")]:w&&w.length,["".concat(P,"-").concat(G)]:G,["".concat(P,"-type-").concat(y)]:!!y,["".concat(P,"-rtl")]:"rtl"===T},d,s,L,B),Q=Object.assign(Object.assign({},null==N?void 0:N.style),u);return I(a.createElement("div",Object.assign({ref:e},Y,{className:V,style:Q}),n,X,K,F))});var t7=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n};t8.Grid=tF,t8.Meta=t=>{let{prefixCls:e,className:n,avatar:o,title:r,description:l}=t,d=t7(t,["prefixCls","className","avatar","title","description"]),{getPrefixCls:s}=a.useContext(i.E_),u=s("card",e),b=c()("".concat(u,"-meta"),n),g=o?a.createElement("div",{className:"".concat(u,"-meta-avatar")},o):null,f=r?a.createElement("div",{className:"".concat(u,"-meta-title")},r):null,p=l?a.createElement("div",{className:"".concat(u,"-meta-description")},l):null,m=f||p?a.createElement("div",{className:"".concat(u,"-meta-detail")},f,p):null;return a.createElement("div",Object.assign({},d,{className:b}),g,m)};var t6=t8},53410:function(t,e,n){var a=n(2265);let o=a.forwardRef(function(t,e){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});e.Z=o}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4292-3e30cf0761abb900.js b/litellm/proxy/_experimental/out/_next/static/chunks/4292-3e30cf0761abb900.js deleted file mode 100644 index a7e9a7f9a9..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/4292-3e30cf0761abb900.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4292],{84717:function(e,s,t){t.d(s,{Ct:function(){return a.Z},Dx:function(){return u.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return m.Z},rj:function(){return i.Z},td:function(){return c.Z},v0:function(){return d.Z},x4:function(){return o.Z},xv:function(){return x.Z},zx:function(){return l.Z}});var a=t(41649),l=t(20831),r=t(12514),i=t(67101),n=t(12485),d=t(18135),c=t(35242),o=t(29706),m=t(77991),x=t(84264),u=t(96761)},40728:function(e,s,t){t.d(s,{C:function(){return a.Z},x:function(){return l.Z}});var a=t(41649),l=t(84264)},16721:function(e,s,t){t.d(s,{Dx:function(){return d.Z},JX:function(){return l.Z},oi:function(){return n.Z},rj:function(){return r.Z},xv:function(){return i.Z},zx:function(){return a.Z}});var a=t(20831),l=t(49804),r=t(67101),i=t(84264),n=t(49566),d=t(96761)},64504:function(e,s,t){t.d(s,{o:function(){return l.Z},z:function(){return a.Z}});var a=t(20831),l=t(49566)},67479:function(e,s,t){var a=t(57437),l=t(2265),r=t(52787),i=t(19250);s.Z=e=>{let{onChange:s,value:t,className:n,accessToken:d,disabled:c}=e,[o,m]=(0,l.useState)([]),[x,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{(async()=>{if(d){u(!0);try{let e=await (0,i.getGuardrailsList)(d);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),m(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{u(!1)}}})()},[d]),(0,a.jsx)("div",{children:(0,a.jsx)(r.default,{mode:"multiple",disabled:c,placeholder:c?"Setting guardrails is a premium feature.":"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),s(e)},value:t,loading:x,className:n,options:o.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}},27799:function(e,s,t){var a=t(57437);t(2265);var l=t(40728),r=t(82182),i=t(91777),n=t(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:t=[],variant:d="card",className:c=""}=e,o=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[t,a]=s;return a===e}))||void 0===s?void 0:s[0])||e},m=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},x=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},u=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,a.jsx)(l.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var t;let i=o(e.callback_name),d=null===(t=n.Dg[i])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}):(0,a.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-blue-800",children:i}),(0,a.jsxs)(l.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,a.jsx)(l.C,{color:m(e.callback_type),size:"sm",children:x(e.callback_type)})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,a.jsx)(l.C,{color:"red",size:"xs",children:t.length})]}),t.length>0?(0,a.jsx)("div",{className:"space-y-3",children:t.map((e,s)=>{var t;let r=n.RD[e]||e,d=null===(t=n.Dg[r])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:r,className:"w-5 h-5 object-contain"}):(0,a.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-red-800",children:r}),(0,a.jsx)(l.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,a.jsx)(l.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(c),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,a.jsx)(l.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(c),children:[(0,a.jsx)(l.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),u]})}},98015:function(e,s,t){t.d(s,{Z:function(){return g}});var a=t(57437),l=t(2265),r=t(92280),i=t(40728),n=t(79814),d=t(19250),c=function(e){let{vectorStores:s,accessToken:t}=e,[r,c]=(0,l.useState)([]);(0,l.useEffect)(()=>{(async()=>{if(t&&0!==s.length)try{let e=await (0,d.vectorStoreListCall)(t);e.data&&c(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,s.length]);let o=e=>{let s=r.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:o(e)},s))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},o=t(25327),m=t(86462),x=t(47686),u=t(89970),h=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:c}=e,[h,g]=(0,l.useState)([]),[p,j]=(0,l.useState)([]),[v,b]=(0,l.useState)(new Set),y=e=>{b(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})};(0,l.useEffect)(()=>{(async()=>{if(c&&s.length>0)try{let e=await (0,d.fetchMCPServers)(c);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[c,s.length]),(0,l.useEffect)(()=>{(async()=>{if(c&&r.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(c));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[c,r.length]);let f=e=>{let s=h.find(s=>s.server_id===e);if(s){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(t,")")}return e},_=e=>e,N=[...s.map(e=>({type:"server",value:e})),...r.map(e=>({type:"accessGroup",value:e}))],k=N.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(o.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:k})]}),k>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let t="server"===e.type?n[e.value]:void 0,l=t&&t.length>0,r=v.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>l&&y(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(l?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(u.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:f(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),l&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:t.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===t.length?"tool":"tools"}),r?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),l&&r&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map((e,s)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(o.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:s,variant:t="card",className:l="",accessToken:i}=e,n=(null==s?void 0:s.vector_stores)||[],d=(null==s?void 0:s.mcp_servers)||[],o=(null==s?void 0:s.mcp_access_groups)||[],m=(null==s?void 0:s.mcp_tool_permissions)||{},x=(0,a.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(c,{vectorStores:n,accessToken:i}),(0,a.jsx)(h,{mcpServers:d,mcpAccessGroups:o,mcpToolPermissions:m,accessToken:i})]});return"card"===t?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),x]}):(0,a.jsxs)("div",{className:"".concat(l),children:[(0,a.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),x]})}},21425:function(e,s,t){var a=t(57437);t(2265);var l=t(54507);s.Z=e=>{let{value:s,onChange:t,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,a.jsx)(l.Z,{value:s,onChange:t,disabledCallbacks:r,onDisabledCallbacksChange:i})}},94292:function(e,s,t){t.d(s,{Z:function(){return q}});var a=t(57437),l=t(2265),r=t(84717),i=t(10900),n=t(23628),d=t(74998),c=t(19250),o=t(13634),m=t(73002),x=t(89970),u=t(9114),h=t(52787),g=t(64482),p=t(64504),j=t(30874),v=t(24199),b=t(97415),y=t(95920),f=t(68473),_=t(21425);let N=["logging"],k=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!N.includes(s)})):{},w=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],Z=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(k(e),null,s)};var S=t(97434),C=t(67479),A=t(62099),I=t(65895);function P(e){var s,t,r,i,n,d,u,N,k;let{keyData:P,onCancel:L,onSubmit:D,teams:M,accessToken:R,userID:E,userRole:T,premiumUser:F=!1}=e,[z]=o.Z.useForm(),[K,O]=(0,l.useState)([]),[U,V]=(0,l.useState)([]),G=null==M?void 0:M.find(e=>e.team_id===P.team_id),[B,J]=(0,l.useState)([]),[W,q]=(0,l.useState)([]),[$,Q]=(0,l.useState)(!1),[X,Y]=(0,l.useState)(Array.isArray(null===(s=P.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,S.PA)(P.metadata.litellm_disabled_callbacks):[]),[H,ee]=(0,l.useState)(P.auto_rotate||!1),[es,et]=(0,l.useState)(P.rotation_interval||"");(0,l.useEffect)(()=>{let e=async()=>{if(E&&T&&R)try{if(null===P.team_id){let e=(await (0,c.modelAvailableCall)(R,E,T)).data.map(e=>e.id);J(e)}else if(null==G?void 0:G.team_id){let e=await (0,j.wk)(E,T,R,G.team_id);J(Array.from(new Set([...G.models,...e])))}}catch(e){console.error("Error fetching models:",e)}};(async()=>{if(R)try{let e=await (0,c.getPromptsList)(R);V(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}})(),e()},[E,T,R,G,P.team_id]),(0,l.useEffect)(()=>{z.setFieldValue("disabled_callbacks",X)},[z,X]);let ea=e=>e&&({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||null,el={...P,token:P.token||P.token_id,budget_duration:ea(P.budget_duration),metadata:Z(P.metadata),guardrails:null===(t=P.metadata)||void 0===t?void 0:t.guardrails,prompts:null===(r=P.metadata)||void 0===r?void 0:r.prompts,vector_stores:(null===(i=P.object_permission)||void 0===i?void 0:i.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(n=P.object_permission)||void 0===n?void 0:n.mcp_servers)||[],accessGroups:(null===(d=P.object_permission)||void 0===d?void 0:d.mcp_access_groups)||[]},mcp_tool_permissions:(null===(u=P.object_permission)||void 0===u?void 0:u.mcp_tool_permissions)||{},logging_settings:w(P.metadata),disabled_callbacks:Array.isArray(null===(N=P.metadata)||void 0===N?void 0:N.litellm_disabled_callbacks)?(0,S.PA)(P.metadata.litellm_disabled_callbacks):[],auto_rotate:P.auto_rotate||!1,...P.rotation_interval&&{rotation_interval:P.rotation_interval}};return(0,l.useEffect)(()=>{var e,s,t,a,l,r,i;z.setFieldsValue({...P,token:P.token||P.token_id,budget_duration:ea(P.budget_duration),metadata:Z(P.metadata),guardrails:null===(e=P.metadata)||void 0===e?void 0:e.guardrails,prompts:null===(s=P.metadata)||void 0===s?void 0:s.prompts,vector_stores:(null===(t=P.object_permission)||void 0===t?void 0:t.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=P.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(l=P.object_permission)||void 0===l?void 0:l.mcp_access_groups)||[]},mcp_tool_permissions:(null===(r=P.object_permission)||void 0===r?void 0:r.mcp_tool_permissions)||{},logging_settings:w(P.metadata),disabled_callbacks:Array.isArray(null===(i=P.metadata)||void 0===i?void 0:i.litellm_disabled_callbacks)?(0,S.PA)(P.metadata.litellm_disabled_callbacks):[],auto_rotate:P.auto_rotate||!1,...P.rotation_interval&&{rotation_interval:P.rotation_interval}})},[P,z]),(0,l.useEffect)(()=>{z.setFieldValue("auto_rotate",H)},[H,z]),(0,l.useEffect)(()=>{es&&z.setFieldValue("rotation_interval",es)},[es,z]),console.log("premiumUser:",F),(0,a.jsxs)(o.Z,{form:z,onFinish:D,initialValues:el,layout:"vertical",children:[(0,a.jsx)(o.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,a.jsx)(p.o,{})}),(0,a.jsx)(o.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(h.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[B.length>0&&(0,a.jsx)(h.default.Option,{value:"all-team-models",children:"All Team Models"}),B.map(e=>(0,a.jsx)(h.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(o.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(v.Z,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,a.jsx)(o.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(h.default,{placeholder:"n/a",children:[(0,a.jsx)(h.default.Option,{value:"daily",children:"Daily"}),(0,a.jsx)(h.default.Option,{value:"weekly",children:"Weekly"}),(0,a.jsx)(h.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,a.jsx)(o.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(I.Z,{type:"tpm",name:"tpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(o.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(I.Z,{type:"rpm",name:"rpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(o.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(o.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,a.jsx)(g.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(o.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,a.jsx)(g.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(o.Z.Item,{label:"Guardrails",name:"guardrails",children:R&&(0,a.jsx)(C.Z,{onChange:e=>{z.setFieldValue("guardrails",e)},accessToken:R,disabled:!F})}),(0,a.jsx)(o.Z.Item,{label:"Prompts",name:"prompts",children:(0,a.jsx)(x.Z,{title:F?"":"Setting prompts by key is a premium feature",placement:"top",children:(0,a.jsx)(h.default,{mode:"tags",style:{width:"100%"},disabled:!F,placeholder:F?Array.isArray(null===(k=P.metadata)||void 0===k?void 0:k.prompts)&&P.metadata.prompts.length>0?"Current: ".concat(P.metadata.prompts.join(", ")):"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:U.map(e=>({value:e,label:e}))})})}),(0,a.jsx)(o.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,a.jsx)(b.Z,{onChange:e=>z.setFieldValue("vector_stores",e),value:z.getFieldValue("vector_stores"),accessToken:R||"",placeholder:"Select vector stores"})}),(0,a.jsx)(o.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,a.jsx)(y.Z,{onChange:e=>z.setFieldValue("mcp_servers_and_groups",e),value:z.getFieldValue("mcp_servers_and_groups"),accessToken:R||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(o.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(g.default,{type:"hidden"})}),(0,a.jsx)(o.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.mcp_servers_and_groups!==s.mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)(f.Z,{accessToken:R||"",selectedServers:(null===(e=z.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:z.getFieldValue("mcp_tool_permissions")||{},onChange:e=>z.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,a.jsx)(o.Z.Item,{label:"Team ID",name:"team_id",children:(0,a.jsx)(h.default,{placeholder:"Select team",style:{width:"100%"},children:null==M?void 0:M.map(e=>(0,a.jsx)(h.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,a.jsx)(o.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,a.jsx)(_.Z,{value:z.getFieldValue("logging_settings"),onChange:e=>z.setFieldValue("logging_settings",e),disabledCallbacks:X,onDisabledCallbacksChange:e=>{Y((0,S.PA)(e)),z.setFieldValue("disabled_callbacks",e)}})}),(0,a.jsx)(o.Z.Item,{label:"Metadata",name:"metadata",children:(0,a.jsx)(g.default.TextArea,{rows:10})}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(A.Z,{form:z,autoRotationEnabled:H,onAutoRotationChange:ee,rotationInterval:es,onRotationIntervalChange:et})}),(0,a.jsx)(o.Z.Item,{name:"token",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(o.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(o.Z.Item,{name:"auto_rotate",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(o.Z.Item,{name:"rotation_interval",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,a.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,a.jsx)(m.ZP,{onClick:L,children:"Cancel"}),(0,a.jsx)(p.z,{type:"submit",children:"Save Changes"})]})})]})}var L=t(16721),D=t(82680),M=t(20577),R=t(7366),E=t(29233);function T(e){let{selectedToken:s,visible:t,onClose:r,accessToken:i,premiumUser:n,setAccessToken:d,onKeyUpdate:m}=e,[x]=o.Z.useForm(),[h,g]=(0,l.useState)(null),[p,j]=(0,l.useState)(null),[v,b]=(0,l.useState)(null),[y,f]=(0,l.useState)(!1),[_,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{t&&s&&i&&(x.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),w(i),N(s.key_name===i))},[t,s,x,i]),(0,l.useEffect)(()=>{t||(g(null),f(!1),N(!1),w(null),x.resetFields())},[t,x]);let Z=e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,R.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,R.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,R.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,l.useEffect)(()=>{(null==p?void 0:p.duration)?b(Z(p.duration)):b(null)},[null==p?void 0:p.duration]);let S=async()=>{if(s&&k){f(!0);try{let e=await x.validateFields(),t=await (0,c.regenerateKeyCall)(k,s.token||s.token_id,e);g(t.key),u.Z.success("API Key regenerated successfully"),console.log("Full regenerate response:",t);let a={token:t.token||t.key_id||s.token,key_name:t.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?Z(e.duration):s.expires,...t};console.log("Updated key data with new token:",a),_&&(w(t.key),d&&d(t.key)),m&&m(a),f(!1)}catch(e){console.error("Error regenerating key:",e),u.Z.fromBackend(e),f(!1)}}},C=()=>{g(null),f(!1),N(!1),w(null),x.resetFields(),r()};return(0,a.jsx)(D.Z,{title:"Regenerate API Key",open:t,onCancel:C,footer:h?[(0,a.jsx)(L.zx,{onClick:C,children:"Close"},"close")]:[(0,a.jsx)(L.zx,{onClick:C,className:"mr-2",children:"Cancel"},"cancel"),(0,a.jsx)(L.zx,{onClick:S,disabled:y,children:y?"Regenerating...":"Regenerate"},"regenerate")],children:h?(0,a.jsxs)(L.rj,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(L.Dx,{children:"Regenerated Key"}),(0,a.jsx)(L.JX,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons,"," ",(0,a.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,a.jsxs)(L.JX,{numColSpan:1,children:[(0,a.jsx)(L.xv,{className:"mt-3",children:"Key Alias:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,a.jsx)(L.xv,{className:"mt-3",children:"New API Key:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:h})}),(0,a.jsx)(E.CopyToClipboard,{text:h,onCopy:()=>u.Z.success("API Key copied to clipboard"),children:(0,a.jsx)(L.zx,{className:"mt-3",children:"Copy API Key"})})]})]}):(0,a.jsxs)(o.Z,{form:x,layout:"vertical",onValuesChange:e=>{"duration"in e&&j(s=>({...s,duration:e.duration}))},children:[(0,a.jsx)(o.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,a.jsx)(L.oi,{disabled:!0})}),(0,a.jsx)(o.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,a.jsx)(M.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,a.jsx)(o.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,a.jsx)(M.Z,{style:{width:"100%"}})}),(0,a.jsx)(o.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,a.jsx)(M.Z,{style:{width:"100%"}})}),(0,a.jsx)(o.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,a.jsx)(L.oi,{placeholder:""})}),(0,a.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry: ",(null==s?void 0:s.expires)?new Date(s.expires).toLocaleString():"Never"]}),v&&(0,a.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",v]})]})})}var F=t(20347),z=t(98015),K=t(27799),O=t(59872),U=t(30401),V=t(78867),G=t(85968),B=t(40728),J=t(58710),W=e=>{let{autoRotate:s=!1,rotationInterval:t,lastRotationAt:l,keyRotationAt:r,nextRotationAt:i,variant:d="card",className:c=""}=e,o=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)},m=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(B.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(B.C,{color:s?"green":"gray",size:"xs",children:s?"Enabled":"Disabled"}),s&&t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(B.x,{className:"text-gray-400",children:"•"}),(0,a.jsxs)(B.x,{className:"text-sm text-gray-600",children:["Every ",t]})]})]})}),(s||l||r||i)&&(0,a.jsxs)("div",{className:"space-y-3",children:[l&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(J.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(B.x,{className:"font-medium text-gray-700",children:"Last Rotation"}),(0,a.jsx)(B.x,{className:"text-sm text-gray-600",children:o(l)})]})]}),(r||i)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(J.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(B.x,{className:"font-medium text-gray-700",children:"Next Scheduled Rotation"}),(0,a.jsx)(B.x,{className:"text-sm text-gray-600",children:o(i||r||"")})]})]}),s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(J.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsx)(B.x,{className:"text-gray-600",children:"No rotation history available"})]})]}),!s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(n.Z,{className:"w-4 h-4 text-gray-400"}),(0,a.jsx)(B.x,{className:"text-gray-600",children:"Auto-rotation is not enabled for this key"})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(c),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(B.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(B.x,{className:"text-xs text-gray-500",children:"Automatic key rotation settings and status for this key"})]})}),m]}):(0,a.jsxs)("div",{className:"".concat(c),children:[(0,a.jsx)(B.x,{className:"font-medium text-gray-900 mb-3",children:"Auto-Rotation"}),m]})};function q(e){var s,t,h,g,p;let{keyId:j,onClose:v,keyData:b,accessToken:y,userID:f,userRole:_,teams:N,onKeyDataUpdate:k,onDelete:C,premiumUser:A,setAccessToken:I,backButtonText:L="Back to Keys"}=e,[D,M]=(0,l.useState)(!1),[R]=o.Z.useForm(),[E,B]=(0,l.useState)(!1),[J,q]=(0,l.useState)(""),[$,Q]=(0,l.useState)(!1),[X,Y]=(0,l.useState)({}),[H,ee]=(0,l.useState)(b),[es,et]=(0,l.useState)(null),[ea,el]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{b&&ee(b)},[b]),(0,l.useEffect)(()=>{if(ea){let e=setTimeout(()=>{el(!1)},5e3);return()=>clearTimeout(e)}},[ea]),!H)return(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(r.zx,{icon:i.Z,variant:"light",onClick:v,className:"mb-4",children:L}),(0,a.jsx)(r.xv,{children:"Key not found"})]});let er=async e=>{try{var s,t,a,l;if(!y)return;let r=e.token;if(e.key=r,A||(delete e.guardrails,delete e.prompts),void 0!==e.vector_stores&&(e.object_permission={...H.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...H.object_permission,mcp_servers:s||[],mcp_access_groups:t||[]},delete e.mcp_servers_and_groups}if(void 0!==e.mcp_tool_permissions){let s=e.mcp_tool_permissions||{};Object.keys(s).length>0&&(e.object_permission={...e.object_permission,mcp_tool_permissions:s}),delete e.mcp_tool_permissions}if(e.metadata&&"string"==typeof e.metadata)try{let a=JSON.parse(e.metadata);e.metadata={...a,...(null===(s=e.guardrails)||void 0===s?void 0:s.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(t=e.disabled_callbacks)||void 0===t?void 0:t.length)>0?{litellm_disabled_callbacks:(0,S.Z3)(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),u.Z.error("Invalid metadata JSON");return}else e.metadata={...e.metadata||{},...(null===(a=e.guardrails)||void 0===a?void 0:a.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(l=e.disabled_callbacks)||void 0===l?void 0:l.length)>0?{litellm_disabled_callbacks:(0,S.Z3)(e.disabled_callbacks)}:{}};delete e.logging_settings,e.budget_duration&&(e.budget_duration=({daily:"24h",weekly:"7d",monthly:"30d"})[e.budget_duration]);let i=await (0,c.keyUpdateCall)(y,e);ee(e=>e?{...e,...i}:void 0),k&&k(i),u.Z.success("Key updated successfully"),M(!1)}catch(e){u.Z.fromBackend((0,G.O)(e)),console.error("Error updating key:",e)}},ei=async()=>{try{if(!y)return;await (0,c.keyDeleteCall)(y,H.token||H.token_id),u.Z.success("Key deleted successfully"),C&&C(),v()}catch(e){console.error("Error deleting the key:",e),u.Z.fromBackend(e)}q("")},en=async(e,s)=>{await (0,O.vQ)(e)&&(Y(e=>({...e,[s]:!0})),setTimeout(()=>{Y(e=>({...e,[s]:!1}))},2e3))},ed=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)};return(0,a.jsxs)("div",{className:"w-full h-screen p-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.zx,{icon:i.Z,variant:"light",onClick:v,className:"mb-4",children:L}),(0,a.jsx)(r.Dx,{children:H.key_alias||"API Key"}),(0,a.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,a.jsx)(r.xv,{className:"text-gray-500 font-mono text-sm",children:H.token_id||H.token})]}),(0,a.jsx)(m.ZP,{type:"text",size:"small",icon:X["key-id"]?(0,a.jsx)(U.Z,{size:12}):(0,a.jsx)(V.Z,{size:12}),onClick:()=>en(H.token_id||H.token,"key-id"),className:"ml-2 transition-all duration-200".concat(X["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)(r.xv,{className:"text-sm text-gray-500",children:H.updated_at&&H.updated_at!==H.created_at?"Updated: ".concat(ed(H.updated_at)):"Created: ".concat(ed(H.created_at))}),ea&&(0,a.jsx)(r.Ct,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),es&&(0,a.jsx)(r.Ct,{color:"blue",size:"xs",children:"Regenerated"})]})]}),_&&F.LQ.includes(_)&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Z,{title:A?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,a.jsx)("span",{className:"inline-block",children:(0,a.jsx)(r.zx,{icon:n.Z,variant:"secondary",onClick:()=>Q(!0),className:"flex items-center",disabled:!A,children:"Regenerate Key"})})}),(0,a.jsx)(r.zx,{icon:d.Z,variant:"secondary",onClick:()=>B(!0),className:"flex items-center",children:"Delete Key"})]})]}),(0,a.jsx)(T,{selectedToken:H,visible:$,onClose:()=>Q(!1),accessToken:y,premiumUser:A,setAccessToken:I,onKeyUpdate:e=>{ee(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),et(new Date),el(!0),k&&k({...e,created_at:new Date().toLocaleString()})}}),E&&(()=>{let e=(null==H?void 0:H.key_alias)||(null==H?void 0:H.token_id)||"API Key",s=J===e;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Key"}),(0,a.jsx)("button",{onClick:()=>{B(!1),q("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsxs)("div",{className:"px-6 py-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,a.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-medium text-red-600",children:"Warning: You are about to delete this API key."}),(0,a.jsx)("p",{className:"text-base text-red-600 mt-2",children:"This action is irreversible and will immediately revoke access for any applications using this key."})]})]}),(0,a.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to delete this API key?"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,a.jsx)("span",{className:"underline",children:e})," to confirm deletion:"]}),(0,a.jsx)("input",{type:"text",value:J,onChange:e=>q(e.target.value),placeholder:"Enter key name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,a.jsx)("button",{onClick:()=>{B(!1),q("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,a.jsx)("button",{onClick:ei,disabled:!s,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(s?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Delete Key"})]})]})})})(),(0,a.jsxs)(r.v0,{children:[(0,a.jsxs)(r.td,{className:"mb-4",children:[(0,a.jsx)(r.OK,{children:"Overview"}),(0,a.jsx)(r.OK,{children:"Settings"})]}),(0,a.jsxs)(r.nP,{children:[(0,a.jsx)(r.x4,{children:(0,a.jsxs)(r.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Spend"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(r.Dx,{children:["$",(0,O.pw)(H.spend,4)]}),(0,a.jsxs)(r.xv,{children:["of"," ",null!==H.max_budget?"$".concat((0,O.pw)(H.max_budget)):"Unlimited"]})]})]}),(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Rate Limits"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(r.xv,{children:["TPM: ",null!==H.tpm_limit?H.tpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["RPM: ",null!==H.rpm_limit?H.rpm_limit:"Unlimited"]})]})]}),(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Models"}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:H.models&&H.models.length>0?H.models.map((e,s)=>(0,a.jsx)(r.Ct,{color:"red",children:e},s)):(0,a.jsx)(r.xv,{children:"No models specified"})})]}),(0,a.jsx)(r.Zb,{children:(0,a.jsx)(z.Z,{objectPermission:H.object_permission,variant:"inline",accessToken:y})}),(0,a.jsx)(K.Z,{loggingConfigs:w(H.metadata),disabledCallbacks:Array.isArray(null===(s=H.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,S.PA)(H.metadata.litellm_disabled_callbacks):[],variant:"card"}),(0,a.jsx)(W,{autoRotate:H.auto_rotate,rotationInterval:H.rotation_interval,lastRotationAt:H.last_rotation_at,keyRotationAt:H.key_rotation_at,nextRotationAt:H.next_rotation_at,variant:"card"})]})}),(0,a.jsx)(r.x4,{children:(0,a.jsxs)(r.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(r.Dx,{children:"Key Settings"}),!D&&_&&F.LQ.includes(_)&&(0,a.jsx)(r.zx,{variant:"light",onClick:()=>M(!0),children:"Edit Settings"})]}),D?(0,a.jsx)(P,{keyData:H,onCancel:()=>M(!1),onSubmit:er,teams:N,accessToken:y,userID:f,userRole:_,premiumUser:A}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Key ID"}),(0,a.jsx)(r.xv,{className:"font-mono",children:H.token_id||H.token})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Key Alias"}),(0,a.jsx)(r.xv,{children:H.key_alias||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Secret Key"}),(0,a.jsx)(r.xv,{className:"font-mono",children:H.key_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Team ID"}),(0,a.jsx)(r.xv,{children:H.team_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Organization"}),(0,a.jsx)(r.xv,{children:H.organization_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created"}),(0,a.jsx)(r.xv,{children:ed(H.created_at)})]}),es&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Last Regenerated"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.xv,{children:ed(es)}),(0,a.jsx)(r.Ct,{color:"green",size:"xs",children:"Recent"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Expires"}),(0,a.jsx)(r.xv,{children:H.expires?ed(H.expires):"Never"})]}),(0,a.jsx)(W,{autoRotate:H.auto_rotate,rotationInterval:H.rotation_interval,lastRotationAt:H.last_rotation_at,keyRotationAt:H.key_rotation_at,nextRotationAt:H.next_rotation_at,variant:"inline",className:"pt-4 border-t border-gray-200"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Spend"}),(0,a.jsxs)(r.xv,{children:["$",(0,O.pw)(H.spend,4)," USD"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Budget"}),(0,a.jsx)(r.xv,{children:null!==H.max_budget?"$".concat((0,O.pw)(H.max_budget,2)):"Unlimited"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Prompts"}),(0,a.jsx)(r.xv,{children:Array.isArray(null===(t=H.metadata)||void 0===t?void 0:t.prompts)&&H.metadata.prompts.length>0?H.metadata.prompts.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No prompts specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Models"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:H.models&&H.models.length>0?H.models.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,a.jsx)(r.xv,{children:"No models specified"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Rate Limits"}),(0,a.jsxs)(r.xv,{children:["TPM: ",null!==H.tpm_limit?H.tpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["RPM: ",null!==H.rpm_limit?H.rpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Max Parallel Requests:"," ",null!==H.max_parallel_requests?H.max_parallel_requests:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Model TPM Limits:"," ",(null===(h=H.metadata)||void 0===h?void 0:h.model_tpm_limit)?JSON.stringify(H.metadata.model_tpm_limit):"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Model RPM Limits:"," ",(null===(g=H.metadata)||void 0===g?void 0:g.model_rpm_limit)?JSON.stringify(H.metadata.model_rpm_limit):"Unlimited"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Metadata"}),(0,a.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:Z(H.metadata)})]}),(0,a.jsx)(z.Z,{objectPermission:H.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:y}),(0,a.jsx)(K.Z,{loggingConfigs:w(H.metadata),disabledCallbacks:Array.isArray(null===(p=H.metadata)||void 0===p?void 0:p.litellm_disabled_callbacks)?(0,S.PA)(H.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/4292-c9a41dd3c8f6925a.js b/litellm/proxy/_experimental/out/_next/static/chunks/4292-a1bc4327d9a3d829.js similarity index 65% rename from ui/litellm-dashboard/out/_next/static/chunks/4292-c9a41dd3c8f6925a.js rename to litellm/proxy/_experimental/out/_next/static/chunks/4292-a1bc4327d9a3d829.js index da4d38fa90..f937a387be 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/4292-c9a41dd3c8f6925a.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/4292-a1bc4327d9a3d829.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4292],{84717:function(e,s,t){t.d(s,{Ct:function(){return a.Z},Dx:function(){return u.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return m.Z},rj:function(){return i.Z},td:function(){return o.Z},v0:function(){return d.Z},x4:function(){return c.Z},xv:function(){return x.Z},zx:function(){return l.Z}});var a=t(41649),l=t(20831),r=t(12514),i=t(67101),n=t(12485),d=t(18135),o=t(35242),c=t(29706),m=t(77991),x=t(84264),u=t(96761)},40728:function(e,s,t){t.d(s,{C:function(){return a.Z},x:function(){return l.Z}});var a=t(41649),l=t(84264)},16721:function(e,s,t){t.d(s,{Dx:function(){return d.Z},JX:function(){return l.Z},oi:function(){return n.Z},rj:function(){return r.Z},xv:function(){return i.Z},zx:function(){return a.Z}});var a=t(20831),l=t(49804),r=t(67101),i=t(84264),n=t(49566),d=t(96761)},64504:function(e,s,t){t.d(s,{o:function(){return l.Z},z:function(){return a.Z}});var a=t(20831),l=t(49566)},67479:function(e,s,t){var a=t(57437),l=t(2265),r=t(52787),i=t(19250);s.Z=e=>{let{onChange:s,value:t,className:n,accessToken:d,disabled:o}=e,[c,m]=(0,l.useState)([]),[x,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{(async()=>{if(d){u(!0);try{let e=await (0,i.getGuardrailsList)(d);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),m(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{u(!1)}}})()},[d]),(0,a.jsx)("div",{children:(0,a.jsx)(r.default,{mode:"multiple",disabled:o,placeholder:o?"Setting guardrails is a premium feature.":"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),s(e)},value:t,loading:x,className:n,options:c.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}},27799:function(e,s,t){var a=t(57437);t(2265);var l=t(40728),r=t(82182),i=t(91777),n=t(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:t=[],variant:d="card",className:o=""}=e,c=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[t,a]=s;return a===e}))||void 0===s?void 0:s[0])||e},m=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},x=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},u=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,a.jsx)(l.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var t;let i=c(e.callback_name),d=null===(t=n.Dg[i])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}):(0,a.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-blue-800",children:i}),(0,a.jsxs)(l.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,a.jsx)(l.C,{color:m(e.callback_type),size:"sm",children:x(e.callback_type)})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,a.jsx)(l.C,{color:"red",size:"xs",children:t.length})]}),t.length>0?(0,a.jsx)("div",{className:"space-y-3",children:t.map((e,s)=>{var t;let r=n.RD[e]||e,d=null===(t=n.Dg[r])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:r,className:"w-5 h-5 object-contain"}):(0,a.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-red-800",children:r}),(0,a.jsx)(l.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,a.jsx)(l.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,a.jsx)(l.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(l.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),u]})}},98015:function(e,s,t){t.d(s,{Z:function(){return g}});var a=t(57437),l=t(2265),r=t(92280),i=t(40728),n=t(79814),d=t(19250),o=function(e){let{vectorStores:s,accessToken:t}=e,[r,o]=(0,l.useState)([]);(0,l.useEffect)(()=>{(async()=>{if(t&&0!==s.length)try{let e=await (0,d.vectorStoreListCall)(t);e.data&&o(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,s.length]);let c=e=>{let s=r.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:c(e)},s))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},c=t(25327),m=t(86462),x=t(47686),u=t(89970),h=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:o}=e,[h,g]=(0,l.useState)([]),[p,j]=(0,l.useState)([]),[v,b]=(0,l.useState)(new Set),y=e=>{b(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})};(0,l.useEffect)(()=>{(async()=>{if(o&&s.length>0)try{let e=await (0,d.fetchMCPServers)(o);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[o,s.length]),(0,l.useEffect)(()=>{(async()=>{if(o&&r.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(o));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let _=e=>{let s=h.find(s=>s.server_id===e);if(s){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(t,")")}return e},f=e=>e,N=[...s.map(e=>({type:"server",value:e})),...r.map(e=>({type:"accessGroup",value:e}))],k=N.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:k})]}),k>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let t="server"===e.type?n[e.value]:void 0,l=t&&t.length>0,r=v.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>l&&y(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(l?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(u.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:f(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),l&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:t.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===t.length?"tool":"tools"}),r?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),l&&r&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map((e,s)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(c.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:s,variant:t="card",className:l="",accessToken:i}=e,n=(null==s?void 0:s.vector_stores)||[],d=(null==s?void 0:s.mcp_servers)||[],c=(null==s?void 0:s.mcp_access_groups)||[],m=(null==s?void 0:s.mcp_tool_permissions)||{},x=(0,a.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(o,{vectorStores:n,accessToken:i}),(0,a.jsx)(h,{mcpServers:d,mcpAccessGroups:c,mcpToolPermissions:m,accessToken:i})]});return"card"===t?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),x]}):(0,a.jsxs)("div",{className:"".concat(l),children:[(0,a.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),x]})}},21425:function(e,s,t){var a=t(57437);t(2265);var l=t(54507);s.Z=e=>{let{value:s,onChange:t,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,a.jsx)(l.Z,{value:s,onChange:t,disabledCallbacks:r,onDisabledCallbacksChange:i})}},94292:function(e,s,t){t.d(s,{Z:function(){return $}});var a=t(57437),l=t(2265),r=t(84717),i=t(10900),n=t(23628),d=t(74998),o=t(19250),c=t(13634),m=t(73002),x=t(89970),u=t(9114),h=t(52787),g=t(64482),p=t(64504),j=t(30874),v=t(24199),b=t(97415),y=t(95920),_=t(68473),f=t(21425);let N=["logging"],k=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!N.includes(s)})):{},w=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],Z=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(k(e),null,s)};var S=t(97434),C=t(67479),A=t(62099),I=t(65895),P=t(95096);function L(e){var s,t,r,i,n,d,u,N,k,L;let{keyData:D,onCancel:M,onSubmit:R,teams:T,accessToken:E,userID:F,userRole:z,premiumUser:K=!1}=e,[O]=c.Z.useForm(),[U,V]=(0,l.useState)([]),[G,B]=(0,l.useState)([]),J=null==T?void 0:T.find(e=>e.team_id===D.team_id),[W,q]=(0,l.useState)([]),[$,Q]=(0,l.useState)([]),[X,Y]=(0,l.useState)(!1),[H,ee]=(0,l.useState)(Array.isArray(null===(s=D.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,S.PA)(D.metadata.litellm_disabled_callbacks):[]),[es,et]=(0,l.useState)(D.auto_rotate||!1),[ea,el]=(0,l.useState)(D.rotation_interval||"");(0,l.useEffect)(()=>{let e=async()=>{if(F&&z&&E)try{if(null===D.team_id){let e=(await (0,o.modelAvailableCall)(E,F,z)).data.map(e=>e.id);q(e)}else if(null==J?void 0:J.team_id){let e=await (0,j.wk)(F,z,E,J.team_id);q(Array.from(new Set([...J.models,...e])))}}catch(e){console.error("Error fetching models:",e)}};(async()=>{if(E)try{let e=await (0,o.getPromptsList)(E);B(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}})(),e()},[F,z,E,J,D.team_id]),(0,l.useEffect)(()=>{O.setFieldValue("disabled_callbacks",H)},[O,H]);let er=e=>e&&({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||null,ei={...D,token:D.token||D.token_id,budget_duration:er(D.budget_duration),metadata:Z(D.metadata),guardrails:null===(t=D.metadata)||void 0===t?void 0:t.guardrails,prompts:null===(r=D.metadata)||void 0===r?void 0:r.prompts,vector_stores:(null===(i=D.object_permission)||void 0===i?void 0:i.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(n=D.object_permission)||void 0===n?void 0:n.mcp_servers)||[],accessGroups:(null===(d=D.object_permission)||void 0===d?void 0:d.mcp_access_groups)||[]},mcp_tool_permissions:(null===(u=D.object_permission)||void 0===u?void 0:u.mcp_tool_permissions)||{},logging_settings:w(D.metadata),disabled_callbacks:Array.isArray(null===(N=D.metadata)||void 0===N?void 0:N.litellm_disabled_callbacks)?(0,S.PA)(D.metadata.litellm_disabled_callbacks):[],auto_rotate:D.auto_rotate||!1,...D.rotation_interval&&{rotation_interval:D.rotation_interval}};return(0,l.useEffect)(()=>{var e,s,t,a,l,r,i;O.setFieldsValue({...D,token:D.token||D.token_id,budget_duration:er(D.budget_duration),metadata:Z(D.metadata),guardrails:null===(e=D.metadata)||void 0===e?void 0:e.guardrails,prompts:null===(s=D.metadata)||void 0===s?void 0:s.prompts,vector_stores:(null===(t=D.object_permission)||void 0===t?void 0:t.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=D.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(l=D.object_permission)||void 0===l?void 0:l.mcp_access_groups)||[]},mcp_tool_permissions:(null===(r=D.object_permission)||void 0===r?void 0:r.mcp_tool_permissions)||{},logging_settings:w(D.metadata),disabled_callbacks:Array.isArray(null===(i=D.metadata)||void 0===i?void 0:i.litellm_disabled_callbacks)?(0,S.PA)(D.metadata.litellm_disabled_callbacks):[],auto_rotate:D.auto_rotate||!1,...D.rotation_interval&&{rotation_interval:D.rotation_interval}})},[D,O]),(0,l.useEffect)(()=>{O.setFieldValue("auto_rotate",es)},[es,O]),(0,l.useEffect)(()=>{ea&&O.setFieldValue("rotation_interval",ea)},[ea,O]),console.log("premiumUser:",K),(0,a.jsxs)(c.Z,{form:O,onFinish:R,initialValues:ei,layout:"vertical",children:[(0,a.jsx)(c.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,a.jsx)(p.o,{})}),(0,a.jsx)(c.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(h.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[W.length>0&&(0,a.jsx)(h.default.Option,{value:"all-team-models",children:"All Team Models"}),W.map(e=>(0,a.jsx)(h.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(v.Z,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,a.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(h.default,{placeholder:"n/a",children:[(0,a.jsx)(h.default.Option,{value:"daily",children:"Daily"}),(0,a.jsx)(h.default.Option,{value:"weekly",children:"Weekly"}),(0,a.jsx)(h.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,a.jsx)(c.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(I.Z,{type:"tpm",name:"tpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(c.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(I.Z,{type:"rpm",name:"rpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(c.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(c.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,a.jsx)(g.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(c.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,a.jsx)(g.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(c.Z.Item,{label:"Guardrails",name:"guardrails",children:E&&(0,a.jsx)(C.Z,{onChange:e=>{O.setFieldValue("guardrails",e)},accessToken:E,disabled:!K})}),(0,a.jsx)(c.Z.Item,{label:"Prompts",name:"prompts",children:(0,a.jsx)(x.Z,{title:K?"":"Setting prompts by key is a premium feature",placement:"top",children:(0,a.jsx)(h.default,{mode:"tags",style:{width:"100%"},disabled:!K,placeholder:K?Array.isArray(null===(k=D.metadata)||void 0===k?void 0:k.prompts)&&D.metadata.prompts.length>0?"Current: ".concat(D.metadata.prompts.join(", ")):"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:G.map(e=>({value:e,label:e}))})})}),(0,a.jsx)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,a.jsx)(x.Z,{title:K?"":"Setting allowed pass through routes by key is a premium feature",placement:"top",children:(0,a.jsx)(P.Z,{onChange:e=>O.setFieldValue("allowed_passthrough_routes",e),value:O.getFieldValue("allowed_passthrough_routes"),accessToken:E||"",placeholder:K?Array.isArray(null===(L=D.metadata)||void 0===L?void 0:L.allowed_passthrough_routes)&&D.metadata.allowed_passthrough_routes.length>0?"Current: ".concat(D.metadata.allowed_passthrough_routes.join(", ")):"Select or enter allowed pass through routes":"Premium feature - Upgrade to set allowed pass through routes by key",disabled:!K})})}),(0,a.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,a.jsx)(b.Z,{onChange:e=>O.setFieldValue("vector_stores",e),value:O.getFieldValue("vector_stores"),accessToken:E||"",placeholder:"Select vector stores"})}),(0,a.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,a.jsx)(y.Z,{onChange:e=>O.setFieldValue("mcp_servers_and_groups",e),value:O.getFieldValue("mcp_servers_and_groups"),accessToken:E||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(g.default,{type:"hidden"})}),(0,a.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.mcp_servers_and_groups!==s.mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)(_.Z,{accessToken:E||"",selectedServers:(null===(e=O.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:O.getFieldValue("mcp_tool_permissions")||{},onChange:e=>O.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,a.jsx)(c.Z.Item,{label:"Team ID",name:"team_id",children:(0,a.jsx)(h.default,{placeholder:"Select team",style:{width:"100%"},children:null==T?void 0:T.map(e=>(0,a.jsx)(h.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,a.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,a.jsx)(f.Z,{value:O.getFieldValue("logging_settings"),onChange:e=>O.setFieldValue("logging_settings",e),disabledCallbacks:H,onDisabledCallbacksChange:e=>{ee((0,S.PA)(e)),O.setFieldValue("disabled_callbacks",e)}})}),(0,a.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,a.jsx)(g.default.TextArea,{rows:10})}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(A.Z,{form:O,autoRotationEnabled:es,onAutoRotationChange:et,rotationInterval:ea,onRotationIntervalChange:el})}),(0,a.jsx)(c.Z.Item,{name:"token",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(c.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(c.Z.Item,{name:"auto_rotate",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(c.Z.Item,{name:"rotation_interval",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,a.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,a.jsx)(m.ZP,{onClick:M,children:"Cancel"}),(0,a.jsx)(p.z,{type:"submit",children:"Save Changes"})]})})]})}var D=t(16721),M=t(82680),R=t(20577),T=t(7366),E=t(29233);function F(e){let{selectedToken:s,visible:t,onClose:r,accessToken:i,premiumUser:n,setAccessToken:d,onKeyUpdate:m}=e,[x]=c.Z.useForm(),[h,g]=(0,l.useState)(null),[p,j]=(0,l.useState)(null),[v,b]=(0,l.useState)(null),[y,_]=(0,l.useState)(!1),[f,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{t&&s&&i&&(x.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),w(i),N(s.key_name===i))},[t,s,x,i]),(0,l.useEffect)(()=>{t||(g(null),_(!1),N(!1),w(null),x.resetFields())},[t,x]);let Z=e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,T.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,T.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,T.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,l.useEffect)(()=>{(null==p?void 0:p.duration)?b(Z(p.duration)):b(null)},[null==p?void 0:p.duration]);let S=async()=>{if(s&&k){_(!0);try{let e=await x.validateFields(),t=await (0,o.regenerateKeyCall)(k,s.token||s.token_id,e);g(t.key),u.Z.success("API Key regenerated successfully"),console.log("Full regenerate response:",t);let a={token:t.token||t.key_id||s.token,key_name:t.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?Z(e.duration):s.expires,...t};console.log("Updated key data with new token:",a),f&&(w(t.key),d&&d(t.key)),m&&m(a),_(!1)}catch(e){console.error("Error regenerating key:",e),u.Z.fromBackend(e),_(!1)}}},C=()=>{g(null),_(!1),N(!1),w(null),x.resetFields(),r()};return(0,a.jsx)(M.Z,{title:"Regenerate API Key",open:t,onCancel:C,footer:h?[(0,a.jsx)(D.zx,{onClick:C,children:"Close"},"close")]:[(0,a.jsx)(D.zx,{onClick:C,className:"mr-2",children:"Cancel"},"cancel"),(0,a.jsx)(D.zx,{onClick:S,disabled:y,children:y?"Regenerating...":"Regenerate"},"regenerate")],children:h?(0,a.jsxs)(D.rj,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(D.Dx,{children:"Regenerated Key"}),(0,a.jsx)(D.JX,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons,"," ",(0,a.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,a.jsxs)(D.JX,{numColSpan:1,children:[(0,a.jsx)(D.xv,{className:"mt-3",children:"Key Alias:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,a.jsx)(D.xv,{className:"mt-3",children:"New API Key:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:h})}),(0,a.jsx)(E.CopyToClipboard,{text:h,onCopy:()=>u.Z.success("API Key copied to clipboard"),children:(0,a.jsx)(D.zx,{className:"mt-3",children:"Copy API Key"})})]})]}):(0,a.jsxs)(c.Z,{form:x,layout:"vertical",onValuesChange:e=>{"duration"in e&&j(s=>({...s,duration:e.duration}))},children:[(0,a.jsx)(c.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,a.jsx)(D.oi,{disabled:!0})}),(0,a.jsx)(c.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,a.jsx)(R.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,a.jsx)(R.Z,{style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,a.jsx)(R.Z,{style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,a.jsx)(D.oi,{placeholder:""})}),(0,a.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry: ",(null==s?void 0:s.expires)?new Date(s.expires).toLocaleString():"Never"]}),v&&(0,a.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",v]})]})})}var z=t(20347),K=t(98015),O=t(27799),U=t(59872),V=t(30401),G=t(78867),B=t(85968),J=t(40728),W=t(58710),q=e=>{let{autoRotate:s=!1,rotationInterval:t,lastRotationAt:l,keyRotationAt:r,nextRotationAt:i,variant:d="card",className:o=""}=e,c=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)},m=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(J.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(J.C,{color:s?"green":"gray",size:"xs",children:s?"Enabled":"Disabled"}),s&&t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(J.x,{className:"text-gray-400",children:"•"}),(0,a.jsxs)(J.x,{className:"text-sm text-gray-600",children:["Every ",t]})]})]})}),(s||l||r||i)&&(0,a.jsxs)("div",{className:"space-y-3",children:[l&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(W.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(J.x,{className:"font-medium text-gray-700",children:"Last Rotation"}),(0,a.jsx)(J.x,{className:"text-sm text-gray-600",children:c(l)})]})]}),(r||i)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(W.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(J.x,{className:"font-medium text-gray-700",children:"Next Scheduled Rotation"}),(0,a.jsx)(J.x,{className:"text-sm text-gray-600",children:c(i||r||"")})]})]}),s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(W.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsx)(J.x,{className:"text-gray-600",children:"No rotation history available"})]})]}),!s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(n.Z,{className:"w-4 h-4 text-gray-400"}),(0,a.jsx)(J.x,{className:"text-gray-600",children:"Auto-rotation is not enabled for this key"})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(J.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(J.x,{className:"text-xs text-gray-500",children:"Automatic key rotation settings and status for this key"})]})}),m]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(J.x,{className:"font-medium text-gray-900 mb-3",children:"Auto-Rotation"}),m]})};function $(e){var s,t,h,g,p,j;let{keyId:v,onClose:b,keyData:y,accessToken:_,userID:f,userRole:N,teams:k,onKeyDataUpdate:C,onDelete:A,premiumUser:I,setAccessToken:P,backButtonText:D="Back to Keys"}=e,[M,R]=(0,l.useState)(!1),[T]=c.Z.useForm(),[E,J]=(0,l.useState)(!1),[W,$]=(0,l.useState)(""),[Q,X]=(0,l.useState)(!1),[Y,H]=(0,l.useState)({}),[ee,es]=(0,l.useState)(y),[et,ea]=(0,l.useState)(null),[el,er]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{y&&es(y)},[y]),(0,l.useEffect)(()=>{if(el){let e=setTimeout(()=>{er(!1)},5e3);return()=>clearTimeout(e)}},[el]),!ee)return(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(r.zx,{icon:i.Z,variant:"light",onClick:b,className:"mb-4",children:D}),(0,a.jsx)(r.xv,{children:"Key not found"})]});let ei=async e=>{try{var s,t,a,l;if(!_)return;let r=e.token;if(e.key=r,I||(delete e.guardrails,delete e.prompts),void 0!==e.vector_stores&&(e.object_permission={...ee.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...ee.object_permission,mcp_servers:s||[],mcp_access_groups:t||[]},delete e.mcp_servers_and_groups}if(void 0!==e.mcp_tool_permissions){let s=e.mcp_tool_permissions||{};Object.keys(s).length>0&&(e.object_permission={...e.object_permission,mcp_tool_permissions:s}),delete e.mcp_tool_permissions}if(e.metadata&&"string"==typeof e.metadata)try{let a=JSON.parse(e.metadata);e.metadata={...a,...(null===(s=e.guardrails)||void 0===s?void 0:s.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(t=e.disabled_callbacks)||void 0===t?void 0:t.length)>0?{litellm_disabled_callbacks:(0,S.Z3)(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),u.Z.error("Invalid metadata JSON");return}else e.metadata={...e.metadata||{},...(null===(a=e.guardrails)||void 0===a?void 0:a.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(l=e.disabled_callbacks)||void 0===l?void 0:l.length)>0?{litellm_disabled_callbacks:(0,S.Z3)(e.disabled_callbacks)}:{}};delete e.logging_settings,e.budget_duration&&(e.budget_duration=({daily:"24h",weekly:"7d",monthly:"30d"})[e.budget_duration]);let i=await (0,o.keyUpdateCall)(_,e);es(e=>e?{...e,...i}:void 0),C&&C(i),u.Z.success("Key updated successfully"),R(!1)}catch(e){u.Z.fromBackend((0,B.O)(e)),console.error("Error updating key:",e)}},en=async()=>{try{if(!_)return;await (0,o.keyDeleteCall)(_,ee.token||ee.token_id),u.Z.success("Key deleted successfully"),A&&A(),b()}catch(e){console.error("Error deleting the key:",e),u.Z.fromBackend(e)}$("")},ed=async(e,s)=>{await (0,U.vQ)(e)&&(H(e=>({...e,[s]:!0})),setTimeout(()=>{H(e=>({...e,[s]:!1}))},2e3))},eo=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)};return(0,a.jsxs)("div",{className:"w-full h-screen p-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.zx,{icon:i.Z,variant:"light",onClick:b,className:"mb-4",children:D}),(0,a.jsx)(r.Dx,{children:ee.key_alias||"API Key"}),(0,a.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,a.jsx)(r.xv,{className:"text-gray-500 font-mono text-sm",children:ee.token_id||ee.token})]}),(0,a.jsx)(m.ZP,{type:"text",size:"small",icon:Y["key-id"]?(0,a.jsx)(V.Z,{size:12}):(0,a.jsx)(G.Z,{size:12}),onClick:()=>ed(ee.token_id||ee.token,"key-id"),className:"ml-2 transition-all duration-200".concat(Y["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)(r.xv,{className:"text-sm text-gray-500",children:ee.updated_at&&ee.updated_at!==ee.created_at?"Updated: ".concat(eo(ee.updated_at)):"Created: ".concat(eo(ee.created_at))}),el&&(0,a.jsx)(r.Ct,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),et&&(0,a.jsx)(r.Ct,{color:"blue",size:"xs",children:"Regenerated"})]})]}),N&&z.LQ.includes(N)&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Z,{title:I?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,a.jsx)("span",{className:"inline-block",children:(0,a.jsx)(r.zx,{icon:n.Z,variant:"secondary",onClick:()=>X(!0),className:"flex items-center",disabled:!I,children:"Regenerate Key"})})}),(0,a.jsx)(r.zx,{icon:d.Z,variant:"secondary",onClick:()=>J(!0),className:"flex items-center",children:"Delete Key"})]})]}),(0,a.jsx)(F,{selectedToken:ee,visible:Q,onClose:()=>X(!1),accessToken:_,premiumUser:I,setAccessToken:P,onKeyUpdate:e=>{es(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),ea(new Date),er(!0),C&&C({...e,created_at:new Date().toLocaleString()})}}),E&&(()=>{let e=(null==ee?void 0:ee.key_alias)||(null==ee?void 0:ee.token_id)||"API Key",s=W===e;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Key"}),(0,a.jsx)("button",{onClick:()=>{J(!1),$("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsxs)("div",{className:"px-6 py-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,a.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-medium text-red-600",children:"Warning: You are about to delete this API key."}),(0,a.jsx)("p",{className:"text-base text-red-600 mt-2",children:"This action is irreversible and will immediately revoke access for any applications using this key."})]})]}),(0,a.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to delete this API key?"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,a.jsx)("span",{className:"underline",children:e})," to confirm deletion:"]}),(0,a.jsx)("input",{type:"text",value:W,onChange:e=>$(e.target.value),placeholder:"Enter key name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,a.jsx)("button",{onClick:()=>{J(!1),$("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,a.jsx)("button",{onClick:en,disabled:!s,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(s?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Delete Key"})]})]})})})(),(0,a.jsxs)(r.v0,{children:[(0,a.jsxs)(r.td,{className:"mb-4",children:[(0,a.jsx)(r.OK,{children:"Overview"}),(0,a.jsx)(r.OK,{children:"Settings"})]}),(0,a.jsxs)(r.nP,{children:[(0,a.jsx)(r.x4,{children:(0,a.jsxs)(r.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Spend"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(r.Dx,{children:["$",(0,U.pw)(ee.spend,4)]}),(0,a.jsxs)(r.xv,{children:["of"," ",null!==ee.max_budget?"$".concat((0,U.pw)(ee.max_budget)):"Unlimited"]})]})]}),(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Rate Limits"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(r.xv,{children:["TPM: ",null!==ee.tpm_limit?ee.tpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["RPM: ",null!==ee.rpm_limit?ee.rpm_limit:"Unlimited"]})]})]}),(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Models"}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:ee.models&&ee.models.length>0?ee.models.map((e,s)=>(0,a.jsx)(r.Ct,{color:"red",children:e},s)):(0,a.jsx)(r.xv,{children:"No models specified"})})]}),(0,a.jsx)(r.Zb,{children:(0,a.jsx)(K.Z,{objectPermission:ee.object_permission,variant:"inline",accessToken:_})}),(0,a.jsx)(O.Z,{loggingConfigs:w(ee.metadata),disabledCallbacks:Array.isArray(null===(s=ee.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,S.PA)(ee.metadata.litellm_disabled_callbacks):[],variant:"card"}),(0,a.jsx)(q,{autoRotate:ee.auto_rotate,rotationInterval:ee.rotation_interval,lastRotationAt:ee.last_rotation_at,keyRotationAt:ee.key_rotation_at,nextRotationAt:ee.next_rotation_at,variant:"card"})]})}),(0,a.jsx)(r.x4,{children:(0,a.jsxs)(r.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(r.Dx,{children:"Key Settings"}),!M&&N&&z.LQ.includes(N)&&(0,a.jsx)(r.zx,{variant:"light",onClick:()=>R(!0),children:"Edit Settings"})]}),M?(0,a.jsx)(L,{keyData:ee,onCancel:()=>R(!1),onSubmit:ei,teams:k,accessToken:_,userID:f,userRole:N,premiumUser:I}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Key ID"}),(0,a.jsx)(r.xv,{className:"font-mono",children:ee.token_id||ee.token})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Key Alias"}),(0,a.jsx)(r.xv,{children:ee.key_alias||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Secret Key"}),(0,a.jsx)(r.xv,{className:"font-mono",children:ee.key_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Team ID"}),(0,a.jsx)(r.xv,{children:ee.team_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Organization"}),(0,a.jsx)(r.xv,{children:ee.organization_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created"}),(0,a.jsx)(r.xv,{children:eo(ee.created_at)})]}),et&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Last Regenerated"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.xv,{children:eo(et)}),(0,a.jsx)(r.Ct,{color:"green",size:"xs",children:"Recent"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Expires"}),(0,a.jsx)(r.xv,{children:ee.expires?eo(ee.expires):"Never"})]}),(0,a.jsx)(q,{autoRotate:ee.auto_rotate,rotationInterval:ee.rotation_interval,lastRotationAt:ee.last_rotation_at,keyRotationAt:ee.key_rotation_at,nextRotationAt:ee.next_rotation_at,variant:"inline",className:"pt-4 border-t border-gray-200"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Spend"}),(0,a.jsxs)(r.xv,{children:["$",(0,U.pw)(ee.spend,4)," USD"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Budget"}),(0,a.jsx)(r.xv,{children:null!==ee.max_budget?"$".concat((0,U.pw)(ee.max_budget,2)):"Unlimited"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Prompts"}),(0,a.jsx)(r.xv,{children:Array.isArray(null===(t=ee.metadata)||void 0===t?void 0:t.prompts)&&ee.metadata.prompts.length>0?ee.metadata.prompts.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No prompts specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Allowed Pass Through Routes"}),(0,a.jsx)(r.xv,{children:Array.isArray(null===(h=ee.metadata)||void 0===h?void 0:h.allowed_passthrough_routes)&&ee.metadata.allowed_passthrough_routes.length>0?ee.metadata.allowed_passthrough_routes.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No pass through routes specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Models"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:ee.models&&ee.models.length>0?ee.models.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,a.jsx)(r.xv,{children:"No models specified"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Rate Limits"}),(0,a.jsxs)(r.xv,{children:["TPM: ",null!==ee.tpm_limit?ee.tpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["RPM: ",null!==ee.rpm_limit?ee.rpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Max Parallel Requests:"," ",null!==ee.max_parallel_requests?ee.max_parallel_requests:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Model TPM Limits:"," ",(null===(g=ee.metadata)||void 0===g?void 0:g.model_tpm_limit)?JSON.stringify(ee.metadata.model_tpm_limit):"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Model RPM Limits:"," ",(null===(p=ee.metadata)||void 0===p?void 0:p.model_rpm_limit)?JSON.stringify(ee.metadata.model_rpm_limit):"Unlimited"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Metadata"}),(0,a.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:Z(ee.metadata)})]}),(0,a.jsx)(K.Z,{objectPermission:ee.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:_}),(0,a.jsx)(O.Z,{loggingConfigs:w(ee.metadata),disabledCallbacks:Array.isArray(null===(j=ee.metadata)||void 0===j?void 0:j.litellm_disabled_callbacks)?(0,S.PA)(ee.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4292],{84717:function(e,s,t){t.d(s,{Ct:function(){return a.Z},Dx:function(){return u.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return m.Z},rj:function(){return i.Z},td:function(){return o.Z},v0:function(){return d.Z},x4:function(){return c.Z},xv:function(){return x.Z},zx:function(){return l.Z}});var a=t(41649),l=t(20831),r=t(12514),i=t(67101),n=t(12485),d=t(18135),o=t(35242),c=t(29706),m=t(77991),x=t(84264),u=t(96761)},40728:function(e,s,t){t.d(s,{C:function(){return a.Z},x:function(){return l.Z}});var a=t(41649),l=t(84264)},16721:function(e,s,t){t.d(s,{Dx:function(){return d.Z},JX:function(){return l.Z},oi:function(){return n.Z},rj:function(){return r.Z},xv:function(){return i.Z},zx:function(){return a.Z}});var a=t(20831),l=t(49804),r=t(67101),i=t(84264),n=t(49566),d=t(96761)},64504:function(e,s,t){t.d(s,{o:function(){return l.Z},z:function(){return a.Z}});var a=t(20831),l=t(49566)},67479:function(e,s,t){var a=t(57437),l=t(2265),r=t(52787),i=t(19250);s.Z=e=>{let{onChange:s,value:t,className:n,accessToken:d,disabled:o}=e,[c,m]=(0,l.useState)([]),[x,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{(async()=>{if(d){u(!0);try{let e=await (0,i.getGuardrailsList)(d);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),m(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{u(!1)}}})()},[d]),(0,a.jsx)("div",{children:(0,a.jsx)(r.default,{mode:"multiple",disabled:o,placeholder:o?"Setting guardrails is a premium feature.":"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),s(e)},value:t,loading:x,className:n,options:c.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}},27799:function(e,s,t){var a=t(57437);t(2265);var l=t(40728),r=t(82182),i=t(91777),n=t(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:t=[],variant:d="card",className:o=""}=e,c=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[t,a]=s;return a===e}))||void 0===s?void 0:s[0])||e},m=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},x=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},u=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,a.jsx)(l.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var t;let i=c(e.callback_name),d=null===(t=n.Dg[i])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}):(0,a.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-blue-800",children:i}),(0,a.jsxs)(l.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,a.jsx)(l.C,{color:m(e.callback_type),size:"sm",children:x(e.callback_type)})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,a.jsx)(l.C,{color:"red",size:"xs",children:t.length})]}),t.length>0?(0,a.jsx)("div",{className:"space-y-3",children:t.map((e,s)=>{var t;let r=n.RD[e]||e,d=null===(t=n.Dg[r])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:r,className:"w-5 h-5 object-contain"}):(0,a.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-red-800",children:r}),(0,a.jsx)(l.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,a.jsx)(l.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,a.jsx)(l.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(l.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),u]})}},98015:function(e,s,t){t.d(s,{Z:function(){return g}});var a=t(57437),l=t(2265),r=t(92280),i=t(40728),n=t(79814),d=t(19250),o=function(e){let{vectorStores:s,accessToken:t}=e,[r,o]=(0,l.useState)([]);(0,l.useEffect)(()=>{(async()=>{if(t&&0!==s.length)try{let e=await (0,d.vectorStoreListCall)(t);e.data&&o(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,s.length]);let c=e=>{let s=r.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:c(e)},s))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},c=t(25327),m=t(86462),x=t(47686),u=t(89970),h=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:o}=e,[h,g]=(0,l.useState)([]),[p,j]=(0,l.useState)([]),[v,b]=(0,l.useState)(new Set),y=e=>{b(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})};(0,l.useEffect)(()=>{(async()=>{if(o&&s.length>0)try{let e=await (0,d.fetchMCPServers)(o);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[o,s.length]),(0,l.useEffect)(()=>{(async()=>{if(o&&r.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(o));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let _=e=>{let s=h.find(s=>s.server_id===e);if(s){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(t,")")}return e},f=e=>e,N=[...s.map(e=>({type:"server",value:e})),...r.map(e=>({type:"accessGroup",value:e}))],k=N.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:k})]}),k>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let t="server"===e.type?n[e.value]:void 0,l=t&&t.length>0,r=v.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>l&&y(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(l?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(u.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:f(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),l&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:t.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===t.length?"tool":"tools"}),r?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),l&&r&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map((e,s)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(c.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:s,variant:t="card",className:l="",accessToken:i}=e,n=(null==s?void 0:s.vector_stores)||[],d=(null==s?void 0:s.mcp_servers)||[],c=(null==s?void 0:s.mcp_access_groups)||[],m=(null==s?void 0:s.mcp_tool_permissions)||{},x=(0,a.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(o,{vectorStores:n,accessToken:i}),(0,a.jsx)(h,{mcpServers:d,mcpAccessGroups:c,mcpToolPermissions:m,accessToken:i})]});return"card"===t?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),x]}):(0,a.jsxs)("div",{className:"".concat(l),children:[(0,a.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),x]})}},21425:function(e,s,t){var a=t(57437);t(2265);var l=t(54507);s.Z=e=>{let{value:s,onChange:t,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,a.jsx)(l.Z,{value:s,onChange:t,disabledCallbacks:r,onDisabledCallbacksChange:i})}},94292:function(e,s,t){t.d(s,{Z:function(){return Q}});var a=t(57437),l=t(2265),r=t(84717),i=t(10900),n=t(23628),d=t(74998),o=t(19250),c=t(13634),m=t(73002),x=t(89970),u=t(9114),h=t(52787),g=t(64482),p=t(64504),j=t(30874),v=t(24199),b=t(97415),y=t(95920),_=t(68473),f=t(21425);let N=["logging"],k=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!N.includes(s)})):{},w=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],Z=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(k(e),null,s)};var S=t(97434),C=t(67479),A=t(62099),I=t(65895),P=t(95096);function L(e){var s,t,r,i,n,d,u,N,k,L;let{keyData:D,onCancel:M,onSubmit:R,teams:T,accessToken:E,userID:F,userRole:z,premiumUser:K=!1}=e,[O]=c.Z.useForm(),[U,V]=(0,l.useState)([]),[G,B]=(0,l.useState)([]),J=null==T?void 0:T.find(e=>e.team_id===D.team_id),[W,q]=(0,l.useState)([]),[$,Q]=(0,l.useState)([]),[X,Y]=(0,l.useState)(!1),[H,ee]=(0,l.useState)(Array.isArray(null===(s=D.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,S.PA)(D.metadata.litellm_disabled_callbacks):[]),[es,et]=(0,l.useState)(D.auto_rotate||!1),[ea,el]=(0,l.useState)(D.rotation_interval||"");(0,l.useEffect)(()=>{let e=async()=>{if(F&&z&&E)try{if(null===D.team_id){let e=(await (0,o.modelAvailableCall)(E,F,z)).data.map(e=>e.id);q(e)}else if(null==J?void 0:J.team_id){let e=await (0,j.wk)(F,z,E,J.team_id);q(Array.from(new Set([...J.models,...e])))}}catch(e){console.error("Error fetching models:",e)}};(async()=>{if(E)try{let e=await (0,o.getPromptsList)(E);B(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}})(),e()},[F,z,E,J,D.team_id]),(0,l.useEffect)(()=>{O.setFieldValue("disabled_callbacks",H)},[O,H]);let er=e=>e&&({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||null,ei={...D,token:D.token||D.token_id,budget_duration:er(D.budget_duration),metadata:Z(D.metadata),guardrails:null===(t=D.metadata)||void 0===t?void 0:t.guardrails,prompts:null===(r=D.metadata)||void 0===r?void 0:r.prompts,vector_stores:(null===(i=D.object_permission)||void 0===i?void 0:i.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(n=D.object_permission)||void 0===n?void 0:n.mcp_servers)||[],accessGroups:(null===(d=D.object_permission)||void 0===d?void 0:d.mcp_access_groups)||[]},mcp_tool_permissions:(null===(u=D.object_permission)||void 0===u?void 0:u.mcp_tool_permissions)||{},logging_settings:w(D.metadata),disabled_callbacks:Array.isArray(null===(N=D.metadata)||void 0===N?void 0:N.litellm_disabled_callbacks)?(0,S.PA)(D.metadata.litellm_disabled_callbacks):[],auto_rotate:D.auto_rotate||!1,...D.rotation_interval&&{rotation_interval:D.rotation_interval}};return(0,l.useEffect)(()=>{var e,s,t,a,l,r,i;O.setFieldsValue({...D,token:D.token||D.token_id,budget_duration:er(D.budget_duration),metadata:Z(D.metadata),guardrails:null===(e=D.metadata)||void 0===e?void 0:e.guardrails,prompts:null===(s=D.metadata)||void 0===s?void 0:s.prompts,vector_stores:(null===(t=D.object_permission)||void 0===t?void 0:t.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=D.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(l=D.object_permission)||void 0===l?void 0:l.mcp_access_groups)||[]},mcp_tool_permissions:(null===(r=D.object_permission)||void 0===r?void 0:r.mcp_tool_permissions)||{},logging_settings:w(D.metadata),disabled_callbacks:Array.isArray(null===(i=D.metadata)||void 0===i?void 0:i.litellm_disabled_callbacks)?(0,S.PA)(D.metadata.litellm_disabled_callbacks):[],auto_rotate:D.auto_rotate||!1,...D.rotation_interval&&{rotation_interval:D.rotation_interval}})},[D,O]),(0,l.useEffect)(()=>{O.setFieldValue("auto_rotate",es)},[es,O]),(0,l.useEffect)(()=>{ea&&O.setFieldValue("rotation_interval",ea)},[ea,O]),console.log("premiumUser:",K),(0,a.jsxs)(c.Z,{form:O,onFinish:R,initialValues:ei,layout:"vertical",children:[(0,a.jsx)(c.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,a.jsx)(p.o,{})}),(0,a.jsx)(c.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(h.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[W.length>0&&(0,a.jsx)(h.default.Option,{value:"all-team-models",children:"All Team Models"}),W.map(e=>(0,a.jsx)(h.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(v.Z,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,a.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(h.default,{placeholder:"n/a",children:[(0,a.jsx)(h.default.Option,{value:"daily",children:"Daily"}),(0,a.jsx)(h.default.Option,{value:"weekly",children:"Weekly"}),(0,a.jsx)(h.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,a.jsx)(c.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(I.Z,{type:"tpm",name:"tpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(c.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(I.Z,{type:"rpm",name:"rpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(c.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(c.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,a.jsx)(g.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(c.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,a.jsx)(g.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(c.Z.Item,{label:"Guardrails",name:"guardrails",children:E&&(0,a.jsx)(C.Z,{onChange:e=>{O.setFieldValue("guardrails",e)},accessToken:E,disabled:!K})}),(0,a.jsx)(c.Z.Item,{label:"Prompts",name:"prompts",children:(0,a.jsx)(x.Z,{title:K?"":"Setting prompts by key is a premium feature",placement:"top",children:(0,a.jsx)(h.default,{mode:"tags",style:{width:"100%"},disabled:!K,placeholder:K?Array.isArray(null===(k=D.metadata)||void 0===k?void 0:k.prompts)&&D.metadata.prompts.length>0?"Current: ".concat(D.metadata.prompts.join(", ")):"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:G.map(e=>({value:e,label:e}))})})}),(0,a.jsx)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,a.jsx)(x.Z,{title:K?"":"Setting allowed pass through routes by key is a premium feature",placement:"top",children:(0,a.jsx)(P.Z,{onChange:e=>O.setFieldValue("allowed_passthrough_routes",e),value:O.getFieldValue("allowed_passthrough_routes"),accessToken:E||"",placeholder:K?Array.isArray(null===(L=D.metadata)||void 0===L?void 0:L.allowed_passthrough_routes)&&D.metadata.allowed_passthrough_routes.length>0?"Current: ".concat(D.metadata.allowed_passthrough_routes.join(", ")):"Select or enter allowed pass through routes":"Premium feature - Upgrade to set allowed pass through routes by key",disabled:!K})})}),(0,a.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,a.jsx)(b.Z,{onChange:e=>O.setFieldValue("vector_stores",e),value:O.getFieldValue("vector_stores"),accessToken:E||"",placeholder:"Select vector stores"})}),(0,a.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,a.jsx)(y.Z,{onChange:e=>O.setFieldValue("mcp_servers_and_groups",e),value:O.getFieldValue("mcp_servers_and_groups"),accessToken:E||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(g.default,{type:"hidden"})}),(0,a.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.mcp_servers_and_groups!==s.mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)(_.Z,{accessToken:E||"",selectedServers:(null===(e=O.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:O.getFieldValue("mcp_tool_permissions")||{},onChange:e=>O.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,a.jsx)(c.Z.Item,{label:"Team ID",name:"team_id",children:(0,a.jsx)(h.default,{placeholder:"Select team",style:{width:"100%"},children:null==T?void 0:T.map(e=>(0,a.jsx)(h.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,a.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,a.jsx)(f.Z,{value:O.getFieldValue("logging_settings"),onChange:e=>O.setFieldValue("logging_settings",e),disabledCallbacks:H,onDisabledCallbacksChange:e=>{ee((0,S.PA)(e)),O.setFieldValue("disabled_callbacks",e)}})}),(0,a.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,a.jsx)(g.default.TextArea,{rows:10})}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(A.Z,{form:O,autoRotationEnabled:es,onAutoRotationChange:et,rotationInterval:ea,onRotationIntervalChange:el})}),(0,a.jsx)(c.Z.Item,{name:"token",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(c.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(c.Z.Item,{name:"auto_rotate",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(c.Z.Item,{name:"rotation_interval",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,a.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,a.jsx)(m.ZP,{onClick:M,children:"Cancel"}),(0,a.jsx)(p.z,{type:"submit",children:"Save Changes"})]})})]})}var D=t(16721),M=t(82680),R=t(20577),T=t(7366),E=t(29233);function F(e){let{selectedToken:s,visible:t,onClose:r,accessToken:i,premiumUser:n,setAccessToken:d,onKeyUpdate:m}=e,[x]=c.Z.useForm(),[h,g]=(0,l.useState)(null),[p,j]=(0,l.useState)(null),[v,b]=(0,l.useState)(null),[y,_]=(0,l.useState)(!1),[f,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{t&&s&&i&&(x.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),w(i),N(s.key_name===i))},[t,s,x,i]),(0,l.useEffect)(()=>{t||(g(null),_(!1),N(!1),w(null),x.resetFields())},[t,x]);let Z=e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,T.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,T.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,T.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,l.useEffect)(()=>{(null==p?void 0:p.duration)?b(Z(p.duration)):b(null)},[null==p?void 0:p.duration]);let S=async()=>{if(s&&k){_(!0);try{let e=await x.validateFields(),t=await (0,o.regenerateKeyCall)(k,s.token||s.token_id,e);g(t.key),u.Z.success("API Key regenerated successfully"),console.log("Full regenerate response:",t);let a={token:t.token||t.key_id||s.token,key_name:t.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?Z(e.duration):s.expires,...t};console.log("Updated key data with new token:",a),f&&(w(t.key),d&&d(t.key)),m&&m(a),_(!1)}catch(e){console.error("Error regenerating key:",e),u.Z.fromBackend(e),_(!1)}}},C=()=>{g(null),_(!1),N(!1),w(null),x.resetFields(),r()};return(0,a.jsx)(M.Z,{title:"Regenerate API Key",open:t,onCancel:C,footer:h?[(0,a.jsx)(D.zx,{onClick:C,children:"Close"},"close")]:[(0,a.jsx)(D.zx,{onClick:C,className:"mr-2",children:"Cancel"},"cancel"),(0,a.jsx)(D.zx,{onClick:S,disabled:y,children:y?"Regenerating...":"Regenerate"},"regenerate")],children:h?(0,a.jsxs)(D.rj,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(D.Dx,{children:"Regenerated Key"}),(0,a.jsx)(D.JX,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons,"," ",(0,a.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,a.jsxs)(D.JX,{numColSpan:1,children:[(0,a.jsx)(D.xv,{className:"mt-3",children:"Key Alias:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,a.jsx)(D.xv,{className:"mt-3",children:"New API Key:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:h})}),(0,a.jsx)(E.CopyToClipboard,{text:h,onCopy:()=>u.Z.success("API Key copied to clipboard"),children:(0,a.jsx)(D.zx,{className:"mt-3",children:"Copy API Key"})})]})]}):(0,a.jsxs)(c.Z,{form:x,layout:"vertical",onValuesChange:e=>{"duration"in e&&j(s=>({...s,duration:e.duration}))},children:[(0,a.jsx)(c.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,a.jsx)(D.oi,{disabled:!0})}),(0,a.jsx)(c.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,a.jsx)(R.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,a.jsx)(R.Z,{style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,a.jsx)(R.Z,{style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,a.jsx)(D.oi,{placeholder:""})}),(0,a.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry: ",(null==s?void 0:s.expires)?new Date(s.expires).toLocaleString():"Never"]}),v&&(0,a.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",v]})]})})}var z=t(20347),K=t(98015),O=t(27799),U=t(59872),V=t(30401),G=t(78867),B=t(85968),J=t(40728),W=t(58710),q=e=>{let{autoRotate:s=!1,rotationInterval:t,lastRotationAt:l,keyRotationAt:r,nextRotationAt:i,variant:d="card",className:o=""}=e,c=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)},m=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(J.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(J.C,{color:s?"green":"gray",size:"xs",children:s?"Enabled":"Disabled"}),s&&t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(J.x,{className:"text-gray-400",children:"•"}),(0,a.jsxs)(J.x,{className:"text-sm text-gray-600",children:["Every ",t]})]})]})}),(s||l||r||i)&&(0,a.jsxs)("div",{className:"space-y-3",children:[l&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(W.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(J.x,{className:"font-medium text-gray-700",children:"Last Rotation"}),(0,a.jsx)(J.x,{className:"text-sm text-gray-600",children:c(l)})]})]}),(r||i)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(W.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(J.x,{className:"font-medium text-gray-700",children:"Next Scheduled Rotation"}),(0,a.jsx)(J.x,{className:"text-sm text-gray-600",children:c(i||r||"")})]})]}),s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(W.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsx)(J.x,{className:"text-gray-600",children:"No rotation history available"})]})]}),!s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(n.Z,{className:"w-4 h-4 text-gray-400"}),(0,a.jsx)(J.x,{className:"text-gray-600",children:"Auto-rotation is not enabled for this key"})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(J.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(J.x,{className:"text-xs text-gray-500",children:"Automatic key rotation settings and status for this key"})]})}),m]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(J.x,{className:"font-medium text-gray-900 mb-3",children:"Auto-Rotation"}),m]})},$=t(33304);function Q(e){var s,t,h,g,p,j;let{keyId:v,onClose:b,keyData:y,accessToken:_,userID:f,userRole:N,teams:k,onKeyDataUpdate:C,onDelete:A,premiumUser:I,setAccessToken:P,backButtonText:D="Back to Keys"}=e,[M,R]=(0,l.useState)(!1),[T]=c.Z.useForm(),[E,J]=(0,l.useState)(!1),[W,Q]=(0,l.useState)(""),[X,Y]=(0,l.useState)(!1),[H,ee]=(0,l.useState)({}),[es,et]=(0,l.useState)(y),[ea,el]=(0,l.useState)(null),[er,ei]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{y&&et(y)},[y]),(0,l.useEffect)(()=>{if(er){let e=setTimeout(()=>{ei(!1)},5e3);return()=>clearTimeout(e)}},[er]),!es)return(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(r.zx,{icon:i.Z,variant:"light",onClick:b,className:"mb-4",children:D}),(0,a.jsx)(r.xv,{children:"Key not found"})]});let en=async e=>{try{var s,t,a,l;if(!_)return;let r=e.token;if(e.key=r,I||(delete e.guardrails,delete e.prompts),e.max_budget=(0,$.C)(e.max_budget),void 0!==e.vector_stores&&(e.object_permission={...es.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...es.object_permission,mcp_servers:s||[],mcp_access_groups:t||[]},delete e.mcp_servers_and_groups}if(void 0!==e.mcp_tool_permissions){let s=e.mcp_tool_permissions||{};Object.keys(s).length>0&&(e.object_permission={...e.object_permission,mcp_tool_permissions:s}),delete e.mcp_tool_permissions}if(e.metadata&&"string"==typeof e.metadata)try{let a=JSON.parse(e.metadata);e.metadata={...a,...(null===(s=e.guardrails)||void 0===s?void 0:s.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(t=e.disabled_callbacks)||void 0===t?void 0:t.length)>0?{litellm_disabled_callbacks:(0,S.Z3)(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),u.Z.error("Invalid metadata JSON");return}else e.metadata={...e.metadata||{},...(null===(a=e.guardrails)||void 0===a?void 0:a.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(l=e.disabled_callbacks)||void 0===l?void 0:l.length)>0?{litellm_disabled_callbacks:(0,S.Z3)(e.disabled_callbacks)}:{}};delete e.logging_settings,e.budget_duration&&(e.budget_duration=({daily:"24h",weekly:"7d",monthly:"30d"})[e.budget_duration]);let i=await (0,o.keyUpdateCall)(_,e);et(e=>e?{...e,...i}:void 0),C&&C(i),u.Z.success("Key updated successfully"),R(!1)}catch(e){u.Z.fromBackend((0,B.O)(e)),console.error("Error updating key:",e)}},ed=async()=>{try{if(!_)return;await (0,o.keyDeleteCall)(_,es.token||es.token_id),u.Z.success("Key deleted successfully"),A&&A(),b()}catch(e){console.error("Error deleting the key:",e),u.Z.fromBackend(e)}Q("")},eo=async(e,s)=>{await (0,U.vQ)(e)&&(ee(e=>({...e,[s]:!0})),setTimeout(()=>{ee(e=>({...e,[s]:!1}))},2e3))},ec=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)};return(0,a.jsxs)("div",{className:"w-full h-screen p-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.zx,{icon:i.Z,variant:"light",onClick:b,className:"mb-4",children:D}),(0,a.jsx)(r.Dx,{children:es.key_alias||"API Key"}),(0,a.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,a.jsx)(r.xv,{className:"text-gray-500 font-mono text-sm",children:es.token_id||es.token})]}),(0,a.jsx)(m.ZP,{type:"text",size:"small",icon:H["key-id"]?(0,a.jsx)(V.Z,{size:12}):(0,a.jsx)(G.Z,{size:12}),onClick:()=>eo(es.token_id||es.token,"key-id"),className:"ml-2 transition-all duration-200".concat(H["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)(r.xv,{className:"text-sm text-gray-500",children:es.updated_at&&es.updated_at!==es.created_at?"Updated: ".concat(ec(es.updated_at)):"Created: ".concat(ec(es.created_at))}),er&&(0,a.jsx)(r.Ct,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),ea&&(0,a.jsx)(r.Ct,{color:"blue",size:"xs",children:"Regenerated"})]})]}),N&&z.LQ.includes(N)&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Z,{title:I?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,a.jsx)("span",{className:"inline-block",children:(0,a.jsx)(r.zx,{icon:n.Z,variant:"secondary",onClick:()=>Y(!0),className:"flex items-center",disabled:!I,children:"Regenerate Key"})})}),(0,a.jsx)(r.zx,{icon:d.Z,variant:"secondary",onClick:()=>J(!0),className:"flex items-center",children:"Delete Key"})]})]}),(0,a.jsx)(F,{selectedToken:es,visible:X,onClose:()=>Y(!1),accessToken:_,premiumUser:I,setAccessToken:P,onKeyUpdate:e=>{et(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),el(new Date),ei(!0),C&&C({...e,created_at:new Date().toLocaleString()})}}),E&&(()=>{let e=(null==es?void 0:es.key_alias)||(null==es?void 0:es.token_id)||"API Key",s=W===e;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Key"}),(0,a.jsx)("button",{onClick:()=>{J(!1),Q("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsxs)("div",{className:"px-6 py-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,a.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-medium text-red-600",children:"Warning: You are about to delete this API key."}),(0,a.jsx)("p",{className:"text-base text-red-600 mt-2",children:"This action is irreversible and will immediately revoke access for any applications using this key."})]})]}),(0,a.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to delete this API key?"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,a.jsx)("span",{className:"underline",children:e})," to confirm deletion:"]}),(0,a.jsx)("input",{type:"text",value:W,onChange:e=>Q(e.target.value),placeholder:"Enter key name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,a.jsx)("button",{onClick:()=>{J(!1),Q("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,a.jsx)("button",{onClick:ed,disabled:!s,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(s?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Delete Key"})]})]})})})(),(0,a.jsxs)(r.v0,{children:[(0,a.jsxs)(r.td,{className:"mb-4",children:[(0,a.jsx)(r.OK,{children:"Overview"}),(0,a.jsx)(r.OK,{children:"Settings"})]}),(0,a.jsxs)(r.nP,{children:[(0,a.jsx)(r.x4,{children:(0,a.jsxs)(r.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Spend"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(r.Dx,{children:["$",(0,U.pw)(es.spend,4)]}),(0,a.jsxs)(r.xv,{children:["of"," ",null!==es.max_budget?"$".concat((0,U.pw)(es.max_budget)):"Unlimited"]})]})]}),(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Rate Limits"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(r.xv,{children:["TPM: ",null!==es.tpm_limit?es.tpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["RPM: ",null!==es.rpm_limit?es.rpm_limit:"Unlimited"]})]})]}),(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Models"}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:es.models&&es.models.length>0?es.models.map((e,s)=>(0,a.jsx)(r.Ct,{color:"red",children:e},s)):(0,a.jsx)(r.xv,{children:"No models specified"})})]}),(0,a.jsx)(r.Zb,{children:(0,a.jsx)(K.Z,{objectPermission:es.object_permission,variant:"inline",accessToken:_})}),(0,a.jsx)(O.Z,{loggingConfigs:w(es.metadata),disabledCallbacks:Array.isArray(null===(s=es.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,S.PA)(es.metadata.litellm_disabled_callbacks):[],variant:"card"}),(0,a.jsx)(q,{autoRotate:es.auto_rotate,rotationInterval:es.rotation_interval,lastRotationAt:es.last_rotation_at,keyRotationAt:es.key_rotation_at,nextRotationAt:es.next_rotation_at,variant:"card"})]})}),(0,a.jsx)(r.x4,{children:(0,a.jsxs)(r.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(r.Dx,{children:"Key Settings"}),!M&&N&&z.LQ.includes(N)&&(0,a.jsx)(r.zx,{variant:"light",onClick:()=>R(!0),children:"Edit Settings"})]}),M?(0,a.jsx)(L,{keyData:es,onCancel:()=>R(!1),onSubmit:en,teams:k,accessToken:_,userID:f,userRole:N,premiumUser:I}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Key ID"}),(0,a.jsx)(r.xv,{className:"font-mono",children:es.token_id||es.token})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Key Alias"}),(0,a.jsx)(r.xv,{children:es.key_alias||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Secret Key"}),(0,a.jsx)(r.xv,{className:"font-mono",children:es.key_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Team ID"}),(0,a.jsx)(r.xv,{children:es.team_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Organization"}),(0,a.jsx)(r.xv,{children:es.organization_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created"}),(0,a.jsx)(r.xv,{children:ec(es.created_at)})]}),ea&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Last Regenerated"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.xv,{children:ec(ea)}),(0,a.jsx)(r.Ct,{color:"green",size:"xs",children:"Recent"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Expires"}),(0,a.jsx)(r.xv,{children:es.expires?ec(es.expires):"Never"})]}),(0,a.jsx)(q,{autoRotate:es.auto_rotate,rotationInterval:es.rotation_interval,lastRotationAt:es.last_rotation_at,keyRotationAt:es.key_rotation_at,nextRotationAt:es.next_rotation_at,variant:"inline",className:"pt-4 border-t border-gray-200"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Spend"}),(0,a.jsxs)(r.xv,{children:["$",(0,U.pw)(es.spend,4)," USD"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Budget"}),(0,a.jsx)(r.xv,{children:null!==es.max_budget?"$".concat((0,U.pw)(es.max_budget,2)):"Unlimited"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Prompts"}),(0,a.jsx)(r.xv,{children:Array.isArray(null===(t=es.metadata)||void 0===t?void 0:t.prompts)&&es.metadata.prompts.length>0?es.metadata.prompts.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No prompts specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Allowed Pass Through Routes"}),(0,a.jsx)(r.xv,{children:Array.isArray(null===(h=es.metadata)||void 0===h?void 0:h.allowed_passthrough_routes)&&es.metadata.allowed_passthrough_routes.length>0?es.metadata.allowed_passthrough_routes.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No pass through routes specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Models"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:es.models&&es.models.length>0?es.models.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,a.jsx)(r.xv,{children:"No models specified"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Rate Limits"}),(0,a.jsxs)(r.xv,{children:["TPM: ",null!==es.tpm_limit?es.tpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["RPM: ",null!==es.rpm_limit?es.rpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Max Parallel Requests:"," ",null!==es.max_parallel_requests?es.max_parallel_requests:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Model TPM Limits:"," ",(null===(g=es.metadata)||void 0===g?void 0:g.model_tpm_limit)?JSON.stringify(es.metadata.model_tpm_limit):"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Model RPM Limits:"," ",(null===(p=es.metadata)||void 0===p?void 0:p.model_rpm_limit)?JSON.stringify(es.metadata.model_rpm_limit):"Unlimited"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Metadata"}),(0,a.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:Z(es.metadata)})]}),(0,a.jsx)(K.Z,{objectPermission:es.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:_}),(0,a.jsx)(O.Z,{loggingConfigs:w(es.metadata),disabledCallbacks:Array.isArray(null===(j=es.metadata)||void 0===j?void 0:j.litellm_disabled_callbacks)?(0,S.PA)(es.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}},33304:function(e,s,t){t.d(s,{C:function(){return a}});function a(e){return""===e?null:e}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4292-c9a41dd3c8f6925a.js b/litellm/proxy/_experimental/out/_next/static/chunks/4292-c9a41dd3c8f6925a.js deleted file mode 100644 index da4d38fa90..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/4292-c9a41dd3c8f6925a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4292],{84717:function(e,s,t){t.d(s,{Ct:function(){return a.Z},Dx:function(){return u.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return m.Z},rj:function(){return i.Z},td:function(){return o.Z},v0:function(){return d.Z},x4:function(){return c.Z},xv:function(){return x.Z},zx:function(){return l.Z}});var a=t(41649),l=t(20831),r=t(12514),i=t(67101),n=t(12485),d=t(18135),o=t(35242),c=t(29706),m=t(77991),x=t(84264),u=t(96761)},40728:function(e,s,t){t.d(s,{C:function(){return a.Z},x:function(){return l.Z}});var a=t(41649),l=t(84264)},16721:function(e,s,t){t.d(s,{Dx:function(){return d.Z},JX:function(){return l.Z},oi:function(){return n.Z},rj:function(){return r.Z},xv:function(){return i.Z},zx:function(){return a.Z}});var a=t(20831),l=t(49804),r=t(67101),i=t(84264),n=t(49566),d=t(96761)},64504:function(e,s,t){t.d(s,{o:function(){return l.Z},z:function(){return a.Z}});var a=t(20831),l=t(49566)},67479:function(e,s,t){var a=t(57437),l=t(2265),r=t(52787),i=t(19250);s.Z=e=>{let{onChange:s,value:t,className:n,accessToken:d,disabled:o}=e,[c,m]=(0,l.useState)([]),[x,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{(async()=>{if(d){u(!0);try{let e=await (0,i.getGuardrailsList)(d);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),m(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{u(!1)}}})()},[d]),(0,a.jsx)("div",{children:(0,a.jsx)(r.default,{mode:"multiple",disabled:o,placeholder:o?"Setting guardrails is a premium feature.":"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),s(e)},value:t,loading:x,className:n,options:c.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}},27799:function(e,s,t){var a=t(57437);t(2265);var l=t(40728),r=t(82182),i=t(91777),n=t(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:t=[],variant:d="card",className:o=""}=e,c=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[t,a]=s;return a===e}))||void 0===s?void 0:s[0])||e},m=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},x=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},u=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,a.jsx)(l.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var t;let i=c(e.callback_name),d=null===(t=n.Dg[i])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}):(0,a.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-blue-800",children:i}),(0,a.jsxs)(l.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,a.jsx)(l.C,{color:m(e.callback_type),size:"sm",children:x(e.callback_type)})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,a.jsx)(l.C,{color:"red",size:"xs",children:t.length})]}),t.length>0?(0,a.jsx)("div",{className:"space-y-3",children:t.map((e,s)=>{var t;let r=n.RD[e]||e,d=null===(t=n.Dg[r])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:r,className:"w-5 h-5 object-contain"}):(0,a.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-red-800",children:r}),(0,a.jsx)(l.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,a.jsx)(l.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,a.jsx)(l.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(l.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),u]})}},98015:function(e,s,t){t.d(s,{Z:function(){return g}});var a=t(57437),l=t(2265),r=t(92280),i=t(40728),n=t(79814),d=t(19250),o=function(e){let{vectorStores:s,accessToken:t}=e,[r,o]=(0,l.useState)([]);(0,l.useEffect)(()=>{(async()=>{if(t&&0!==s.length)try{let e=await (0,d.vectorStoreListCall)(t);e.data&&o(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,s.length]);let c=e=>{let s=r.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:c(e)},s))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},c=t(25327),m=t(86462),x=t(47686),u=t(89970),h=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:o}=e,[h,g]=(0,l.useState)([]),[p,j]=(0,l.useState)([]),[v,b]=(0,l.useState)(new Set),y=e=>{b(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})};(0,l.useEffect)(()=>{(async()=>{if(o&&s.length>0)try{let e=await (0,d.fetchMCPServers)(o);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[o,s.length]),(0,l.useEffect)(()=>{(async()=>{if(o&&r.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(o));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let _=e=>{let s=h.find(s=>s.server_id===e);if(s){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(t,")")}return e},f=e=>e,N=[...s.map(e=>({type:"server",value:e})),...r.map(e=>({type:"accessGroup",value:e}))],k=N.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:k})]}),k>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let t="server"===e.type?n[e.value]:void 0,l=t&&t.length>0,r=v.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>l&&y(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(l?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(u.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:f(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),l&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:t.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===t.length?"tool":"tools"}),r?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),l&&r&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map((e,s)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(c.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:s,variant:t="card",className:l="",accessToken:i}=e,n=(null==s?void 0:s.vector_stores)||[],d=(null==s?void 0:s.mcp_servers)||[],c=(null==s?void 0:s.mcp_access_groups)||[],m=(null==s?void 0:s.mcp_tool_permissions)||{},x=(0,a.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(o,{vectorStores:n,accessToken:i}),(0,a.jsx)(h,{mcpServers:d,mcpAccessGroups:c,mcpToolPermissions:m,accessToken:i})]});return"card"===t?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),x]}):(0,a.jsxs)("div",{className:"".concat(l),children:[(0,a.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),x]})}},21425:function(e,s,t){var a=t(57437);t(2265);var l=t(54507);s.Z=e=>{let{value:s,onChange:t,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,a.jsx)(l.Z,{value:s,onChange:t,disabledCallbacks:r,onDisabledCallbacksChange:i})}},94292:function(e,s,t){t.d(s,{Z:function(){return $}});var a=t(57437),l=t(2265),r=t(84717),i=t(10900),n=t(23628),d=t(74998),o=t(19250),c=t(13634),m=t(73002),x=t(89970),u=t(9114),h=t(52787),g=t(64482),p=t(64504),j=t(30874),v=t(24199),b=t(97415),y=t(95920),_=t(68473),f=t(21425);let N=["logging"],k=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!N.includes(s)})):{},w=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],Z=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(k(e),null,s)};var S=t(97434),C=t(67479),A=t(62099),I=t(65895),P=t(95096);function L(e){var s,t,r,i,n,d,u,N,k,L;let{keyData:D,onCancel:M,onSubmit:R,teams:T,accessToken:E,userID:F,userRole:z,premiumUser:K=!1}=e,[O]=c.Z.useForm(),[U,V]=(0,l.useState)([]),[G,B]=(0,l.useState)([]),J=null==T?void 0:T.find(e=>e.team_id===D.team_id),[W,q]=(0,l.useState)([]),[$,Q]=(0,l.useState)([]),[X,Y]=(0,l.useState)(!1),[H,ee]=(0,l.useState)(Array.isArray(null===(s=D.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,S.PA)(D.metadata.litellm_disabled_callbacks):[]),[es,et]=(0,l.useState)(D.auto_rotate||!1),[ea,el]=(0,l.useState)(D.rotation_interval||"");(0,l.useEffect)(()=>{let e=async()=>{if(F&&z&&E)try{if(null===D.team_id){let e=(await (0,o.modelAvailableCall)(E,F,z)).data.map(e=>e.id);q(e)}else if(null==J?void 0:J.team_id){let e=await (0,j.wk)(F,z,E,J.team_id);q(Array.from(new Set([...J.models,...e])))}}catch(e){console.error("Error fetching models:",e)}};(async()=>{if(E)try{let e=await (0,o.getPromptsList)(E);B(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}})(),e()},[F,z,E,J,D.team_id]),(0,l.useEffect)(()=>{O.setFieldValue("disabled_callbacks",H)},[O,H]);let er=e=>e&&({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||null,ei={...D,token:D.token||D.token_id,budget_duration:er(D.budget_duration),metadata:Z(D.metadata),guardrails:null===(t=D.metadata)||void 0===t?void 0:t.guardrails,prompts:null===(r=D.metadata)||void 0===r?void 0:r.prompts,vector_stores:(null===(i=D.object_permission)||void 0===i?void 0:i.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(n=D.object_permission)||void 0===n?void 0:n.mcp_servers)||[],accessGroups:(null===(d=D.object_permission)||void 0===d?void 0:d.mcp_access_groups)||[]},mcp_tool_permissions:(null===(u=D.object_permission)||void 0===u?void 0:u.mcp_tool_permissions)||{},logging_settings:w(D.metadata),disabled_callbacks:Array.isArray(null===(N=D.metadata)||void 0===N?void 0:N.litellm_disabled_callbacks)?(0,S.PA)(D.metadata.litellm_disabled_callbacks):[],auto_rotate:D.auto_rotate||!1,...D.rotation_interval&&{rotation_interval:D.rotation_interval}};return(0,l.useEffect)(()=>{var e,s,t,a,l,r,i;O.setFieldsValue({...D,token:D.token||D.token_id,budget_duration:er(D.budget_duration),metadata:Z(D.metadata),guardrails:null===(e=D.metadata)||void 0===e?void 0:e.guardrails,prompts:null===(s=D.metadata)||void 0===s?void 0:s.prompts,vector_stores:(null===(t=D.object_permission)||void 0===t?void 0:t.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=D.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(l=D.object_permission)||void 0===l?void 0:l.mcp_access_groups)||[]},mcp_tool_permissions:(null===(r=D.object_permission)||void 0===r?void 0:r.mcp_tool_permissions)||{},logging_settings:w(D.metadata),disabled_callbacks:Array.isArray(null===(i=D.metadata)||void 0===i?void 0:i.litellm_disabled_callbacks)?(0,S.PA)(D.metadata.litellm_disabled_callbacks):[],auto_rotate:D.auto_rotate||!1,...D.rotation_interval&&{rotation_interval:D.rotation_interval}})},[D,O]),(0,l.useEffect)(()=>{O.setFieldValue("auto_rotate",es)},[es,O]),(0,l.useEffect)(()=>{ea&&O.setFieldValue("rotation_interval",ea)},[ea,O]),console.log("premiumUser:",K),(0,a.jsxs)(c.Z,{form:O,onFinish:R,initialValues:ei,layout:"vertical",children:[(0,a.jsx)(c.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,a.jsx)(p.o,{})}),(0,a.jsx)(c.Z.Item,{label:"Models",name:"models",children:(0,a.jsxs)(h.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[W.length>0&&(0,a.jsx)(h.default.Option,{value:"all-team-models",children:"All Team Models"}),W.map(e=>(0,a.jsx)(h.default.Option,{value:e,children:e},e))]})}),(0,a.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(v.Z,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,a.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(h.default,{placeholder:"n/a",children:[(0,a.jsx)(h.default.Option,{value:"daily",children:"Daily"}),(0,a.jsx)(h.default.Option,{value:"weekly",children:"Weekly"}),(0,a.jsx)(h.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,a.jsx)(c.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(I.Z,{type:"tpm",name:"tpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(c.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(I.Z,{type:"rpm",name:"rpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(c.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,a.jsx)(v.Z,{min:0})}),(0,a.jsx)(c.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,a.jsx)(g.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(c.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,a.jsx)(g.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(c.Z.Item,{label:"Guardrails",name:"guardrails",children:E&&(0,a.jsx)(C.Z,{onChange:e=>{O.setFieldValue("guardrails",e)},accessToken:E,disabled:!K})}),(0,a.jsx)(c.Z.Item,{label:"Prompts",name:"prompts",children:(0,a.jsx)(x.Z,{title:K?"":"Setting prompts by key is a premium feature",placement:"top",children:(0,a.jsx)(h.default,{mode:"tags",style:{width:"100%"},disabled:!K,placeholder:K?Array.isArray(null===(k=D.metadata)||void 0===k?void 0:k.prompts)&&D.metadata.prompts.length>0?"Current: ".concat(D.metadata.prompts.join(", ")):"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:G.map(e=>({value:e,label:e}))})})}),(0,a.jsx)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,a.jsx)(x.Z,{title:K?"":"Setting allowed pass through routes by key is a premium feature",placement:"top",children:(0,a.jsx)(P.Z,{onChange:e=>O.setFieldValue("allowed_passthrough_routes",e),value:O.getFieldValue("allowed_passthrough_routes"),accessToken:E||"",placeholder:K?Array.isArray(null===(L=D.metadata)||void 0===L?void 0:L.allowed_passthrough_routes)&&D.metadata.allowed_passthrough_routes.length>0?"Current: ".concat(D.metadata.allowed_passthrough_routes.join(", ")):"Select or enter allowed pass through routes":"Premium feature - Upgrade to set allowed pass through routes by key",disabled:!K})})}),(0,a.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,a.jsx)(b.Z,{onChange:e=>O.setFieldValue("vector_stores",e),value:O.getFieldValue("vector_stores"),accessToken:E||"",placeholder:"Select vector stores"})}),(0,a.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,a.jsx)(y.Z,{onChange:e=>O.setFieldValue("mcp_servers_and_groups",e),value:O.getFieldValue("mcp_servers_and_groups"),accessToken:E||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(g.default,{type:"hidden"})}),(0,a.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.mcp_servers_and_groups!==s.mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)(_.Z,{accessToken:E||"",selectedServers:(null===(e=O.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:O.getFieldValue("mcp_tool_permissions")||{},onChange:e=>O.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,a.jsx)(c.Z.Item,{label:"Team ID",name:"team_id",children:(0,a.jsx)(h.default,{placeholder:"Select team",style:{width:"100%"},children:null==T?void 0:T.map(e=>(0,a.jsx)(h.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,a.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,a.jsx)(f.Z,{value:O.getFieldValue("logging_settings"),onChange:e=>O.setFieldValue("logging_settings",e),disabledCallbacks:H,onDisabledCallbacksChange:e=>{ee((0,S.PA)(e)),O.setFieldValue("disabled_callbacks",e)}})}),(0,a.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,a.jsx)(g.default.TextArea,{rows:10})}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(A.Z,{form:O,autoRotationEnabled:es,onAutoRotationChange:et,rotationInterval:ea,onRotationIntervalChange:el})}),(0,a.jsx)(c.Z.Item,{name:"token",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(c.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(c.Z.Item,{name:"auto_rotate",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)(c.Z.Item,{name:"rotation_interval",hidden:!0,children:(0,a.jsx)(g.default,{})}),(0,a.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,a.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,a.jsx)(m.ZP,{onClick:M,children:"Cancel"}),(0,a.jsx)(p.z,{type:"submit",children:"Save Changes"})]})})]})}var D=t(16721),M=t(82680),R=t(20577),T=t(7366),E=t(29233);function F(e){let{selectedToken:s,visible:t,onClose:r,accessToken:i,premiumUser:n,setAccessToken:d,onKeyUpdate:m}=e,[x]=c.Z.useForm(),[h,g]=(0,l.useState)(null),[p,j]=(0,l.useState)(null),[v,b]=(0,l.useState)(null),[y,_]=(0,l.useState)(!1),[f,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{t&&s&&i&&(x.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),w(i),N(s.key_name===i))},[t,s,x,i]),(0,l.useEffect)(()=>{t||(g(null),_(!1),N(!1),w(null),x.resetFields())},[t,x]);let Z=e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,T.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,T.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,T.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,l.useEffect)(()=>{(null==p?void 0:p.duration)?b(Z(p.duration)):b(null)},[null==p?void 0:p.duration]);let S=async()=>{if(s&&k){_(!0);try{let e=await x.validateFields(),t=await (0,o.regenerateKeyCall)(k,s.token||s.token_id,e);g(t.key),u.Z.success("API Key regenerated successfully"),console.log("Full regenerate response:",t);let a={token:t.token||t.key_id||s.token,key_name:t.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?Z(e.duration):s.expires,...t};console.log("Updated key data with new token:",a),f&&(w(t.key),d&&d(t.key)),m&&m(a),_(!1)}catch(e){console.error("Error regenerating key:",e),u.Z.fromBackend(e),_(!1)}}},C=()=>{g(null),_(!1),N(!1),w(null),x.resetFields(),r()};return(0,a.jsx)(M.Z,{title:"Regenerate API Key",open:t,onCancel:C,footer:h?[(0,a.jsx)(D.zx,{onClick:C,children:"Close"},"close")]:[(0,a.jsx)(D.zx,{onClick:C,className:"mr-2",children:"Cancel"},"cancel"),(0,a.jsx)(D.zx,{onClick:S,disabled:y,children:y?"Regenerating...":"Regenerate"},"regenerate")],children:h?(0,a.jsxs)(D.rj,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(D.Dx,{children:"Regenerated Key"}),(0,a.jsx)(D.JX,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons,"," ",(0,a.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,a.jsxs)(D.JX,{numColSpan:1,children:[(0,a.jsx)(D.xv,{className:"mt-3",children:"Key Alias:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,a.jsx)(D.xv,{className:"mt-3",children:"New API Key:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:h})}),(0,a.jsx)(E.CopyToClipboard,{text:h,onCopy:()=>u.Z.success("API Key copied to clipboard"),children:(0,a.jsx)(D.zx,{className:"mt-3",children:"Copy API Key"})})]})]}):(0,a.jsxs)(c.Z,{form:x,layout:"vertical",onValuesChange:e=>{"duration"in e&&j(s=>({...s,duration:e.duration}))},children:[(0,a.jsx)(c.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,a.jsx)(D.oi,{disabled:!0})}),(0,a.jsx)(c.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,a.jsx)(R.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,a.jsx)(R.Z,{style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,a.jsx)(R.Z,{style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,a.jsx)(D.oi,{placeholder:""})}),(0,a.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry: ",(null==s?void 0:s.expires)?new Date(s.expires).toLocaleString():"Never"]}),v&&(0,a.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",v]})]})})}var z=t(20347),K=t(98015),O=t(27799),U=t(59872),V=t(30401),G=t(78867),B=t(85968),J=t(40728),W=t(58710),q=e=>{let{autoRotate:s=!1,rotationInterval:t,lastRotationAt:l,keyRotationAt:r,nextRotationAt:i,variant:d="card",className:o=""}=e,c=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)},m=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(J.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(J.C,{color:s?"green":"gray",size:"xs",children:s?"Enabled":"Disabled"}),s&&t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(J.x,{className:"text-gray-400",children:"•"}),(0,a.jsxs)(J.x,{className:"text-sm text-gray-600",children:["Every ",t]})]})]})}),(s||l||r||i)&&(0,a.jsxs)("div",{className:"space-y-3",children:[l&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(W.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(J.x,{className:"font-medium text-gray-700",children:"Last Rotation"}),(0,a.jsx)(J.x,{className:"text-sm text-gray-600",children:c(l)})]})]}),(r||i)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(W.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(J.x,{className:"font-medium text-gray-700",children:"Next Scheduled Rotation"}),(0,a.jsx)(J.x,{className:"text-sm text-gray-600",children:c(i||r||"")})]})]}),s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(W.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsx)(J.x,{className:"text-gray-600",children:"No rotation history available"})]})]}),!s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(n.Z,{className:"w-4 h-4 text-gray-400"}),(0,a.jsx)(J.x,{className:"text-gray-600",children:"Auto-rotation is not enabled for this key"})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(J.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(J.x,{className:"text-xs text-gray-500",children:"Automatic key rotation settings and status for this key"})]})}),m]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(J.x,{className:"font-medium text-gray-900 mb-3",children:"Auto-Rotation"}),m]})};function $(e){var s,t,h,g,p,j;let{keyId:v,onClose:b,keyData:y,accessToken:_,userID:f,userRole:N,teams:k,onKeyDataUpdate:C,onDelete:A,premiumUser:I,setAccessToken:P,backButtonText:D="Back to Keys"}=e,[M,R]=(0,l.useState)(!1),[T]=c.Z.useForm(),[E,J]=(0,l.useState)(!1),[W,$]=(0,l.useState)(""),[Q,X]=(0,l.useState)(!1),[Y,H]=(0,l.useState)({}),[ee,es]=(0,l.useState)(y),[et,ea]=(0,l.useState)(null),[el,er]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{y&&es(y)},[y]),(0,l.useEffect)(()=>{if(el){let e=setTimeout(()=>{er(!1)},5e3);return()=>clearTimeout(e)}},[el]),!ee)return(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(r.zx,{icon:i.Z,variant:"light",onClick:b,className:"mb-4",children:D}),(0,a.jsx)(r.xv,{children:"Key not found"})]});let ei=async e=>{try{var s,t,a,l;if(!_)return;let r=e.token;if(e.key=r,I||(delete e.guardrails,delete e.prompts),void 0!==e.vector_stores&&(e.object_permission={...ee.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...ee.object_permission,mcp_servers:s||[],mcp_access_groups:t||[]},delete e.mcp_servers_and_groups}if(void 0!==e.mcp_tool_permissions){let s=e.mcp_tool_permissions||{};Object.keys(s).length>0&&(e.object_permission={...e.object_permission,mcp_tool_permissions:s}),delete e.mcp_tool_permissions}if(e.metadata&&"string"==typeof e.metadata)try{let a=JSON.parse(e.metadata);e.metadata={...a,...(null===(s=e.guardrails)||void 0===s?void 0:s.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(t=e.disabled_callbacks)||void 0===t?void 0:t.length)>0?{litellm_disabled_callbacks:(0,S.Z3)(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),u.Z.error("Invalid metadata JSON");return}else e.metadata={...e.metadata||{},...(null===(a=e.guardrails)||void 0===a?void 0:a.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(l=e.disabled_callbacks)||void 0===l?void 0:l.length)>0?{litellm_disabled_callbacks:(0,S.Z3)(e.disabled_callbacks)}:{}};delete e.logging_settings,e.budget_duration&&(e.budget_duration=({daily:"24h",weekly:"7d",monthly:"30d"})[e.budget_duration]);let i=await (0,o.keyUpdateCall)(_,e);es(e=>e?{...e,...i}:void 0),C&&C(i),u.Z.success("Key updated successfully"),R(!1)}catch(e){u.Z.fromBackend((0,B.O)(e)),console.error("Error updating key:",e)}},en=async()=>{try{if(!_)return;await (0,o.keyDeleteCall)(_,ee.token||ee.token_id),u.Z.success("Key deleted successfully"),A&&A(),b()}catch(e){console.error("Error deleting the key:",e),u.Z.fromBackend(e)}$("")},ed=async(e,s)=>{await (0,U.vQ)(e)&&(H(e=>({...e,[s]:!0})),setTimeout(()=>{H(e=>({...e,[s]:!1}))},2e3))},eo=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)};return(0,a.jsxs)("div",{className:"w-full h-screen p-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.zx,{icon:i.Z,variant:"light",onClick:b,className:"mb-4",children:D}),(0,a.jsx)(r.Dx,{children:ee.key_alias||"API Key"}),(0,a.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,a.jsx)(r.xv,{className:"text-gray-500 font-mono text-sm",children:ee.token_id||ee.token})]}),(0,a.jsx)(m.ZP,{type:"text",size:"small",icon:Y["key-id"]?(0,a.jsx)(V.Z,{size:12}):(0,a.jsx)(G.Z,{size:12}),onClick:()=>ed(ee.token_id||ee.token,"key-id"),className:"ml-2 transition-all duration-200".concat(Y["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)(r.xv,{className:"text-sm text-gray-500",children:ee.updated_at&&ee.updated_at!==ee.created_at?"Updated: ".concat(eo(ee.updated_at)):"Created: ".concat(eo(ee.created_at))}),el&&(0,a.jsx)(r.Ct,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),et&&(0,a.jsx)(r.Ct,{color:"blue",size:"xs",children:"Regenerated"})]})]}),N&&z.LQ.includes(N)&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Z,{title:I?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,a.jsx)("span",{className:"inline-block",children:(0,a.jsx)(r.zx,{icon:n.Z,variant:"secondary",onClick:()=>X(!0),className:"flex items-center",disabled:!I,children:"Regenerate Key"})})}),(0,a.jsx)(r.zx,{icon:d.Z,variant:"secondary",onClick:()=>J(!0),className:"flex items-center",children:"Delete Key"})]})]}),(0,a.jsx)(F,{selectedToken:ee,visible:Q,onClose:()=>X(!1),accessToken:_,premiumUser:I,setAccessToken:P,onKeyUpdate:e=>{es(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),ea(new Date),er(!0),C&&C({...e,created_at:new Date().toLocaleString()})}}),E&&(()=>{let e=(null==ee?void 0:ee.key_alias)||(null==ee?void 0:ee.token_id)||"API Key",s=W===e;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Key"}),(0,a.jsx)("button",{onClick:()=>{J(!1),$("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsxs)("div",{className:"px-6 py-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,a.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-medium text-red-600",children:"Warning: You are about to delete this API key."}),(0,a.jsx)("p",{className:"text-base text-red-600 mt-2",children:"This action is irreversible and will immediately revoke access for any applications using this key."})]})]}),(0,a.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to delete this API key?"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,a.jsx)("span",{className:"underline",children:e})," to confirm deletion:"]}),(0,a.jsx)("input",{type:"text",value:W,onChange:e=>$(e.target.value),placeholder:"Enter key name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,a.jsx)("button",{onClick:()=>{J(!1),$("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,a.jsx)("button",{onClick:en,disabled:!s,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(s?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Delete Key"})]})]})})})(),(0,a.jsxs)(r.v0,{children:[(0,a.jsxs)(r.td,{className:"mb-4",children:[(0,a.jsx)(r.OK,{children:"Overview"}),(0,a.jsx)(r.OK,{children:"Settings"})]}),(0,a.jsxs)(r.nP,{children:[(0,a.jsx)(r.x4,{children:(0,a.jsxs)(r.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Spend"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(r.Dx,{children:["$",(0,U.pw)(ee.spend,4)]}),(0,a.jsxs)(r.xv,{children:["of"," ",null!==ee.max_budget?"$".concat((0,U.pw)(ee.max_budget)):"Unlimited"]})]})]}),(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Rate Limits"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(r.xv,{children:["TPM: ",null!==ee.tpm_limit?ee.tpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["RPM: ",null!==ee.rpm_limit?ee.rpm_limit:"Unlimited"]})]})]}),(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.xv,{children:"Models"}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:ee.models&&ee.models.length>0?ee.models.map((e,s)=>(0,a.jsx)(r.Ct,{color:"red",children:e},s)):(0,a.jsx)(r.xv,{children:"No models specified"})})]}),(0,a.jsx)(r.Zb,{children:(0,a.jsx)(K.Z,{objectPermission:ee.object_permission,variant:"inline",accessToken:_})}),(0,a.jsx)(O.Z,{loggingConfigs:w(ee.metadata),disabledCallbacks:Array.isArray(null===(s=ee.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,S.PA)(ee.metadata.litellm_disabled_callbacks):[],variant:"card"}),(0,a.jsx)(q,{autoRotate:ee.auto_rotate,rotationInterval:ee.rotation_interval,lastRotationAt:ee.last_rotation_at,keyRotationAt:ee.key_rotation_at,nextRotationAt:ee.next_rotation_at,variant:"card"})]})}),(0,a.jsx)(r.x4,{children:(0,a.jsxs)(r.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(r.Dx,{children:"Key Settings"}),!M&&N&&z.LQ.includes(N)&&(0,a.jsx)(r.zx,{variant:"light",onClick:()=>R(!0),children:"Edit Settings"})]}),M?(0,a.jsx)(L,{keyData:ee,onCancel:()=>R(!1),onSubmit:ei,teams:k,accessToken:_,userID:f,userRole:N,premiumUser:I}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Key ID"}),(0,a.jsx)(r.xv,{className:"font-mono",children:ee.token_id||ee.token})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Key Alias"}),(0,a.jsx)(r.xv,{children:ee.key_alias||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Secret Key"}),(0,a.jsx)(r.xv,{className:"font-mono",children:ee.key_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Team ID"}),(0,a.jsx)(r.xv,{children:ee.team_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Organization"}),(0,a.jsx)(r.xv,{children:ee.organization_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created"}),(0,a.jsx)(r.xv,{children:eo(ee.created_at)})]}),et&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Last Regenerated"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.xv,{children:eo(et)}),(0,a.jsx)(r.Ct,{color:"green",size:"xs",children:"Recent"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Expires"}),(0,a.jsx)(r.xv,{children:ee.expires?eo(ee.expires):"Never"})]}),(0,a.jsx)(q,{autoRotate:ee.auto_rotate,rotationInterval:ee.rotation_interval,lastRotationAt:ee.last_rotation_at,keyRotationAt:ee.key_rotation_at,nextRotationAt:ee.next_rotation_at,variant:"inline",className:"pt-4 border-t border-gray-200"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Spend"}),(0,a.jsxs)(r.xv,{children:["$",(0,U.pw)(ee.spend,4)," USD"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Budget"}),(0,a.jsx)(r.xv,{children:null!==ee.max_budget?"$".concat((0,U.pw)(ee.max_budget,2)):"Unlimited"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Prompts"}),(0,a.jsx)(r.xv,{children:Array.isArray(null===(t=ee.metadata)||void 0===t?void 0:t.prompts)&&ee.metadata.prompts.length>0?ee.metadata.prompts.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No prompts specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Allowed Pass Through Routes"}),(0,a.jsx)(r.xv,{children:Array.isArray(null===(h=ee.metadata)||void 0===h?void 0:h.allowed_passthrough_routes)&&ee.metadata.allowed_passthrough_routes.length>0?ee.metadata.allowed_passthrough_routes.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No pass through routes specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Models"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:ee.models&&ee.models.length>0?ee.models.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,a.jsx)(r.xv,{children:"No models specified"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Rate Limits"}),(0,a.jsxs)(r.xv,{children:["TPM: ",null!==ee.tpm_limit?ee.tpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["RPM: ",null!==ee.rpm_limit?ee.rpm_limit:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Max Parallel Requests:"," ",null!==ee.max_parallel_requests?ee.max_parallel_requests:"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Model TPM Limits:"," ",(null===(g=ee.metadata)||void 0===g?void 0:g.model_tpm_limit)?JSON.stringify(ee.metadata.model_tpm_limit):"Unlimited"]}),(0,a.jsxs)(r.xv,{children:["Model RPM Limits:"," ",(null===(p=ee.metadata)||void 0===p?void 0:p.model_rpm_limit)?JSON.stringify(ee.metadata.model_rpm_limit):"Unlimited"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Metadata"}),(0,a.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:Z(ee.metadata)})]}),(0,a.jsx)(K.Z,{objectPermission:ee.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:_}),(0,a.jsx)(O.Z,{loggingConfigs:w(ee.metadata),disabledCallbacks:Array.isArray(null===(j=ee.metadata)||void 0===j?void 0:j.litellm_disabled_callbacks)?(0,S.PA)(ee.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5105-eb18802ec448789d.js b/litellm/proxy/_experimental/out/_next/static/chunks/5105-e9f08a6b3a1f2881.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/5105-eb18802ec448789d.js rename to litellm/proxy/_experimental/out/_next/static/chunks/5105-e9f08a6b3a1f2881.js index bd2f7143a4..47357e7c67 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5105-eb18802ec448789d.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/5105-e9f08a6b3a1f2881.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{75105:function(t,e,n){n.d(e,{Z:function(){return te}});var r=n(5853),a=n(2265),i=n(47625),o=n(93765),l=n(87602),c=n(59221),s=n(86757),u=n.n(s),p=n(95645),d=n.n(p),y=n(77571),f=n.n(y),m=n(82559),h=n.n(m),v=n(21652),b=n.n(v),g=n(57165),k=n(81889),x=n(9841),A=n(58772),O=n(34067),E=n(16630),P=n(85355),j=n(82944),w=["layout","type","stroke","connectNulls","isRange","ref"];function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function L(){return(L=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(i,w));return a.createElement(x.m,{clipPath:n?"url(#clipPath-".concat(r,")"):null},a.createElement(g.H,L({},(0,j.L6)(p,!0),{points:t,connectNulls:s,type:l,baseLine:e,layout:o,stroke:"none",className:"recharts-area-area"})),"none"!==c&&a.createElement(g.H,L({},(0,j.L6)(this.props,!1),{className:"recharts-area-curve",layout:o,type:l,connectNulls:s,fill:"none",points:t})),"none"!==c&&u&&a.createElement(g.H,L({},(0,j.L6)(this.props,!1),{className:"recharts-area-curve",layout:o,type:l,connectNulls:s,fill:"none",points:e})))}},{key:"renderAreaWithAnimation",value:function(t,e){var n=this,r=this.props,i=r.points,o=r.baseLine,l=r.isAnimationActive,s=r.animationBegin,u=r.animationDuration,p=r.animationEasing,d=r.animationId,y=this.state,m=y.prevPoints,v=y.prevBaseLine;return a.createElement(c.ZP,{begin:s,duration:u,isActive:l,easing:p,from:{t:0},to:{t:1},key:"area-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var l=r.t;if(m){var c,s=m.length/i.length,u=i.map(function(t,e){var n=Math.floor(e*s);if(m[n]){var r=m[n],a=(0,E.k4)(r.x,t.x),i=(0,E.k4)(r.y,t.y);return N(N({},t),{},{x:a(l),y:i(l)})}return t});return c=(0,E.hj)(o)&&"number"==typeof o?(0,E.k4)(v,o)(l):f()(o)||h()(o)?(0,E.k4)(v,0)(l):o.map(function(t,e){var n=Math.floor(e*s);if(v[n]){var r=v[n],a=(0,E.k4)(r.x,t.x),i=(0,E.k4)(r.y,t.y);return N(N({},t),{},{x:a(l),y:i(l)})}return t}),n.renderAreaStatically(u,c,t,e)}return a.createElement(x.m,null,a.createElement("defs",null,a.createElement("clipPath",{id:"animationClipPath-".concat(e)},n.renderClipRect(l))),a.createElement(x.m,{clipPath:"url(#animationClipPath-".concat(e,")")},n.renderAreaStatically(i,o,t,e)))})}},{key:"renderArea",value:function(t,e){var n=this.props,r=n.points,a=n.baseLine,i=n.isAnimationActive,o=this.state,l=o.prevPoints,c=o.prevBaseLine,s=o.totalLength;return i&&r&&r.length&&(!l&&s>0||!b()(l,r)||!b()(c,a))?this.renderAreaWithAnimation(t,e):this.renderAreaStatically(r,a,t,e)}},{key:"render",value:function(){var t,e=this.props,n=e.hide,r=e.dot,i=e.points,o=e.className,c=e.top,s=e.left,u=e.xAxis,p=e.yAxis,d=e.width,y=e.height,m=e.isAnimationActive,h=e.id;if(n||!i||!i.length)return null;var v=this.state.isAnimationFinished,b=1===i.length,g=(0,l.Z)("recharts-area",o),k=u&&u.allowDataOverflow,O=p&&p.allowDataOverflow,E=k||O,P=f()(h)?this.id:h,w=null!==(t=(0,j.L6)(r,!1))&&void 0!==t?t:{r:3,strokeWidth:2},S=w.r,L=w.strokeWidth,D=((0,j.$k)(r)?r:{}).clipDot,N=void 0===D||D,C=2*(void 0===S?3:S)+(void 0===L?2:L);return a.createElement(x.m,{className:g},k||O?a.createElement("defs",null,a.createElement("clipPath",{id:"clipPath-".concat(P)},a.createElement("rect",{x:k?s:s-d/2,y:O?c:c-y/2,width:k?d:2*d,height:O?y:2*y})),!N&&a.createElement("clipPath",{id:"clipPath-dots-".concat(P)},a.createElement("rect",{x:s-C/2,y:c-C/2,width:d+C,height:y+C}))):null,b?null:this.renderArea(E,P),(r||b)&&this.renderDots(E,N,P),(!m||v)&&A.e.renderCallByParent(this.props,i))}}],r=[{key:"getDerivedStateFromProps",value:function(t,e){return t.animationId!==e.prevAnimationId?{prevAnimationId:t.animationId,curPoints:t.points,curBaseLine:t.baseLine,prevPoints:e.curPoints,prevBaseLine:e.curBaseLine}:t.points!==e.curPoints||t.baseLine!==e.curBaseLine?{curPoints:t.points,curBaseLine:t.baseLine}:null}}],n&&C(o.prototype,n),r&&C(o,r),Object.defineProperty(o,"prototype",{writable:!1}),o}(a.PureComponent);F(B,"displayName","Area"),F(B,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!O.x.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),F(B,"getBaseValue",function(t,e,n,r){var a=t.layout,i=t.baseValue,o=e.props.baseValue,l=null!=o?o:i;if((0,E.hj)(l)&&"number"==typeof l)return l;var c="horizontal"===a?r:n,s=c.scale.domain();if("number"===c.type){var u=Math.max(s[0],s[1]),p=Math.min(s[0],s[1]);return"dataMin"===l?p:"dataMax"===l?u:u<0?u:Math.max(Math.min(s[0],s[1]),0)}return"dataMin"===l?s[0]:"dataMax"===l?s[1]:s[0]}),F(B,"getComposedData",function(t){var e,n=t.props,r=t.item,a=t.xAxis,i=t.yAxis,o=t.xAxisTicks,l=t.yAxisTicks,c=t.bandSize,s=t.dataKey,u=t.stackedData,p=t.dataStartIndex,d=t.displayedData,y=t.offset,f=n.layout,m=u&&u.length,h=B.getBaseValue(n,r,a,i),v="horizontal"===f,b=!1,g=d.map(function(t,e){m?n=u[p+e]:Array.isArray(n=(0,P.F$)(t,s))?b=!0:n=[h,n];var n,r=null==n[1]||m&&null==(0,P.F$)(t,s);return v?{x:(0,P.Hv)({axis:a,ticks:o,bandSize:c,entry:t,index:e}),y:r?null:i.scale(n[1]),value:n,payload:t}:{x:r?null:a.scale(n[1]),y:(0,P.Hv)({axis:i,ticks:l,bandSize:c,entry:t,index:e}),value:n,payload:t}});return e=m||b?g.map(function(t){var e=Array.isArray(t.value)?t.value[0]:null;return v?{x:t.x,y:null!=e&&null!=t.y?i.scale(e):null}:{x:null!=e?a.scale(e):null,y:t.y}}):v?i.scale(h):a.scale(h),N({points:g,baseLine:e,layout:f,isRange:b},y)}),F(B,"renderDotItem",function(t,e){return a.isValidElement(t)?a.cloneElement(t,e):u()(t)?t(e):a.createElement(k.o,L({},e,{className:"recharts-area-dot"}))});var R=n(97059),W=n(62994),_=n(25311),V=(0,o.z)({chartName:"AreaChart",GraphicalChild:B,axisComponents:[{axisType:"xAxis",AxisComp:R.K},{axisType:"yAxis",AxisComp:W.B}],formatAxisMap:_.t9}),G=n(56940),z=n(8147),H=n(22190),q=n(54061),Z=n(65278),$=n(98593),X=n(69448),U=n(32644),Y=n(7084),J=n(26898),Q=n(97324),tt=n(1153);let te=a.forwardRef((t,e)=>{let{data:n=[],categories:o=[],index:l,stack:c=!1,colors:s=J.s,valueFormatter:u=tt.Cj,startEndOnly:p=!1,showXAxis:d=!0,showYAxis:y=!0,yAxisWidth:f=56,intervalType:m="equidistantPreserveStart",showAnimation:h=!1,animationDuration:v=900,showTooltip:b=!0,showLegend:g=!0,showGridLines:x=!0,showGradient:A=!0,autoMinValue:O=!1,curveType:E="linear",minValue:P,maxValue:j,connectNulls:w=!1,allowDecimals:S=!0,noDataText:L,className:D,onValueChange:N,enableLegendSlider:C=!1,customTooltip:T,rotateLabelX:K,tickGap:M=5}=t,F=(0,r._T)(t,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),I=(d||y)&&(!p||y)?20:0,[_,te]=(0,a.useState)(60),[tn,tr]=(0,a.useState)(void 0),[ta,ti]=(0,a.useState)(void 0),to=(0,U.me)(o,s),tl=(0,U.i4)(O,P,j),tc=!!N;function ts(t){tc&&(t===ta&&!tn||(0,U.FB)(n,t)&&tn&&tn.dataKey===t?(ti(void 0),null==N||N(null)):(ti(t),null==N||N({eventType:"category",categoryClicked:t})),tr(void 0))}return a.createElement("div",Object.assign({ref:e,className:(0,Q.q)("w-full h-80",D)},F),a.createElement(i.h,{className:"h-full w-full"},(null==n?void 0:n.length)?a.createElement(V,{data:n,onClick:tc&&(ta||tn)?()=>{tr(void 0),ti(void 0),null==N||N(null)}:void 0},x?a.createElement(G.q,{className:(0,Q.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,a.createElement(R.K,{padding:{left:I,right:I},hide:!d,dataKey:l,tick:{transform:"translate(0, 6)"},ticks:p?[n[0][l],n[n.length-1][l]]:void 0,fill:"",stroke:"",className:(0,Q.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:p?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:M,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight}),a.createElement(W.B,{width:f,hide:!y,axisLine:!1,tickLine:!1,type:"number",domain:tl,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,Q.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:u,allowDecimals:S}),a.createElement(z.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:b?t=>{let{active:e,payload:n,label:r}=t;return T?a.createElement(T,{payload:null==n?void 0:n.map(t=>{var e;return Object.assign(Object.assign({},t),{color:null!==(e=to.get(t.dataKey))&&void 0!==e?e:Y.fr.Gray})}),active:e,label:r}):a.createElement($.ZP,{active:e,payload:n,label:r,valueFormatter:u,categoryColors:to})}:a.createElement(a.Fragment,null),position:{y:0}}),g?a.createElement(H.D,{verticalAlign:"top",height:_,content:t=>{let{payload:e}=t;return(0,Z.Z)({payload:e},to,te,ta,tc?t=>ts(t):void 0,C)}}):null,o.map(t=>{var e,n;return a.createElement("defs",{key:t},A?a.createElement("linearGradient",{className:(0,tt.bM)(null!==(e=to.get(t))&&void 0!==e?e:Y.fr.Gray,J.K.text).textColor,id:to.get(t),x1:"0",y1:"0",x2:"0",y2:"1"},a.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:tn||ta&&ta!==t?.15:.4}),a.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):a.createElement("linearGradient",{className:(0,tt.bM)(null!==(n=to.get(t))&&void 0!==n?n:Y.fr.Gray,J.K.text).textColor,id:to.get(t),x1:"0",y1:"0",x2:"0",y2:"1"},a.createElement("stop",{stopColor:"currentColor",stopOpacity:tn||ta&&ta!==t?.1:.3})))}),o.map(t=>{var e;return a.createElement(B,{className:(0,tt.bM)(null!==(e=to.get(t))&&void 0!==e?e:Y.fr.Gray,J.K.text).strokeColor,strokeOpacity:tn||ta&&ta!==t?.3:1,activeDot:t=>{var e;let{cx:r,cy:i,stroke:o,strokeLinecap:l,strokeLinejoin:c,strokeWidth:s,dataKey:u}=t;return a.createElement(k.o,{className:(0,Q.q)("stroke-tremor-background dark:stroke-dark-tremor-background",N?"cursor-pointer":"",(0,tt.bM)(null!==(e=to.get(u))&&void 0!==e?e:Y.fr.Gray,J.K.text).fillColor),cx:r,cy:i,r:5,fill:"",stroke:o,strokeLinecap:l,strokeLinejoin:c,strokeWidth:s,onClick:(e,r)=>{r.stopPropagation(),tc&&(t.index===(null==tn?void 0:tn.index)&&t.dataKey===(null==tn?void 0:tn.dataKey)||(0,U.FB)(n,t.dataKey)&&ta&&ta===t.dataKey?(ti(void 0),tr(void 0),null==N||N(null)):(ti(t.dataKey),tr({index:t.index,dataKey:t.dataKey}),null==N||N(Object.assign({eventType:"dot",categoryClicked:t.dataKey},t.payload))))}})},dot:e=>{var r;let{stroke:i,strokeLinecap:o,strokeLinejoin:l,strokeWidth:c,cx:s,cy:u,dataKey:p,index:d}=e;return(0,U.FB)(n,t)&&!(tn||ta&&ta!==t)||(null==tn?void 0:tn.index)===d&&(null==tn?void 0:tn.dataKey)===t?a.createElement(k.o,{key:d,cx:s,cy:u,r:5,stroke:i,fill:"",strokeLinecap:o,strokeLinejoin:l,strokeWidth:c,className:(0,Q.q)("stroke-tremor-background dark:stroke-dark-tremor-background",N?"cursor-pointer":"",(0,tt.bM)(null!==(r=to.get(p))&&void 0!==r?r:Y.fr.Gray,J.K.text).fillColor)}):a.createElement(a.Fragment,{key:d})},key:t,name:t,type:E,dataKey:t,stroke:"",fill:"url(#".concat(to.get(t),")"),strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:h,animationDuration:v,stackId:c?"a":void 0,connectNulls:w})}),N?o.map(t=>a.createElement(q.x,{className:(0,Q.q)("cursor-pointer"),strokeOpacity:0,key:t,name:t,type:E,dataKey:t,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:w,onClick:(t,e)=>{e.stopPropagation();let{name:n}=t;ts(n)}})):null):a.createElement(X.Z,{noDataText:L})))});te.displayName="AreaChart"},54061:function(t,e,n){n.d(e,{x:function(){return K}});var r=n(2265),a=n(59221),i=n(86757),o=n.n(i),l=n(77571),c=n.n(l),s=n(21652),u=n.n(s),p=n(87602),d=n(57165),y=n(81889),f=n(9841),m=n(58772),h=n(13137),v=n(16630),b=n(82944),g=n(34067),k=n(85355),x=["type","layout","connectNulls","ref"];function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O(){return(O=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);ni){l=[].concat(j(r.slice(0,c)),[i-u]);break}var p=l.length%2==0?[0,o]:[o];return[].concat(j(s.repeat(r,Math.floor(e/a))),j(l),p).map(function(t){return"".concat(t,"px")}).join(", ")}),C(D(t),"id",(0,v.EL)("recharts-line-")),C(D(t),"pathRef",function(e){t.mainCurve=e}),C(D(t),"handleAnimationEnd",function(){t.setState({isAnimationFinished:!0}),t.props.onAnimationEnd&&t.props.onAnimationEnd()}),C(D(t),"handleAnimationStart",function(){t.setState({isAnimationFinished:!1}),t.props.onAnimationStart&&t.props.onAnimationStart()}),t}return n=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var t=this.getTotalLength();this.setState({totalLength:t})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var t=this.getTotalLength();t!==this.state.totalLength&&this.setState({totalLength:t})}}},{key:"getTotalLength",value:function(){var t=this.mainCurve;try{return t&&t.getTotalLength&&t.getTotalLength()||0}catch(t){return 0}}},{key:"renderErrorBar",value:function(t,e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,a=n.points,i=n.xAxis,o=n.yAxis,l=n.layout,c=n.children,s=(0,b.NN)(c,h.W);if(!s)return null;var u=function(t,e){return{x:t.x,y:t.y,value:t.value,errorVal:(0,k.F$)(t.payload,e)}};return r.createElement(f.m,{clipPath:t?"url(#clipPath-".concat(e,")"):null},s.map(function(t){return r.cloneElement(t,{key:"bar-".concat(t.props.dataKey),data:a,xAxis:i,yAxis:o,layout:l,dataPointFormatter:u})}))}},{key:"renderDots",value:function(t,e,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,i=a.dot,o=a.points,l=a.dataKey,c=(0,b.L6)(this.props,!1),u=(0,b.L6)(i,!0),p=o.map(function(t,e){var n=P(P(P({key:"dot-".concat(e),r:3},c),u),{},{value:t.value,dataKey:l,cx:t.x,cy:t.y,index:e,payload:t.payload});return s.renderDotItem(i,n)}),d={clipPath:t?"url(#clipPath-".concat(e?"":"dots-").concat(n,")"):null};return r.createElement(f.m,O({className:"recharts-line-dots",key:"dots"},d),p)}},{key:"renderCurveStatically",value:function(t,e,n,a){var i=this.props,o=i.type,l=i.layout,c=i.connectNulls,s=(i.ref,function(t,e){if(null==t)return{};var n,r,a=function(t,e){if(null==t)return{};var n,r,a={},i=Object.keys(t);for(r=0;r=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(i,x)),u=P(P(P({},(0,b.L6)(s,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:e?"url(#clipPath-".concat(n,")"):null,points:t},a),{},{type:o,layout:l,connectNulls:c});return r.createElement(d.H,O({},u,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(t,e){var n=this,i=this.props,o=i.points,l=i.strokeDasharray,c=i.isAnimationActive,s=i.animationBegin,u=i.animationDuration,p=i.animationEasing,d=i.animationId,y=i.animateNewValues,f=i.width,m=i.height,h=this.state,b=h.prevPoints,g=h.totalLength;return r.createElement(a.ZP,{begin:s,duration:u,isActive:c,easing:p,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var a,i=r.t;if(b){var c=b.length/o.length,s=o.map(function(t,e){var n=Math.floor(e*c);if(b[n]){var r=b[n],a=(0,v.k4)(r.x,t.x),o=(0,v.k4)(r.y,t.y);return P(P({},t),{},{x:a(i),y:o(i)})}if(y){var l=(0,v.k4)(2*f,t.x),s=(0,v.k4)(m/2,t.y);return P(P({},t),{},{x:l(i),y:s(i)})}return P(P({},t),{},{x:t.x,y:t.y})});return n.renderCurveStatically(s,t,e)}var u=(0,v.k4)(0,g)(i);if(l){var p="".concat(l).split(/[,\s]+/gim).map(function(t){return parseFloat(t)});a=n.getStrokeDasharray(u,g,p)}else a=n.generateSimpleStrokeDasharray(g,u);return n.renderCurveStatically(o,t,e,{strokeDasharray:a})})}},{key:"renderCurve",value:function(t,e){var n=this.props,r=n.points,a=n.isAnimationActive,i=this.state,o=i.prevPoints,l=i.totalLength;return a&&r&&r.length&&(!o&&l>0||!u()(o,r))?this.renderCurveWithAnimation(t,e):this.renderCurveStatically(r,t,e)}},{key:"render",value:function(){var t,e=this.props,n=e.hide,a=e.dot,i=e.points,o=e.className,l=e.xAxis,s=e.yAxis,u=e.top,d=e.left,y=e.width,h=e.height,v=e.isAnimationActive,g=e.id;if(n||!i||!i.length)return null;var k=this.state.isAnimationFinished,x=1===i.length,A=(0,p.Z)("recharts-line",o),O=l&&l.allowDataOverflow,E=s&&s.allowDataOverflow,P=O||E,j=c()(g)?this.id:g,w=null!==(t=(0,b.L6)(a,!1))&&void 0!==t?t:{r:3,strokeWidth:2},S=w.r,L=w.strokeWidth,D=((0,b.$k)(a)?a:{}).clipDot,N=void 0===D||D,C=2*(void 0===S?3:S)+(void 0===L?2:L);return r.createElement(f.m,{className:A},O||E?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(j)},r.createElement("rect",{x:O?d:d-y/2,y:E?u:u-h/2,width:O?y:2*y,height:E?h:2*h})),!N&&r.createElement("clipPath",{id:"clipPath-dots-".concat(j)},r.createElement("rect",{x:d-C/2,y:u-C/2,width:y+C,height:h+C}))):null,!x&&this.renderCurve(P,j),this.renderErrorBar(P,j),(x||a)&&this.renderDots(P,N,j),(!v||k)&&m.e.renderCallByParent(this.props,i))}}],i=[{key:"getDerivedStateFromProps",value:function(t,e){return t.animationId!==e.prevAnimationId?{prevAnimationId:t.animationId,curPoints:t.points,prevPoints:e.curPoints}:t.points!==e.curPoints?{curPoints:t.points}:null}},{key:"repeat",value:function(t,e){for(var n=t.length%2!=0?[].concat(j(t),[0]):t,r=[],a=0;a=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(i,w));return a.createElement(x.m,{clipPath:n?"url(#clipPath-".concat(r,")"):null},a.createElement(g.H,L({},(0,j.L6)(p,!0),{points:t,connectNulls:s,type:l,baseLine:e,layout:o,stroke:"none",className:"recharts-area-area"})),"none"!==c&&a.createElement(g.H,L({},(0,j.L6)(this.props,!1),{className:"recharts-area-curve",layout:o,type:l,connectNulls:s,fill:"none",points:t})),"none"!==c&&u&&a.createElement(g.H,L({},(0,j.L6)(this.props,!1),{className:"recharts-area-curve",layout:o,type:l,connectNulls:s,fill:"none",points:e})))}},{key:"renderAreaWithAnimation",value:function(t,e){var n=this,r=this.props,i=r.points,o=r.baseLine,l=r.isAnimationActive,s=r.animationBegin,u=r.animationDuration,p=r.animationEasing,d=r.animationId,y=this.state,m=y.prevPoints,v=y.prevBaseLine;return a.createElement(c.ZP,{begin:s,duration:u,isActive:l,easing:p,from:{t:0},to:{t:1},key:"area-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var l=r.t;if(m){var c,s=m.length/i.length,u=i.map(function(t,e){var n=Math.floor(e*s);if(m[n]){var r=m[n],a=(0,E.k4)(r.x,t.x),i=(0,E.k4)(r.y,t.y);return N(N({},t),{},{x:a(l),y:i(l)})}return t});return c=(0,E.hj)(o)&&"number"==typeof o?(0,E.k4)(v,o)(l):f()(o)||h()(o)?(0,E.k4)(v,0)(l):o.map(function(t,e){var n=Math.floor(e*s);if(v[n]){var r=v[n],a=(0,E.k4)(r.x,t.x),i=(0,E.k4)(r.y,t.y);return N(N({},t),{},{x:a(l),y:i(l)})}return t}),n.renderAreaStatically(u,c,t,e)}return a.createElement(x.m,null,a.createElement("defs",null,a.createElement("clipPath",{id:"animationClipPath-".concat(e)},n.renderClipRect(l))),a.createElement(x.m,{clipPath:"url(#animationClipPath-".concat(e,")")},n.renderAreaStatically(i,o,t,e)))})}},{key:"renderArea",value:function(t,e){var n=this.props,r=n.points,a=n.baseLine,i=n.isAnimationActive,o=this.state,l=o.prevPoints,c=o.prevBaseLine,s=o.totalLength;return i&&r&&r.length&&(!l&&s>0||!b()(l,r)||!b()(c,a))?this.renderAreaWithAnimation(t,e):this.renderAreaStatically(r,a,t,e)}},{key:"render",value:function(){var t,e=this.props,n=e.hide,r=e.dot,i=e.points,o=e.className,c=e.top,s=e.left,u=e.xAxis,p=e.yAxis,d=e.width,y=e.height,m=e.isAnimationActive,h=e.id;if(n||!i||!i.length)return null;var v=this.state.isAnimationFinished,b=1===i.length,g=(0,l.Z)("recharts-area",o),k=u&&u.allowDataOverflow,O=p&&p.allowDataOverflow,E=k||O,P=f()(h)?this.id:h,w=null!==(t=(0,j.L6)(r,!1))&&void 0!==t?t:{r:3,strokeWidth:2},S=w.r,L=w.strokeWidth,D=((0,j.$k)(r)?r:{}).clipDot,N=void 0===D||D,C=2*(void 0===S?3:S)+(void 0===L?2:L);return a.createElement(x.m,{className:g},k||O?a.createElement("defs",null,a.createElement("clipPath",{id:"clipPath-".concat(P)},a.createElement("rect",{x:k?s:s-d/2,y:O?c:c-y/2,width:k?d:2*d,height:O?y:2*y})),!N&&a.createElement("clipPath",{id:"clipPath-dots-".concat(P)},a.createElement("rect",{x:s-C/2,y:c-C/2,width:d+C,height:y+C}))):null,b?null:this.renderArea(E,P),(r||b)&&this.renderDots(E,N,P),(!m||v)&&A.e.renderCallByParent(this.props,i))}}],r=[{key:"getDerivedStateFromProps",value:function(t,e){return t.animationId!==e.prevAnimationId?{prevAnimationId:t.animationId,curPoints:t.points,curBaseLine:t.baseLine,prevPoints:e.curPoints,prevBaseLine:e.curBaseLine}:t.points!==e.curPoints||t.baseLine!==e.curBaseLine?{curPoints:t.points,curBaseLine:t.baseLine}:null}}],n&&C(o.prototype,n),r&&C(o,r),Object.defineProperty(o,"prototype",{writable:!1}),o}(a.PureComponent);F(B,"displayName","Area"),F(B,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!O.x.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),F(B,"getBaseValue",function(t,e,n,r){var a=t.layout,i=t.baseValue,o=e.props.baseValue,l=null!=o?o:i;if((0,E.hj)(l)&&"number"==typeof l)return l;var c="horizontal"===a?r:n,s=c.scale.domain();if("number"===c.type){var u=Math.max(s[0],s[1]),p=Math.min(s[0],s[1]);return"dataMin"===l?p:"dataMax"===l?u:u<0?u:Math.max(Math.min(s[0],s[1]),0)}return"dataMin"===l?s[0]:"dataMax"===l?s[1]:s[0]}),F(B,"getComposedData",function(t){var e,n=t.props,r=t.item,a=t.xAxis,i=t.yAxis,o=t.xAxisTicks,l=t.yAxisTicks,c=t.bandSize,s=t.dataKey,u=t.stackedData,p=t.dataStartIndex,d=t.displayedData,y=t.offset,f=n.layout,m=u&&u.length,h=B.getBaseValue(n,r,a,i),v="horizontal"===f,b=!1,g=d.map(function(t,e){m?n=u[p+e]:Array.isArray(n=(0,P.F$)(t,s))?b=!0:n=[h,n];var n,r=null==n[1]||m&&null==(0,P.F$)(t,s);return v?{x:(0,P.Hv)({axis:a,ticks:o,bandSize:c,entry:t,index:e}),y:r?null:i.scale(n[1]),value:n,payload:t}:{x:r?null:a.scale(n[1]),y:(0,P.Hv)({axis:i,ticks:l,bandSize:c,entry:t,index:e}),value:n,payload:t}});return e=m||b?g.map(function(t){var e=Array.isArray(t.value)?t.value[0]:null;return v?{x:t.x,y:null!=e&&null!=t.y?i.scale(e):null}:{x:null!=e?a.scale(e):null,y:t.y}}):v?i.scale(h):a.scale(h),N({points:g,baseLine:e,layout:f,isRange:b},y)}),F(B,"renderDotItem",function(t,e){return a.isValidElement(t)?a.cloneElement(t,e):u()(t)?t(e):a.createElement(k.o,L({},e,{className:"recharts-area-dot"}))});var R=n(97059),W=n(62994),_=n(25311),V=(0,o.z)({chartName:"AreaChart",GraphicalChild:B,axisComponents:[{axisType:"xAxis",AxisComp:R.K},{axisType:"yAxis",AxisComp:W.B}],formatAxisMap:_.t9}),G=n(56940),z=n(8147),H=n(22190),q=n(54061),Z=n(65278),$=n(98593),X=n(69448),U=n(32644),Y=n(7084),J=n(26898),Q=n(97324),tt=n(1153);let te=a.forwardRef((t,e)=>{let{data:n=[],categories:o=[],index:l,stack:c=!1,colors:s=J.s,valueFormatter:u=tt.Cj,startEndOnly:p=!1,showXAxis:d=!0,showYAxis:y=!0,yAxisWidth:f=56,intervalType:m="equidistantPreserveStart",showAnimation:h=!1,animationDuration:v=900,showTooltip:b=!0,showLegend:g=!0,showGridLines:x=!0,showGradient:A=!0,autoMinValue:O=!1,curveType:E="linear",minValue:P,maxValue:j,connectNulls:w=!1,allowDecimals:S=!0,noDataText:L,className:D,onValueChange:N,enableLegendSlider:C=!1,customTooltip:T,rotateLabelX:K,tickGap:M=5}=t,F=(0,r._T)(t,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),I=(d||y)&&(!p||y)?20:0,[_,te]=(0,a.useState)(60),[tn,tr]=(0,a.useState)(void 0),[ta,ti]=(0,a.useState)(void 0),to=(0,U.me)(o,s),tl=(0,U.i4)(O,P,j),tc=!!N;function ts(t){tc&&(t===ta&&!tn||(0,U.FB)(n,t)&&tn&&tn.dataKey===t?(ti(void 0),null==N||N(null)):(ti(t),null==N||N({eventType:"category",categoryClicked:t})),tr(void 0))}return a.createElement("div",Object.assign({ref:e,className:(0,Q.q)("w-full h-80",D)},F),a.createElement(i.h,{className:"h-full w-full"},(null==n?void 0:n.length)?a.createElement(V,{data:n,onClick:tc&&(ta||tn)?()=>{tr(void 0),ti(void 0),null==N||N(null)}:void 0},x?a.createElement(G.q,{className:(0,Q.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,a.createElement(R.K,{padding:{left:I,right:I},hide:!d,dataKey:l,tick:{transform:"translate(0, 6)"},ticks:p?[n[0][l],n[n.length-1][l]]:void 0,fill:"",stroke:"",className:(0,Q.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:p?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:M,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight}),a.createElement(W.B,{width:f,hide:!y,axisLine:!1,tickLine:!1,type:"number",domain:tl,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,Q.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:u,allowDecimals:S}),a.createElement(z.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:b?t=>{let{active:e,payload:n,label:r}=t;return T?a.createElement(T,{payload:null==n?void 0:n.map(t=>{var e;return Object.assign(Object.assign({},t),{color:null!==(e=to.get(t.dataKey))&&void 0!==e?e:Y.fr.Gray})}),active:e,label:r}):a.createElement($.ZP,{active:e,payload:n,label:r,valueFormatter:u,categoryColors:to})}:a.createElement(a.Fragment,null),position:{y:0}}),g?a.createElement(H.D,{verticalAlign:"top",height:_,content:t=>{let{payload:e}=t;return(0,Z.Z)({payload:e},to,te,ta,tc?t=>ts(t):void 0,C)}}):null,o.map(t=>{var e,n;return a.createElement("defs",{key:t},A?a.createElement("linearGradient",{className:(0,tt.bM)(null!==(e=to.get(t))&&void 0!==e?e:Y.fr.Gray,J.K.text).textColor,id:to.get(t),x1:"0",y1:"0",x2:"0",y2:"1"},a.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:tn||ta&&ta!==t?.15:.4}),a.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):a.createElement("linearGradient",{className:(0,tt.bM)(null!==(n=to.get(t))&&void 0!==n?n:Y.fr.Gray,J.K.text).textColor,id:to.get(t),x1:"0",y1:"0",x2:"0",y2:"1"},a.createElement("stop",{stopColor:"currentColor",stopOpacity:tn||ta&&ta!==t?.1:.3})))}),o.map(t=>{var e;return a.createElement(B,{className:(0,tt.bM)(null!==(e=to.get(t))&&void 0!==e?e:Y.fr.Gray,J.K.text).strokeColor,strokeOpacity:tn||ta&&ta!==t?.3:1,activeDot:t=>{var e;let{cx:r,cy:i,stroke:o,strokeLinecap:l,strokeLinejoin:c,strokeWidth:s,dataKey:u}=t;return a.createElement(k.o,{className:(0,Q.q)("stroke-tremor-background dark:stroke-dark-tremor-background",N?"cursor-pointer":"",(0,tt.bM)(null!==(e=to.get(u))&&void 0!==e?e:Y.fr.Gray,J.K.text).fillColor),cx:r,cy:i,r:5,fill:"",stroke:o,strokeLinecap:l,strokeLinejoin:c,strokeWidth:s,onClick:(e,r)=>{r.stopPropagation(),tc&&(t.index===(null==tn?void 0:tn.index)&&t.dataKey===(null==tn?void 0:tn.dataKey)||(0,U.FB)(n,t.dataKey)&&ta&&ta===t.dataKey?(ti(void 0),tr(void 0),null==N||N(null)):(ti(t.dataKey),tr({index:t.index,dataKey:t.dataKey}),null==N||N(Object.assign({eventType:"dot",categoryClicked:t.dataKey},t.payload))))}})},dot:e=>{var r;let{stroke:i,strokeLinecap:o,strokeLinejoin:l,strokeWidth:c,cx:s,cy:u,dataKey:p,index:d}=e;return(0,U.FB)(n,t)&&!(tn||ta&&ta!==t)||(null==tn?void 0:tn.index)===d&&(null==tn?void 0:tn.dataKey)===t?a.createElement(k.o,{key:d,cx:s,cy:u,r:5,stroke:i,fill:"",strokeLinecap:o,strokeLinejoin:l,strokeWidth:c,className:(0,Q.q)("stroke-tremor-background dark:stroke-dark-tremor-background",N?"cursor-pointer":"",(0,tt.bM)(null!==(r=to.get(p))&&void 0!==r?r:Y.fr.Gray,J.K.text).fillColor)}):a.createElement(a.Fragment,{key:d})},key:t,name:t,type:E,dataKey:t,stroke:"",fill:"url(#".concat(to.get(t),")"),strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:h,animationDuration:v,stackId:c?"a":void 0,connectNulls:w})}),N?o.map(t=>a.createElement(q.x,{className:(0,Q.q)("cursor-pointer"),strokeOpacity:0,key:t,name:t,type:E,dataKey:t,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:w,onClick:(t,e)=>{e.stopPropagation();let{name:n}=t;ts(n)}})):null):a.createElement(X.Z,{noDataText:L})))});te.displayName="AreaChart"},54061:function(t,e,n){n.d(e,{x:function(){return K}});var r=n(2265),a=n(59221),i=n(86757),o=n.n(i),l=n(77571),c=n.n(l),s=n(21652),u=n.n(s),p=n(61994),d=n(57165),y=n(81889),f=n(9841),m=n(58772),h=n(13137),v=n(16630),b=n(82944),g=n(34067),k=n(85355),x=["type","layout","connectNulls","ref"];function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O(){return(O=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);ni){l=[].concat(j(r.slice(0,c)),[i-u]);break}var p=l.length%2==0?[0,o]:[o];return[].concat(j(s.repeat(r,Math.floor(e/a))),j(l),p).map(function(t){return"".concat(t,"px")}).join(", ")}),C(D(t),"id",(0,v.EL)("recharts-line-")),C(D(t),"pathRef",function(e){t.mainCurve=e}),C(D(t),"handleAnimationEnd",function(){t.setState({isAnimationFinished:!0}),t.props.onAnimationEnd&&t.props.onAnimationEnd()}),C(D(t),"handleAnimationStart",function(){t.setState({isAnimationFinished:!1}),t.props.onAnimationStart&&t.props.onAnimationStart()}),t}return n=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var t=this.getTotalLength();this.setState({totalLength:t})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var t=this.getTotalLength();t!==this.state.totalLength&&this.setState({totalLength:t})}}},{key:"getTotalLength",value:function(){var t=this.mainCurve;try{return t&&t.getTotalLength&&t.getTotalLength()||0}catch(t){return 0}}},{key:"renderErrorBar",value:function(t,e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,a=n.points,i=n.xAxis,o=n.yAxis,l=n.layout,c=n.children,s=(0,b.NN)(c,h.W);if(!s)return null;var u=function(t,e){return{x:t.x,y:t.y,value:t.value,errorVal:(0,k.F$)(t.payload,e)}};return r.createElement(f.m,{clipPath:t?"url(#clipPath-".concat(e,")"):null},s.map(function(t){return r.cloneElement(t,{key:"bar-".concat(t.props.dataKey),data:a,xAxis:i,yAxis:o,layout:l,dataPointFormatter:u})}))}},{key:"renderDots",value:function(t,e,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,i=a.dot,o=a.points,l=a.dataKey,c=(0,b.L6)(this.props,!1),u=(0,b.L6)(i,!0),p=o.map(function(t,e){var n=P(P(P({key:"dot-".concat(e),r:3},c),u),{},{value:t.value,dataKey:l,cx:t.x,cy:t.y,index:e,payload:t.payload});return s.renderDotItem(i,n)}),d={clipPath:t?"url(#clipPath-".concat(e?"":"dots-").concat(n,")"):null};return r.createElement(f.m,O({className:"recharts-line-dots",key:"dots"},d),p)}},{key:"renderCurveStatically",value:function(t,e,n,a){var i=this.props,o=i.type,l=i.layout,c=i.connectNulls,s=(i.ref,function(t,e){if(null==t)return{};var n,r,a=function(t,e){if(null==t)return{};var n,r,a={},i=Object.keys(t);for(r=0;r=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(i,x)),u=P(P(P({},(0,b.L6)(s,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:e?"url(#clipPath-".concat(n,")"):null,points:t},a),{},{type:o,layout:l,connectNulls:c});return r.createElement(d.H,O({},u,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(t,e){var n=this,i=this.props,o=i.points,l=i.strokeDasharray,c=i.isAnimationActive,s=i.animationBegin,u=i.animationDuration,p=i.animationEasing,d=i.animationId,y=i.animateNewValues,f=i.width,m=i.height,h=this.state,b=h.prevPoints,g=h.totalLength;return r.createElement(a.ZP,{begin:s,duration:u,isActive:c,easing:p,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var a,i=r.t;if(b){var c=b.length/o.length,s=o.map(function(t,e){var n=Math.floor(e*c);if(b[n]){var r=b[n],a=(0,v.k4)(r.x,t.x),o=(0,v.k4)(r.y,t.y);return P(P({},t),{},{x:a(i),y:o(i)})}if(y){var l=(0,v.k4)(2*f,t.x),s=(0,v.k4)(m/2,t.y);return P(P({},t),{},{x:l(i),y:s(i)})}return P(P({},t),{},{x:t.x,y:t.y})});return n.renderCurveStatically(s,t,e)}var u=(0,v.k4)(0,g)(i);if(l){var p="".concat(l).split(/[,\s]+/gim).map(function(t){return parseFloat(t)});a=n.getStrokeDasharray(u,g,p)}else a=n.generateSimpleStrokeDasharray(g,u);return n.renderCurveStatically(o,t,e,{strokeDasharray:a})})}},{key:"renderCurve",value:function(t,e){var n=this.props,r=n.points,a=n.isAnimationActive,i=this.state,o=i.prevPoints,l=i.totalLength;return a&&r&&r.length&&(!o&&l>0||!u()(o,r))?this.renderCurveWithAnimation(t,e):this.renderCurveStatically(r,t,e)}},{key:"render",value:function(){var t,e=this.props,n=e.hide,a=e.dot,i=e.points,o=e.className,l=e.xAxis,s=e.yAxis,u=e.top,d=e.left,y=e.width,h=e.height,v=e.isAnimationActive,g=e.id;if(n||!i||!i.length)return null;var k=this.state.isAnimationFinished,x=1===i.length,A=(0,p.Z)("recharts-line",o),O=l&&l.allowDataOverflow,E=s&&s.allowDataOverflow,P=O||E,j=c()(g)?this.id:g,w=null!==(t=(0,b.L6)(a,!1))&&void 0!==t?t:{r:3,strokeWidth:2},S=w.r,L=w.strokeWidth,D=((0,b.$k)(a)?a:{}).clipDot,N=void 0===D||D,C=2*(void 0===S?3:S)+(void 0===L?2:L);return r.createElement(f.m,{className:A},O||E?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(j)},r.createElement("rect",{x:O?d:d-y/2,y:E?u:u-h/2,width:O?y:2*y,height:E?h:2*h})),!N&&r.createElement("clipPath",{id:"clipPath-dots-".concat(j)},r.createElement("rect",{x:d-C/2,y:u-C/2,width:y+C,height:h+C}))):null,!x&&this.renderCurve(P,j),this.renderErrorBar(P,j),(x||a)&&this.renderDots(P,N,j),(!v||k)&&m.e.renderCallByParent(this.props,i))}}],i=[{key:"getDerivedStateFromProps",value:function(t,e){return t.animationId!==e.prevAnimationId?{prevAnimationId:t.animationId,curPoints:t.points,prevPoints:e.curPoints}:t.points!==e.curPoints?{curPoints:t.points}:null}},{key:"repeat",value:function(t,e){for(var n=t.length%2!=0?[].concat(j(t),[0]):t,r=[],a=0;a0)||void 0===arguments[0]||arguments[0],t=(0,o.useRef)({}),n=(0,a.Z)(),c=(0,l.ZP)();return(0,r.Z)(()=>{let o=c.subscribe(o=>{t.current=o,e&&n()});return()=>c.unsubscribe(o)},[]),t.current}},29967:function(e,t,n){n.d(t,{ZP:function(){return T}});var o=n(2265),r=n(36760),a=n.n(r),l=n(50506),c=n(18242),i=n(71744),d=n(33759);let s=o.createContext(null),u=s.Provider,f=o.createContext(null),p=f.Provider;var m=n(20873),g=n(28791),h=n(6694),v=n(34709),b=n(86586),y=n(39109),x=n(352),k=n(12918),C=n(80669),S=n(3104);let E=e=>{let{componentCls:t,antCls:n}=e,o="".concat(t,"-group");return{[o]:Object.assign(Object.assign({},(0,k.Wf)(e)),{display:"inline-block",fontSize:0,["&".concat(o,"-rtl")]:{direction:"rtl"},["".concat(n,"-badge ").concat(n,"-badge-count")]:{zIndex:1},["> ".concat(n,"-badge:not(:first-child) > ").concat(n,"-button-wrapper")]:{borderInlineStart:"none"}})}},w=e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:o,radioSize:r,motionDurationSlow:a,motionDurationMid:l,motionEaseInOutCirc:c,colorBgContainer:i,colorBorder:d,lineWidth:s,colorBgContainerDisabled:u,colorTextDisabled:f,paddingXS:p,dotColorDisabled:m,lineType:g,radioColor:h,radioBgColor:v,calc:b}=e,y="".concat(t,"-inner"),C=b(r).sub(b(4).mul(2)),S=b(1).mul(r).equal();return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,k.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",["&".concat(t,"-wrapper-rtl")]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},["".concat(t,"-checked::after")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:"".concat((0,x.bf)(s)," ").concat(g," ").concat(o),borderRadius:"50%",visibility:"hidden",content:'""'},[t]:Object.assign(Object.assign({},(0,k.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),["".concat(t,"-wrapper:hover &,\n &:hover ").concat(y)]:{borderColor:o},["".concat(t,"-input:focus-visible + ").concat(y)]:Object.assign({},(0,k.oN)(e)),["".concat(t,":hover::after, ").concat(t,"-wrapper:hover &::after")]:{visibility:"visible"},["".concat(t,"-inner")]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:S,height:S,marginBlockStart:b(1).mul(r).div(-2).equal(),marginInlineStart:b(1).mul(r).div(-2).equal(),backgroundColor:h,borderBlockStart:0,borderInlineStart:0,borderRadius:S,transform:"scale(0)",opacity:0,transition:"all ".concat(a," ").concat(c),content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:S,height:S,backgroundColor:i,borderColor:d,borderStyle:"solid",borderWidth:s,borderRadius:"50%",transition:"all ".concat(l)},["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},["".concat(t,"-checked")]:{[y]:{borderColor:o,backgroundColor:v,"&::after":{transform:"scale(".concat(e.calc(e.dotSize).div(r).equal(),")"),opacity:1,transition:"all ".concat(a," ").concat(c)}}},["".concat(t,"-disabled")]:{cursor:"not-allowed",[y]:{backgroundColor:u,borderColor:d,cursor:"not-allowed","&::after":{backgroundColor:m}},["".concat(t,"-input")]:{cursor:"not-allowed"},["".concat(t,"-disabled + span")]:{color:f,cursor:"not-allowed"},["&".concat(t,"-checked")]:{[y]:{"&::after":{transform:"scale(".concat(b(C).div(r).equal({unit:!1}),")")}}}},["span".concat(t," + *")]:{paddingInlineStart:p,paddingInlineEnd:p}})}},N=e=>{let{buttonColor:t,controlHeight:n,componentCls:o,lineWidth:r,lineType:a,colorBorder:l,motionDurationSlow:c,motionDurationMid:i,buttonPaddingInline:d,fontSize:s,buttonBg:u,fontSizeLG:f,controlHeightLG:p,controlHeightSM:m,paddingXS:g,borderRadius:h,borderRadiusSM:v,borderRadiusLG:b,buttonCheckedBg:y,buttonSolidCheckedColor:C,colorTextDisabled:S,colorBgContainerDisabled:E,buttonCheckedBgDisabled:w,buttonCheckedColorDisabled:N,colorPrimary:Z,colorPrimaryHover:O,colorPrimaryActive:K,buttonSolidCheckedBg:I,buttonSolidCheckedHoverBg:R,buttonSolidCheckedActiveBg:P,calc:D}=e;return{["".concat(o,"-button-wrapper")]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:d,paddingBlock:0,color:t,fontSize:s,lineHeight:(0,x.bf)(D(n).sub(D(r).mul(2)).equal()),background:u,border:"".concat((0,x.bf)(r)," ").concat(a," ").concat(l),borderBlockStartWidth:D(r).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:r,cursor:"pointer",transition:["color ".concat(i),"background ".concat(i),"box-shadow ".concat(i)].join(","),a:{color:t},["> ".concat(o,"-button")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:D(r).mul(-1).equal(),insetInlineStart:D(r).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:r,paddingInline:0,backgroundColor:l,transition:"background-color ".concat(c),content:'""'}},"&:first-child":{borderInlineStart:"".concat((0,x.bf)(r)," ").concat(a," ").concat(l),borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h},"&:first-child:last-child":{borderRadius:h},["".concat(o,"-group-large &")]:{height:p,fontSize:f,lineHeight:(0,x.bf)(D(p).sub(D(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:b,borderEndStartRadius:b},"&:last-child":{borderStartEndRadius:b,borderEndEndRadius:b}},["".concat(o,"-group-small &")]:{height:m,paddingInline:D(g).sub(r).equal(),paddingBlock:0,lineHeight:(0,x.bf)(D(m).sub(D(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:Z},"&:has(:focus-visible)":Object.assign({},(0,k.oN)(e)),["".concat(o,"-inner, input[type='checkbox'], input[type='radio']")]:{width:0,height:0,opacity:0,pointerEvents:"none"},["&-checked:not(".concat(o,"-button-wrapper-disabled)")]:{zIndex:1,color:Z,background:y,borderColor:Z,"&::before":{backgroundColor:Z},"&:first-child":{borderColor:Z},"&:hover":{color:O,borderColor:O,"&::before":{backgroundColor:O}},"&:active":{color:K,borderColor:K,"&::before":{backgroundColor:K}}},["".concat(o,"-group-solid &-checked:not(").concat(o,"-button-wrapper-disabled)")]:{color:C,background:I,borderColor:I,"&:hover":{color:C,background:R,borderColor:R},"&:active":{color:C,background:P,borderColor:P}},"&-disabled":{color:S,backgroundColor:E,borderColor:l,cursor:"not-allowed","&:first-child, &:hover":{color:S,backgroundColor:E,borderColor:l}},["&-disabled".concat(o,"-button-wrapper-checked")]:{color:N,backgroundColor:w,borderColor:l,boxShadow:"none"}}}};var Z=(0,C.I$)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,o="0 0 0 ".concat((0,x.bf)(n)," ").concat(t),r=(0,S.TS)(e,{radioFocusShadow:o,radioButtonFocusShadow:o});return[E(r),w(r),N(r)]},e=>{let{wireframe:t,padding:n,marginXS:o,lineWidth:r,fontSizeLG:a,colorText:l,colorBgContainer:c,colorTextDisabled:i,controlItemBgActiveDisabled:d,colorTextLightSolid:s,colorPrimary:u,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:m}=e;return{radioSize:a,dotSize:t?a-8:a-(4+r)*2,dotColorDisabled:i,buttonSolidCheckedColor:s,buttonSolidCheckedBg:u,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:c,buttonCheckedBg:c,buttonColor:l,buttonCheckedBgDisabled:d,buttonCheckedColorDisabled:i,buttonPaddingInline:n-r,wrapperMarginInlineEnd:o,radioColor:t?u:m,radioBgColor:t?c:u}},{unitless:{radioSize:!0,dotSize:!0}}),O=n(64024),K=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let I=o.forwardRef((e,t)=>{var n,r;let l=o.useContext(s),c=o.useContext(f),{getPrefixCls:d,direction:u,radio:p}=o.useContext(i.E_),x=o.useRef(null),k=(0,g.sQ)(t,x),{isFormItemInput:C}=o.useContext(y.aM),{prefixCls:S,className:E,rootClassName:w,children:N,style:I,title:R}=e,P=K(e,["prefixCls","className","rootClassName","children","style","title"]),D=d("radio",S),M="button"===((null==l?void 0:l.optionType)||c),T=M?"".concat(D,"-button"):D,j=(0,O.Z)(D),[B,z,H]=Z(D,j),L=Object.assign({},P),A=o.useContext(b.Z);l&&(L.name=l.name,L.onChange=t=>{var n,o;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(o=null==l?void 0:l.onChange)||void 0===o||o.call(l,t)},L.checked=e.value===l.value,L.disabled=null!==(n=L.disabled)&&void 0!==n?n:l.disabled),L.disabled=null!==(r=L.disabled)&&void 0!==r?r:A;let _=a()("".concat(T,"-wrapper"),{["".concat(T,"-wrapper-checked")]:L.checked,["".concat(T,"-wrapper-disabled")]:L.disabled,["".concat(T,"-wrapper-rtl")]:"rtl"===u,["".concat(T,"-wrapper-in-form-item")]:C},null==p?void 0:p.className,E,w,z,H,j);return B(o.createElement(h.Z,{component:"Radio",disabled:L.disabled},o.createElement("label",{className:_,style:Object.assign(Object.assign({},null==p?void 0:p.style),I),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:R},o.createElement(m.Z,Object.assign({},L,{className:a()(L.className,!M&&v.A),type:"radio",prefixCls:T,ref:k})),void 0!==N?o.createElement("span",null,N):null)))}),R=o.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r}=o.useContext(i.E_),[s,f]=(0,l.Z)(e.defaultValue,{value:e.value}),{prefixCls:p,className:m,rootClassName:g,options:h,buttonStyle:v="outline",disabled:b,children:y,size:x,style:k,id:C,onMouseEnter:S,onMouseLeave:E,onFocus:w,onBlur:N}=e,K=n("radio",p),R="".concat(K,"-group"),P=(0,O.Z)(K),[D,M,T]=Z(K,P),j=y;h&&h.length>0&&(j=h.map(e=>"string"==typeof e||"number"==typeof e?o.createElement(I,{key:e.toString(),prefixCls:K,disabled:b,value:e,checked:s===e},e):o.createElement(I,{key:"radio-group-value-options-".concat(e.value),prefixCls:K,disabled:e.disabled||b,value:e.value,checked:s===e.value,title:e.title,style:e.style,id:e.id,required:e.required},e.label)));let B=(0,d.Z)(x),z=a()(R,"".concat(R,"-").concat(v),{["".concat(R,"-").concat(B)]:B,["".concat(R,"-rtl")]:"rtl"===r},m,g,M,T,P);return D(o.createElement("div",Object.assign({},(0,c.Z)(e,{aria:!0,data:!0}),{className:z,style:k,onMouseEnter:S,onMouseLeave:E,onFocus:w,onBlur:N,id:C,ref:t}),o.createElement(u,{value:{onChange:t=>{let n=t.target.value;"value"in e||f(n);let{onChange:o}=e;o&&n!==s&&o(t)},value:s,disabled:e.disabled,name:e.name,optionType:e.optionType}},j)))});var P=o.memo(R),D=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},M=o.forwardRef((e,t)=>{let{getPrefixCls:n}=o.useContext(i.E_),{prefixCls:r}=e,a=D(e,["prefixCls"]),l=n("radio",r);return o.createElement(p,{value:"button"},o.createElement(I,Object.assign({prefixCls:l},a,{type:"radio",ref:t})))});I.Button=M,I.Group=P,I.__ANT_RADIO=!0;var T=I},72188:function(e,t,n){n.d(t,{Z:function(){return re}});var o,r,a=n(2265),l={},c="rc-table-internal-hook",i=n(26365),d=n(58525),s=n(27380),u=n(16671),f=n(54887);function p(e){var t=a.createContext(void 0);return{Context:t,Provider:function(e){var n=e.value,o=e.children,r=a.useRef(n);r.current=n;var l=a.useState(function(){return{getValue:function(){return r.current},listeners:new Set}}),c=(0,i.Z)(l,1)[0];return(0,s.Z)(function(){(0,f.unstable_batchedUpdates)(function(){c.listeners.forEach(function(e){e(n)})})},[n]),a.createElement(t.Provider,{value:c},o)},defaultValue:e}}function m(e,t){var n=(0,d.Z)("function"==typeof t?t:function(e){if(void 0===t)return e;if(!Array.isArray(t))return e[t];var n={};return t.forEach(function(t){n[t]=e[t]}),n}),o=a.useContext(null==e?void 0:e.Context),r=o||{},l=r.listeners,c=r.getValue,f=a.useRef();f.current=n(o?c():null==e?void 0:e.defaultValue);var p=a.useState({}),m=(0,i.Z)(p,2)[1];return(0,s.Z)(function(){if(o)return l.add(e),function(){l.delete(e)};function e(e){var t=n(e);(0,u.Z)(f.current,t,!0)||m({})}},[o]),f.current}var g=n(1119),h=n(28791);function v(){var e=a.createContext(null);function t(){return a.useContext(e)}return{makeImmutable:function(n,o){var r=(0,h.Yr)(n),l=function(l,c){var i=r?{ref:c}:{},d=a.useRef(0),s=a.useRef(l);return null!==t()?a.createElement(n,(0,g.Z)({},l,i)):((!o||o(s.current,l))&&(d.current+=1),s.current=l,a.createElement(e.Provider,{value:d.current},a.createElement(n,(0,g.Z)({},l,i))))};return r?a.forwardRef(l):l},responseImmutable:function(e,n){var o=(0,h.Yr)(e),r=function(n,r){return t(),a.createElement(e,(0,g.Z)({},n,o?{ref:r}:{}))};return o?a.memo(a.forwardRef(r),n):a.memo(r,n)},useImmutableMark:t}}var b=v();b.makeImmutable,b.responseImmutable,b.useImmutableMark;var y=v(),x=y.makeImmutable,k=y.responseImmutable,C=y.useImmutableMark,S=p();a.memo(function(){var e,t,n,o,r,l=(t=a.useRef(0),t.current+=1,n=a.useRef(void 0),o=[],Object.keys(e||{}).map(function(t){var r;(null==e?void 0:e[t])!==(null===(r=n.current)||void 0===r?void 0:r[t])&&o.push(t)}),n.current=e,r=a.useRef([]),o.length&&(r.current=o),a.useDebugValue(t.current),a.useDebugValue(r.current.join(", ")),t.current);return a.createElement("h1",null,"Render Times: ",l)}).displayName="RenderBlock";var E=n(41154),w=n(31686),N=n(11993),Z=n(36760),O=n.n(Z),K=n(6397),I=n(16847),R=n(32559),P=a.createContext({renderWithProps:!1});function D(e){var t=[],n={};return e.forEach(function(e){for(var o=e||{},r=o.key,a=o.dataIndex,l=r||(null==a?[]:Array.isArray(a)?a:[a]).join("-")||"RC_TABLE_KEY";n[l];)l="".concat(l,"_next");n[l]=!0,t.push(l)}),t}var M=n(74126),T=function(e){var t,n=e.ellipsis,o=e.rowType,r=e.children,l=!0===n?{showTitle:!0}:n;return l&&(l.showTitle||"header"===o)&&("string"==typeof r||"number"==typeof r?t=r.toString():a.isValidElement(r)&&"string"==typeof r.props.children&&(t=r.props.children)),t},j=a.memo(function(e){var t,n,o,r,l,c,d,s,f,p,h=e.component,v=e.children,b=e.ellipsis,y=e.scope,x=e.prefixCls,k=e.className,Z=e.align,R=e.record,D=e.render,j=e.dataIndex,B=e.renderIndex,z=e.shouldCellUpdate,H=e.index,L=e.rowType,A=e.colSpan,_=e.rowSpan,W=e.fixLeft,q=e.fixRight,F=e.firstFixLeft,V=e.lastFixLeft,X=e.firstFixRight,U=e.lastFixRight,G=e.appendNode,Y=e.additionalProps,$=void 0===Y?{}:Y,J=e.isSticky,Q="".concat(x,"-cell"),ee=m(S,["supportSticky","allColumnsFixedLeft"]),et=ee.supportSticky,en=ee.allColumnsFixedLeft,eo=(t=a.useContext(P),n=C(),(0,K.Z)(function(){if(null!=v)return[v];var e=null==j||""===j?[]:Array.isArray(j)?j:[j],n=(0,I.Z)(R,e),o=n,r=void 0;if(D){var l=D(n,R,B);!l||"object"!==(0,E.Z)(l)||Array.isArray(l)||a.isValidElement(l)?o=l:(o=l.children,r=l.props,t.renderWithProps=!0)}return[o,r]},[n,R,v,j,D,B],function(e,n){if(z){var o=(0,i.Z)(e,2)[1];return z((0,i.Z)(n,2)[1],o)}return!!t.renderWithProps||!(0,u.Z)(e,n,!0)})),er=(0,i.Z)(eo,2),ea=er[0],el=er[1],ec={},ei="number"==typeof W&&et,ed="number"==typeof q&&et;ei&&(ec.position="sticky",ec.left=W),ed&&(ec.position="sticky",ec.right=q);var es=null!==(o=null!==(r=null!==(l=null==el?void 0:el.colSpan)&&void 0!==l?l:$.colSpan)&&void 0!==r?r:A)&&void 0!==o?o:1,eu=null!==(c=null!==(d=null!==(s=null==el?void 0:el.rowSpan)&&void 0!==s?s:$.rowSpan)&&void 0!==d?d:_)&&void 0!==c?c:1,ef=m(S,function(e){var t,n;return[(t=eu||1,n=e.hoverStartRow,H<=e.hoverEndRow&&H+t-1>=n),e.onHover]}),ep=(0,i.Z)(ef,2),em=ep[0],eg=ep[1],eh=(0,M.zX)(function(e){var t;R&&eg(H,H+eu-1),null==$||null===(t=$.onMouseEnter)||void 0===t||t.call($,e)}),ev=(0,M.zX)(function(e){var t;R&&eg(-1,-1),null==$||null===(t=$.onMouseLeave)||void 0===t||t.call($,e)});if(0===es||0===eu)return null;var eb=null!==(f=$.title)&&void 0!==f?f:T({rowType:L,ellipsis:b,children:ea}),ey=O()(Q,k,(p={},(0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)(p,"".concat(Q,"-fix-left"),ei&&et),"".concat(Q,"-fix-left-first"),F&&et),"".concat(Q,"-fix-left-last"),V&&et),"".concat(Q,"-fix-left-all"),V&&en&&et),"".concat(Q,"-fix-right"),ed&&et),"".concat(Q,"-fix-right-first"),X&&et),"".concat(Q,"-fix-right-last"),U&&et),"".concat(Q,"-ellipsis"),b),"".concat(Q,"-with-append"),G),"".concat(Q,"-fix-sticky"),(ei||ed)&&J&&et),(0,N.Z)(p,"".concat(Q,"-row-hover"),!el&&em)),$.className,null==el?void 0:el.className),ex={};Z&&(ex.textAlign=Z);var ek=(0,w.Z)((0,w.Z)((0,w.Z)((0,w.Z)({},ec),$.style),ex),null==el?void 0:el.style),eC=ea;return"object"!==(0,E.Z)(eC)||Array.isArray(eC)||a.isValidElement(eC)||(eC=null),b&&(V||X)&&(eC=a.createElement("span",{className:"".concat(Q,"-content")},eC)),a.createElement(h,(0,g.Z)({},el,$,{className:ey,style:ek,title:eb,scope:y,onMouseEnter:eh,onMouseLeave:ev,colSpan:1!==es?es:null,rowSpan:1!==eu?eu:null}),G,eC)});function B(e,t,n,o,r,a){var l,c,i=n[e]||{},d=n[t]||{};"left"===i.fixed?l=o.left["rtl"===r?t:e]:"right"===d.fixed&&(c=o.right["rtl"===r?e:t]);var s=!1,u=!1,f=!1,p=!1,m=n[t+1],g=n[e-1],h=!(null!=a&&a.children);return"rtl"===r?void 0!==l?p=!(g&&"left"===g.fixed)&&h:void 0!==c&&(f=!(m&&"right"===m.fixed)&&h):void 0!==l?s=!(m&&"left"===m.fixed)&&h:void 0!==c&&(u=!(g&&"right"===g.fixed)&&h),{fixLeft:l,fixRight:c,lastFixLeft:s,firstFixRight:u,lastFixRight:f,firstFixLeft:p,isSticky:o.isSticky}}var z=a.createContext({}),H=n(6989),L=["children"];function A(e){return e.children}A.Row=function(e){var t=e.children,n=(0,H.Z)(e,L);return a.createElement("tr",n,t)},A.Cell=function(e){var t=e.className,n=e.index,o=e.children,r=e.colSpan,l=void 0===r?1:r,c=e.rowSpan,i=e.align,d=m(S,["prefixCls","direction"]),s=d.prefixCls,u=d.direction,f=a.useContext(z),p=f.scrollColumnIndex,h=f.stickyOffsets,v=f.flattenColumns,b=f.columns,y=n+l-1+1===p?l+1:l,x=B(n,n+y-1,v,h,u,null==b?void 0:b[n]);return a.createElement(j,(0,g.Z)({className:t,index:n,component:"td",prefixCls:s,record:null,dataIndex:null,align:i,colSpan:y,rowSpan:c,render:function(){return o}},x))};var _=k(function(e){var t=e.children,n=e.stickyOffsets,o=e.flattenColumns,r=e.columns,l=m(S,"prefixCls"),c=o.length-1,i=o[c],d=a.useMemo(function(){return{stickyOffsets:n,flattenColumns:o,scrollColumnIndex:null!=i&&i.scrollbar?c:null,columns:r}},[i,o,c,n,r]);return a.createElement(z.Provider,{value:d},a.createElement("tfoot",{className:"".concat(l,"-summary")},t))}),W=n(31474),q=n(2857),F=n(10281),V=n(3208),X=n(18242);function U(e,t,n,o){return a.useMemo(function(){if(null!=n&&n.size){for(var r=[],a=0;a<(null==e?void 0:e.length);a+=1)!function e(t,n,o,r,a,l,c){t.push({record:n,indent:o,index:c});var i=l(n),d=null==a?void 0:a.has(i);if(n&&Array.isArray(n[r])&&d)for(var s=0;s1?n-1:0),r=1;r=0;i-=1){var d=t[i],s=n&&n[i],u=s&&s[ea];if(d||u||c){var f=u||{},p=(f.columnType,(0,H.Z)(f,el));r.unshift(a.createElement("col",(0,g.Z)({key:i,style:{width:d}},p))),c=!0}}return a.createElement("colgroup",null,r)},ei=n(83145),ed=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"],es=a.forwardRef(function(e,t){var n=e.className,o=e.noData,r=e.columns,l=e.flattenColumns,c=e.colWidths,i=e.columCount,d=e.stickyOffsets,s=e.direction,u=e.fixHeader,f=e.stickyTopOffset,p=e.stickyBottomOffset,g=e.stickyClassName,v=e.onScroll,b=e.maxContentScroll,y=e.children,x=(0,H.Z)(e,ed),k=m(S,["prefixCls","scrollbarSize","isSticky"]),C=k.prefixCls,E=k.scrollbarSize,Z=k.isSticky,K=Z&&!u?0:E,I=a.useRef(null),R=a.useCallback(function(e){(0,h.mH)(t,e),(0,h.mH)(I,e)},[]);a.useEffect(function(){var e;function t(e){var t=e.currentTarget,n=e.deltaX;n&&(v({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}return null===(e=I.current)||void 0===e||e.addEventListener("wheel",t),function(){var e;null===(e=I.current)||void 0===e||e.removeEventListener("wheel",t)}},[]);var P=a.useMemo(function(){return l.every(function(e){return e.width})},[l]),D=l[l.length-1],M={fixed:D?D.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(C,"-cell-scrollbar")}}},T=(0,a.useMemo)(function(){return K?[].concat((0,ei.Z)(r),[M]):r},[K,r]),j=(0,a.useMemo)(function(){return K?[].concat((0,ei.Z)(l),[M]):l},[K,l]),B=(0,a.useMemo)(function(){var e=d.right,t=d.left;return(0,w.Z)((0,w.Z)({},d),{},{left:"rtl"===s?[].concat((0,ei.Z)(t.map(function(e){return e+K})),[0]):t,right:"rtl"===s?e:[].concat((0,ei.Z)(e.map(function(e){return e+K})),[0]),isSticky:Z})},[K,d,Z]),z=(0,a.useMemo)(function(){for(var e=[],t=0;t1?"colgroup":"col":null,ellipsis:l.ellipsis,align:l.align,component:l.title?c:i,prefixCls:f,key:h[t]},d,{additionalProps:n,rowType:"header"}))}))}ef.displayName="HeaderRow";var ep=k(function(e){var t=e.stickyOffsets,n=e.columns,o=e.flattenColumns,r=e.onHeaderRow,l=m(S,["prefixCls","getComponent"]),c=l.prefixCls,i=l.getComponent,d=a.useMemo(function(){return function(e){var t=[];!function e(n,o){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[r]=t[r]||[];var a=o;return n.filter(Boolean).map(function(n){var o={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},l=1,c=n.children;return c&&c.length>0&&(l=e(c,a,r+1).reduce(function(e,t){return e+t},0),o.hasSubColumns=!0),"colSpan"in n&&(l=n.colSpan),"rowSpan"in n&&(o.rowSpan=n.rowSpan),o.colSpan=l,o.colEnd=o.colStart+l-1,t[r].push(o),a+=l,l})}(e,0);for(var n=t.length,o=function(e){t[e].forEach(function(t){("rowSpan"in t)||t.hasSubColumns||(t.rowSpan=n-e)})},r=0;r1&&void 0!==arguments[1]?arguments[1]:"";return"number"==typeof t?t:t.endsWith("%")?e*parseFloat(t)/100:null}var eh=["children"],ev=["fixed"];function eb(e){return(0,em.Z)(e).filter(function(e){return a.isValidElement(e)}).map(function(e){var t=e.key,n=e.props,o=n.children,r=(0,H.Z)(n,eh),a=(0,w.Z)({key:t},r);return o&&(a.children=eb(o)),a})}function ey(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";return e.filter(function(e){return e&&"object"===(0,E.Z)(e)}).reduce(function(e,n,o){var r=n.fixed,a=!0===r?"left":r,l="".concat(t,"-").concat(o),c=n.children;return c&&c.length>0?[].concat((0,ei.Z)(e),(0,ei.Z)(ey(c,l).map(function(e){return(0,w.Z)({fixed:a},e)}))):[].concat((0,ei.Z)(e),[(0,w.Z)((0,w.Z)({key:l},n),{},{fixed:a})])},[])}var ex=function(e,t){var n=e.prefixCls,o=e.columns,r=e.children,c=e.expandable,d=e.expandedKeys,s=e.columnTitle,u=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,m=e.rowExpandable,g=e.expandIconColumnIndex,h=e.direction,v=e.expandRowByClick,b=e.columnWidth,y=e.fixed,x=e.scrollWidth,k=e.clientWidth,C=a.useMemo(function(){return function e(t){return t.filter(function(e){return e&&"object"===(0,E.Z)(e)&&!e.hidden}).map(function(t){var n=t.children;return n&&n.length>0?(0,w.Z)((0,w.Z)({},t),{},{children:e(n)}):t})}((o||eb(r)||[]).slice())},[o,r]),S=a.useMemo(function(){if(c){var e,t=C.slice();if(!t.includes(l)){var o=g||0;o>=0&&t.splice(o,0,l)}var r=t.indexOf(l);t=t.filter(function(e,t){return e!==l||t===r});var i=C[r];e=("left"===y||y)&&!g?"left":("right"===y||y)&&g===C.length?"right":i?i.fixed:null;var h=(0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)({},ea,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",s),"fixed",e),"className","".concat(n,"-row-expand-icon-cell")),"width",b),"render",function(e,t,o){var r=u(t,o),l=p({prefixCls:n,expanded:d.has(r),expandable:!m||m(t),record:t,onExpand:f});return v?a.createElement("span",{onClick:function(e){return e.stopPropagation()}},l):l});return t.map(function(e){return e===l?h:e})}return C.filter(function(e){return e!==l})},[c,C,u,d,p,h]),Z=a.useMemo(function(){var e=S;return t&&(e=t(e)),e.length||(e=[{render:function(){return null}}]),e},[t,S,h]),O=a.useMemo(function(){return"rtl"===h?ey(Z).map(function(e){var t=e.fixed,n=(0,H.Z)(e,ev),o=t;return"left"===t?o="right":"right"===t&&(o="left"),(0,w.Z)({fixed:o},n)}):ey(Z)},[Z,h,x]),K=a.useMemo(function(){if(x&&x>0){var e=0,t=0;O.forEach(function(n){var o=eg(x,n.width);o?e+=o:t+=1});var n=Math.max(x,k),o=Math.max(n-e,t),r=t,a=o/t,l=0,c=O.map(function(e){var t=(0,w.Z)({},e),n=eg(x,t.width);if(n)t.width=n;else{var c=Math.floor(a);t.width=1===r?o:c,o-=c,r-=1}return l+=t.width,t});if(l=f&&(o=f-p),l({scrollLeft:o/f*(u+2)}),x.current.x=e.pageX},R=function(){if(r.current){var e=eN(r.current).top,t=e+r.current.offsetHeight,n=d===window?document.documentElement.scrollTop+window.innerHeight:eN(d).top+d.clientHeight;t-(0,V.Z)()<=n||e>=n-c?y(function(e){return(0,w.Z)((0,w.Z)({},e),{},{isHiddenScrollBar:!0})}):y(function(e){return(0,w.Z)((0,w.Z)({},e),{},{isHiddenScrollBar:!1})})}},P=function(e){y(function(t){return(0,w.Z)((0,w.Z)({},t),{},{scrollLeft:e/u*f||0})})};return(a.useImperativeHandle(t,function(){return{setScrollLeft:P}}),a.useEffect(function(){var e=ew(document.body,"mouseup",K,!1),t=ew(document.body,"mousemove",I,!1);return R(),function(){e.remove(),t.remove()}},[p,E]),a.useEffect(function(){var e=ew(d,"scroll",R,!1),t=ew(window,"resize",R,!1);return function(){e.remove(),t.remove()}},[d]),a.useEffect(function(){b.isHiddenScrollBar||y(function(e){var t=r.current;return t?(0,w.Z)((0,w.Z)({},e),{},{scrollLeft:t.scrollLeft/t.scrollWidth*t.clientWidth}):e})},[b.isHiddenScrollBar]),u<=f||!p||b.isHiddenScrollBar)?null:a.createElement("div",{style:{height:(0,V.Z)(),width:f,bottom:c},className:"".concat(s,"-sticky-scroll")},a.createElement("div",{onMouseDown:function(e){e.persist(),x.current.delta=e.pageX-b.scrollLeft,x.current.x=0,Z(!0),e.preventDefault()},ref:g,className:O()("".concat(s,"-sticky-scroll-bar"),(0,N.Z)({},"".concat(s,"-sticky-scroll-bar-active"),E)),style:{width:"".concat(p,"px"),transform:"translate3d(".concat(b.scrollLeft,"px, 0, 0)")}}))}),eO="rc-table",eK=[],eI={};function eR(){return"No Data"}var eP=a.forwardRef(function(e,t){var n,o=(0,w.Z)({rowKey:"key",prefixCls:eO,emptyText:eR},e),r=o.prefixCls,l=o.className,s=o.rowClassName,f=o.style,p=o.data,m=o.rowKey,h=o.scroll,v=o.tableLayout,b=o.direction,y=o.title,x=o.footer,k=o.summary,C=o.caption,Z=o.id,R=o.showHeader,P=o.components,M=o.emptyText,T=o.onRow,j=o.onHeaderRow,z=o.internalHooks,L=o.transformColumns,U=o.internalRefs,G=o.tailor,Y=o.getContainerWidth,$=o.sticky,J=p||eK,Q=!!J.length,ee=z===c,et=a.useCallback(function(e,t){return(0,I.Z)(P,e)||t},[P]),en=a.useMemo(function(){return"function"==typeof m?m:function(e){return e&&e[m]}},[m]),ea=et(["body"]),el=(t_=a.useState(-1),tq=(tW=(0,i.Z)(t_,2))[0],tF=tW[1],tV=a.useState(-1),tU=(tX=(0,i.Z)(tV,2))[0],tG=tX[1],[tq,tU,a.useCallback(function(e,t){tF(e),tG(t)},[])]),ed=(0,i.Z)(el,3),es=ed[0],ef=ed[1],em=ed[2],eg=(tQ=(t$=o.expandable,tJ=(0,H.Z)(o,er),!1===(tY="expandable"in o?(0,w.Z)((0,w.Z)({},tJ),t$):tJ).showExpandColumn&&(tY.expandIconColumnIndex=-1),tY).expandIcon,t0=tY.expandedRowKeys,t1=tY.defaultExpandedRowKeys,t2=tY.defaultExpandAllRows,t3=tY.expandedRowRender,t4=tY.onExpand,t6=tY.onExpandedRowsChange,t8=tY.childrenColumnName||"children",t5=a.useMemo(function(){return t3?"row":!!(o.expandable&&o.internalHooks===c&&o.expandable.__PARENT_RENDER_ICON__||J.some(function(e){return e&&"object"===(0,E.Z)(e)&&e[t8]}))&&"nest"},[!!t3,J]),t7=a.useState(function(){if(t1)return t1;if(t2){var e;return e=[],function t(n){(n||[]).forEach(function(n,o){e.push(en(n,o)),t(n[t8])})}(J),e}return[]}),ne=(t9=(0,i.Z)(t7,2))[0],nt=t9[1],nn=a.useMemo(function(){return new Set(t0||ne||[])},[t0,ne]),no=a.useCallback(function(e){var t,n=en(e,J.indexOf(e)),o=nn.has(n);o?(nn.delete(n),t=(0,ei.Z)(nn)):t=[].concat((0,ei.Z)(nn),[n]),nt(t),t4&&t4(!o,e),t6&&t6(t)},[en,nn,J,t4,t6]),[tY,t5,nn,tQ||ek,t8,no]),eh=(0,i.Z)(eg,6),ev=eh[0],eb=eh[1],ey=eh[2],ew=eh[3],eN=eh[4],eP=eh[5],eD=null==h?void 0:h.x,eM=a.useState(0),eT=(0,i.Z)(eM,2),ej=eT[0],eB=eT[1],ez=ex((0,w.Z)((0,w.Z)((0,w.Z)({},o),ev),{},{expandable:!!ev.expandedRowRender,columnTitle:ev.columnTitle,expandedKeys:ey,getRowKey:en,onTriggerExpand:eP,expandIcon:ew,expandIconColumnIndex:ev.expandIconColumnIndex,direction:b,scrollWidth:ee&&G&&"number"==typeof eD?eD:null,clientWidth:ej}),ee?L:null),eH=(0,i.Z)(ez,3),eL=eH[0],eA=eH[1],e_=eH[2],eW=null!=e_?e_:eD,eq=a.useMemo(function(){return{columns:eL,flattenColumns:eA}},[eL,eA]),eF=a.useRef(),eV=a.useRef(),eX=a.useRef(),eU=a.useRef();a.useImperativeHandle(t,function(){return{nativeElement:eF.current,scrollTo:function(e){var t;if(eX.current instanceof HTMLElement){var n=e.index,o=e.top,r=e.key;if(o)null===(a=eX.current)||void 0===a||a.scrollTo({top:o});else{var a,l,c=null!=r?r:en(J[n]);null===(l=eX.current.querySelector('[data-row-key="'.concat(c,'"]')))||void 0===l||l.scrollIntoView()}}else null!==(t=eX.current)&&void 0!==t&&t.scrollTo&&eX.current.scrollTo(e)}}});var eG=a.useRef(),eY=a.useState(!1),e$=(0,i.Z)(eY,2),eJ=e$[0],eQ=e$[1],e0=a.useState(!1),e1=(0,i.Z)(e0,2),e2=e1[0],e3=e1[1],e4=eC(new Map),e6=(0,i.Z)(e4,2),e8=e6[0],e5=e6[1],e7=D(eA).map(function(e){return e8.get(e)}),e9=a.useMemo(function(){return e7},[e7.join("_")]),te=(nr=eA.length,(0,a.useMemo)(function(){for(var e=[],t=[],n=0,o=0,r=0;r0)):(eQ(a>0),e3(a1?y-D:0,pointerEvents:"auto"}),T=a.useMemo(function(){return f?P<=1:0===I||0===P||P>1},[P,I,f]);T?M.visibility="hidden":f&&(M.height=null==p?void 0:p(P));var B={};return(0===P||0===I)&&(B.rowSpan=1,B.colSpan=1),a.createElement(j,(0,g.Z)({className:O()(b,u),ellipsis:o.ellipsis,align:o.align,scope:o.rowScope,component:"div",prefixCls:n.prefixCls,key:C,record:d,index:c,renderIndex:i,dataIndex:v,render:T?function(){return null}:h,shouldCellUpdate:o.shouldCellUpdate},S,{appendNode:E,additionalProps:(0,w.Z)((0,w.Z)({},N),{},{style:M},B)}))},ez=["data","index","className","rowKey","style","extra","getHeight"],eH=k(a.forwardRef(function(e,t){var n,o=e.data,r=e.index,l=e.className,c=e.rowKey,i=e.style,d=e.extra,s=e.getHeight,u=(0,H.Z)(e,ez),f=o.record,p=o.indent,h=o.index,v=m(S,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),b=v.scrollX,y=v.flattenColumns,x=v.prefixCls,k=v.fixColumn,C=v.componentWidth,E=G(f,c,r,p),Z=E.rowSupportExpand,K=E.expanded,I=E.rowProps,R=E.expandedRowRender,P=E.expandedRowClassName;if(Z&&K){var D=R(f,r,p+1,K),M=null==P?void 0:P(f,r,p),T={};k&&(T={style:(0,N.Z)({},"--virtual-width","".concat(C,"px"))});var B="".concat(x,"-expanded-row-cell");n=a.createElement("div",{className:O()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(p+1),M)},a.createElement(j,{component:"div",prefixCls:x,className:O()(B,(0,N.Z)({},"".concat(B,"-fixed"),k)),additionalProps:T},D))}var z=(0,w.Z)((0,w.Z)({},i),{},{width:b});d&&(z.position="absolute",z.pointerEvents="none");var L=a.createElement("div",(0,g.Z)({},I,u,{ref:Z?null:t,className:O()(l,"".concat(x,"-row"),null==I?void 0:I.className,(0,N.Z)({},"".concat(x,"-row-extra"),d)),style:(0,w.Z)((0,w.Z)({},z),null==I?void 0:I.style)}),y.map(function(e,t){return a.createElement(eB,{key:t,rowInfo:E,column:e,colIndex:t,indent:p,index:r,renderIndex:h,record:f,inverse:d,getHeight:s})}));return Z?a.createElement("div",{ref:t},L,n):L})),eL=k(a.forwardRef(function(e,t){var n,o=e.data,r=e.onScroll,l=m(S,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","emptyNode","scrollX"]),c=l.flattenColumns,d=l.onColumnResize,s=l.getRowKey,u=l.expandedKeys,f=l.prefixCls,p=l.childrenColumnName,h=l.emptyNode,v=l.scrollX,b=m(eT),y=b.sticky,x=b.scrollY,k=b.listItemHeight,C=a.useRef(),w=U(o,p,u,s),N=a.useMemo(function(){var e=0;return c.map(function(t){var n=t.width,o=t.key;return e+=n,[o,n,e]})},[c]),Z=a.useMemo(function(){return N.map(function(e){return e[2]})},[N]);a.useEffect(function(){N.forEach(function(e){var t=(0,i.Z)(e,2);d(t[0],t[1])})},[N]),a.useImperativeHandle(t,function(){var e={scrollTo:function(e){var t;null===(t=C.current)||void 0===t||t.scrollTo(e)}};return Object.defineProperty(e,"scrollLeft",{get:function(){var e;return(null===(e=C.current)||void 0===e?void 0:e.getScrollInfo().x)||0},set:function(e){var t;null===(t=C.current)||void 0===t||t.scrollTo({left:e})}}),e});var K=function(e,t){var n=null===(r=w[t])||void 0===r?void 0:r.record,o=e.onCell;if(o){var r,a,l=o(n,t);return null!==(a=null==l?void 0:l.rowSpan)&&void 0!==a?a:1}return 1},I=a.useMemo(function(){return{columnsOffset:Z}},[Z]),R="".concat(f,"-tbody");if(w.length){var P={};y&&(P.position="sticky",P.bottom=0,"object"===(0,E.Z)(y)&&y.offsetScroll&&(P.bottom=y.offsetScroll)),n=a.createElement(eM.Z,{fullHeight:!1,ref:C,styles:{horizontalScrollBar:P},className:O()(R,"".concat(R,"-virtual")),height:x,itemHeight:k||24,data:w,itemKey:function(e){return s(e.record)},scrollWidth:v,onVirtualScroll:function(e){r({scrollLeft:e.x})},extraRender:function(e){var t=e.start,n=e.end,o=e.getSize,r=e.offsetY;if(n<0)return null;for(var l=c.filter(function(e){return 0===K(e,t)}),i=t,d=function(e){if(!(l=l.filter(function(t){return 0===K(t,e)})).length)return i=e,1},u=t;u>=0&&!d(u);u-=1);for(var f=c.filter(function(e){return 1!==K(e,n)}),p=n,m=function(e){if(!(f=f.filter(function(t){return 1!==K(t,e)})).length)return p=Math.max(e-1,n),1},g=n;g1})&&h.push(e)},b=i;b<=p;b+=1)if(v(b))continue;return h.map(function(e){var t=w[e],n=s(t.record,e),l=o(n);return a.createElement(eH,{key:e,data:t,rowKey:n,index:e,style:{top:-r+l.top},extra:!0,getHeight:function(t){var r=e+t-1,a=o(n,s(w[r].record,r));return a.bottom-a.top}})})}},function(e,t,n){var o=s(e.record,t);return a.createElement(eH,(0,g.Z)({data:e,rowKey:o,index:t},n))})}else n=a.createElement("div",{className:O()("".concat(f,"-placeholder"))},a.createElement(j,{component:"div",prefixCls:f},h));return a.createElement(ej.Provider,{value:I},n)})),eA=function(e,t){var n=t.ref,o=t.onScroll;return a.createElement(eL,{ref:n,data:e,onScroll:o})},e_=a.forwardRef(function(e,t){var n=e.columns,o=e.scroll,r=e.sticky,l=e.prefixCls,i=void 0===l?eO:l,d=e.className,s=e.listItemHeight,u=e.components,f=o||{},p=f.x,m=f.y;"number"!=typeof p&&(p=1),"number"!=typeof m&&(m=500);var h=a.useMemo(function(){return{sticky:r,scrollY:m,listItemHeight:s}},[r,m,s]);return a.createElement(eT.Provider,{value:h},a.createElement(eD,(0,g.Z)({},e,{className:O()(d,"".concat(i,"-virtual")),scroll:(0,w.Z)((0,w.Z)({},o),{},{x:p}),components:(0,w.Z)((0,w.Z)({},u),{},{body:eA}),columns:n,internalHooks:c,tailor:!0,ref:t})))});x(e_,void 0);var eW=n(70464),eq=n(76405),eF=n(25049),eV=n(63496),eX=n(15354),eU=n(15900),eG=a.createContext(null),eY=a.memo(function(e){for(var t,n=e.prefixCls,o=e.level,r=e.isStart,l=e.isEnd,c="".concat(n,"-indent-unit"),i=[],d=0;d1&&void 0!==arguments[1]?arguments[1]:null;return n.map(function(d,s){for(var u,f=eQ(o?o.pos:"0",s),p=e0(d[a],f),m=0;m1&&void 0!==arguments[1]?arguments[1]:{},f=u.initWrapper,p=u.processEntity,m=u.onProcessFinished,g=u.externalGetKey,h=u.childrenPropName,v=u.fieldNames,b=arguments.length>2?arguments[2]:void 0,y={},x={},k={posEntities:y,keyEntities:x};return f&&(k=f(k)||k),t=function(e){var t=e.node,n=e.index,o=e.pos,r=e.key,a=e.parentPos,l=e.level,c={node:t,nodes:e.nodes,index:n,key:r,pos:o,level:l},i=e0(r,o);y[o]=c,x[i]=c,c.parent=y[a],c.parent&&(c.parent.children=c.parent.children||[],c.parent.children.push(c)),p&&p(c,k)},n={externalGetKey:g||b,childrenPropName:h,fieldNames:v},a=(r=("object"===(0,E.Z)(n)?n:{externalGetKey:n})||{}).childrenPropName,l=r.externalGetKey,i=(c=e1(r.fieldNames)).key,d=c.children,s=a||d,l?"string"==typeof l?o=function(e){return e[l]}:"function"==typeof l&&(o=function(e){return l(e)}):o=function(e,t){return e0(e[i],t)},function n(r,a,l,c){var i=r?r[s]:e,d=r?eQ(l.pos,a):"0",u=r?[].concat((0,ei.Z)(c),[r]):[];if(r){var f=o(r,d);t({node:r,index:a,pos:d,key:f,parentPos:l.node?l.pos:null,level:l.level+1,nodes:u})}i&&i.forEach(function(e,t){n(e,t,{node:r,pos:d,level:l?l.level+1:-1},u)})}(null),m&&m(k),k}function e6(e,t){var n=t.expandedKeys,o=t.selectedKeys,r=t.loadedKeys,a=t.loadingKeys,l=t.checkedKeys,c=t.halfCheckedKeys,i=t.dragOverNodeKey,d=t.dropPosition,s=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==o.indexOf(e),loaded:-1!==r.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==l.indexOf(e),halfChecked:-1!==c.indexOf(e),pos:String(s?s.pos:""),dragOver:i===e&&0===d,dragOverGapTop:i===e&&-1===d,dragOverGapBottom:i===e&&1===d}}function e8(e){var t=e.data,n=e.expanded,o=e.selected,r=e.checked,a=e.loaded,l=e.loading,c=e.halfChecked,i=e.dragOver,d=e.dragOverGapTop,s=e.dragOverGapBottom,u=e.pos,f=e.active,p=e.eventKey,m=(0,w.Z)((0,w.Z)({},t),{},{expanded:n,selected:o,checked:r,loaded:a,loading:l,halfChecked:c,dragOver:i,dragOverGapTop:d,dragOverGapBottom:s,pos:u,active:f,key:p});return"props"in m||Object.defineProperty(m,"props",{get:function(){return(0,R.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}var e5=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],e7="open",e9="close",te=function(e){(0,eX.Z)(n,e);var t=(0,eU.Z)(n);function n(){var e;(0,eq.Z)(this,n);for(var o=arguments.length,r=Array(o),l=0;l=0&&n.splice(o,1),n}function to(e,t){var n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function tr(e){return e.split("-")}function ta(e,t,n,o,r,a,l,c,i,d){var s,u,f=e.clientX,p=e.clientY,m=e.target.getBoundingClientRect(),g=m.top,h=m.height,v=(("rtl"===d?-1:1)*(((null==r?void 0:r.x)||0)-f)-12)/o,b=c[n.props.eventKey];if(p-1.5?a({dragNode:N,dropNode:Z,dropPosition:1})?S=1:O=!1:a({dragNode:N,dropNode:Z,dropPosition:0})?S=0:a({dragNode:N,dropNode:Z,dropPosition:1})?S=1:O=!1:a({dragNode:N,dropNode:Z,dropPosition:1})?S=1:O=!1,{dropPosition:S,dropLevelOffset:E,dropTargetKey:b.key,dropTargetPos:b.pos,dragOverNodeKey:C,dropContainerKey:0===S?null:(null===(u=b.parent)||void 0===u?void 0:u.key)||null,dropAllowed:O}}function tl(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function tc(e){var t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,E.Z)(e))return(0,R.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function ti(e,t){var n=new Set;return(e||[]).forEach(function(e){!function e(o){if(!n.has(o)){var r=t[o];if(r){n.add(o);var a=r.parent;!r.node.disabled&&a&&e(a.key)}}}(e)}),(0,ei.Z)(n)}function td(e,t){var n=new Set;return e.forEach(function(e){t.has(e)||n.add(e)}),n}function ts(e){var t=e||{},n=t.disabled,o=t.disableCheckbox,r=t.checkable;return!!(n||o)||!1===r}function tu(e,t,n,o){var r,a=[];r=o||ts;var l=new Set(e.filter(function(e){var t=!!n[e];return t||a.push(e),t})),c=new Map,i=0;return Object.keys(n).forEach(function(e){var t=n[e],o=t.level,r=c.get(o);r||(r=new Set,c.set(o,r)),r.add(t),i=Math.max(i,o)}),(0,R.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map(function(e){return"'".concat(e,"'")}).join(", "))),!0===t?function(e,t,n,o){for(var r=new Set(e),a=new Set,l=0;l<=n;l+=1)(t.get(l)||new Set).forEach(function(e){var t=e.key,n=e.node,a=e.children,l=void 0===a?[]:a;r.has(t)&&!o(n)&&l.filter(function(e){return!o(e.node)}).forEach(function(e){r.add(e.key)})});for(var c=new Set,i=n;i>=0;i-=1)(t.get(i)||new Set).forEach(function(e){var t=e.parent;if(!(o(e.node)||!e.parent||c.has(e.parent.key))){if(o(e.parent.node)){c.add(t.key);return}var n=!0,l=!1;(t.children||[]).filter(function(e){return!o(e.node)}).forEach(function(e){var t=e.key,o=r.has(t);n&&!o&&(n=!1),!l&&(o||a.has(t))&&(l=!0)}),n&&r.add(t.key),l&&a.add(t.key),c.add(t.key)}});return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(td(a,r))}}(l,c,i,r):function(e,t,n,o,r){for(var a=new Set(e),l=new Set(t),c=0;c<=o;c+=1)(n.get(c)||new Set).forEach(function(e){var t=e.key,n=e.node,o=e.children,c=void 0===o?[]:o;a.has(t)||l.has(t)||r(n)||c.filter(function(e){return!r(e.node)}).forEach(function(e){a.delete(e.key)})});l=new Set;for(var i=new Set,d=o;d>=0;d-=1)(n.get(d)||new Set).forEach(function(e){var t=e.parent;if(!(r(e.node)||!e.parent||i.has(e.parent.key))){if(r(e.parent.node)){i.add(t.key);return}var n=!0,o=!1;(t.children||[]).filter(function(e){return!r(e.node)}).forEach(function(e){var t=e.key,r=a.has(t);n&&!r&&(n=!1),!o&&(r||l.has(t))&&(o=!0)}),n||a.delete(t.key),o&&l.add(t.key),i.add(t.key)}});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(td(l,a))}}(l,t.halfCheckedKeys,c,i,r)}tt.displayName="TreeNode",tt.isTreeNode=1;var tf=n(50506),tp=n(13613),tm=n(61994),tg=n(80795),th=n(29967);let tv={},tb="SELECT_ALL",ty="SELECT_INVERT",tx="SELECT_NONE",tk=[],tC=(e,t)=>{let n=[];return(t||[]).forEach(t=>{n.push(t),t&&"object"==typeof t&&e in t&&(n=[].concat((0,ei.Z)(n),(0,ei.Z)(tC(e,t[e]))))}),n};var tS=(e,t)=>{let{preserveSelectedRowKeys:n,selectedRowKeys:o,defaultSelectedRowKeys:r,getCheckboxProps:l,onChange:c,onSelect:i,onSelectAll:d,onSelectInvert:s,onSelectNone:u,onSelectMultiple:f,columnWidth:p,type:m,selections:g,fixed:h,renderCell:v,hideSelectAll:b,checkStrictly:y=!0}=t||{},{prefixCls:x,data:k,pageData:C,getRecordByKey:S,getRowKey:E,expandType:w,childrenColumnName:N,locale:Z,getPopupContainer:K}=e,I=(0,tp.ln)("Table"),[R,P]=function(e){let[t,n]=(0,a.useState)(null);return[(0,a.useCallback)((o,r,a)=>{let l=null!=t?t:o,c=Math.max(l||0,o),i=r.slice(Math.min(l||0,o),c+1).map(t=>e(t)),d=i.some(e=>!a.has(e)),s=[];return i.forEach(e=>{d?(a.has(e)||s.push(e),a.add(e)):(a.delete(e),s.push(e))}),n(d?c:null),s},[t]),e=>{n(e)}]}(e=>e),[D,M]=(0,tf.Z)(o||r||tk,{value:o}),T=a.useRef(new Map),j=(0,a.useCallback)(e=>{if(n){let t=new Map;e.forEach(e=>{let n=S(e);!n&&T.current.has(e)&&(n=T.current.get(e)),t.set(e,n)}),T.current=t}},[S,n]);a.useEffect(()=>{j(D)},[D]);let{keyEntities:B}=(0,a.useMemo)(()=>{if(y)return{keyEntities:null};let e=k;if(n){let t=new Set(k.map((e,t)=>E(e,t))),n=Array.from(T.current).reduce((e,n)=>{let[o,r]=n;return t.has(o)?e:e.concat(r)},[]);e=[].concat((0,ei.Z)(e),(0,ei.Z)(n))}return e4(e,{externalGetKey:E,childrenPropName:N})},[k,E,y,N,n]),z=(0,a.useMemo)(()=>tC(N,C),[N,C]),H=(0,a.useMemo)(()=>{let e=new Map;return z.forEach((t,n)=>{let o=E(t,n),r=(l?l(t):null)||{};e.set(o,r)}),e},[z,E,l]),L=(0,a.useCallback)(e=>{var t;return!!(null===(t=H.get(E(e)))||void 0===t?void 0:t.disabled)},[H,E]),[A,_]=(0,a.useMemo)(()=>{if(y)return[D||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=tu(D,!0,B,L);return[e||[],t]},[D,y,B,L]),W=(0,a.useMemo)(()=>new Set("radio"===m?A.slice(0,1):A),[A,m]),q=(0,a.useMemo)(()=>"radio"===m?new Set:new Set(_),[_,m]);a.useEffect(()=>{t||M(tk)},[!!t]);let F=(0,a.useCallback)((e,t)=>{let o,r;j(e),n?(o=e,r=e.map(e=>T.current.get(e))):(o=[],r=[],e.forEach(e=>{let t=S(e);void 0!==t&&(o.push(e),r.push(t))})),M(o),null==c||c(o,r,{type:t})},[M,S,c,n]),V=(0,a.useCallback)((e,t,n,o)=>{if(i){let r=n.map(e=>S(e));i(S(e),t,r,o)}F(n,"single")},[i,S,F]),X=(0,a.useMemo)(()=>!g||b?null:(!0===g?[tb,ty,tx]:g).map(e=>e===tb?{key:"all",text:Z.selectionAll,onSelect(){F(k.map((e,t)=>E(e,t)).filter(e=>{let t=H.get(e);return!(null==t?void 0:t.disabled)||W.has(e)}),"all")}}:e===ty?{key:"invert",text:Z.selectInvert,onSelect(){let e=new Set(W);C.forEach((t,n)=>{let o=E(t,n),r=H.get(o);(null==r?void 0:r.disabled)||(e.has(o)?e.delete(o):e.add(o))});let t=Array.from(e);s&&(I.deprecated(!1,"onSelectInvert","onChange"),s(t)),F(t,"invert")}}:e===tx?{key:"none",text:Z.selectNone,onSelect(){null==u||u(),F(Array.from(W).filter(e=>{let t=H.get(e);return null==t?void 0:t.disabled}),"none")}}:e).map(e=>Object.assign(Object.assign({},e),{onSelect:function(){for(var t,n=arguments.length,o=Array(n),r=0;r{var n;let o,r,l;if(!t)return e.filter(e=>e!==tv);let c=(0,ei.Z)(e),i=new Set(W),s=z.map(E).filter(e=>!H.get(e).disabled),u=s.every(e=>i.has(e)),k=s.some(e=>i.has(e));if("radio"!==m){let e;if(X){let t={getPopupContainer:K,items:X.map((e,t)=>{let{key:n,text:o,onSelect:r}=e;return{key:null!=n?n:t,onClick:()=>{null==r||r(s)},label:o}})};e=a.createElement("div",{className:"".concat(x,"-selection-extra")},a.createElement(tg.Z,{menu:t,getPopupContainer:K},a.createElement("span",null,a.createElement(eW.Z,null))))}let t=z.map((e,t)=>{let n=E(e,t),o=H.get(n)||{};return Object.assign({checked:i.has(n)},o)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===z.length,l=n&&t.every(e=>{let{checked:t}=e;return t}),c=n&&t.some(e=>{let{checked:t}=e;return t});r=a.createElement(tm.Z,{checked:n?l:!!z.length&&u,indeterminate:n?!l&&c:!u&&k,onChange:()=>{let e=[];u?s.forEach(t=>{i.delete(t),e.push(t)}):s.forEach(t=>{i.has(t)||(i.add(t),e.push(t))});let t=Array.from(i);null==d||d(!u,t.map(e=>S(e)),e.map(e=>S(e))),F(t,"all"),P(null)},disabled:0===z.length||n,"aria-label":e?"Custom selection":"Select all",skipGroup:!0}),o=!b&&a.createElement("div",{className:"".concat(x,"-selection")},r,e)}if(l="radio"===m?(e,t,n)=>{let o=E(t,n),r=i.has(o);return{node:a.createElement(th.ZP,Object.assign({},H.get(o),{checked:r,onClick:e=>e.stopPropagation(),onChange:e=>{i.has(o)||V(o,!0,[o],e.nativeEvent)}})),checked:r}}:(e,t,n)=>{var o;let r;let l=E(t,n),c=i.has(l),d=q.has(l),u=H.get(l);return r="nest"===w?d:null!==(o=null==u?void 0:u.indeterminate)&&void 0!==o?o:d,{node:a.createElement(tm.Z,Object.assign({},u,{indeterminate:r,checked:c,skipGroup:!0,onClick:e=>e.stopPropagation(),onChange:e=>{let{nativeEvent:t}=e,{shiftKey:n}=t,o=s.findIndex(e=>e===l),r=A.some(e=>s.includes(e));if(n&&y&&r){let e=R(o,s,i),t=Array.from(i);null==f||f(!c,t.map(e=>S(e)),e.map(e=>S(e))),F(t,"multiple")}else if(y){let e=c?tn(A,l):to(A,l);V(l,!c,e,t)}else{let{checkedKeys:e,halfCheckedKeys:n}=tu([].concat((0,ei.Z)(A),[l]),!0,B,L),o=e;if(c){let t=new Set(e);t.delete(l),o=tu(Array.from(t),{checked:!1,halfCheckedKeys:n},B,L).checkedKeys}V(l,!c,o,t)}c?P(null):P(o)}})),checked:c}},!c.includes(tv)){if(0===c.findIndex(e=>{var t;return(null===(t=e[ea])||void 0===t?void 0:t.columnType)==="EXPAND_COLUMN"})){let[e,...t]=c;c=[e,tv].concat((0,ei.Z)(t))}else c=[tv].concat((0,ei.Z)(c))}let C=c.indexOf(tv),N=(c=c.filter((e,t)=>e!==tv||t===C))[C-1],Z=c[C+1],I=h;void 0===I&&((null==Z?void 0:Z.fixed)!==void 0?I=Z.fixed:(null==N?void 0:N.fixed)!==void 0&&(I=N.fixed)),I&&N&&(null===(n=N[ea])||void 0===n?void 0:n.columnType)==="EXPAND_COLUMN"&&void 0===N.fixed&&(N.fixed=I);let D=O()("".concat(x,"-selection-col"),{["".concat(x,"-selection-col-with-dropdown")]:g&&"checkbox"===m}),M={fixed:I,width:p,className:"".concat(x,"-selection-column"),title:(null==t?void 0:t.columnTitle)?"function"==typeof t.columnTitle?t.columnTitle(r):t.columnTitle:o,render:(e,t,n)=>{let{node:o,checked:r}=l(e,t,n);return v?v(r,t,n,o):o},onCell:t.onCell,[ea]:{className:D}};return c.map(e=>e===tv?M:e)},[E,z,t,A,W,q,p,X,w,H,f,V,L]),W]},tE=n(53346);function tw(e){return null!=e&&e===e.window}var tN=n(71744),tZ=n(91086),tO=n(64024),tK=n(33759),tI=n(28617),tR=n(13823),tP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},tD=n(55015),tM=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:tP}))}),tT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},tj=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:tT}))}),tB=n(15327),tz=n(77565),tH=n(95814),tL={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},tA=["10","20","50","100"],t_=function(e){var t=e.pageSizeOptions,n=void 0===t?tA:t,o=e.locale,r=e.changeSize,l=e.pageSize,c=e.goButton,d=e.quickGo,s=e.rootPrefixCls,u=e.selectComponentClass,f=e.selectPrefixCls,p=e.disabled,m=e.buildOptionText,g=a.useState(""),h=(0,i.Z)(g,2),v=h[0],b=h[1],y=function(){return!v||Number.isNaN(v)?void 0:Number(v)},x="function"==typeof m?m:function(e){return"".concat(e," ").concat(o.items_per_page)},k=function(e){""!==v&&(e.keyCode===tH.Z.ENTER||"click"===e.type)&&(b(""),null==d||d(y()))},C="".concat(s,"-options");if(!r&&!d)return null;var S=null,E=null,w=null;if(r&&u){var N=(n.some(function(e){return e.toString()===l.toString()})?n:n.concat([l.toString()]).sort(function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))})).map(function(e,t){return a.createElement(u.Option,{key:t,value:e.toString()},x(e))});S=a.createElement(u,{disabled:p,prefixCls:f,showSearch:!1,className:"".concat(C,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(l||n[0]).toString(),onChange:function(e){null==r||r(Number(e))},getPopupContainer:function(e){return e.parentNode},"aria-label":o.page_size,defaultOpen:!1},N)}return d&&(c&&(w="boolean"==typeof c?a.createElement("button",{type:"button",onClick:k,onKeyUp:k,disabled:p,className:"".concat(C,"-quick-jumper-button")},o.jump_to_confirm):a.createElement("span",{onClick:k,onKeyUp:k},c)),E=a.createElement("div",{className:"".concat(C,"-quick-jumper")},o.jump_to,a.createElement("input",{disabled:p,type:"text",value:v,onChange:function(e){b(e.target.value)},onKeyUp:k,onBlur:function(e){!c&&""!==v&&(b(""),e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(s,"-item-link"))>=0||e.relatedTarget.className.indexOf("".concat(s,"-item"))>=0)||null==d||d(y()))},"aria-label":o.page}),o.page,w)),a.createElement("li",{className:C},S,E)},tW=function(e){var t,n=e.rootPrefixCls,o=e.page,r=e.active,l=e.className,c=e.showTitle,i=e.onClick,d=e.onKeyPress,s=e.itemRender,u="".concat(n,"-item"),f=O()(u,"".concat(u,"-").concat(o),(t={},(0,N.Z)(t,"".concat(u,"-active"),r),(0,N.Z)(t,"".concat(u,"-disabled"),!o),t),l),p=s(o,"page",a.createElement("a",{rel:"nofollow"},o));return p?a.createElement("li",{title:c?String(o):null,className:f,onClick:function(){i(o)},onKeyDown:function(e){d(e,i,o)},tabIndex:0},p):null},tq=function(e,t,n){return n};function tF(){}function tV(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function tX(e,t,n){return Math.floor((n-1)/(void 0===e?t:e))+1}var tU=function(e){var t,n,o,r,l,c=e.prefixCls,d=void 0===c?"rc-pagination":c,s=e.selectPrefixCls,u=e.className,f=e.selectComponentClass,p=e.current,m=e.defaultCurrent,h=e.total,v=void 0===h?0:h,b=e.pageSize,y=e.defaultPageSize,x=e.onChange,k=void 0===x?tF:x,C=e.hideOnSinglePage,S=e.showPrevNextJumpers,E=e.showQuickJumper,Z=e.showLessItems,K=e.showTitle,I=void 0===K||K,R=e.onShowSizeChange,P=void 0===R?tF:R,D=e.locale,M=void 0===D?tL:D,T=e.style,j=e.totalBoundaryShowSizeChanger,B=e.disabled,z=e.simple,H=e.showTotal,L=e.showSizeChanger,A=e.pageSizeOptions,_=e.itemRender,W=void 0===_?tq:_,q=e.jumpPrevIcon,F=e.jumpNextIcon,V=e.prevIcon,U=e.nextIcon,G=a.useRef(null),Y=(0,tf.Z)(10,{value:b,defaultValue:void 0===y?10:y}),$=(0,i.Z)(Y,2),J=$[0],Q=$[1],ee=(0,tf.Z)(1,{value:p,defaultValue:void 0===m?1:m,postState:function(e){return Math.max(1,Math.min(e,tX(void 0,J,v)))}}),et=(0,i.Z)(ee,2),en=et[0],eo=et[1],er=a.useState(en),ea=(0,i.Z)(er,2),el=ea[0],ec=ea[1];(0,a.useEffect)(function(){ec(en)},[en]);var ei=Math.max(1,en-(Z?3:5)),ed=Math.min(tX(void 0,J,v),en+(Z?3:5));function es(t,n){var o=t||a.createElement("button",{type:"button","aria-label":n,className:"".concat(d,"-item-link")});return"function"==typeof t&&(o=a.createElement(t,(0,w.Z)({},e))),o}function eu(e){var t=e.target.value,n=tX(void 0,J,v);return""===t?t:Number.isNaN(Number(t))?el:t>=n?n:Number(t)}var ef=v>J&&E;function ep(e){var t=eu(e);switch(t!==el&&ec(t),e.keyCode){case tH.Z.ENTER:em(t);break;case tH.Z.UP:em(t-1);break;case tH.Z.DOWN:em(t+1)}}function em(e){if(tV(e)&&e!==en&&tV(v)&&v>0&&!B){var t=tX(void 0,J,v),n=e;return e>t?n=t:e<1&&(n=1),n!==el&&ec(n),eo(n),null==k||k(n,J),n}return en}var eg=en>1,eh=en(void 0===j?50:j);function eb(){eg&&em(en-1)}function ey(){eh&&em(en+1)}function ex(){em(ei)}function ek(){em(ed)}function eC(e,t){if("Enter"===e.key||e.charCode===tH.Z.ENTER||e.keyCode===tH.Z.ENTER){for(var n=arguments.length,o=Array(n>2?n-2:0),r=2;rv?v:en*J])),eZ=null,eO=tX(void 0,J,v);if(C&&v<=J)return null;var eK=[],eI={rootPrefixCls:d,onClick:em,onKeyPress:eC,showTitle:I,itemRender:W,page:-1},eR=en-1>0?en-1:0,eP=en+1=2*ej&&3!==en&&(eK[0]=a.cloneElement(eK[0],{className:O()("".concat(d,"-item-after-jump-prev"),eK[0].props.className)}),eK.unshift(eE)),eO-en>=2*ej&&en!==eO-2){var eF=eK[eK.length-1];eK[eK.length-1]=a.cloneElement(eF,{className:O()("".concat(d,"-item-before-jump-next"),eF.props.className)}),eK.push(eZ)}1!==e_&&eK.unshift(a.createElement(tW,(0,g.Z)({},eI,{key:1,page:1}))),eW!==eO&&eK.push(a.createElement(tW,(0,g.Z)({},eI,{key:eO,page:eO})))}var eV=(t=W(eR,"prev",es(V,"prev page")),a.isValidElement(t)?a.cloneElement(t,{disabled:!eg}):t);if(eV){var eX=!eg||!eO;eV=a.createElement("li",{title:I?M.prev_page:null,onClick:eb,tabIndex:eX?null:0,onKeyDown:function(e){eC(e,eb)},className:O()("".concat(d,"-prev"),(0,N.Z)({},"".concat(d,"-disabled"),eX)),"aria-disabled":eX},eV)}var eU=(n=W(eP,"next",es(U,"next page")),a.isValidElement(n)?a.cloneElement(n,{disabled:!eh}):n);eU&&(z?(r=!eh,l=eg?0:null):l=(r=!eh||!eO)?null:0,eU=a.createElement("li",{title:I?M.next_page:null,onClick:ey,tabIndex:l,onKeyDown:function(e){eC(e,ey)},className:O()("".concat(d,"-next"),(0,N.Z)({},"".concat(d,"-disabled"),r)),"aria-disabled":r},eU));var eG=O()(d,u,(o={},(0,N.Z)(o,"".concat(d,"-simple"),z),(0,N.Z)(o,"".concat(d,"-disabled"),B),o));return a.createElement("ul",(0,g.Z)({className:eG,style:T,ref:G},ew),eN,eV,z?eT:eK,eU,a.createElement(t_,{locale:M,rootPrefixCls:d,disabled:B,selectComponentClass:f,selectPrefixCls:void 0===s?"rc-select":s,changeSize:ev?function(e){var t=tX(e,J,v),n=en>t&&0!==t?t:en;Q(e),ec(n),null==P||P(en,e),eo(n),null==k||k(n,e)}:null,pageSize:J,pageSizeOptions:A,quickGo:ef?em:null,goButton:eM}))},tG=n(96257),tY=n(55274),t$=n(52787);let tJ=e=>a.createElement(t$.default,Object.assign({},e,{showSearch:!0,size:"small"})),tQ=e=>a.createElement(t$.default,Object.assign({},e,{showSearch:!0,size:"middle"}));tJ.Option=t$.default.Option,tQ.Option=t$.default.Option;var t0=n(352),t1=n(31282),t2=n(37433),t3=n(12918),t4=n(3104),t6=n(80669),t8=n(65265);let t5=e=>{let{componentCls:t}=e;return{["".concat(t,"-disabled")]:{"&, &:hover":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},["&".concat(t,"-disabled")]:{cursor:"not-allowed",["".concat(t,"-item")]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},["".concat(t,"-simple&")]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},["".concat(t,"-simple-pager")]:{color:e.colorTextDisabled},["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{["".concat(t,"-item-link-icon")]:{opacity:0},["".concat(t,"-item-ellipsis")]:{opacity:1}}},["&".concat(t,"-simple")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&".concat(t,"-disabled ").concat(t,"-item-link")]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},t7=e=>{let{componentCls:t}=e;return{["&".concat(t,"-mini ").concat(t,"-total-text, &").concat(t,"-mini ").concat(t,"-simple-pager")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-item")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.calc(e.itemSizeSM).sub(2).equal())},["&".concat(t,"-mini:not(").concat(t,"-disabled) ").concat(t,"-item:not(").concat(t,"-item-active)")]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},["&".concat(t,"-mini ").concat(t,"-prev, &").concat(t,"-mini ").concat(t,"-next")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini:not(").concat(t,"-disabled)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover ").concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["\n &".concat(t,"-mini ").concat(t,"-prev ").concat(t,"-item-link,\n &").concat(t,"-mini ").concat(t,"-next ").concat(t,"-item-link\n ")]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}},["&".concat(t,"-mini ").concat(t,"-jump-prev, &").concat(t,"-mini ").concat(t,"-jump-next")]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-options")]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),input:Object.assign(Object.assign({},(0,t1.x0)(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},t9=e=>{let{componentCls:t}=e;return{["\n &".concat(t,"-simple ").concat(t,"-prev,\n &").concat(t,"-simple ").concat(t,"-next\n ")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),verticalAlign:"top",["".concat(t,"-item-link")]:{height:e.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}}},["&".concat(t,"-simple ").concat(t,"-simple-pager")]:{display:"inline-block",height:e.itemSizeSM,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:e.marginXS,padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),textAlign:"center",backgroundColor:e.itemInputBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadius,outline:"none",transition:"border-color ".concat(e.motionDurationMid),color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:"".concat((0,t0.bf)(e.inputOutlineOffset)," 0 ").concat((0,t0.bf)(e.controlOutlineWidth)," ").concat(e.controlOutline)},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}}}},ne=e=>{let{componentCls:t}=e;return{["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{outline:0,["".concat(t,"-item-container")]:{position:"relative",["".concat(t,"-item-link-icon")]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:"all ".concat(e.motionDurationMid),"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},["".concat(t,"-item-ellipsis")]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:"all ".concat(e.motionDurationMid)}},"&:hover":{["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}}},["\n ".concat(t,"-prev,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{marginInlineEnd:e.marginXS},["\n ".concat(t,"-prev,\n ").concat(t,"-next,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:"".concat((0,t0.bf)(e.itemSize)),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:"all ".concat(e.motionDurationMid)},["".concat(t,"-prev, ").concat(t,"-next")]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},["".concat(t,"-item-link")]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:"none",transition:"all ".concat(e.motionDurationMid)},["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover")]:{["".concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["".concat(t,"-slash")]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},["".concat(t,"-options")]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:(0,t0.bf)(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},(0,t1.ik)(e)),(0,t8.$U)(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},(0,t8.Xy)(e)),width:e.calc(e.controlHeightLG).mul(1.25).equal(),height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},nt=e=>{let{componentCls:t}=e;return{["".concat(t,"-item")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),color:e.colorText,"&:hover":{textDecoration:"none"}},["&:not(".concat(t,"-item-active)")]:{"&:hover":{transition:"all ".concat(e.motionDurationMid),backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}}}},nn=e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,t3.Wf)(e)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},["".concat(t,"-total-text")]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),nt(e)),ne(e)),t9(e)),t7(e)),t5(e)),{["@media only screen and (max-width: ".concat(e.screenLG,"px)")]:{["".concat(t,"-item")]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},["@media only screen and (max-width: ".concat(e.screenSM,"px)")]:{["".concat(t,"-options")]:{display:"none"}}}),["&".concat(e.componentCls,"-rtl")]:{direction:"rtl"}}},no=e=>{let{componentCls:t}=e;return{["".concat(t,":not(").concat(t,"-disabled)")]:{["".concat(t,"-item")]:Object.assign({},(0,t3.Qy)(e)),["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{"&:focus-visible":Object.assign({["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}},(0,t3.oN)(e))},["".concat(t,"-prev, ").concat(t,"-next")]:{["&:focus-visible ".concat(t,"-item-link")]:Object.assign({},(0,t3.oN)(e))}}}},nr=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},(0,t2.T)(e)),na=e=>(0,t4.TS)(e,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginXXS,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},(0,t2.e)(e));var nl=(0,t6.I$)("Pagination",e=>{let t=na(e);return[nn(t),no(t)]},nr),nc=n(29961);let ni=e=>{let{componentCls:t}=e;return{["".concat(t).concat(t,"-bordered").concat(t,"-disabled:not(").concat(t,"-mini)")]:{"&, &:hover":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},"&:focus-visible":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},["".concat(t,"-item, ").concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,["&:hover:not(".concat(t,"-item-active)")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},["&".concat(t,"-item-active")]:{backgroundColor:e.itemActiveBgDisabled}},["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},["".concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},["".concat(t).concat(t,"-bordered:not(").concat(t,"-mini)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},["".concat(t,"-item-link")]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},["&:hover ".concat(t,"-item-link")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},["&".concat(t,"-disabled")]:{["".concat(t,"-item-link")]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},["".concat(t,"-item")]:{backgroundColor:e.itemBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),["&:hover:not(".concat(t,"-item-active)")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}};var nd=(0,t6.bk)(["Pagination","bordered"],e=>[ni(na(e))],nr),ns=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},nu=e=>{let{prefixCls:t,selectPrefixCls:n,className:o,rootClassName:r,style:l,size:c,locale:i,selectComponentClass:d,responsive:s,showSizeChanger:u}=e,f=ns(e,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:p}=(0,tI.Z)(s),[,m]=(0,nc.ZP)(),{getPrefixCls:g,direction:h,pagination:v={}}=a.useContext(tN.E_),b=g("pagination",t),[y,x,k]=nl(b),C=null!=u?u:v.showSizeChanger,S=a.useMemo(()=>{let e=a.createElement("span",{className:"".concat(b,"-item-ellipsis")},"•••"),t=a.createElement("button",{className:"".concat(b,"-item-link"),type:"button",tabIndex:-1},"rtl"===h?a.createElement(tz.Z,null):a.createElement(tB.Z,null));return{prevIcon:t,nextIcon:a.createElement("button",{className:"".concat(b,"-item-link"),type:"button",tabIndex:-1},"rtl"===h?a.createElement(tB.Z,null):a.createElement(tz.Z,null)),jumpPrevIcon:a.createElement("a",{className:"".concat(b,"-item-link")},a.createElement("div",{className:"".concat(b,"-item-container")},"rtl"===h?a.createElement(tj,{className:"".concat(b,"-item-link-icon")}):a.createElement(tM,{className:"".concat(b,"-item-link-icon")}),e)),jumpNextIcon:a.createElement("a",{className:"".concat(b,"-item-link")},a.createElement("div",{className:"".concat(b,"-item-container")},"rtl"===h?a.createElement(tM,{className:"".concat(b,"-item-link-icon")}):a.createElement(tj,{className:"".concat(b,"-item-link-icon")}),e))}},[h,b]),[E]=(0,tY.Z)("Pagination",tG.Z),w=Object.assign(Object.assign({},E),i),N=(0,tK.Z)(c),Z="small"===N||!!(p&&!N&&s),K=g("select",n),I=O()({["".concat(b,"-mini")]:Z,["".concat(b,"-rtl")]:"rtl"===h,["".concat(b,"-bordered")]:m.wireframe},null==v?void 0:v.className,o,r,x,k),R=Object.assign(Object.assign({},null==v?void 0:v.style),l);return y(a.createElement(a.Fragment,null,m.wireframe&&a.createElement(nd,{prefixCls:b}),a.createElement(tU,Object.assign({},S,f,{style:R,prefixCls:b,selectPrefixCls:K,className:I,selectComponentClass:d||(Z?tJ:tQ),locale:w,showSizeChanger:C}))))},nf=n(87908);function np(e,t){return"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t}function nm(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}function ng(e,t){return"function"==typeof e?e(t):e}var nh={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},nv=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:nh}))}),nb=n(51646),ny=n(73002),nx=n(85180),nk=n(45937),nC=n(88208);function nS(e){if(null==e)throw TypeError("Cannot destructure "+e)}var nE=n(47970),nw=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],nN=function(e,t){var n,o,r,l,c,d=e.className,u=e.style,f=e.motion,p=e.motionNodes,m=e.motionType,h=e.onMotionStart,v=e.onMotionEnd,b=e.active,y=e.treeNodeRequiredProps,x=(0,H.Z)(e,nw),k=a.useState(!0),C=(0,i.Z)(k,2),S=C[0],E=C[1],w=a.useContext(eG).prefixCls,N=p&&"hide"!==m;(0,s.Z)(function(){p&&N!==S&&E(N)},[p]);var Z=a.useRef(!1),K=function(){p&&!Z.current&&(Z.current=!0,v())};return(n=function(){p&&h()},o=a.useState(!1),l=(r=(0,i.Z)(o,2))[0],c=r[1],(0,s.Z)(function(){if(l)return n(),function(){K()}},[l]),(0,s.Z)(function(){return c(!0),function(){c(!1)}},[]),p)?a.createElement(nE.ZP,(0,g.Z)({ref:t,visible:S},f,{motionAppear:"show"===m,onVisibleChanged:function(e){N===e&&K()}}),function(e,t){var n=e.className,o=e.style;return a.createElement("div",{ref:t,className:O()("".concat(w,"-treenode-motion"),n),style:o},p.map(function(e){var t=(0,g.Z)({},(nS(e.data),e.data)),n=e.title,o=e.key,r=e.isStart,l=e.isEnd;delete t.children;var c=e6(o,y);return a.createElement(tt,(0,g.Z)({},t,c,{title:n,active:b,data:e.data,key:o,isStart:r,isEnd:l}))}))}):a.createElement(tt,(0,g.Z)({domRef:t,className:d,style:u},x,{active:b}))};nN.displayName="MotionTreeNode";var nZ=a.forwardRef(nN);function nO(e,t,n){var o=e.findIndex(function(e){return e.key===n}),r=e[o+1],a=t.findIndex(function(e){return e.key===n});if(r){var l=t.findIndex(function(e){return e.key===r.key});return t.slice(a+1,l)}return t.slice(a+1)}var nK=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],nI={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},nR=function(){},nP="RC_TREE_MOTION_".concat(Math.random()),nD={key:nP},nM={key:nP,level:0,index:0,pos:"0",node:nD,nodes:[nD]},nT={parent:null,children:[],pos:nM.pos,data:nD,title:null,key:nP,isStart:[],isEnd:[]};function nj(e,t,n,o){return!1!==t&&n?e.slice(0,Math.ceil(n/o)+1):e}function nB(e){return e0(e.key,e.pos)}var nz=a.forwardRef(function(e,t){var n=e.prefixCls,o=e.data,r=(e.selectable,e.checkable,e.expandedKeys),l=e.selectedKeys,c=e.checkedKeys,d=e.loadedKeys,u=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,m=e.disabled,h=e.dragging,v=e.dragOverNodeKey,b=e.dropPosition,y=e.motion,x=e.height,k=e.itemHeight,C=e.virtual,S=e.focusable,E=e.activeItem,w=e.focused,N=e.tabIndex,Z=e.onKeyDown,O=e.onFocus,K=e.onBlur,I=e.onActiveChange,R=e.onListChangeStart,P=e.onListChangeEnd,D=(0,H.Z)(e,nK),M=a.useRef(null),T=a.useRef(null);a.useImperativeHandle(t,function(){return{scrollTo:function(e){M.current.scrollTo(e)},getIndentWidth:function(){return T.current.offsetWidth}}});var j=a.useState(r),B=(0,i.Z)(j,2),z=B[0],L=B[1],A=a.useState(o),_=(0,i.Z)(A,2),W=_[0],q=_[1],F=a.useState(o),V=(0,i.Z)(F,2),X=V[0],U=V[1],G=a.useState([]),Y=(0,i.Z)(G,2),$=Y[0],J=Y[1],Q=a.useState(null),ee=(0,i.Z)(Q,2),et=ee[0],en=ee[1],eo=a.useRef(o);function er(){var e=eo.current;q(e),U(e),J([]),en(null),P()}eo.current=o,(0,s.Z)(function(){L(r);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,o=t.length;if(1!==Math.abs(n-o))return{add:!1,key:null};function r(e,t){var n=new Map;e.forEach(function(e){n.set(e,!0)});var o=t.filter(function(e){return!n.has(e)});return 1===o.length?o[0]:null}return n ").concat(t);return t}(E)),a.createElement("div",null,a.createElement("input",{style:nI,disabled:!1===S||m,tabIndex:!1!==S?N:null,onKeyDown:Z,onFocus:O,onBlur:K,value:"",onChange:nR,"aria-label":"for screen reader"})),a.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},a.createElement("div",{className:"".concat(n,"-indent")},a.createElement("div",{ref:T,className:"".concat(n,"-indent-unit")}))),a.createElement(eM.Z,(0,g.Z)({},D,{data:ea,itemKey:nB,height:x,fullHeight:!1,virtual:C,itemHeight:k,prefixCls:"".concat(n,"-list"),ref:M,onVisibleChange:function(e,t){var n=new Set(e);t.filter(function(e){return!n.has(e)}).some(function(e){return nB(e)===nP})&&er()}}),function(e){var t=e.pos,n=(0,g.Z)({},(nS(e.data),e.data)),o=e.title,r=e.key,l=e.isStart,c=e.isEnd,i=e0(r,t);delete n.key,delete n.children;var d=e6(i,el);return a.createElement(nZ,(0,g.Z)({},n,d,{title:o,active:!!E&&r===E.key,pos:t,data:e.data,isStart:l,isEnd:c,motion:y,motionNodes:r===nP?$:null,motionType:et,onMotionStart:R,onMotionEnd:er,treeNodeRequiredProps:el,onMouseMove:function(){I(null)}}))}))});nz.displayName="NodeList";var nH=function(e){(0,eX.Z)(n,e);var t=(0,eU.Z)(n);function n(){var e;(0,eq.Z)(this,n);for(var o=arguments.length,r=Array(o),l=0;l0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var n=t.key,r=t.children;o.push(n),e(r)})}(l[i].children),o),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(d),window.addEventListener("dragend",e.onWindowDragEnd),null==c||c({event:t,node:e8(n.props)})},e.onNodeDragEnter=function(t,n){var o=e.state,r=o.expandedKeys,a=o.keyEntities,l=o.dragChildrenKeys,c=o.flattenNodes,i=o.indent,d=e.props,s=d.onDragEnter,u=d.onExpand,f=d.allowDrop,p=d.direction,m=n.props,g=m.pos,h=m.eventKey,v=(0,eV.Z)(e).dragNode;if(e.currentMouseOverDroppableNodeKey!==h&&(e.currentMouseOverDroppableNodeKey=h),!v){e.resetDragState();return}var b=ta(t,v,n,i,e.dragStartMousePosition,f,c,a,r,p),y=b.dropPosition,x=b.dropLevelOffset,k=b.dropTargetKey,C=b.dropContainerKey,S=b.dropTargetPos,E=b.dropAllowed,w=b.dragOverNodeKey;if(-1!==l.indexOf(k)||!E||(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach(function(t){clearTimeout(e.delayedDragEnterLogic[t])}),v.props.eventKey!==n.props.eventKey&&(t.persist(),e.delayedDragEnterLogic[g]=window.setTimeout(function(){if(null!==e.state.draggingNodeKey){var o=(0,ei.Z)(r),l=a[n.props.eventKey];l&&(l.children||[]).length&&(o=to(r,n.props.eventKey)),"expandedKeys"in e.props||e.setExpandedKeys(o),null==u||u(o,{node:e8(n.props),expanded:!0,nativeEvent:t.nativeEvent})}},800)),v.props.eventKey===k&&0===x)){e.resetDragState();return}e.setState({dragOverNodeKey:w,dropPosition:y,dropLevelOffset:x,dropTargetKey:k,dropContainerKey:C,dropTargetPos:S,dropAllowed:E}),null==s||s({event:t,node:e8(n.props),expandedKeys:r})},e.onNodeDragOver=function(t,n){var o=e.state,r=o.dragChildrenKeys,a=o.flattenNodes,l=o.keyEntities,c=o.expandedKeys,i=o.indent,d=e.props,s=d.onDragOver,u=d.allowDrop,f=d.direction,p=(0,eV.Z)(e).dragNode;if(p){var m=ta(t,p,n,i,e.dragStartMousePosition,u,a,l,c,f),g=m.dropPosition,h=m.dropLevelOffset,v=m.dropTargetKey,b=m.dropContainerKey,y=m.dropAllowed,x=m.dropTargetPos,k=m.dragOverNodeKey;-1===r.indexOf(v)&&y&&(p.props.eventKey===v&&0===h?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():g===e.state.dropPosition&&h===e.state.dropLevelOffset&&v===e.state.dropTargetKey&&b===e.state.dropContainerKey&&x===e.state.dropTargetPos&&y===e.state.dropAllowed&&k===e.state.dragOverNodeKey||e.setState({dropPosition:g,dropLevelOffset:h,dropTargetKey:v,dropContainerKey:b,dropTargetPos:x,dropAllowed:y,dragOverNodeKey:k}),null==s||s({event:t,node:e8(n.props)}))}},e.onNodeDragLeave=function(t,n){e.currentMouseOverDroppableNodeKey!==n.props.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var o=e.props.onDragLeave;null==o||o({event:t,node:e8(n.props)})},e.onWindowDragEnd=function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDragEnd=function(t,n){var o=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==o||o({event:t,node:e8(n.props)}),e.dragNode=null,window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDrop=function(t,n){var o,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,l=a.dragChildrenKeys,c=a.dropPosition,i=a.dropTargetKey,d=a.dropTargetPos;if(a.dropAllowed){var s=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==i){var u=(0,w.Z)((0,w.Z)({},e6(i,e.getTreeNodeRequiredProps())),{},{active:(null===(o=e.getActiveItem())||void 0===o?void 0:o.key)===i,data:e.state.keyEntities[i].node}),f=-1!==l.indexOf(i);(0,R.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=tr(d),m={event:t,node:e8(u),dragNode:e.dragNode?e8(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(l),dropToGap:0!==c,dropPosition:c+Number(p[p.length-1])};r||null==s||s(m),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(t,n){var o=e.state,r=o.expandedKeys,a=o.flattenNodes,l=n.expanded,c=n.key;if(!n.isLeaf&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey){var i=a.filter(function(e){return e.key===c})[0],d=e8((0,w.Z)((0,w.Z)({},e6(c,e.getTreeNodeRequiredProps())),{},{data:i.data}));e.setExpandedKeys(l?tn(r,c):to(r,c)),e.onNodeExpand(t,d)}},e.onNodeClick=function(t,n){var o=e.props,r=o.onClick;"click"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)},e.onNodeDoubleClick=function(t,n){var o=e.props,r=o.onDoubleClick;"doubleClick"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)},e.onNodeSelect=function(t,n){var o=e.state.selectedKeys,r=e.state,a=r.keyEntities,l=r.fieldNames,c=e.props,i=c.onSelect,d=c.multiple,s=n.selected,u=n[l.key],f=!s,p=(o=f?d?to(o,u):[u]:tn(o,u)).map(function(e){var t=a[e];return t?t.node:null}).filter(function(e){return e});e.setUncontrolledState({selectedKeys:o}),null==i||i(o,{event:"select",selected:f,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,o){var r,a=e.state,l=a.keyEntities,c=a.checkedKeys,i=a.halfCheckedKeys,d=e.props,s=d.checkStrictly,u=d.onCheck,f=n.key,p={event:"check",node:n,checked:o,nativeEvent:t.nativeEvent};if(s){var m=o?to(c,f):tn(c,f);r={checked:m,halfChecked:tn(i,f)},p.checkedNodes=m.map(function(e){return l[e]}).filter(function(e){return e}).map(function(e){return e.node}),e.setUncontrolledState({checkedKeys:m})}else{var g=tu([].concat((0,ei.Z)(c),[f]),!0,l),h=g.checkedKeys,v=g.halfCheckedKeys;if(!o){var b=new Set(h);b.delete(f);var y=tu(Array.from(b),{checked:!1,halfCheckedKeys:v},l);h=y.checkedKeys,v=y.halfCheckedKeys}r=h,p.checkedNodes=[],p.checkedNodesPositions=[],p.halfCheckedKeys=v,h.forEach(function(e){var t=l[e];if(t){var n=t.node,o=t.pos;p.checkedNodes.push(n),p.checkedNodesPositions.push({node:n,pos:o})}}),e.setUncontrolledState({checkedKeys:h},!1,{halfCheckedKeys:v})}null==u||u(r,p)},e.onNodeLoad=function(t){var n=t.key,o=new Promise(function(o,r){e.setState(function(a){var l=a.loadedKeys,c=a.loadingKeys,i=void 0===c?[]:c,d=e.props,s=d.loadData,u=d.onLoad;return s&&-1===(void 0===l?[]:l).indexOf(n)&&-1===i.indexOf(n)?(s(t).then(function(){var r=to(e.state.loadedKeys,n);null==u||u(r,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:r}),e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),o()}).catch(function(t){if(e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),e.loadingRetryTimes[n]=(e.loadingRetryTimes[n]||0)+1,e.loadingRetryTimes[n]>=10){var a=e.state.loadedKeys;(0,R.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:to(a,n)}),o()}r(t)}),{loadingKeys:to(i,n)}):null})});return o.catch(function(){}),o},e.onNodeMouseEnter=function(t,n){var o=e.props.onMouseEnter;null==o||o({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var o=e.props.onMouseLeave;null==o||o({event:t,node:n})},e.onNodeContextMenu=function(t,n){var o=e.props.onRightClick;o&&(t.preventDefault(),o({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,o=Array(n),r=0;r1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var r=!1,a=!0,l={};Object.keys(t).forEach(function(n){if(n in e.props){a=!1;return}r=!0,l[n]=t[n]}),r&&(!n||a)&&e.setState((0,w.Z)((0,w.Z)({},l),o))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return(0,eF.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props,t=e.activeKey,n=e.itemScrollOffset;void 0!==t&&t!==this.state.activeKey&&(this.setState({activeKey:t}),null!==t&&this.scrollTo({key:t,offset:void 0===n?0:n}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t,n=this.state,o=n.focused,r=n.flattenNodes,l=n.keyEntities,c=n.draggingNodeKey,i=n.activeKey,d=n.dropLevelOffset,s=n.dropContainerKey,u=n.dropTargetKey,f=n.dropPosition,p=n.dragOverNodeKey,m=n.indent,h=this.props,v=h.prefixCls,b=h.className,y=h.style,x=h.showLine,k=h.focusable,C=h.tabIndex,S=h.selectable,w=h.showIcon,Z=h.icon,K=h.switcherIcon,I=h.draggable,R=h.checkable,P=h.checkStrictly,D=h.disabled,M=h.motion,T=h.loadData,j=h.filterTreeNode,B=h.height,z=h.itemHeight,H=h.virtual,L=h.titleRender,A=h.dropIndicatorRender,_=h.onContextMenu,W=h.onScroll,q=h.direction,F=h.rootClassName,V=h.rootStyle,U=(0,X.Z)(this.props,{aria:!0,data:!0});return I&&(t="object"===(0,E.Z)(I)?I:"function"==typeof I?{nodeDraggable:I}:{}),a.createElement(eG.Provider,{value:{prefixCls:v,selectable:S,showIcon:w,icon:Z,switcherIcon:K,draggable:t,draggingNodeKey:c,checkable:R,checkStrictly:P,disabled:D,keyEntities:l,dropLevelOffset:d,dropContainerKey:s,dropTargetKey:u,dropPosition:f,dragOverNodeKey:p,indent:m,direction:q,dropIndicatorRender:A,loadData:T,filterTreeNode:j,titleRender:L,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},a.createElement("div",{role:"tree",className:O()(v,b,F,(e={},(0,N.Z)(e,"".concat(v,"-show-line"),x),(0,N.Z)(e,"".concat(v,"-focused"),o),(0,N.Z)(e,"".concat(v,"-active-focused"),null!==i),e)),style:V},a.createElement(nz,(0,g.Z)({ref:this.listRef,prefixCls:v,style:y,data:r,disabled:D,selectable:S,checkable:!!R,motion:M,dragging:null!==c,height:B,itemHeight:z,virtual:H,focusable:k,focused:o,tabIndex:void 0===C?0:C,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:_,onScroll:W},this.getTreeNodeRequiredProps(),U))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,o,r=t.prevProps,a={prevProps:e};function l(t){return!r&&t in e||r&&r[t]!==e[t]}var c=t.fieldNames;if(l("fieldNames")&&(c=e1(e.fieldNames),a.fieldNames=c),l("treeData")?n=e.treeData:l("children")&&((0,R.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=e2(e.children)),n){a.treeData=n;var i=e4(n,{fieldNames:c});a.keyEntities=(0,w.Z)((0,N.Z)({},nP,nM),i.keyEntities)}var d=a.keyEntities||t.keyEntities;if(l("expandedKeys")||r&&l("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!r&&e.defaultExpandParent?ti(e.expandedKeys,d):e.expandedKeys;else if(!r&&e.defaultExpandAll){var s=(0,w.Z)({},d);delete s[nP],a.expandedKeys=Object.keys(s).map(function(e){return s[e].key})}else!r&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?ti(e.defaultExpandedKeys,d):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var u=e3(n||t.treeData,a.expandedKeys||t.expandedKeys,c);a.flattenNodes=u}if(e.selectable&&(l("selectedKeys")?a.selectedKeys=tl(e.selectedKeys,e):!r&&e.defaultSelectedKeys&&(a.selectedKeys=tl(e.defaultSelectedKeys,e))),e.checkable&&(l("checkedKeys")?o=tc(e.checkedKeys)||{}:!r&&e.defaultCheckedKeys?o=tc(e.defaultCheckedKeys)||{}:n&&(o=tc(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),o)){var f=o,p=f.checkedKeys,m=void 0===p?[]:p,g=f.halfCheckedKeys,h=void 0===g?[]:g;if(!e.checkStrictly){var v=tu(m,!0,d);m=v.checkedKeys,h=v.halfCheckedKeys}a.checkedKeys=m,a.halfCheckedKeys=h}return l("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(a.Component);nH.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,o=e.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:r.top=0,r.left=-n*o;break;case 1:r.bottom=0,r.left=-n*o;break;case 0:r.bottom=0,r.left=o}return a.createElement("div",{style:r})},allowDrop:function(){return!0},expandAction:!1},nH.TreeNode=tt;var nL={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},nA=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:nL}))}),n_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},nW=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:n_}))}),nq={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},nF=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:nq}))}),nV={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},nX=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:nV}))}),nU=n(68710),nG=n(23159),nY=n(63074);let n$=new t0.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nJ=(e,t)=>({[".".concat(e,"-switcher-icon")]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:"transform ".concat(t.motionDurationSlow)}}}),nQ=(e,t)=>({[".".concat(e,"-drop-indicator")]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:"".concat((0,t0.bf)(t.lineWidthBold)," solid ").concat(t.colorPrimary),borderRadius:"50%",content:'""'}}}),n0=(e,t)=>{let{treeCls:n,treeNodeCls:o,treeNodePadding:r,titleHeight:a,nodeSelectedBg:l,nodeHoverBg:c}=t,i=t.paddingXS;return{[n]:Object.assign(Object.assign({},(0,t3.Wf)(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:"background-color ".concat(t.motionDurationSlow),["&".concat(n,"-rtl")]:{["".concat(n,"-switcher")]:{"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(90deg)"}}}}},["&-focused:not(:hover):not(".concat(n,"-active-focused)")]:Object.assign({},(0,t3.oN)(t)),["".concat(n,"-list-holder-inner")]:{alignItems:"flex-start"},["&".concat(n,"-block-node")]:{["".concat(n,"-list-holder-inner")]:{alignItems:"stretch",["".concat(n,"-node-content-wrapper")]:{flex:"auto"},["".concat(o,".dragging")]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,border:"1px solid ".concat(t.colorPrimary),opacity:0,animationName:n$,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},["".concat(o)]:{display:"flex",alignItems:"flex-start",padding:"0 0 ".concat((0,t0.bf)(r)," 0"),outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{["".concat(n,"-node-content-wrapper")]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},["&-active ".concat(n,"-node-content-wrapper")]:{background:t.controlItemBgHover},["&:not(".concat(o,"-disabled).filter-node ").concat(n,"-title")]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",["".concat(n,"-draggable-icon")]:{flexShrink:0,width:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",visibility:"visible",opacity:.2,transition:"opacity ".concat(t.motionDurationSlow),["".concat(o,":hover &")]:{opacity:.45}},["&".concat(o,"-disabled")]:{["".concat(n,"-draggable-icon")]:{visibility:"hidden"}}}},["".concat(n,"-indent")]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:a}},["".concat(n,"-draggable-icon")]:{visibility:"hidden"},["".concat(n,"-switcher")]:Object.assign(Object.assign({},nJ(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,margin:0,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",cursor:"pointer",userSelect:"none",transition:"all ".concat(t.motionDurationSlow),borderRadius:t.borderRadius,"&-noop":{cursor:"unset"},["&:not(".concat(n,"-switcher-noop):hover")]:{backgroundColor:t.colorBgTextHover},"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:"1px solid ".concat(t.colorBorder),content:'""'}}}),["".concat(n,"-checkbox")]:{top:"initial",marginInlineEnd:i,alignSelf:"flex-start",marginTop:t.marginXXS},["".concat(n,"-node-content-wrapper, ").concat(n,"-checkbox + span")]:{position:"relative",zIndex:"auto",minHeight:a,margin:0,padding:"0 ".concat((0,t0.bf)(t.calc(t.paddingXS).div(2).equal())),color:"inherit",lineHeight:"".concat((0,t0.bf)(a)),background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:"all ".concat(t.motionDurationMid,", border 0s, line-height 0s, box-shadow 0s"),"&:hover":{backgroundColor:c},["&".concat(n,"-node-selected")]:{backgroundColor:l},["".concat(n,"-iconEle")]:{display:"inline-block",width:a,height:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},["".concat(n,"-unselectable ").concat(n,"-node-content-wrapper:hover")]:{backgroundColor:"transparent"},["".concat(n,"-node-content-wrapper")]:Object.assign({lineHeight:"".concat((0,t0.bf)(a)),userSelect:"none"},nQ(e,t)),["".concat(o,".drop-container")]:{"> [draggable]":{boxShadow:"0 0 0 2px ".concat(t.colorPrimary)}},"&-show-line":{["".concat(n,"-indent")]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&-end":{"&:before":{display:"none"}}}},["".concat(n,"-switcher")]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},["".concat(o,"-leaf-last")]:{["".concat(n,"-switcher")]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:"".concat((0,t0.bf)(t.calc(a).div(2).equal())," !important")}}}}})}},n1=e=>{let{treeCls:t,treeNodeCls:n,treeNodePadding:o,directoryNodeSelectedBg:r,directoryNodeSelectedColor:a}=e;return{["".concat(t).concat(t,"-directory")]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,transition:"background-color ".concat(e.motionDurationMid),content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},["".concat(t,"-switcher")]:{transition:"color ".concat(e.motionDurationMid)},["".concat(t,"-node-content-wrapper")]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},["&".concat(t,"-node-selected")]:{color:a,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:r},["".concat(t,"-switcher")]:{color:a},["".concat(t,"-node-content-wrapper")]:{color:a,background:"transparent"}}}}}},n2=(e,t)=>{let n=".".concat(e),o=t.calc(t.paddingXS).div(2).equal(),r=(0,t4.TS)(t,{treeCls:n,treeNodeCls:"".concat(n,"-treenode"),treeNodePadding:o});return[n0(e,r),n1(r)]},n3=e=>{let{controlHeightSM:t}=e;return{titleHeight:t,nodeHoverBg:e.controlItemBgHover,nodeSelectedBg:e.controlItemBgActive}};var n4=(0,t6.I$)("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,nG.C2)("".concat(n,"-checkbox"),e)},n2(n,e),(0,nY.Z)(e)]},e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},n3(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})});function n6(e){let{dropPosition:t,dropLevelOffset:n,prefixCls:o,indent:r,direction:l="ltr"}=e,c="ltr"===l?"left":"right",i={[c]:-n*r+4,["ltr"===l?"right":"left"]:0};switch(t){case -1:i.top=-3;break;case 1:i.bottom=-3;break;default:i.bottom=-3,i[c]=r+4}return a.createElement("div",{style:i,className:"".concat(o,"-drop-indicator")})}var n8={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},n5=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:n8}))}),n7=n(61935),n9={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},oe=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:n9}))}),ot={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},on=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:ot}))}),oo=n(19722),or=e=>{let t;let{prefixCls:n,switcherIcon:o,treeNodeProps:r,showLine:l}=e,{isLeaf:c,expanded:i,loading:d}=r;if(d)return a.createElement(n7.Z,{className:"".concat(n,"-switcher-loading-icon")});if(l&&"object"==typeof l&&(t=l.showLeafIcon),c){if(!l)return null;if("boolean"!=typeof t&&t){let e="function"==typeof t?t(r):t;return(0,oo.l$)(e)?(0,oo.Tm)(e,{className:O()(e.props.className||"","".concat(n,"-switcher-line-custom-icon"))}):e}return t?a.createElement(nA,{className:"".concat(n,"-switcher-line-icon")}):a.createElement("span",{className:"".concat(n,"-switcher-leaf-line")})}let s="".concat(n,"-switcher-icon"),u="function"==typeof o?o(r):o;return(0,oo.l$)(u)?(0,oo.Tm)(u,{className:O()(u.props.className||"",s)}):void 0!==u?u:l?i?a.createElement(oe,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(on,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(n5,{className:s})};let oa=a.forwardRef((e,t)=>{var n;let{getPrefixCls:o,direction:r,virtual:l,tree:c}=a.useContext(tN.E_),{prefixCls:i,className:d,showIcon:s=!1,showLine:u,switcherIcon:f,blockNode:p=!1,children:m,checkable:g=!1,selectable:h=!0,draggable:v,motion:b,style:y}=e,x=o("tree",i),k=o(),C=null!=b?b:Object.assign(Object.assign({},(0,nU.Z)(k)),{motionAppear:!1}),S=Object.assign(Object.assign({},e),{checkable:g,selectable:h,showIcon:s,motion:C,blockNode:p,showLine:!!u,dropIndicatorRender:n6}),[E,w,N]=n4(x),[,Z]=(0,nc.ZP)(),K=Z.paddingXS/2+((null===(n=Z.Tree)||void 0===n?void 0:n.titleHeight)||Z.controlHeightSM),I=a.useMemo(()=>{if(!v)return!1;let e={};switch(typeof v){case"function":e.nodeDraggable=v;break;case"object":e=Object.assign({},v)}return!1!==e.icon&&(e.icon=e.icon||a.createElement(nX,null)),e},[v]);return E(a.createElement(nH,Object.assign({itemHeight:K,ref:t,virtual:l},S,{style:Object.assign(Object.assign({},null==c?void 0:c.style),y),prefixCls:x,className:O()({["".concat(x,"-icon-hide")]:!s,["".concat(x,"-block-node")]:p,["".concat(x,"-unselectable")]:!h,["".concat(x,"-rtl")]:"rtl"===r},null==c?void 0:c.className,d,w,N),direction:r,checkable:g?a.createElement("span",{className:"".concat(x,"-checkbox-inner")}):g,selectable:h,switcherIcon:e=>a.createElement(or,{prefixCls:x,switcherIcon:f,treeNodeProps:e,showLine:u}),draggable:I}),m))});function ol(e,t,n){let{key:o,children:r}=n;e.forEach(function(e){let a=e[o],l=e[r];!1!==t(a,e)&&ol(l||[],t,n)})}(o=r||(r={}))[o.None=0]="None",o[o.Start=1]="Start",o[o.End=2]="End";var oc=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};function oi(e){let{isLeaf:t,expanded:n}=e;return t?a.createElement(nA,null):n?a.createElement(nW,null):a.createElement(nF,null)}function od(e){let{treeData:t,children:n}=e;return t||e2(n)}let os=a.forwardRef((e,t)=>{var{defaultExpandAll:n,defaultExpandParent:o,defaultExpandedKeys:l}=e,c=oc(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);let i=a.useRef(),d=a.useRef(),s=()=>{let{keyEntities:e}=e4(od(c));return n?Object.keys(e):o?ti(c.expandedKeys||l||[],e):c.expandedKeys||l},[u,f]=a.useState(c.selectedKeys||c.defaultSelectedKeys||[]),[p,m]=a.useState(()=>s());a.useEffect(()=>{"selectedKeys"in c&&f(c.selectedKeys)},[c.selectedKeys]),a.useEffect(()=>{"expandedKeys"in c&&m(c.expandedKeys)},[c.expandedKeys]);let{getPrefixCls:g,direction:h}=a.useContext(tN.E_),{prefixCls:v,className:b,showIcon:y=!0,expandAction:x="click"}=c,k=oc(c,["prefixCls","className","showIcon","expandAction"]),C=g("tree",v),S=O()("".concat(C,"-directory"),{["".concat(C,"-directory-rtl")]:"rtl"===h},b);return a.createElement(oa,Object.assign({icon:oi,ref:t,blockNode:!0},k,{showIcon:y,expandAction:x,prefixCls:C,className:S,expandedKeys:p,selectedKeys:u,onSelect:(e,t)=>{var n;let o;let{multiple:a,fieldNames:l}=c,{node:s,nativeEvent:u}=t,{key:m=""}=s,g=od(c),h=Object.assign(Object.assign({},t),{selected:!0}),v=(null==u?void 0:u.ctrlKey)||(null==u?void 0:u.metaKey),b=null==u?void 0:u.shiftKey;a&&v?(o=e,i.current=m,d.current=o):a&&b?o=Array.from(new Set([].concat((0,ei.Z)(d.current||[]),(0,ei.Z)(function(e){let{treeData:t,expandedKeys:n,startKey:o,endKey:a,fieldNames:l}=e,c=[],i=r.None;return o&&o===a?[o]:o&&a?(ol(t,e=>{if(i===r.End)return!1;if(e===o||e===a){if(c.push(e),i===r.None)i=r.Start;else if(i===r.Start)return i=r.End,!1}else i===r.Start&&c.push(e);return n.includes(e)},e1(l)),c):[]}({treeData:g,expandedKeys:p,startKey:m,endKey:i.current,fieldNames:l}))))):(o=[m],i.current=m,d.current=o),h.selectedNodes=function(e,t,n){let o=(0,ei.Z)(t),r=[];return ol(e,(e,t)=>{let n=o.indexOf(e);return -1!==n&&(r.push(t),o.splice(n,1)),!!o.length},e1(n)),r}(g,o,l),null===(n=c.onSelect)||void 0===n||n.call(c,o,h),"selectedKeys"in c||f(o)},onExpand:(e,t)=>{var n;return"expandedKeys"in c||m(e),null===(n=c.onExpand)||void 0===n?void 0:n.call(c,e,t)}}))});oa.DirectoryTree=os,oa.TreeNode=tt;var ou=n(29436),of=n(64482),op=function(e){let{value:t,onChange:n,filterSearch:o,tablePrefixCls:r,locale:l}=e;return o?a.createElement("div",{className:"".concat(r,"-filter-dropdown-search")},a.createElement(of.default,{prefix:a.createElement(ou.Z,null),placeholder:l.filterSearchPlaceholder,onChange:n,value:t,htmlSize:1,className:"".concat(r,"-filter-dropdown-search-input")})):null};let om=e=>{let{keyCode:t}=e;t===tH.Z.ENTER&&e.stopPropagation()},og=a.forwardRef((e,t)=>a.createElement("div",{className:e.className,onClick:e=>e.stopPropagation(),onKeyDown:om,ref:t},e.children));function oh(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:o}=e;t.push(n),o&&(t=[].concat((0,ei.Z)(t),(0,ei.Z)(oh(o))))}),t}function ov(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}var ob=function(e){var t,n;let o,r;let{tablePrefixCls:l,prefixCls:c,column:i,dropdownPrefixCls:d,columnKey:s,filterMultiple:f,filterMode:p="menu",filterSearch:m=!1,filterState:g,triggerFilter:h,locale:v,children:b,getPopupContainer:y,rootClassName:x}=e,{filterDropdownOpen:k,onFilterDropdownOpenChange:C,filterResetToDefaultFilteredValue:S,defaultFilteredValue:E,filterDropdownVisible:w,onFilterDropdownVisibleChange:N}=i,[Z,K]=a.useState(!1),I=!!(g&&((null===(t=g.filteredKeys)||void 0===t?void 0:t.length)||g.forceFiltered)),R=e=>{K(e),null==C||C(e),null==N||N(e)},P=null!==(n=null!=k?k:w)&&void 0!==n?n:Z,D=null==g?void 0:g.filteredKeys,[M,T]=function(e){let t=a.useRef(e),n=(0,nb.Z)();return[()=>t.current,e=>{t.current=e,n()}]}(D||[]),j=e=>{let{selectedKeys:t}=e;T(t)};a.useEffect(()=>{Z&&j({selectedKeys:D||[]})},[D]);let[B,z]=a.useState([]),[H,L]=a.useState(""),A=e=>{let{value:t}=e.target;L(t)};a.useEffect(()=>{Z||L("")},[Z]);let _=e=>{let t=e&&e.length?e:null;if(null===t&&(!g||!g.filteredKeys)||(0,u.Z)(t,null==g?void 0:g.filteredKeys,!0))return null;h({column:i,key:s,filteredKeys:t})},W=()=>{R(!1),_(M())},q=function(){let{confirm:e,closeDropdown:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1};e&&_([]),t&&R(!1),L(""),S?T((E||[]).map(e=>String(e))):T([])},F=O()({["".concat(d,"-menu-without-submenu")]:!(i.filters||[]).some(e=>{let{children:t}=e;return t})}),V=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),o={title:e.text,key:void 0!==e.value?n:String(t)};return e.children&&(o.children=V({filters:e.children})),o})},X=e=>{var t;return Object.assign(Object.assign({},e),{text:e.title,value:e.key,children:(null===(t=e.children)||void 0===t?void 0:t.map(e=>X(e)))||[]})};if("function"==typeof i.filterDropdown)o=i.filterDropdown({prefixCls:"".concat(d,"-custom"),setSelectedKeys:e=>j({selectedKeys:e}),selectedKeys:M(),confirm:function(){let{closeDropdown:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0};e&&R(!1),_(M())},clearFilters:q,filters:i.filters,visible:P,close:()=>{R(!1)}});else if(i.filterDropdown)o=i.filterDropdown;else{let e=M()||[];o=a.createElement(a.Fragment,null,0===(i.filters||[]).length?a.createElement(nx.Z,{image:nx.Z.PRESENTED_IMAGE_SIMPLE,description:v.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):"tree"===p?a.createElement(a.Fragment,null,a.createElement(op,{filterSearch:m,value:H,onChange:A,tablePrefixCls:l,locale:v}),a.createElement("div",{className:"".concat(l,"-filter-dropdown-tree")},f?a.createElement(tm.Z,{checked:e.length===oh(i.filters).length,indeterminate:e.length>0&&e.length{e.target.checked?T(oh(null==i?void 0:i.filters).map(e=>String(e))):T([])}},v.filterCheckall):null,a.createElement(oa,{checkable:!0,selectable:!1,blockNode:!0,multiple:f,checkStrictly:!f,className:"".concat(d,"-menu"),onCheck:(e,t)=>{let{node:n,checked:o}=t;f?j({selectedKeys:e}):j({selectedKeys:o&&n.key?[n.key]:[]})},checkedKeys:e,selectedKeys:e,showIcon:!1,treeData:V({filters:i.filters}),autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:H.trim()?e=>"function"==typeof m?m(H,X(e)):ov(H,e.title):void 0}))):a.createElement(a.Fragment,null,a.createElement(op,{filterSearch:m,value:H,onChange:A,tablePrefixCls:l,locale:v}),a.createElement(nk.Z,{selectable:!0,multiple:f,prefixCls:"".concat(d,"-menu"),className:F,onSelect:j,onDeselect:j,selectedKeys:e,getPopupContainer:y,openKeys:B,onOpenChange:e=>{z(e)},items:function e(t){let{filters:n,prefixCls:o,filteredKeys:r,filterMultiple:l,searchValue:c,filterSearch:i}=t;return n.map((t,n)=>{let d=String(t.value);if(t.children)return{key:d||n,label:t.text,popupClassName:"".concat(o,"-dropdown-submenu"),children:e({filters:t.children,prefixCls:o,filteredKeys:r,filterMultiple:l,searchValue:c,filterSearch:i})};let s=l?tm.Z:th.ZP,u={key:void 0!==t.value?d:n,label:a.createElement(a.Fragment,null,a.createElement(s,{checked:r.includes(d)}),a.createElement("span",null,t.text))};return c.trim()?"function"==typeof i?i(c,t)?u:null:ov(c,t.text)?u:null:u})}({filters:i.filters||[],filterSearch:m,prefixCls:c,filteredKeys:M(),filterMultiple:f,searchValue:H})})),a.createElement("div",{className:"".concat(c,"-dropdown-btns")},a.createElement(ny.ZP,{type:"link",size:"small",disabled:S?(0,u.Z)((E||[]).map(e=>String(e)),e,!0):0===e.length,onClick:()=>q()},v.filterReset),a.createElement(ny.ZP,{type:"primary",size:"small",onClick:W},v.filterConfirm)))}i.filterDropdown&&(o=a.createElement(nC.J,{selectable:void 0},o)),r="function"==typeof i.filterIcon?i.filterIcon(I):i.filterIcon?i.filterIcon:a.createElement(nv,null);let{direction:U}=a.useContext(tN.E_);return a.createElement("div",{className:"".concat(c,"-column")},a.createElement("span",{className:"".concat(l,"-column-title")},b),a.createElement(tg.Z,{dropdownRender:()=>a.createElement(og,{className:"".concat(c,"-dropdown")},o),trigger:["click"],open:P,onOpenChange:(e,t)=>{"trigger"===t.source&&(e&&void 0!==D&&T(D||[]),R(e),e||i.filterDropdown||W())},getPopupContainer:y,placement:"rtl"===U?"bottomLeft":"bottomRight",rootClassName:x},a.createElement("span",{role:"button",tabIndex:-1,className:O()("".concat(c,"-trigger"),{active:I}),onClick:e=>{e.stopPropagation()}},r)))};function oy(e,t,n){let o=[];return(e||[]).forEach((e,r)=>{var a;let l=nm(r,n);if(e.filters||"filterDropdown"in e||"onFilter"in e){if("filteredValue"in e){let t=e.filteredValue;"filterDropdown"in e||(t=null!==(a=null==t?void 0:t.map(String))&&void 0!==a?a:t),o.push({column:e,key:np(e,l),filteredKeys:t,forceFiltered:e.filtered})}else o.push({column:e,key:np(e,l),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered})}"children"in e&&(o=[].concat((0,ei.Z)(o),(0,ei.Z)(oy(e.children,t,l))))}),o}function ox(e){let t={};return e.forEach(e=>{let{key:n,filteredKeys:o,column:r}=e,{filters:a,filterDropdown:l}=r;if(l)t[n]=o||null;else if(Array.isArray(o)){let e=oh(a);t[n]=e.filter(e=>o.includes(String(e)))}else t[n]=null}),t}function ok(e,t){return t.reduce((e,t)=>{let{column:{onFilter:n,filters:o},filteredKeys:r}=t;return n&&r&&r.length?e.filter(e=>r.some(t=>{let r=oh(o),a=r.findIndex(e=>String(e)===String(t));return n(-1!==a?r[a]:t,e)})):e},e)}let oC=e=>e.flatMap(e=>"children"in e?[e].concat((0,ei.Z)(oC(e.children||[]))):[e]);var oS=function(e){let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:o,onFilterChange:r,getPopupContainer:l,locale:c,rootClassName:i}=e;(0,tp.ln)("Table");let d=a.useMemo(()=>oC(o||[]),[o]),[s,u]=a.useState(()=>oy(d,!0)),f=a.useMemo(()=>{let e=oy(d,!1);if(0===e.length)return e;let t=!0;if(e.forEach(e=>{let{filteredKeys:n}=e;void 0!==n&&(t=!1)}),t){let e=(d||[]).map((e,t)=>np(e,nm(t)));return s.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=d[e.findIndex(e=>e===t.key)];return Object.assign(Object.assign({},t),{column:Object.assign(Object.assign({},t.column),n),forceFiltered:n.filtered})})}return e},[d,s]),p=a.useMemo(()=>ox(f),[f]),m=e=>{let t=f.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),u(t),r(ox(t),t)};return[e=>(function e(t,n,o,r,l,c,i,d,s){return o.map((o,u)=>{let f=nm(u,d),{filterMultiple:p=!0,filterMode:m,filterSearch:g}=o,h=o;if(h.filters||h.filterDropdown){let e=np(h,f),d=r.find(t=>{let{key:n}=t;return e===n});h=Object.assign(Object.assign({},h),{title:r=>a.createElement(ob,{tablePrefixCls:t,prefixCls:"".concat(t,"-filter"),dropdownPrefixCls:n,column:h,columnKey:e,filterState:d,filterMultiple:p,filterMode:m,filterSearch:g,triggerFilter:c,locale:l,getPopupContainer:i,rootClassName:s},ng(o.title,r))})}return"children"in h&&(h=Object.assign(Object.assign({},h),{children:e(t,n,h.children,r,l,c,i,f,s)})),h})})(t,n,e,f,c,m,l,void 0,i),f,p]},oE=function(){let e=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let t=1;t{let o=n[t];void 0!==o&&(e[t]=o)})}return e},ow=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},oN=function(e,t,n){let o=n&&"object"==typeof n?n:{},{total:r=0}=o,l=ow(o,["total"]),[c,i]=(0,a.useState)(()=>({current:"defaultCurrent"in l?l.defaultCurrent:1,pageSize:"defaultPageSize"in l?l.defaultPageSize:10})),d=oE(c,l,{total:r>0?r:e}),s=Math.ceil((r||e)/d.pageSize);d.current>s&&(d.current=s||1);let u=(e,t)=>{i({current:null!=e?e:1,pageSize:t||d.pageSize})};return!1===n?[{},()=>{}]:[Object.assign(Object.assign({},d),{onChange:(e,o)=>{var r;n&&(null===(r=n.onChange)||void 0===r||r.call(n,e,o)),u(e,o),t(e,o||(null==d?void 0:d.pageSize))}}),u]},oZ={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},oO=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:oZ}))}),oK={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},oI=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:oK}))}),oR=n(89970);let oP="ascend",oD="descend";function oM(e){return"object"==typeof e.sorter&&"number"==typeof e.sorter.multiple&&e.sorter.multiple}function oT(e){return"function"==typeof e?e:!!e&&"object"==typeof e&&!!e.compare&&e.compare}function oj(e,t,n){let o=[];function r(e,t){o.push({column:e,key:np(e,t),multiplePriority:oM(e),sortOrder:e.sortOrder})}return(e||[]).forEach((e,a)=>{let l=nm(a,n);e.children?("sortOrder"in e&&r(e,l),o=[].concat((0,ei.Z)(o),(0,ei.Z)(oj(e.children,t,l)))):e.sorter&&("sortOrder"in e?r(e,l):t&&e.defaultSortOrder&&o.push({column:e,key:np(e,l),multiplePriority:oM(e),sortOrder:e.defaultSortOrder}))}),o}function oB(e){let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}}function oz(e){let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(oB);return 0===t.length&&e.length?Object.assign(Object.assign({},oB(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function oH(e,t,n){let o=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),r=e.slice(),a=o.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return oT(t)&&n});return a.length?r.sort((e,t)=>{for(let n=0;n{let o=e[n];return o?Object.assign(Object.assign({},e),{[n]:oH(o,t,n)}):e}):r}var oL=x(eP,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o}),oA=x(e_,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o}),o_=n(36360),oW=e=>{let{componentCls:t,lineWidth:n,lineType:o,tableBorderColor:r,tableHeaderBg:a,tablePaddingVertical:l,tablePaddingHorizontal:c,calc:i}=e,d="".concat((0,t0.bf)(n)," ").concat(o," ").concat(r),s=(e,o,r)=>({["&".concat(t,"-").concat(e)]:{["> ".concat(t,"-container")]:{["> ".concat(t,"-content, > ").concat(t,"-body")]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(i(o).mul(-1).equal()),"\n ").concat((0,t0.bf)(i(i(r).add(n)).mul(-1).equal()))}}}}}});return{["".concat(t,"-wrapper")]:{["".concat(t).concat(t,"-bordered")]:Object.assign(Object.assign(Object.assign({["> ".concat(t,"-title")]:{border:d,borderBottom:0},["> ".concat(t,"-container")]:{borderInlineStart:d,borderTop:d,["\n > ".concat(t,"-content,\n > ").concat(t,"-header,\n > ").concat(t,"-body,\n > ").concat(t,"-summary\n ")]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:d},"> thead":{"> tr:not(:last-child) > th":{borderBottom:d},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{["> ".concat(t,"-cell-fix-right-first::after")]:{borderInlineEnd:d}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(i(l).mul(-1).equal())," ").concat((0,t0.bf)(i(i(c).add(n)).mul(-1).equal())),"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:d,content:'""'}}}}}},["&".concat(t,"-scroll-horizontal")]:{["> ".concat(t,"-container > ").concat(t,"-body")]:{"> table > tbody":{["\n > tr".concat(t,"-expanded-row,\n > tr").concat(t,"-placeholder\n ")]:{"> th, > td":{borderInlineEnd:0}}}}}},s("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),s("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{["> ".concat(t,"-footer")]:{border:d,borderTop:0}}),["".concat(t,"-cell")]:{["".concat(t,"-container:first-child")]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:"0 ".concat((0,t0.bf)(n)," 0 ").concat((0,t0.bf)(n)," ").concat(a)}},["".concat(t,"-bordered ").concat(t,"-cell-scrollbar")]:{borderInlineEnd:d}}}},oq=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-cell-ellipsis")]:Object.assign(Object.assign({},t3.vS),{wordBreak:"keep-all",["\n &".concat(t,"-cell-fix-left-last,\n &").concat(t,"-cell-fix-right-first\n ")]:{overflow:"visible",["".concat(t,"-cell-content")]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},["".concat(t,"-column-title")]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},oF=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody > tr").concat(t,"-placeholder")]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},oV=n(76122),oX=e=>{let{componentCls:t,antCls:n,motionDurationSlow:o,lineWidth:r,paddingXS:a,lineType:l,tableBorderColor:c,tableExpandIconBg:i,tableExpandColumnWidth:d,borderRadius:s,tablePaddingVertical:u,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:m,expandIconMarginTop:g,expandIconSize:h,expandIconHalfInner:v,expandIconScale:b,calc:y}=e,x="".concat((0,t0.bf)(r)," ").concat(l," ").concat(c),k=y(m).sub(r).equal();return{["".concat(t,"-wrapper")]:{["".concat(t,"-expand-icon-col")]:{width:d},["".concat(t,"-row-expand-icon-cell")]:{textAlign:"center",["".concat(t,"-row-expand-icon")]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},["".concat(t,"-row-indent")]:{height:1,float:"left"},["".concat(t,"-row-expand-icon")]:Object.assign(Object.assign({},(0,oV.N)(e)),{position:"relative",float:"left",boxSizing:"border-box",width:h,height:h,padding:0,color:"inherit",lineHeight:(0,t0.bf)(h),background:i,border:x,borderRadius:s,transform:"scale(".concat(b,")"),transition:"all ".concat(o),userSelect:"none","&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:"transform ".concat(o," ease-out"),content:'""'},"&::before":{top:v,insetInlineEnd:k,insetInlineStart:k,height:r},"&::after":{top:k,bottom:k,insetInlineStart:v,width:r,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),["".concat(t,"-row-indent + ").concat(t,"-row-expand-icon")]:{marginTop:g,marginInlineEnd:a},["tr".concat(t,"-expanded-row")]:{"&, &:hover":{"> th, > td":{background:p}},["".concat(n,"-descriptions-view")]:{display:"flex",table:{flex:"auto",width:"auto"}}},["".concat(t,"-expanded-row-fixed")]:{position:"relative",margin:"".concat((0,t0.bf)(y(u).mul(-1).equal())," ").concat((0,t0.bf)(y(f).mul(-1).equal())),padding:"".concat((0,t0.bf)(u)," ").concat((0,t0.bf)(f))}}}},oU=e=>{let{componentCls:t,antCls:n,iconCls:o,tableFilterDropdownWidth:r,tableFilterDropdownSearchWidth:a,paddingXXS:l,paddingXS:c,colorText:i,lineWidth:d,lineType:s,tableBorderColor:u,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:m,borderRadius:g,motionDurationSlow:h,colorTextDescription:v,colorPrimary:b,tableHeaderFilterActiveBg:y,colorTextDisabled:x,tableFilterDropdownBg:k,tableFilterDropdownHeight:C,controlItemBgHover:S,controlItemBgActive:E,boxShadowSecondary:w,filterDropdownMenuBg:N,calc:Z}=e,O="".concat(n,"-dropdown"),K="".concat(t,"-filter-dropdown"),I="".concat(n,"-tree"),R="".concat((0,t0.bf)(d)," ").concat(s," ").concat(u);return[{["".concat(t,"-wrapper")]:{["".concat(t,"-filter-column")]:{display:"flex",justifyContent:"space-between"},["".concat(t,"-filter-trigger")]:{position:"relative",display:"flex",alignItems:"center",marginBlock:Z(l).mul(-1).equal(),marginInline:"".concat((0,t0.bf)(l)," ").concat((0,t0.bf)(Z(m).div(2).mul(-1).equal())),padding:"0 ".concat((0,t0.bf)(l)),color:f,fontSize:p,borderRadius:g,cursor:"pointer",transition:"all ".concat(h),"&:hover":{color:v,background:y},"&.active":{color:b}}}},{["".concat(n,"-dropdown")]:{[K]:Object.assign(Object.assign({},(0,t3.Wf)(e)),{minWidth:r,backgroundColor:k,borderRadius:g,boxShadow:w,overflow:"hidden",["".concat(O,"-menu")]:{maxHeight:C,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:N,"&:empty::after":{display:"block",padding:"".concat((0,t0.bf)(c)," 0"),color:x,fontSize:p,textAlign:"center",content:'"Not Found"'}},["".concat(K,"-tree")]:{paddingBlock:"".concat((0,t0.bf)(c)," 0"),paddingInline:c,[I]:{padding:0},["".concat(I,"-treenode ").concat(I,"-node-content-wrapper:hover")]:{backgroundColor:S},["".concat(I,"-treenode-checkbox-checked ").concat(I,"-node-content-wrapper")]:{"&, &:hover":{backgroundColor:E}}},["".concat(K,"-search")]:{padding:c,borderBottom:R,"&-input":{input:{minWidth:a},[o]:{color:x}}},["".concat(K,"-checkall")]:{width:"100%",marginBottom:l,marginInlineStart:l},["".concat(K,"-btns")]:{display:"flex",justifyContent:"space-between",padding:"".concat((0,t0.bf)(Z(c).sub(d).equal())," ").concat((0,t0.bf)(c)),overflow:"hidden",borderTop:R}})}},{["".concat(n,"-dropdown ").concat(K,", ").concat(K,"-submenu")]:{["".concat(n,"-checkbox-wrapper + span")]:{paddingInlineStart:c,color:i},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},oG=e=>{let{componentCls:t,lineWidth:n,colorSplit:o,motionDurationSlow:r,zIndexTableFixed:a,tableBg:l,zIndexTableSticky:c,calc:i}=e;return{["".concat(t,"-wrapper")]:{["\n ".concat(t,"-cell-fix-left,\n ").concat(t,"-cell-fix-right\n ")]:{position:"sticky !important",zIndex:a,background:l},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:i(n).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},["".concat(t,"-cell-fix-left-all::after")]:{display:"none"},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{position:"absolute",top:0,bottom:i(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},["".concat(t,"-container")]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:i(c).add(1).equal({unit:!1}),width:30,transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},["".concat(t,"-ping-left")]:{["&:not(".concat(t,"-has-fix-left) ").concat(t,"-container::before")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["".concat(t,"-cell-fix-left-last::before")]:{backgroundColor:"transparent !important"}},["".concat(t,"-ping-right")]:{["&:not(".concat(t,"-has-fix-right) ").concat(t,"-container::after")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)}}}}},oY=e=>{let{componentCls:t,antCls:n,margin:o}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-pagination").concat(n,"-pagination")]:{margin:"".concat((0,t0.bf)(o)," 0")},["".concat(t,"-pagination")]:{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"> *":{flex:"none"},"&-left":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-right":{justifyContent:"flex-end"}}}}},o$=e=>{let{componentCls:t,tableRadius:n}=e;return{["".concat(t,"-wrapper")]:{[t]:{["".concat(t,"-title, ").concat(t,"-header")]:{borderRadius:"".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n)," 0 0")},["".concat(t,"-title + ").concat(t,"-container")]:{borderStartStartRadius:0,borderStartEndRadius:0,["".concat(t,"-header, table")]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:"0 0 ".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n))}}}}},oJ=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper-rtl")]:{direction:"rtl",table:{direction:"rtl"},["".concat(t,"-pagination-left")]:{justifyContent:"flex-end"},["".concat(t,"-pagination-right")]:{justifyContent:"flex-start"},["".concat(t,"-row-expand-icon")]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},["".concat(t,"-container")]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},["".concat(t,"-row-indent")]:{float:"right"}}}}},oQ=e=>{let{componentCls:t,antCls:n,iconCls:o,fontSizeIcon:r,padding:a,paddingXS:l,headerIconColor:c,headerIconHoverColor:i,tableSelectionColumnWidth:d,tableSelectedRowBg:s,tableSelectedRowHoverBg:u,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:m}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-selection-col")]:{width:d,["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).equal()}},["".concat(t,"-bordered ").concat(t,"-selection-col")]:{width:m(d).add(m(l).mul(2)).equal(),["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).add(m(l).mul(2)).equal()}},["\n table tr th".concat(t,"-selection-column,\n table tr td").concat(t,"-selection-column,\n ").concat(t,"-selection-column\n ")]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",["".concat(n,"-radio-wrapper")]:{marginInlineEnd:0}},["table tr th".concat(t,"-selection-column").concat(t,"-cell-fix-left")]:{zIndex:e.zIndexTableFixed+1},["table tr th".concat(t,"-selection-column::after")]:{backgroundColor:"transparent !important"},["".concat(t,"-selection")]:{position:"relative",display:"inline-flex",flexDirection:"column"},["".concat(t,"-selection-extra")]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),marginInlineStart:"100%",paddingInlineStart:(0,t0.bf)(m(p).div(4).equal()),[o]:{color:c,fontSize:r,verticalAlign:"baseline","&:hover":{color:i}}},["".concat(t,"-tbody")]:{["".concat(t,"-row")]:{["&".concat(t,"-row-selected")]:{["> ".concat(t,"-cell")]:{background:s,"&-row-hover":{background:u}}},["> ".concat(t,"-cell-row-hover")]:{background:f}}}}}},o0=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:o}=e,r=(e,r,a,l)=>({["".concat(t).concat(t,"-").concat(e)]:{fontSize:l,["\n ".concat(t,"-title,\n ").concat(t,"-footer,\n ").concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(a))},["".concat(t,"-filter-trigger")]:{marginInlineEnd:(0,t0.bf)(o(a).div(2).mul(-1).equal())},["".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(o(r).mul(-1).equal())," ").concat((0,t0.bf)(o(a).mul(-1).equal()))},["".concat(t,"-tbody")]:{["".concat(t,"-wrapper:only-child ").concat(t)]:{marginBlock:(0,t0.bf)(o(r).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(o(n).sub(a).equal())," ").concat((0,t0.bf)(o(a).mul(-1).equal()))}},["".concat(t,"-selection-extra")]:{paddingInlineStart:(0,t0.bf)(o(a).div(4).equal())}}});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},r("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),r("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},o1=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:o,headerIconColor:r,headerIconHoverColor:a}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-thead th").concat(t,"-column-has-sorters")]:{outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},["\n &".concat(t,"-cell-fix-left:hover,\n &").concat(t,"-cell-fix-right:hover\n ")]:{background:e.tableFixedHeaderSortActiveBg}},["".concat(t,"-thead th").concat(t,"-column-sort")]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},["td".concat(t,"-column-sort")]:{background:e.tableBodySortBg},["".concat(t,"-column-title")]:{position:"relative",zIndex:1,flex:1},["".concat(t,"-column-sorters")]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},["".concat(t,"-column-sorter")]:{marginInlineStart:n,color:r,fontSize:0,transition:"color ".concat(e.motionDurationSlow),"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:o,"&.active":{color:e.colorPrimary}},["".concat(t,"-column-sorter-up + ").concat(t,"-column-sorter-down")]:{marginTop:"-0.3em"}},["".concat(t,"-column-sorters:hover ").concat(t,"-column-sorter")]:{color:a}}}},o2=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:o,tableScrollThumbBgHover:r,tableScrollThumbSize:a,tableScrollBg:l,zIndexTableSticky:c,stickyScrollBarBorderRadius:i,lineWidth:d,lineType:s,tableBorderColor:u}=e,f="".concat((0,t0.bf)(d)," ").concat(s," ").concat(u);return{["".concat(t,"-wrapper")]:{["".concat(t,"-sticky")]:{"&-holder":{position:"sticky",zIndex:c,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:"".concat((0,t0.bf)(a)," !important"),zIndex:c,display:"flex",alignItems:"center",background:l,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:o,borderRadius:i,transition:"all ".concat(e.motionDurationSlow,", transform none"),position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:r}}}}}}},o3=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:o,calc:r}=e,a="".concat((0,t0.bf)(n)," ").concat(e.lineType," ").concat(o);return{["".concat(t,"-wrapper")]:{["".concat(t,"-summary")]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},["div".concat(t,"-summary")]:{boxShadow:"0 ".concat((0,t0.bf)(r(n).mul(-1).equal())," 0 ").concat(o)}}}},o4=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:o,lineType:r,tableBorderColor:a,calc:l}=e,c="".concat((0,t0.bf)(o)," ").concat(r," ").concat(a),i="".concat(t,"-expanded-row-cell");return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody-virtual")]:{["".concat(t,"-row")]:{display:"flex",boxSizing:"border-box",width:"100%"},["".concat(t,"-cell")]:{borderBottom:c,transition:"background ".concat(n)},["".concat(t,"-expanded-row")]:{["".concat(i).concat(i,"-fixed")]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:"calc(var(--virtual-width) - ".concat((0,t0.bf)(o),")"),borderInlineEnd:"none"}}},["".concat(t,"-bordered")]:{["".concat(t,"-tbody-virtual")]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:c,position:"absolute"},["".concat(t,"-cell")]:{borderInlineEnd:c,["&".concat(t,"-cell-fix-right-first:before")]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:l(o).mul(-1).equal(),borderInlineStart:c}}},["&".concat(t,"-virtual")]:{["".concat(t,"-placeholder ").concat(t,"-cell")]:{borderInlineEnd:c,borderBottom:c}}}}}};let o6=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:o,tablePaddingHorizontal:r,tableExpandColumnWidth:a,lineWidth:l,lineType:c,tableBorderColor:i,tableFontSize:d,tableBg:s,tableRadius:u,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:m,tableHeaderCellSplitColor:g,tableFooterTextColor:h,tableFooterBg:v,calc:b}=e,y="".concat((0,t0.bf)(l)," ").concat(c," ").concat(i);return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({clear:"both",maxWidth:"100%"},(0,t3.dF)()),{[t]:Object.assign(Object.assign({},(0,t3.Wf)(e)),{fontSize:d,background:s,borderRadius:"".concat((0,t0.bf)(u)," ").concat((0,t0.bf)(u)," 0 0")}),table:{width:"100%",textAlign:"start",borderRadius:"".concat((0,t0.bf)(u)," ").concat((0,t0.bf)(u)," 0 0"),borderCollapse:"separate",borderSpacing:0},["\n ".concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{position:"relative",padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(r)),overflowWrap:"break-word"},["".concat(t,"-title")]:{padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(r))},["".concat(t,"-thead")]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease"),"&[colspan]:not([colspan='1'])":{textAlign:"center"},["&:not(:last-child):not(".concat(t,"-selection-column):not(").concat(t,"-row-expand-icon-cell):not([colspan])::before")]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:g,transform:"translateY(-50%)",transition:"background-color ".concat(p),content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},["".concat(t,"-tbody")]:{"> tr":{"> th, > td":{transition:"background ".concat(p,", border-color ").concat(p),borderBottom:y,["\n > ".concat(t,"-wrapper:only-child,\n > ").concat(t,"-expanded-row-fixed > ").concat(t,"-wrapper:only-child\n ")]:{[t]:{marginBlock:(0,t0.bf)(b(o).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(b(a).sub(r).equal()),"\n ").concat((0,t0.bf)(b(r).mul(-1).equal())),["".concat(t,"-tbody > tr:last-child > td")]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease")}}},["".concat(t,"-footer")]:{padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(r)),color:h,background:v}})}};var o8=(0,t6.I$)("Table",e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:o,controlInteractiveSize:r,headerBg:a,headerColor:l,headerSortActiveBg:c,headerSortHoverBg:i,bodySortBg:d,rowHoverBg:s,rowSelectedBg:u,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:m,cellPaddingInline:g,cellPaddingBlockMD:h,cellPaddingInlineMD:v,cellPaddingBlockSM:b,cellPaddingInlineSM:y,borderColor:x,footerBg:k,footerColor:C,headerBorderRadius:S,cellFontSize:E,cellFontSizeMD:w,cellFontSizeSM:N,headerSplitColor:Z,fixedHeaderSortActiveBg:O,headerFilterHoverBg:K,filterDropdownBg:I,expandIconBg:R,selectionColumnWidth:P,stickyScrollBarBg:D,calc:M}=e,T=(0,t4.TS)(e,{tableFontSize:E,tableBg:o,tableRadius:S,tablePaddingVertical:m,tablePaddingHorizontal:g,tablePaddingVerticalMiddle:h,tablePaddingHorizontalMiddle:v,tablePaddingVerticalSmall:b,tablePaddingHorizontalSmall:y,tableBorderColor:x,tableHeaderTextColor:l,tableHeaderBg:a,tableFooterTextColor:C,tableFooterBg:k,tableHeaderCellSplitColor:Z,tableHeaderSortBg:c,tableHeaderSortHoverBg:i,tableBodySortBg:d,tableFixedHeaderSortActiveBg:O,tableHeaderFilterActiveBg:K,tableFilterDropdownBg:I,tableRowHoverBg:s,tableSelectedRowBg:u,tableSelectedRowHoverBg:f,zIndexTableFixed:2,zIndexTableSticky:3,tableFontSizeMiddle:w,tableFontSizeSmall:N,tableSelectionColumnWidth:P,tableExpandIconBg:R,tableExpandColumnWidth:M(r).add(M(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:D,tableScrollThumbBgHover:t,tableScrollBg:n});return[o6(T),oY(T),o3(T),o1(T),oU(T),oW(T),o$(T),oX(T),o3(T),oF(T),oQ(T),oG(T),o2(T),oq(T),o0(T),oJ(T),o4(T)]},e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:o,colorFillSecondary:r,colorFillContent:a,controlItemBgActive:l,controlItemBgActiveHover:c,padding:i,paddingSM:d,paddingXS:s,colorBorderSecondary:u,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:m,fontSize:g,fontSizeSM:h,lineHeight:v,lineWidth:b,colorIcon:y,colorIconHover:x,opacityLoading:k,controlInteractiveSize:C}=e,S=new o_.C(r).onBackground(n).toHexShortString(),E=new o_.C(a).onBackground(n).toHexShortString(),w=new o_.C(t).onBackground(n).toHexShortString(),N=new o_.C(y),Z=new o_.C(x),O=C/2-b,K=2*O+3*b;return{headerBg:w,headerColor:o,headerSortActiveBg:S,headerSortHoverBg:E,bodySortBg:w,rowHoverBg:w,rowSelectedBg:l,rowSelectedHoverBg:c,rowExpandedBg:t,cellPaddingBlock:i,cellPaddingInline:i,cellPaddingBlockMD:d,cellPaddingInlineMD:s,cellPaddingBlockSM:s,cellPaddingInlineSM:s,borderColor:u,headerBorderRadius:f,footerBg:w,footerColor:o,cellFontSize:g,cellFontSizeMD:g,cellFontSizeSM:g,headerSplitColor:u,fixedHeaderSortActiveBg:S,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:m,stickyScrollBarBorderRadius:100,expandIconMarginTop:(g*v-3*b)/2-Math.ceil((1.4*h-3*b)/2),headerIconColor:N.clone().setAlpha(N.getAlpha()*k).toRgbString(),headerIconHoverColor:Z.clone().setAlpha(Z.getAlpha()*k).toRgbString(),expandIconHalfInner:O,expandIconSize:K,expandIconScale:C/K}},{unitless:{expandIconScale:!0}});let o5=[];var o7=a.forwardRef((e,t)=>{var n,o;let r,l,i;let{prefixCls:d,className:s,rootClassName:u,style:f,size:p,bordered:m,dropdownPrefixCls:g,dataSource:h,pagination:v,rowSelection:b,rowKey:y="key",rowClassName:x,columns:k,children:C,childrenColumnName:S,onChange:E,getPopupContainer:w,loading:N,expandIcon:Z,expandable:K,expandedRowRender:I,expandIconColumnIndex:R,indentSize:P,scroll:D,sortDirections:M,locale:T,showSorterTooltip:j=!0,virtual:B}=e;(0,tp.ln)("Table");let z=a.useMemo(()=>k||eb(C),[k,C]),H=a.useMemo(()=>z.some(e=>e.responsive),[z]),L=(0,tI.Z)(H),A=a.useMemo(()=>{let e=new Set(Object.keys(L).filter(e=>L[e]));return z.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[z,L]),_=(0,e$.Z)(e,["className","style","columns"]),{locale:W=tR.Z,direction:q,table:F,renderEmpty:V,getPrefixCls:X,getPopupContainer:U}=a.useContext(tN.E_),G=(0,tK.Z)(p),Y=Object.assign(Object.assign({},W.Table),T),$=h||o5,J=X("table",d),Q=X("dropdown",g),[,ee]=(0,nc.ZP)(),et=(0,tO.Z)(J),[en,eo,er]=o8(J,et),ea=Object.assign({childrenColumnName:S,expandIconColumnIndex:R},K),{childrenColumnName:el="children"}=ea,ec=a.useMemo(()=>$.some(e=>null==e?void 0:e[el])?"nest":I||K&&K.expandedRowRender?"row":null,[$]),ed={body:a.useRef()},es=a.useRef(null),eu=a.useRef(null);n=()=>Object.assign(Object.assign({},eu.current),{nativeElement:es.current}),(0,a.useImperativeHandle)(t,()=>{let e=n(),{nativeElement:t}=e;return"undefined"!=typeof Proxy?new Proxy(t,{get:(t,n)=>e[n]?e[n]:Reflect.get(t,n)}):(t._antProxy=t._antProxy||{},Object.keys(e).forEach(n=>{if(!(n in t._antProxy)){let o=t[n];t._antProxy[n]=o,t[n]=e[n]}}),t)});let ef=a.useMemo(()=>"function"==typeof y?y:e=>null==e?void 0:e[y],[y]),[ep]=function(e,t,n){let o=a.useRef({});return[function(r){if(!o.current||o.current.data!==e||o.current.childrenColumnName!==t||o.current.getRowKey!==n){let r=new Map;!function e(o){o.forEach((o,a)=>{let l=n(o,a);r.set(l,o),o&&"object"==typeof o&&t in o&&e(o[t]||[])})}(e),o.current={data:e,childrenColumnName:t,kvMap:r,getRowKey:n}}return o.current.kvMap.get(r)}]}($,el,ef),em={},eg=function(e,t){var n,o,r;let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=Object.assign(Object.assign({},em),e);a&&(null===(n=em.resetPagination)||void 0===n||n.call(em),(null===(o=l.pagination)||void 0===o?void 0:o.current)&&(l.pagination.current=1),v&&v.onChange&&v.onChange(1,null===(r=l.pagination)||void 0===r?void 0:r.pageSize)),D&&!1!==D.scrollToFirstRowOnChange&&ed.body.current&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{getContainer:n=()=>window,callback:o,duration:r=450}=t,a=n(),l=function(e,t){var n,o;if("undefined"==typeof window)return 0;let r=t?"scrollTop":"scrollLeft",a=0;return tw(e)?a=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?a=e.documentElement[r]:e instanceof HTMLElement?a=e[r]:e&&(a=e[r]),e&&!tw(e)&&"number"!=typeof a&&(a=null===(o=(null!==(n=e.ownerDocument)&&void 0!==n?n:e).documentElement)||void 0===o?void 0:o[r]),a}(a,!0),c=Date.now(),i=()=>{let t=Date.now()-c,n=function(e,t,n,o){let r=n-t;return(e/=o/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}(t>r?r:t,l,e,r);tw(a)?a.scrollTo(window.pageXOffset,n):a instanceof Document||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=n:a.scrollTop=n,ted.body.current}),null==E||E(l.pagination,l.filters,l.sorter,{currentDataSource:ok(oH($,l.sorterStates,el),l.filterStates),action:t})},[eh,ev,ey,ex]=function(e){let{prefixCls:t,mergedColumns:n,onSorterChange:o,sortDirections:r,tableLocale:l,showSorterTooltip:c}=e,[i,d]=a.useState(oj(n,!0)),s=a.useMemo(()=>{let e=!0,t=oj(n,!1);if(!t.length)return i;let o=[];function r(t){e?o.push(t):o.push(Object.assign(Object.assign({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{null===a?(r(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:a=!0)):(a&&!1!==t.multiplePriority||(e=!1),r(t))}),o},[n,i]),u=a.useMemo(()=>{let e=s.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:e,sortColumn:e[0]&&e[0].column,sortOrder:e[0]&&e[0].order}},[s]);function f(e){let t;d(t=!1!==e.multiplePriority&&s.length&&!1!==s[0].multiplePriority?[].concat((0,ei.Z)(s.filter(t=>{let{key:n}=t;return n!==e.key})),[e]):[e]),o(oz(t),t)}return[e=>(function e(t,n,o,r,l,c,i,d){return(n||[]).map((n,s)=>{let u=nm(s,d),f=n;if(f.sorter){let e;let d=f.sortDirections||l,s=void 0===f.showSorterTooltip?i:f.showSorterTooltip,p=np(f,u),m=o.find(e=>{let{key:t}=e;return t===p}),g=m?m.sortOrder:null,h=g?d[d.indexOf(g)+1]:d[0];if(n.sortIcon)e=n.sortIcon({sortOrder:g});else{let n=d.includes(oP)&&a.createElement(oI,{className:O()("".concat(t,"-column-sorter-up"),{active:g===oP})}),o=d.includes(oD)&&a.createElement(oO,{className:O()("".concat(t,"-column-sorter-down"),{active:g===oD})});e=a.createElement("span",{className:O()("".concat(t,"-column-sorter"),{["".concat(t,"-column-sorter-full")]:!!(n&&o)})},a.createElement("span",{className:"".concat(t,"-column-sorter-inner"),"aria-hidden":"true"},n,o))}let{cancelSort:v,triggerAsc:b,triggerDesc:y}=c||{},x=v;h===oD?x=y:h===oP&&(x=b);let k="object"==typeof s?Object.assign({title:x},s):{title:x};f=Object.assign(Object.assign({},f),{className:O()(f.className,{["".concat(t,"-column-sort")]:g}),title:o=>{let r=a.createElement("div",{className:"".concat(t,"-column-sorters")},a.createElement("span",{className:"".concat(t,"-column-title")},ng(n.title,o)),e);return s?a.createElement(oR.Z,Object.assign({},k),r):r},onHeaderCell:e=>{let o=n.onHeaderCell&&n.onHeaderCell(e)||{},a=o.onClick,l=o.onKeyDown;o.onClick=e=>{r({column:n,key:p,sortOrder:h,multiplePriority:oM(n)}),null==a||a(e)},o.onKeyDown=e=>{e.keyCode===tH.Z.ENTER&&(r({column:n,key:p,sortOrder:h,multiplePriority:oM(n)}),null==l||l(e))};let c=function(e,t){let n=ng(e,t);return"[object Object]"===Object.prototype.toString.call(n)?"":n}(n.title,{}),i=null==c?void 0:c.toString();return g?o["aria-sort"]="ascend"===g?"ascending":"descending":o["aria-label"]=i||"",o.className=O()(o.className,"".concat(t,"-column-has-sorters")),o.tabIndex=0,n.ellipsis&&(o.title=(null!=c?c:"").toString()),o}})}return"children"in f&&(f=Object.assign(Object.assign({},f),{children:e(t,f.children,o,r,l,c,i,u)})),f})})(t,e,s,f,r,l,c),s,u,()=>oz(s)]}({prefixCls:J,mergedColumns:A,onSorterChange:(e,t)=>{eg({sorter:e,sorterStates:t},"sort",!1)},sortDirections:M||["ascend","descend"],tableLocale:Y,showSorterTooltip:j}),ek=a.useMemo(()=>oH($,ev,el),[$,ev]);em.sorter=ex(),em.sorterStates=ev;let[eC,eS,eE]=oS({prefixCls:J,locale:Y,dropdownPrefixCls:Q,mergedColumns:A,onFilterChange:(e,t)=>{eg({filters:e,filterStates:t},"filter",!0)},getPopupContainer:w||U,rootClassName:O()(u,et)}),ew=ok(ek,eS);em.filters=eE,em.filterStates=eS;let[eN]=(o=a.useMemo(()=>{let e={};return Object.keys(eE).forEach(t=>{null!==eE[t]&&(e[t]=eE[t])}),Object.assign(Object.assign({},ey),{filters:e})},[ey,eE]),[a.useCallback(e=>(function e(t,n){return t.map(t=>{let o=Object.assign({},t);return o.title=ng(t.title,n),"children"in o&&(o.children=e(o.children,n)),o})})(e,o),[o])]),[eZ,eO]=oN(ew.length,(e,t)=>{eg({pagination:Object.assign(Object.assign({},em.pagination),{current:e,pageSize:t})},"paginate")},v);em.pagination=!1===v?{}:function(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&"object"==typeof t?t:{}).forEach(t=>{let o=e[t];"function"!=typeof o&&(n[t]=o)}),n}(eZ,v),em.resetPagination=eO;let eK=a.useMemo(()=>{if(!1===v||!eZ.pageSize)return ew;let{current:e=1,total:t,pageSize:n=10}=eZ;return ew.lengthn?ew.slice((e-1)*n,e*n):ew:ew.slice((e-1)*n,e*n)},[!!v,ew,eZ&&eZ.current,eZ&&eZ.pageSize,eZ&&eZ.total]),[eI,eR]=tS({prefixCls:J,data:ew,pageData:eK,getRowKey:ef,getRecordByKey:ep,expandType:ec,childrenColumnName:el,locale:Y,getPopupContainer:w||U},b);ea.__PARENT_RENDER_ICON__=ea.expandIcon,ea.expandIcon=ea.expandIcon||Z||function(e){let{prefixCls:t,onExpand:n,record:o,expanded:r,expandable:l}=e,c="".concat(t,"-row-expand-icon");return a.createElement("button",{type:"button",onClick:e=>{n(o,e),e.stopPropagation()},className:O()(c,{["".concat(c,"-spaced")]:!l,["".concat(c,"-expanded")]:l&&r,["".concat(c,"-collapsed")]:l&&!r}),"aria-label":r?Y.collapse:Y.expand,"aria-expanded":r})},"nest"===ec&&void 0===ea.expandIconColumnIndex?ea.expandIconColumnIndex=b?1:0:ea.expandIconColumnIndex>0&&b&&(ea.expandIconColumnIndex-=1),"number"!=typeof ea.indentSize&&(ea.indentSize="number"==typeof P?P:15);let eP=a.useCallback(e=>eN(eI(eC(eh(e)))),[eh,eC,eI]);if(!1!==v&&(null==eZ?void 0:eZ.total)){let e;e=eZ.size?eZ.size:"small"===G||"middle"===G?"small":void 0;let t=t=>a.createElement(nu,Object.assign({},eZ,{className:O()("".concat(J,"-pagination ").concat(J,"-pagination-").concat(t),eZ.className),size:e})),n="rtl"===q?"left":"right",{position:o}=eZ;if(null!==o&&Array.isArray(o)){let e=o.find(e=>e.includes("top")),a=o.find(e=>e.includes("bottom")),c=o.every(e=>"none"==="".concat(e));e||a||c||(l=t(n)),e&&(r=t(e.toLowerCase().replace("top",""))),a&&(l=t(a.toLowerCase().replace("bottom","")))}else l=t(n)}"boolean"==typeof N?i={spinning:N}:"object"==typeof N&&(i=Object.assign({spinning:!0},N));let eD=O()(er,et,"".concat(J,"-wrapper"),null==F?void 0:F.className,{["".concat(J,"-wrapper-rtl")]:"rtl"===q},s,u,eo),eM=Object.assign(Object.assign({},null==F?void 0:F.style),f),eT=T&&T.emptyText||(null==V?void 0:V("Table"))||a.createElement(tZ.Z,{componentName:"Table"}),ej={},eB=a.useMemo(()=>{let{fontSize:e,lineHeight:t,padding:n,paddingXS:o,paddingSM:r}=ee,a=Math.floor(e*t);switch(G){case"large":return 2*n+a;case"small":return 2*o+a;default:return 2*r+a}},[ee,G]);return B&&(ej.listItemHeight=eB),en(a.createElement("div",{ref:es,className:eD,style:eM},a.createElement(nf.Z,Object.assign({spinning:!1},i),r,a.createElement(B?oA:oL,Object.assign({},ej,_,{ref:eu,columns:A,direction:q,expandable:ea,prefixCls:J,className:O()({["".concat(J,"-middle")]:"middle"===G,["".concat(J,"-small")]:"small"===G,["".concat(J,"-bordered")]:m,["".concat(J,"-empty")]:0===$.length},er,et,eo),data:eK,rowKey:ef,rowClassName:(e,t,n)=>{let o;return o="function"==typeof x?O()(x(e,t,n)):O()(x),O()({["".concat(J,"-row-selected")]:eR.has(ef(e,t))},o)},emptyText:eT,internalHooks:c,internalRefs:ed,transformColumns:eP,getContainerWidth:(e,t)=>{let n=e.querySelector(".".concat(J,"-container")),o=t;if(n){let e=getComputedStyle(n);o=t-parseInt(e.borderLeftWidth,10)-parseInt(e.borderRightWidth,10)}return o}})),l)))});let o9=a.forwardRef((e,t)=>{let n=a.useRef(0);return n.current+=1,a.createElement(o7,Object.assign({},e,{ref:t,_renderTimes:n.current}))});o9.SELECTION_COLUMN=tv,o9.EXPAND_COLUMN=l,o9.SELECTION_ALL=tb,o9.SELECTION_INVERT=ty,o9.SELECTION_NONE=tx,o9.Column=function(e){return null},o9.ColumnGroup=function(e){return null},o9.Summary=A;var re=o9},88532:function(e,t,n){var o=n(2265);let r=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});t.Z=r}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6494-938b4af798279e4a.js b/litellm/proxy/_experimental/out/_next/static/chunks/6494-938b4af798279e4a.js new file mode 100644 index 0000000000..401a8b8645 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/6494-938b4af798279e4a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6494],{3632:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),r=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},l=n(55015),c=r.forwardRef(function(e,t){return r.createElement(l.Z,(0,o.Z)({},e,{ref:t,icon:a}))})},35291:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),r=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},l=n(55015),c=r.forwardRef(function(e,t){return r.createElement(l.Z,(0,o.Z)({},e,{ref:t,icon:a}))})},28617:function(e,t,n){var o=n(2265),r=n(27380),a=n(51646),l=n(6543);t.Z=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,o.useRef)({}),n=(0,a.Z)(),c=(0,l.ZP)();return(0,r.Z)(()=>{let o=c.subscribe(o=>{t.current=o,e&&n()});return()=>c.unsubscribe(o)},[]),t.current}},29967:function(e,t,n){n.d(t,{ZP:function(){return T}});var o=n(2265),r=n(36760),a=n.n(r),l=n(50506),c=n(18242),i=n(71744),d=n(33759);let s=o.createContext(null),u=s.Provider,f=o.createContext(null),p=f.Provider;var m=n(20873),g=n(28791),h=n(6694),v=n(34709),b=n(86586),y=n(39109),x=n(352),k=n(12918),C=n(80669),S=n(3104);let E=e=>{let{componentCls:t,antCls:n}=e,o="".concat(t,"-group");return{[o]:Object.assign(Object.assign({},(0,k.Wf)(e)),{display:"inline-block",fontSize:0,["&".concat(o,"-rtl")]:{direction:"rtl"},["".concat(n,"-badge ").concat(n,"-badge-count")]:{zIndex:1},["> ".concat(n,"-badge:not(:first-child) > ").concat(n,"-button-wrapper")]:{borderInlineStart:"none"}})}},w=e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:o,radioSize:r,motionDurationSlow:a,motionDurationMid:l,motionEaseInOutCirc:c,colorBgContainer:i,colorBorder:d,lineWidth:s,colorBgContainerDisabled:u,colorTextDisabled:f,paddingXS:p,dotColorDisabled:m,lineType:g,radioColor:h,radioBgColor:v,calc:b}=e,y="".concat(t,"-inner"),C=b(r).sub(b(4).mul(2)),S=b(1).mul(r).equal();return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,k.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",["&".concat(t,"-wrapper-rtl")]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},["".concat(t,"-checked::after")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:"".concat((0,x.bf)(s)," ").concat(g," ").concat(o),borderRadius:"50%",visibility:"hidden",content:'""'},[t]:Object.assign(Object.assign({},(0,k.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),["".concat(t,"-wrapper:hover &,\n &:hover ").concat(y)]:{borderColor:o},["".concat(t,"-input:focus-visible + ").concat(y)]:Object.assign({},(0,k.oN)(e)),["".concat(t,":hover::after, ").concat(t,"-wrapper:hover &::after")]:{visibility:"visible"},["".concat(t,"-inner")]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:S,height:S,marginBlockStart:b(1).mul(r).div(-2).equal(),marginInlineStart:b(1).mul(r).div(-2).equal(),backgroundColor:h,borderBlockStart:0,borderInlineStart:0,borderRadius:S,transform:"scale(0)",opacity:0,transition:"all ".concat(a," ").concat(c),content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:S,height:S,backgroundColor:i,borderColor:d,borderStyle:"solid",borderWidth:s,borderRadius:"50%",transition:"all ".concat(l)},["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},["".concat(t,"-checked")]:{[y]:{borderColor:o,backgroundColor:v,"&::after":{transform:"scale(".concat(e.calc(e.dotSize).div(r).equal(),")"),opacity:1,transition:"all ".concat(a," ").concat(c)}}},["".concat(t,"-disabled")]:{cursor:"not-allowed",[y]:{backgroundColor:u,borderColor:d,cursor:"not-allowed","&::after":{backgroundColor:m}},["".concat(t,"-input")]:{cursor:"not-allowed"},["".concat(t,"-disabled + span")]:{color:f,cursor:"not-allowed"},["&".concat(t,"-checked")]:{[y]:{"&::after":{transform:"scale(".concat(b(C).div(r).equal({unit:!1}),")")}}}},["span".concat(t," + *")]:{paddingInlineStart:p,paddingInlineEnd:p}})}},N=e=>{let{buttonColor:t,controlHeight:n,componentCls:o,lineWidth:r,lineType:a,colorBorder:l,motionDurationSlow:c,motionDurationMid:i,buttonPaddingInline:d,fontSize:s,buttonBg:u,fontSizeLG:f,controlHeightLG:p,controlHeightSM:m,paddingXS:g,borderRadius:h,borderRadiusSM:v,borderRadiusLG:b,buttonCheckedBg:y,buttonSolidCheckedColor:C,colorTextDisabled:S,colorBgContainerDisabled:E,buttonCheckedBgDisabled:w,buttonCheckedColorDisabled:N,colorPrimary:Z,colorPrimaryHover:O,colorPrimaryActive:K,buttonSolidCheckedBg:I,buttonSolidCheckedHoverBg:R,buttonSolidCheckedActiveBg:P,calc:D}=e;return{["".concat(o,"-button-wrapper")]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:d,paddingBlock:0,color:t,fontSize:s,lineHeight:(0,x.bf)(D(n).sub(D(r).mul(2)).equal()),background:u,border:"".concat((0,x.bf)(r)," ").concat(a," ").concat(l),borderBlockStartWidth:D(r).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:r,cursor:"pointer",transition:["color ".concat(i),"background ".concat(i),"box-shadow ".concat(i)].join(","),a:{color:t},["> ".concat(o,"-button")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:D(r).mul(-1).equal(),insetInlineStart:D(r).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:r,paddingInline:0,backgroundColor:l,transition:"background-color ".concat(c),content:'""'}},"&:first-child":{borderInlineStart:"".concat((0,x.bf)(r)," ").concat(a," ").concat(l),borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h},"&:first-child:last-child":{borderRadius:h},["".concat(o,"-group-large &")]:{height:p,fontSize:f,lineHeight:(0,x.bf)(D(p).sub(D(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:b,borderEndStartRadius:b},"&:last-child":{borderStartEndRadius:b,borderEndEndRadius:b}},["".concat(o,"-group-small &")]:{height:m,paddingInline:D(g).sub(r).equal(),paddingBlock:0,lineHeight:(0,x.bf)(D(m).sub(D(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:Z},"&:has(:focus-visible)":Object.assign({},(0,k.oN)(e)),["".concat(o,"-inner, input[type='checkbox'], input[type='radio']")]:{width:0,height:0,opacity:0,pointerEvents:"none"},["&-checked:not(".concat(o,"-button-wrapper-disabled)")]:{zIndex:1,color:Z,background:y,borderColor:Z,"&::before":{backgroundColor:Z},"&:first-child":{borderColor:Z},"&:hover":{color:O,borderColor:O,"&::before":{backgroundColor:O}},"&:active":{color:K,borderColor:K,"&::before":{backgroundColor:K}}},["".concat(o,"-group-solid &-checked:not(").concat(o,"-button-wrapper-disabled)")]:{color:C,background:I,borderColor:I,"&:hover":{color:C,background:R,borderColor:R},"&:active":{color:C,background:P,borderColor:P}},"&-disabled":{color:S,backgroundColor:E,borderColor:l,cursor:"not-allowed","&:first-child, &:hover":{color:S,backgroundColor:E,borderColor:l}},["&-disabled".concat(o,"-button-wrapper-checked")]:{color:N,backgroundColor:w,borderColor:l,boxShadow:"none"}}}};var Z=(0,C.I$)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,o="0 0 0 ".concat((0,x.bf)(n)," ").concat(t),r=(0,S.TS)(e,{radioFocusShadow:o,radioButtonFocusShadow:o});return[E(r),w(r),N(r)]},e=>{let{wireframe:t,padding:n,marginXS:o,lineWidth:r,fontSizeLG:a,colorText:l,colorBgContainer:c,colorTextDisabled:i,controlItemBgActiveDisabled:d,colorTextLightSolid:s,colorPrimary:u,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:m}=e;return{radioSize:a,dotSize:t?a-8:a-(4+r)*2,dotColorDisabled:i,buttonSolidCheckedColor:s,buttonSolidCheckedBg:u,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:c,buttonCheckedBg:c,buttonColor:l,buttonCheckedBgDisabled:d,buttonCheckedColorDisabled:i,buttonPaddingInline:n-r,wrapperMarginInlineEnd:o,radioColor:t?u:m,radioBgColor:t?c:u}},{unitless:{radioSize:!0,dotSize:!0}}),O=n(64024),K=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let I=o.forwardRef((e,t)=>{var n,r;let l=o.useContext(s),c=o.useContext(f),{getPrefixCls:d,direction:u,radio:p}=o.useContext(i.E_),x=o.useRef(null),k=(0,g.sQ)(t,x),{isFormItemInput:C}=o.useContext(y.aM),{prefixCls:S,className:E,rootClassName:w,children:N,style:I,title:R}=e,P=K(e,["prefixCls","className","rootClassName","children","style","title"]),D=d("radio",S),M="button"===((null==l?void 0:l.optionType)||c),T=M?"".concat(D,"-button"):D,j=(0,O.Z)(D),[B,z,H]=Z(D,j),L=Object.assign({},P),A=o.useContext(b.Z);l&&(L.name=l.name,L.onChange=t=>{var n,o;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(o=null==l?void 0:l.onChange)||void 0===o||o.call(l,t)},L.checked=e.value===l.value,L.disabled=null!==(n=L.disabled)&&void 0!==n?n:l.disabled),L.disabled=null!==(r=L.disabled)&&void 0!==r?r:A;let _=a()("".concat(T,"-wrapper"),{["".concat(T,"-wrapper-checked")]:L.checked,["".concat(T,"-wrapper-disabled")]:L.disabled,["".concat(T,"-wrapper-rtl")]:"rtl"===u,["".concat(T,"-wrapper-in-form-item")]:C},null==p?void 0:p.className,E,w,z,H,j);return B(o.createElement(h.Z,{component:"Radio",disabled:L.disabled},o.createElement("label",{className:_,style:Object.assign(Object.assign({},null==p?void 0:p.style),I),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:R},o.createElement(m.Z,Object.assign({},L,{className:a()(L.className,!M&&v.A),type:"radio",prefixCls:T,ref:k})),void 0!==N?o.createElement("span",null,N):null)))}),R=o.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r}=o.useContext(i.E_),[s,f]=(0,l.Z)(e.defaultValue,{value:e.value}),{prefixCls:p,className:m,rootClassName:g,options:h,buttonStyle:v="outline",disabled:b,children:y,size:x,style:k,id:C,onMouseEnter:S,onMouseLeave:E,onFocus:w,onBlur:N}=e,K=n("radio",p),R="".concat(K,"-group"),P=(0,O.Z)(K),[D,M,T]=Z(K,P),j=y;h&&h.length>0&&(j=h.map(e=>"string"==typeof e||"number"==typeof e?o.createElement(I,{key:e.toString(),prefixCls:K,disabled:b,value:e,checked:s===e},e):o.createElement(I,{key:"radio-group-value-options-".concat(e.value),prefixCls:K,disabled:e.disabled||b,value:e.value,checked:s===e.value,title:e.title,style:e.style,id:e.id,required:e.required},e.label)));let B=(0,d.Z)(x),z=a()(R,"".concat(R,"-").concat(v),{["".concat(R,"-").concat(B)]:B,["".concat(R,"-rtl")]:"rtl"===r},m,g,M,T,P);return D(o.createElement("div",Object.assign({},(0,c.Z)(e,{aria:!0,data:!0}),{className:z,style:k,onMouseEnter:S,onMouseLeave:E,onFocus:w,onBlur:N,id:C,ref:t}),o.createElement(u,{value:{onChange:t=>{let n=t.target.value;"value"in e||f(n);let{onChange:o}=e;o&&n!==s&&o(t)},value:s,disabled:e.disabled,name:e.name,optionType:e.optionType}},j)))});var P=o.memo(R),D=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},M=o.forwardRef((e,t)=>{let{getPrefixCls:n}=o.useContext(i.E_),{prefixCls:r}=e,a=D(e,["prefixCls"]),l=n("radio",r);return o.createElement(p,{value:"button"},o.createElement(I,Object.assign({prefixCls:l},a,{type:"radio",ref:t})))});I.Button=M,I.Group=P,I.__ANT_RADIO=!0;var T=I},72188:function(e,t,n){n.d(t,{Z:function(){return re}});var o,r,a=n(2265),l={},c="rc-table-internal-hook",i=n(26365),d=n(58525),s=n(27380),u=n(16671),f=n(54887);function p(e){var t=a.createContext(void 0);return{Context:t,Provider:function(e){var n=e.value,o=e.children,r=a.useRef(n);r.current=n;var l=a.useState(function(){return{getValue:function(){return r.current},listeners:new Set}}),c=(0,i.Z)(l,1)[0];return(0,s.Z)(function(){(0,f.unstable_batchedUpdates)(function(){c.listeners.forEach(function(e){e(n)})})},[n]),a.createElement(t.Provider,{value:c},o)},defaultValue:e}}function m(e,t){var n=(0,d.Z)("function"==typeof t?t:function(e){if(void 0===t)return e;if(!Array.isArray(t))return e[t];var n={};return t.forEach(function(t){n[t]=e[t]}),n}),o=a.useContext(null==e?void 0:e.Context),r=o||{},l=r.listeners,c=r.getValue,f=a.useRef();f.current=n(o?c():null==e?void 0:e.defaultValue);var p=a.useState({}),m=(0,i.Z)(p,2)[1];return(0,s.Z)(function(){if(o)return l.add(e),function(){l.delete(e)};function e(e){var t=n(e);(0,u.Z)(f.current,t,!0)||m({})}},[o]),f.current}var g=n(1119),h=n(28791);function v(){var e=a.createContext(null);function t(){return a.useContext(e)}return{makeImmutable:function(n,o){var r=(0,h.Yr)(n),l=function(l,c){var i=r?{ref:c}:{},d=a.useRef(0),s=a.useRef(l);return null!==t()?a.createElement(n,(0,g.Z)({},l,i)):((!o||o(s.current,l))&&(d.current+=1),s.current=l,a.createElement(e.Provider,{value:d.current},a.createElement(n,(0,g.Z)({},l,i))))};return r?a.forwardRef(l):l},responseImmutable:function(e,n){var o=(0,h.Yr)(e),r=function(n,r){return t(),a.createElement(e,(0,g.Z)({},n,o?{ref:r}:{}))};return o?a.memo(a.forwardRef(r),n):a.memo(r,n)},useImmutableMark:t}}var b=v();b.makeImmutable,b.responseImmutable,b.useImmutableMark;var y=v(),x=y.makeImmutable,k=y.responseImmutable,C=y.useImmutableMark,S=p();a.memo(function(){var e,t,n,o,r,l=(t=a.useRef(0),t.current+=1,n=a.useRef(void 0),o=[],Object.keys(e||{}).map(function(t){var r;(null==e?void 0:e[t])!==(null===(r=n.current)||void 0===r?void 0:r[t])&&o.push(t)}),n.current=e,r=a.useRef([]),o.length&&(r.current=o),a.useDebugValue(t.current),a.useDebugValue(r.current.join(", ")),t.current);return a.createElement("h1",null,"Render Times: ",l)}).displayName="RenderBlock";var E=n(41154),w=n(31686),N=n(11993),Z=n(36760),O=n.n(Z),K=n(6397),I=n(16847),R=n(32559),P=a.createContext({renderWithProps:!1});function D(e){var t=[],n={};return e.forEach(function(e){for(var o=e||{},r=o.key,a=o.dataIndex,l=r||(null==a?[]:Array.isArray(a)?a:[a]).join("-")||"RC_TABLE_KEY";n[l];)l="".concat(l,"_next");n[l]=!0,t.push(l)}),t}var M=n(74126),T=function(e){var t,n=e.ellipsis,o=e.rowType,r=e.children,l=!0===n?{showTitle:!0}:n;return l&&(l.showTitle||"header"===o)&&("string"==typeof r||"number"==typeof r?t=r.toString():a.isValidElement(r)&&"string"==typeof r.props.children&&(t=r.props.children)),t},j=a.memo(function(e){var t,n,o,r,l,c,d,s,f,p,h=e.component,v=e.children,b=e.ellipsis,y=e.scope,x=e.prefixCls,k=e.className,Z=e.align,R=e.record,D=e.render,j=e.dataIndex,B=e.renderIndex,z=e.shouldCellUpdate,H=e.index,L=e.rowType,A=e.colSpan,_=e.rowSpan,W=e.fixLeft,q=e.fixRight,F=e.firstFixLeft,V=e.lastFixLeft,X=e.firstFixRight,U=e.lastFixRight,G=e.appendNode,Y=e.additionalProps,$=void 0===Y?{}:Y,J=e.isSticky,Q="".concat(x,"-cell"),ee=m(S,["supportSticky","allColumnsFixedLeft"]),et=ee.supportSticky,en=ee.allColumnsFixedLeft,eo=(t=a.useContext(P),n=C(),(0,K.Z)(function(){if(null!=v)return[v];var e=null==j||""===j?[]:Array.isArray(j)?j:[j],n=(0,I.Z)(R,e),o=n,r=void 0;if(D){var l=D(n,R,B);!l||"object"!==(0,E.Z)(l)||Array.isArray(l)||a.isValidElement(l)?o=l:(o=l.children,r=l.props,t.renderWithProps=!0)}return[o,r]},[n,R,v,j,D,B],function(e,n){if(z){var o=(0,i.Z)(e,2)[1];return z((0,i.Z)(n,2)[1],o)}return!!t.renderWithProps||!(0,u.Z)(e,n,!0)})),er=(0,i.Z)(eo,2),ea=er[0],el=er[1],ec={},ei="number"==typeof W&&et,ed="number"==typeof q&&et;ei&&(ec.position="sticky",ec.left=W),ed&&(ec.position="sticky",ec.right=q);var es=null!==(o=null!==(r=null!==(l=null==el?void 0:el.colSpan)&&void 0!==l?l:$.colSpan)&&void 0!==r?r:A)&&void 0!==o?o:1,eu=null!==(c=null!==(d=null!==(s=null==el?void 0:el.rowSpan)&&void 0!==s?s:$.rowSpan)&&void 0!==d?d:_)&&void 0!==c?c:1,ef=m(S,function(e){var t,n;return[(t=eu||1,n=e.hoverStartRow,H<=e.hoverEndRow&&H+t-1>=n),e.onHover]}),ep=(0,i.Z)(ef,2),em=ep[0],eg=ep[1],eh=(0,M.zX)(function(e){var t;R&&eg(H,H+eu-1),null==$||null===(t=$.onMouseEnter)||void 0===t||t.call($,e)}),ev=(0,M.zX)(function(e){var t;R&&eg(-1,-1),null==$||null===(t=$.onMouseLeave)||void 0===t||t.call($,e)});if(0===es||0===eu)return null;var eb=null!==(f=$.title)&&void 0!==f?f:T({rowType:L,ellipsis:b,children:ea}),ey=O()(Q,k,(p={},(0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)(p,"".concat(Q,"-fix-left"),ei&&et),"".concat(Q,"-fix-left-first"),F&&et),"".concat(Q,"-fix-left-last"),V&&et),"".concat(Q,"-fix-left-all"),V&&en&&et),"".concat(Q,"-fix-right"),ed&&et),"".concat(Q,"-fix-right-first"),X&&et),"".concat(Q,"-fix-right-last"),U&&et),"".concat(Q,"-ellipsis"),b),"".concat(Q,"-with-append"),G),"".concat(Q,"-fix-sticky"),(ei||ed)&&J&&et),(0,N.Z)(p,"".concat(Q,"-row-hover"),!el&&em)),$.className,null==el?void 0:el.className),ex={};Z&&(ex.textAlign=Z);var ek=(0,w.Z)((0,w.Z)((0,w.Z)((0,w.Z)({},ec),$.style),ex),null==el?void 0:el.style),eC=ea;return"object"!==(0,E.Z)(eC)||Array.isArray(eC)||a.isValidElement(eC)||(eC=null),b&&(V||X)&&(eC=a.createElement("span",{className:"".concat(Q,"-content")},eC)),a.createElement(h,(0,g.Z)({},el,$,{className:ey,style:ek,title:eb,scope:y,onMouseEnter:eh,onMouseLeave:ev,colSpan:1!==es?es:null,rowSpan:1!==eu?eu:null}),G,eC)});function B(e,t,n,o,r,a){var l,c,i=n[e]||{},d=n[t]||{};"left"===i.fixed?l=o.left["rtl"===r?t:e]:"right"===d.fixed&&(c=o.right["rtl"===r?e:t]);var s=!1,u=!1,f=!1,p=!1,m=n[t+1],g=n[e-1],h=!(null!=a&&a.children);return"rtl"===r?void 0!==l?p=!(g&&"left"===g.fixed)&&h:void 0!==c&&(f=!(m&&"right"===m.fixed)&&h):void 0!==l?s=!(m&&"left"===m.fixed)&&h:void 0!==c&&(u=!(g&&"right"===g.fixed)&&h),{fixLeft:l,fixRight:c,lastFixLeft:s,firstFixRight:u,lastFixRight:f,firstFixLeft:p,isSticky:o.isSticky}}var z=a.createContext({}),H=n(6989),L=["children"];function A(e){return e.children}A.Row=function(e){var t=e.children,n=(0,H.Z)(e,L);return a.createElement("tr",n,t)},A.Cell=function(e){var t=e.className,n=e.index,o=e.children,r=e.colSpan,l=void 0===r?1:r,c=e.rowSpan,i=e.align,d=m(S,["prefixCls","direction"]),s=d.prefixCls,u=d.direction,f=a.useContext(z),p=f.scrollColumnIndex,h=f.stickyOffsets,v=f.flattenColumns,b=f.columns,y=n+l-1+1===p?l+1:l,x=B(n,n+y-1,v,h,u,null==b?void 0:b[n]);return a.createElement(j,(0,g.Z)({className:t,index:n,component:"td",prefixCls:s,record:null,dataIndex:null,align:i,colSpan:y,rowSpan:c,render:function(){return o}},x))};var _=k(function(e){var t=e.children,n=e.stickyOffsets,o=e.flattenColumns,r=e.columns,l=m(S,"prefixCls"),c=o.length-1,i=o[c],d=a.useMemo(function(){return{stickyOffsets:n,flattenColumns:o,scrollColumnIndex:null!=i&&i.scrollbar?c:null,columns:r}},[i,o,c,n,r]);return a.createElement(z.Provider,{value:d},a.createElement("tfoot",{className:"".concat(l,"-summary")},t))}),W=n(31474),q=n(2857),F=n(10281),V=n(3208),X=n(18242);function U(e,t,n,o){return a.useMemo(function(){if(null!=n&&n.size){for(var r=[],a=0;a<(null==e?void 0:e.length);a+=1)!function e(t,n,o,r,a,l,c){t.push({record:n,indent:o,index:c});var i=l(n),d=null==a?void 0:a.has(i);if(n&&Array.isArray(n[r])&&d)for(var s=0;s1?n-1:0),r=1;r=0;i-=1){var d=t[i],s=n&&n[i],u=s&&s[ea];if(d||u||c){var f=u||{},p=(f.columnType,(0,H.Z)(f,el));r.unshift(a.createElement("col",(0,g.Z)({key:i,style:{width:d}},p))),c=!0}}return a.createElement("colgroup",null,r)},ei=n(83145),ed=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"],es=a.forwardRef(function(e,t){var n=e.className,o=e.noData,r=e.columns,l=e.flattenColumns,c=e.colWidths,i=e.columCount,d=e.stickyOffsets,s=e.direction,u=e.fixHeader,f=e.stickyTopOffset,p=e.stickyBottomOffset,g=e.stickyClassName,v=e.onScroll,b=e.maxContentScroll,y=e.children,x=(0,H.Z)(e,ed),k=m(S,["prefixCls","scrollbarSize","isSticky"]),C=k.prefixCls,E=k.scrollbarSize,Z=k.isSticky,K=Z&&!u?0:E,I=a.useRef(null),R=a.useCallback(function(e){(0,h.mH)(t,e),(0,h.mH)(I,e)},[]);a.useEffect(function(){var e;function t(e){var t=e.currentTarget,n=e.deltaX;n&&(v({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}return null===(e=I.current)||void 0===e||e.addEventListener("wheel",t),function(){var e;null===(e=I.current)||void 0===e||e.removeEventListener("wheel",t)}},[]);var P=a.useMemo(function(){return l.every(function(e){return e.width})},[l]),D=l[l.length-1],M={fixed:D?D.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(C,"-cell-scrollbar")}}},T=(0,a.useMemo)(function(){return K?[].concat((0,ei.Z)(r),[M]):r},[K,r]),j=(0,a.useMemo)(function(){return K?[].concat((0,ei.Z)(l),[M]):l},[K,l]),B=(0,a.useMemo)(function(){var e=d.right,t=d.left;return(0,w.Z)((0,w.Z)({},d),{},{left:"rtl"===s?[].concat((0,ei.Z)(t.map(function(e){return e+K})),[0]):t,right:"rtl"===s?e:[].concat((0,ei.Z)(e.map(function(e){return e+K})),[0]),isSticky:Z})},[K,d,Z]),z=(0,a.useMemo)(function(){for(var e=[],t=0;t1?"colgroup":"col":null,ellipsis:l.ellipsis,align:l.align,component:l.title?c:i,prefixCls:f,key:h[t]},d,{additionalProps:n,rowType:"header"}))}))}ef.displayName="HeaderRow";var ep=k(function(e){var t=e.stickyOffsets,n=e.columns,o=e.flattenColumns,r=e.onHeaderRow,l=m(S,["prefixCls","getComponent"]),c=l.prefixCls,i=l.getComponent,d=a.useMemo(function(){return function(e){var t=[];!function e(n,o){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[r]=t[r]||[];var a=o;return n.filter(Boolean).map(function(n){var o={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},l=1,c=n.children;return c&&c.length>0&&(l=e(c,a,r+1).reduce(function(e,t){return e+t},0),o.hasSubColumns=!0),"colSpan"in n&&(l=n.colSpan),"rowSpan"in n&&(o.rowSpan=n.rowSpan),o.colSpan=l,o.colEnd=o.colStart+l-1,t[r].push(o),a+=l,l})}(e,0);for(var n=t.length,o=function(e){t[e].forEach(function(t){("rowSpan"in t)||t.hasSubColumns||(t.rowSpan=n-e)})},r=0;r1&&void 0!==arguments[1]?arguments[1]:"";return"number"==typeof t?t:t.endsWith("%")?e*parseFloat(t)/100:null}var eh=["children"],ev=["fixed"];function eb(e){return(0,em.Z)(e).filter(function(e){return a.isValidElement(e)}).map(function(e){var t=e.key,n=e.props,o=n.children,r=(0,H.Z)(n,eh),a=(0,w.Z)({key:t},r);return o&&(a.children=eb(o)),a})}function ey(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";return e.filter(function(e){return e&&"object"===(0,E.Z)(e)}).reduce(function(e,n,o){var r=n.fixed,a=!0===r?"left":r,l="".concat(t,"-").concat(o),c=n.children;return c&&c.length>0?[].concat((0,ei.Z)(e),(0,ei.Z)(ey(c,l).map(function(e){return(0,w.Z)({fixed:a},e)}))):[].concat((0,ei.Z)(e),[(0,w.Z)((0,w.Z)({key:l},n),{},{fixed:a})])},[])}var ex=function(e,t){var n=e.prefixCls,o=e.columns,r=e.children,c=e.expandable,d=e.expandedKeys,s=e.columnTitle,u=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,m=e.rowExpandable,g=e.expandIconColumnIndex,h=e.direction,v=e.expandRowByClick,b=e.columnWidth,y=e.fixed,x=e.scrollWidth,k=e.clientWidth,C=a.useMemo(function(){return function e(t){return t.filter(function(e){return e&&"object"===(0,E.Z)(e)&&!e.hidden}).map(function(t){var n=t.children;return n&&n.length>0?(0,w.Z)((0,w.Z)({},t),{},{children:e(n)}):t})}((o||eb(r)||[]).slice())},[o,r]),S=a.useMemo(function(){if(c){var e,t=C.slice();if(!t.includes(l)){var o=g||0;o>=0&&t.splice(o,0,l)}var r=t.indexOf(l);t=t.filter(function(e,t){return e!==l||t===r});var i=C[r];e=("left"===y||y)&&!g?"left":("right"===y||y)&&g===C.length?"right":i?i.fixed:null;var h=(0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)({},ea,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",s),"fixed",e),"className","".concat(n,"-row-expand-icon-cell")),"width",b),"render",function(e,t,o){var r=u(t,o),l=p({prefixCls:n,expanded:d.has(r),expandable:!m||m(t),record:t,onExpand:f});return v?a.createElement("span",{onClick:function(e){return e.stopPropagation()}},l):l});return t.map(function(e){return e===l?h:e})}return C.filter(function(e){return e!==l})},[c,C,u,d,p,h]),Z=a.useMemo(function(){var e=S;return t&&(e=t(e)),e.length||(e=[{render:function(){return null}}]),e},[t,S,h]),O=a.useMemo(function(){return"rtl"===h?ey(Z).map(function(e){var t=e.fixed,n=(0,H.Z)(e,ev),o=t;return"left"===t?o="right":"right"===t&&(o="left"),(0,w.Z)({fixed:o},n)}):ey(Z)},[Z,h,x]),K=a.useMemo(function(){if(x&&x>0){var e=0,t=0;O.forEach(function(n){var o=eg(x,n.width);o?e+=o:t+=1});var n=Math.max(x,k),o=Math.max(n-e,t),r=t,a=o/t,l=0,c=O.map(function(e){var t=(0,w.Z)({},e),n=eg(x,t.width);if(n)t.width=n;else{var c=Math.floor(a);t.width=1===r?o:c,o-=c,r-=1}return l+=t.width,t});if(l=f&&(o=f-p),l({scrollLeft:o/f*(u+2)}),x.current.x=e.pageX},R=function(){if(r.current){var e=eN(r.current).top,t=e+r.current.offsetHeight,n=d===window?document.documentElement.scrollTop+window.innerHeight:eN(d).top+d.clientHeight;t-(0,V.Z)()<=n||e>=n-c?y(function(e){return(0,w.Z)((0,w.Z)({},e),{},{isHiddenScrollBar:!0})}):y(function(e){return(0,w.Z)((0,w.Z)({},e),{},{isHiddenScrollBar:!1})})}},P=function(e){y(function(t){return(0,w.Z)((0,w.Z)({},t),{},{scrollLeft:e/u*f||0})})};return(a.useImperativeHandle(t,function(){return{setScrollLeft:P}}),a.useEffect(function(){var e=ew(document.body,"mouseup",K,!1),t=ew(document.body,"mousemove",I,!1);return R(),function(){e.remove(),t.remove()}},[p,E]),a.useEffect(function(){var e=ew(d,"scroll",R,!1),t=ew(window,"resize",R,!1);return function(){e.remove(),t.remove()}},[d]),a.useEffect(function(){b.isHiddenScrollBar||y(function(e){var t=r.current;return t?(0,w.Z)((0,w.Z)({},e),{},{scrollLeft:t.scrollLeft/t.scrollWidth*t.clientWidth}):e})},[b.isHiddenScrollBar]),u<=f||!p||b.isHiddenScrollBar)?null:a.createElement("div",{style:{height:(0,V.Z)(),width:f,bottom:c},className:"".concat(s,"-sticky-scroll")},a.createElement("div",{onMouseDown:function(e){e.persist(),x.current.delta=e.pageX-b.scrollLeft,x.current.x=0,Z(!0),e.preventDefault()},ref:g,className:O()("".concat(s,"-sticky-scroll-bar"),(0,N.Z)({},"".concat(s,"-sticky-scroll-bar-active"),E)),style:{width:"".concat(p,"px"),transform:"translate3d(".concat(b.scrollLeft,"px, 0, 0)")}}))}),eO="rc-table",eK=[],eI={};function eR(){return"No Data"}var eP=a.forwardRef(function(e,t){var n,o=(0,w.Z)({rowKey:"key",prefixCls:eO,emptyText:eR},e),r=o.prefixCls,l=o.className,s=o.rowClassName,f=o.style,p=o.data,m=o.rowKey,h=o.scroll,v=o.tableLayout,b=o.direction,y=o.title,x=o.footer,k=o.summary,C=o.caption,Z=o.id,R=o.showHeader,P=o.components,M=o.emptyText,T=o.onRow,j=o.onHeaderRow,z=o.internalHooks,L=o.transformColumns,U=o.internalRefs,G=o.tailor,Y=o.getContainerWidth,$=o.sticky,J=p||eK,Q=!!J.length,ee=z===c,et=a.useCallback(function(e,t){return(0,I.Z)(P,e)||t},[P]),en=a.useMemo(function(){return"function"==typeof m?m:function(e){return e&&e[m]}},[m]),ea=et(["body"]),el=(t_=a.useState(-1),tq=(tW=(0,i.Z)(t_,2))[0],tF=tW[1],tV=a.useState(-1),tU=(tX=(0,i.Z)(tV,2))[0],tG=tX[1],[tq,tU,a.useCallback(function(e,t){tF(e),tG(t)},[])]),ed=(0,i.Z)(el,3),es=ed[0],ef=ed[1],em=ed[2],eg=(tQ=(t$=o.expandable,tJ=(0,H.Z)(o,er),!1===(tY="expandable"in o?(0,w.Z)((0,w.Z)({},tJ),t$):tJ).showExpandColumn&&(tY.expandIconColumnIndex=-1),tY).expandIcon,t0=tY.expandedRowKeys,t1=tY.defaultExpandedRowKeys,t2=tY.defaultExpandAllRows,t3=tY.expandedRowRender,t4=tY.onExpand,t6=tY.onExpandedRowsChange,t8=tY.childrenColumnName||"children",t5=a.useMemo(function(){return t3?"row":!!(o.expandable&&o.internalHooks===c&&o.expandable.__PARENT_RENDER_ICON__||J.some(function(e){return e&&"object"===(0,E.Z)(e)&&e[t8]}))&&"nest"},[!!t3,J]),t7=a.useState(function(){if(t1)return t1;if(t2){var e;return e=[],function t(n){(n||[]).forEach(function(n,o){e.push(en(n,o)),t(n[t8])})}(J),e}return[]}),ne=(t9=(0,i.Z)(t7,2))[0],nt=t9[1],nn=a.useMemo(function(){return new Set(t0||ne||[])},[t0,ne]),no=a.useCallback(function(e){var t,n=en(e,J.indexOf(e)),o=nn.has(n);o?(nn.delete(n),t=(0,ei.Z)(nn)):t=[].concat((0,ei.Z)(nn),[n]),nt(t),t4&&t4(!o,e),t6&&t6(t)},[en,nn,J,t4,t6]),[tY,t5,nn,tQ||ek,t8,no]),eh=(0,i.Z)(eg,6),ev=eh[0],eb=eh[1],ey=eh[2],ew=eh[3],eN=eh[4],eP=eh[5],eD=null==h?void 0:h.x,eM=a.useState(0),eT=(0,i.Z)(eM,2),ej=eT[0],eB=eT[1],ez=ex((0,w.Z)((0,w.Z)((0,w.Z)({},o),ev),{},{expandable:!!ev.expandedRowRender,columnTitle:ev.columnTitle,expandedKeys:ey,getRowKey:en,onTriggerExpand:eP,expandIcon:ew,expandIconColumnIndex:ev.expandIconColumnIndex,direction:b,scrollWidth:ee&&G&&"number"==typeof eD?eD:null,clientWidth:ej}),ee?L:null),eH=(0,i.Z)(ez,3),eL=eH[0],eA=eH[1],e_=eH[2],eW=null!=e_?e_:eD,eq=a.useMemo(function(){return{columns:eL,flattenColumns:eA}},[eL,eA]),eF=a.useRef(),eV=a.useRef(),eX=a.useRef(),eU=a.useRef();a.useImperativeHandle(t,function(){return{nativeElement:eF.current,scrollTo:function(e){var t;if(eX.current instanceof HTMLElement){var n=e.index,o=e.top,r=e.key;if(o)null===(a=eX.current)||void 0===a||a.scrollTo({top:o});else{var a,l,c=null!=r?r:en(J[n]);null===(l=eX.current.querySelector('[data-row-key="'.concat(c,'"]')))||void 0===l||l.scrollIntoView()}}else null!==(t=eX.current)&&void 0!==t&&t.scrollTo&&eX.current.scrollTo(e)}}});var eG=a.useRef(),eY=a.useState(!1),e$=(0,i.Z)(eY,2),eJ=e$[0],eQ=e$[1],e0=a.useState(!1),e1=(0,i.Z)(e0,2),e2=e1[0],e3=e1[1],e4=eC(new Map),e6=(0,i.Z)(e4,2),e8=e6[0],e5=e6[1],e7=D(eA).map(function(e){return e8.get(e)}),e9=a.useMemo(function(){return e7},[e7.join("_")]),te=(nr=eA.length,(0,a.useMemo)(function(){for(var e=[],t=[],n=0,o=0,r=0;r0)):(eQ(a>0),e3(a1?y-D:0,pointerEvents:"auto"}),T=a.useMemo(function(){return f?P<=1:0===I||0===P||P>1},[P,I,f]);T?M.visibility="hidden":f&&(M.height=null==p?void 0:p(P));var B={};return(0===P||0===I)&&(B.rowSpan=1,B.colSpan=1),a.createElement(j,(0,g.Z)({className:O()(b,u),ellipsis:o.ellipsis,align:o.align,scope:o.rowScope,component:"div",prefixCls:n.prefixCls,key:C,record:d,index:c,renderIndex:i,dataIndex:v,render:T?function(){return null}:h,shouldCellUpdate:o.shouldCellUpdate},S,{appendNode:E,additionalProps:(0,w.Z)((0,w.Z)({},N),{},{style:M},B)}))},ez=["data","index","className","rowKey","style","extra","getHeight"],eH=k(a.forwardRef(function(e,t){var n,o=e.data,r=e.index,l=e.className,c=e.rowKey,i=e.style,d=e.extra,s=e.getHeight,u=(0,H.Z)(e,ez),f=o.record,p=o.indent,h=o.index,v=m(S,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),b=v.scrollX,y=v.flattenColumns,x=v.prefixCls,k=v.fixColumn,C=v.componentWidth,E=G(f,c,r,p),Z=E.rowSupportExpand,K=E.expanded,I=E.rowProps,R=E.expandedRowRender,P=E.expandedRowClassName;if(Z&&K){var D=R(f,r,p+1,K),M=null==P?void 0:P(f,r,p),T={};k&&(T={style:(0,N.Z)({},"--virtual-width","".concat(C,"px"))});var B="".concat(x,"-expanded-row-cell");n=a.createElement("div",{className:O()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(p+1),M)},a.createElement(j,{component:"div",prefixCls:x,className:O()(B,(0,N.Z)({},"".concat(B,"-fixed"),k)),additionalProps:T},D))}var z=(0,w.Z)((0,w.Z)({},i),{},{width:b});d&&(z.position="absolute",z.pointerEvents="none");var L=a.createElement("div",(0,g.Z)({},I,u,{ref:Z?null:t,className:O()(l,"".concat(x,"-row"),null==I?void 0:I.className,(0,N.Z)({},"".concat(x,"-row-extra"),d)),style:(0,w.Z)((0,w.Z)({},z),null==I?void 0:I.style)}),y.map(function(e,t){return a.createElement(eB,{key:t,rowInfo:E,column:e,colIndex:t,indent:p,index:r,renderIndex:h,record:f,inverse:d,getHeight:s})}));return Z?a.createElement("div",{ref:t},L,n):L})),eL=k(a.forwardRef(function(e,t){var n,o=e.data,r=e.onScroll,l=m(S,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","emptyNode","scrollX"]),c=l.flattenColumns,d=l.onColumnResize,s=l.getRowKey,u=l.expandedKeys,f=l.prefixCls,p=l.childrenColumnName,h=l.emptyNode,v=l.scrollX,b=m(eT),y=b.sticky,x=b.scrollY,k=b.listItemHeight,C=a.useRef(),w=U(o,p,u,s),N=a.useMemo(function(){var e=0;return c.map(function(t){var n=t.width,o=t.key;return e+=n,[o,n,e]})},[c]),Z=a.useMemo(function(){return N.map(function(e){return e[2]})},[N]);a.useEffect(function(){N.forEach(function(e){var t=(0,i.Z)(e,2);d(t[0],t[1])})},[N]),a.useImperativeHandle(t,function(){var e={scrollTo:function(e){var t;null===(t=C.current)||void 0===t||t.scrollTo(e)}};return Object.defineProperty(e,"scrollLeft",{get:function(){var e;return(null===(e=C.current)||void 0===e?void 0:e.getScrollInfo().x)||0},set:function(e){var t;null===(t=C.current)||void 0===t||t.scrollTo({left:e})}}),e});var K=function(e,t){var n=null===(r=w[t])||void 0===r?void 0:r.record,o=e.onCell;if(o){var r,a,l=o(n,t);return null!==(a=null==l?void 0:l.rowSpan)&&void 0!==a?a:1}return 1},I=a.useMemo(function(){return{columnsOffset:Z}},[Z]),R="".concat(f,"-tbody");if(w.length){var P={};y&&(P.position="sticky",P.bottom=0,"object"===(0,E.Z)(y)&&y.offsetScroll&&(P.bottom=y.offsetScroll)),n=a.createElement(eM.Z,{fullHeight:!1,ref:C,styles:{horizontalScrollBar:P},className:O()(R,"".concat(R,"-virtual")),height:x,itemHeight:k||24,data:w,itemKey:function(e){return s(e.record)},scrollWidth:v,onVirtualScroll:function(e){r({scrollLeft:e.x})},extraRender:function(e){var t=e.start,n=e.end,o=e.getSize,r=e.offsetY;if(n<0)return null;for(var l=c.filter(function(e){return 0===K(e,t)}),i=t,d=function(e){if(!(l=l.filter(function(t){return 0===K(t,e)})).length)return i=e,1},u=t;u>=0&&!d(u);u-=1);for(var f=c.filter(function(e){return 1!==K(e,n)}),p=n,m=function(e){if(!(f=f.filter(function(t){return 1!==K(t,e)})).length)return p=Math.max(e-1,n),1},g=n;g1})&&h.push(e)},b=i;b<=p;b+=1)if(v(b))continue;return h.map(function(e){var t=w[e],n=s(t.record,e),l=o(n);return a.createElement(eH,{key:e,data:t,rowKey:n,index:e,style:{top:-r+l.top},extra:!0,getHeight:function(t){var r=e+t-1,a=o(n,s(w[r].record,r));return a.bottom-a.top}})})}},function(e,t,n){var o=s(e.record,t);return a.createElement(eH,(0,g.Z)({data:e,rowKey:o,index:t},n))})}else n=a.createElement("div",{className:O()("".concat(f,"-placeholder"))},a.createElement(j,{component:"div",prefixCls:f},h));return a.createElement(ej.Provider,{value:I},n)})),eA=function(e,t){var n=t.ref,o=t.onScroll;return a.createElement(eL,{ref:n,data:e,onScroll:o})},e_=a.forwardRef(function(e,t){var n=e.columns,o=e.scroll,r=e.sticky,l=e.prefixCls,i=void 0===l?eO:l,d=e.className,s=e.listItemHeight,u=e.components,f=o||{},p=f.x,m=f.y;"number"!=typeof p&&(p=1),"number"!=typeof m&&(m=500);var h=a.useMemo(function(){return{sticky:r,scrollY:m,listItemHeight:s}},[r,m,s]);return a.createElement(eT.Provider,{value:h},a.createElement(eD,(0,g.Z)({},e,{className:O()(d,"".concat(i,"-virtual")),scroll:(0,w.Z)((0,w.Z)({},o),{},{x:p}),components:(0,w.Z)((0,w.Z)({},u),{},{body:eA}),columns:n,internalHooks:c,tailor:!0,ref:t})))});x(e_,void 0);var eW=n(70464),eq=n(76405),eF=n(25049),eV=n(63496),eX=n(15354),eU=n(15900),eG=a.createContext(null),eY=a.memo(function(e){for(var t,n=e.prefixCls,o=e.level,r=e.isStart,l=e.isEnd,c="".concat(n,"-indent-unit"),i=[],d=0;d1&&void 0!==arguments[1]?arguments[1]:null;return n.map(function(d,s){for(var u,f=eQ(o?o.pos:"0",s),p=e0(d[a],f),m=0;m1&&void 0!==arguments[1]?arguments[1]:{},f=u.initWrapper,p=u.processEntity,m=u.onProcessFinished,g=u.externalGetKey,h=u.childrenPropName,v=u.fieldNames,b=arguments.length>2?arguments[2]:void 0,y={},x={},k={posEntities:y,keyEntities:x};return f&&(k=f(k)||k),t=function(e){var t=e.node,n=e.index,o=e.pos,r=e.key,a=e.parentPos,l=e.level,c={node:t,nodes:e.nodes,index:n,key:r,pos:o,level:l},i=e0(r,o);y[o]=c,x[i]=c,c.parent=y[a],c.parent&&(c.parent.children=c.parent.children||[],c.parent.children.push(c)),p&&p(c,k)},n={externalGetKey:g||b,childrenPropName:h,fieldNames:v},a=(r=("object"===(0,E.Z)(n)?n:{externalGetKey:n})||{}).childrenPropName,l=r.externalGetKey,i=(c=e1(r.fieldNames)).key,d=c.children,s=a||d,l?"string"==typeof l?o=function(e){return e[l]}:"function"==typeof l&&(o=function(e){return l(e)}):o=function(e,t){return e0(e[i],t)},function n(r,a,l,c){var i=r?r[s]:e,d=r?eQ(l.pos,a):"0",u=r?[].concat((0,ei.Z)(c),[r]):[];if(r){var f=o(r,d);t({node:r,index:a,pos:d,key:f,parentPos:l.node?l.pos:null,level:l.level+1,nodes:u})}i&&i.forEach(function(e,t){n(e,t,{node:r,pos:d,level:l?l.level+1:-1},u)})}(null),m&&m(k),k}function e6(e,t){var n=t.expandedKeys,o=t.selectedKeys,r=t.loadedKeys,a=t.loadingKeys,l=t.checkedKeys,c=t.halfCheckedKeys,i=t.dragOverNodeKey,d=t.dropPosition,s=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==o.indexOf(e),loaded:-1!==r.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==l.indexOf(e),halfChecked:-1!==c.indexOf(e),pos:String(s?s.pos:""),dragOver:i===e&&0===d,dragOverGapTop:i===e&&-1===d,dragOverGapBottom:i===e&&1===d}}function e8(e){var t=e.data,n=e.expanded,o=e.selected,r=e.checked,a=e.loaded,l=e.loading,c=e.halfChecked,i=e.dragOver,d=e.dragOverGapTop,s=e.dragOverGapBottom,u=e.pos,f=e.active,p=e.eventKey,m=(0,w.Z)((0,w.Z)({},t),{},{expanded:n,selected:o,checked:r,loaded:a,loading:l,halfChecked:c,dragOver:i,dragOverGapTop:d,dragOverGapBottom:s,pos:u,active:f,key:p});return"props"in m||Object.defineProperty(m,"props",{get:function(){return(0,R.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}var e5=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],e7="open",e9="close",te=function(e){(0,eX.Z)(n,e);var t=(0,eU.Z)(n);function n(){var e;(0,eq.Z)(this,n);for(var o=arguments.length,r=Array(o),l=0;l=0&&n.splice(o,1),n}function to(e,t){var n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function tr(e){return e.split("-")}function ta(e,t,n,o,r,a,l,c,i,d){var s,u,f=e.clientX,p=e.clientY,m=e.target.getBoundingClientRect(),g=m.top,h=m.height,v=(("rtl"===d?-1:1)*(((null==r?void 0:r.x)||0)-f)-12)/o,b=c[n.props.eventKey];if(p-1.5?a({dragNode:N,dropNode:Z,dropPosition:1})?S=1:O=!1:a({dragNode:N,dropNode:Z,dropPosition:0})?S=0:a({dragNode:N,dropNode:Z,dropPosition:1})?S=1:O=!1:a({dragNode:N,dropNode:Z,dropPosition:1})?S=1:O=!1,{dropPosition:S,dropLevelOffset:E,dropTargetKey:b.key,dropTargetPos:b.pos,dragOverNodeKey:C,dropContainerKey:0===S?null:(null===(u=b.parent)||void 0===u?void 0:u.key)||null,dropAllowed:O}}function tl(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function tc(e){var t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,E.Z)(e))return(0,R.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function ti(e,t){var n=new Set;return(e||[]).forEach(function(e){!function e(o){if(!n.has(o)){var r=t[o];if(r){n.add(o);var a=r.parent;!r.node.disabled&&a&&e(a.key)}}}(e)}),(0,ei.Z)(n)}function td(e,t){var n=new Set;return e.forEach(function(e){t.has(e)||n.add(e)}),n}function ts(e){var t=e||{},n=t.disabled,o=t.disableCheckbox,r=t.checkable;return!!(n||o)||!1===r}function tu(e,t,n,o){var r,a=[];r=o||ts;var l=new Set(e.filter(function(e){var t=!!n[e];return t||a.push(e),t})),c=new Map,i=0;return Object.keys(n).forEach(function(e){var t=n[e],o=t.level,r=c.get(o);r||(r=new Set,c.set(o,r)),r.add(t),i=Math.max(i,o)}),(0,R.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map(function(e){return"'".concat(e,"'")}).join(", "))),!0===t?function(e,t,n,o){for(var r=new Set(e),a=new Set,l=0;l<=n;l+=1)(t.get(l)||new Set).forEach(function(e){var t=e.key,n=e.node,a=e.children,l=void 0===a?[]:a;r.has(t)&&!o(n)&&l.filter(function(e){return!o(e.node)}).forEach(function(e){r.add(e.key)})});for(var c=new Set,i=n;i>=0;i-=1)(t.get(i)||new Set).forEach(function(e){var t=e.parent;if(!(o(e.node)||!e.parent||c.has(e.parent.key))){if(o(e.parent.node)){c.add(t.key);return}var n=!0,l=!1;(t.children||[]).filter(function(e){return!o(e.node)}).forEach(function(e){var t=e.key,o=r.has(t);n&&!o&&(n=!1),!l&&(o||a.has(t))&&(l=!0)}),n&&r.add(t.key),l&&a.add(t.key),c.add(t.key)}});return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(td(a,r))}}(l,c,i,r):function(e,t,n,o,r){for(var a=new Set(e),l=new Set(t),c=0;c<=o;c+=1)(n.get(c)||new Set).forEach(function(e){var t=e.key,n=e.node,o=e.children,c=void 0===o?[]:o;a.has(t)||l.has(t)||r(n)||c.filter(function(e){return!r(e.node)}).forEach(function(e){a.delete(e.key)})});l=new Set;for(var i=new Set,d=o;d>=0;d-=1)(n.get(d)||new Set).forEach(function(e){var t=e.parent;if(!(r(e.node)||!e.parent||i.has(e.parent.key))){if(r(e.parent.node)){i.add(t.key);return}var n=!0,o=!1;(t.children||[]).filter(function(e){return!r(e.node)}).forEach(function(e){var t=e.key,r=a.has(t);n&&!r&&(n=!1),!o&&(r||l.has(t))&&(o=!0)}),n||a.delete(t.key),o&&l.add(t.key),i.add(t.key)}});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(td(l,a))}}(l,t.halfCheckedKeys,c,i,r)}tt.displayName="TreeNode",tt.isTreeNode=1;var tf=n(50506),tp=n(13613),tm=n(4156),tg=n(80795),th=n(29967);let tv={},tb="SELECT_ALL",ty="SELECT_INVERT",tx="SELECT_NONE",tk=[],tC=(e,t)=>{let n=[];return(t||[]).forEach(t=>{n.push(t),t&&"object"==typeof t&&e in t&&(n=[].concat((0,ei.Z)(n),(0,ei.Z)(tC(e,t[e]))))}),n};var tS=(e,t)=>{let{preserveSelectedRowKeys:n,selectedRowKeys:o,defaultSelectedRowKeys:r,getCheckboxProps:l,onChange:c,onSelect:i,onSelectAll:d,onSelectInvert:s,onSelectNone:u,onSelectMultiple:f,columnWidth:p,type:m,selections:g,fixed:h,renderCell:v,hideSelectAll:b,checkStrictly:y=!0}=t||{},{prefixCls:x,data:k,pageData:C,getRecordByKey:S,getRowKey:E,expandType:w,childrenColumnName:N,locale:Z,getPopupContainer:K}=e,I=(0,tp.ln)("Table"),[R,P]=function(e){let[t,n]=(0,a.useState)(null);return[(0,a.useCallback)((o,r,a)=>{let l=null!=t?t:o,c=Math.max(l||0,o),i=r.slice(Math.min(l||0,o),c+1).map(t=>e(t)),d=i.some(e=>!a.has(e)),s=[];return i.forEach(e=>{d?(a.has(e)||s.push(e),a.add(e)):(a.delete(e),s.push(e))}),n(d?c:null),s},[t]),e=>{n(e)}]}(e=>e),[D,M]=(0,tf.Z)(o||r||tk,{value:o}),T=a.useRef(new Map),j=(0,a.useCallback)(e=>{if(n){let t=new Map;e.forEach(e=>{let n=S(e);!n&&T.current.has(e)&&(n=T.current.get(e)),t.set(e,n)}),T.current=t}},[S,n]);a.useEffect(()=>{j(D)},[D]);let{keyEntities:B}=(0,a.useMemo)(()=>{if(y)return{keyEntities:null};let e=k;if(n){let t=new Set(k.map((e,t)=>E(e,t))),n=Array.from(T.current).reduce((e,n)=>{let[o,r]=n;return t.has(o)?e:e.concat(r)},[]);e=[].concat((0,ei.Z)(e),(0,ei.Z)(n))}return e4(e,{externalGetKey:E,childrenPropName:N})},[k,E,y,N,n]),z=(0,a.useMemo)(()=>tC(N,C),[N,C]),H=(0,a.useMemo)(()=>{let e=new Map;return z.forEach((t,n)=>{let o=E(t,n),r=(l?l(t):null)||{};e.set(o,r)}),e},[z,E,l]),L=(0,a.useCallback)(e=>{var t;return!!(null===(t=H.get(E(e)))||void 0===t?void 0:t.disabled)},[H,E]),[A,_]=(0,a.useMemo)(()=>{if(y)return[D||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=tu(D,!0,B,L);return[e||[],t]},[D,y,B,L]),W=(0,a.useMemo)(()=>new Set("radio"===m?A.slice(0,1):A),[A,m]),q=(0,a.useMemo)(()=>"radio"===m?new Set:new Set(_),[_,m]);a.useEffect(()=>{t||M(tk)},[!!t]);let F=(0,a.useCallback)((e,t)=>{let o,r;j(e),n?(o=e,r=e.map(e=>T.current.get(e))):(o=[],r=[],e.forEach(e=>{let t=S(e);void 0!==t&&(o.push(e),r.push(t))})),M(o),null==c||c(o,r,{type:t})},[M,S,c,n]),V=(0,a.useCallback)((e,t,n,o)=>{if(i){let r=n.map(e=>S(e));i(S(e),t,r,o)}F(n,"single")},[i,S,F]),X=(0,a.useMemo)(()=>!g||b?null:(!0===g?[tb,ty,tx]:g).map(e=>e===tb?{key:"all",text:Z.selectionAll,onSelect(){F(k.map((e,t)=>E(e,t)).filter(e=>{let t=H.get(e);return!(null==t?void 0:t.disabled)||W.has(e)}),"all")}}:e===ty?{key:"invert",text:Z.selectInvert,onSelect(){let e=new Set(W);C.forEach((t,n)=>{let o=E(t,n),r=H.get(o);(null==r?void 0:r.disabled)||(e.has(o)?e.delete(o):e.add(o))});let t=Array.from(e);s&&(I.deprecated(!1,"onSelectInvert","onChange"),s(t)),F(t,"invert")}}:e===tx?{key:"none",text:Z.selectNone,onSelect(){null==u||u(),F(Array.from(W).filter(e=>{let t=H.get(e);return null==t?void 0:t.disabled}),"none")}}:e).map(e=>Object.assign(Object.assign({},e),{onSelect:function(){for(var t,n=arguments.length,o=Array(n),r=0;r{var n;let o,r,l;if(!t)return e.filter(e=>e!==tv);let c=(0,ei.Z)(e),i=new Set(W),s=z.map(E).filter(e=>!H.get(e).disabled),u=s.every(e=>i.has(e)),k=s.some(e=>i.has(e));if("radio"!==m){let e;if(X){let t={getPopupContainer:K,items:X.map((e,t)=>{let{key:n,text:o,onSelect:r}=e;return{key:null!=n?n:t,onClick:()=>{null==r||r(s)},label:o}})};e=a.createElement("div",{className:"".concat(x,"-selection-extra")},a.createElement(tg.Z,{menu:t,getPopupContainer:K},a.createElement("span",null,a.createElement(eW.Z,null))))}let t=z.map((e,t)=>{let n=E(e,t),o=H.get(n)||{};return Object.assign({checked:i.has(n)},o)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===z.length,l=n&&t.every(e=>{let{checked:t}=e;return t}),c=n&&t.some(e=>{let{checked:t}=e;return t});r=a.createElement(tm.Z,{checked:n?l:!!z.length&&u,indeterminate:n?!l&&c:!u&&k,onChange:()=>{let e=[];u?s.forEach(t=>{i.delete(t),e.push(t)}):s.forEach(t=>{i.has(t)||(i.add(t),e.push(t))});let t=Array.from(i);null==d||d(!u,t.map(e=>S(e)),e.map(e=>S(e))),F(t,"all"),P(null)},disabled:0===z.length||n,"aria-label":e?"Custom selection":"Select all",skipGroup:!0}),o=!b&&a.createElement("div",{className:"".concat(x,"-selection")},r,e)}if(l="radio"===m?(e,t,n)=>{let o=E(t,n),r=i.has(o);return{node:a.createElement(th.ZP,Object.assign({},H.get(o),{checked:r,onClick:e=>e.stopPropagation(),onChange:e=>{i.has(o)||V(o,!0,[o],e.nativeEvent)}})),checked:r}}:(e,t,n)=>{var o;let r;let l=E(t,n),c=i.has(l),d=q.has(l),u=H.get(l);return r="nest"===w?d:null!==(o=null==u?void 0:u.indeterminate)&&void 0!==o?o:d,{node:a.createElement(tm.Z,Object.assign({},u,{indeterminate:r,checked:c,skipGroup:!0,onClick:e=>e.stopPropagation(),onChange:e=>{let{nativeEvent:t}=e,{shiftKey:n}=t,o=s.findIndex(e=>e===l),r=A.some(e=>s.includes(e));if(n&&y&&r){let e=R(o,s,i),t=Array.from(i);null==f||f(!c,t.map(e=>S(e)),e.map(e=>S(e))),F(t,"multiple")}else if(y){let e=c?tn(A,l):to(A,l);V(l,!c,e,t)}else{let{checkedKeys:e,halfCheckedKeys:n}=tu([].concat((0,ei.Z)(A),[l]),!0,B,L),o=e;if(c){let t=new Set(e);t.delete(l),o=tu(Array.from(t),{checked:!1,halfCheckedKeys:n},B,L).checkedKeys}V(l,!c,o,t)}c?P(null):P(o)}})),checked:c}},!c.includes(tv)){if(0===c.findIndex(e=>{var t;return(null===(t=e[ea])||void 0===t?void 0:t.columnType)==="EXPAND_COLUMN"})){let[e,...t]=c;c=[e,tv].concat((0,ei.Z)(t))}else c=[tv].concat((0,ei.Z)(c))}let C=c.indexOf(tv),N=(c=c.filter((e,t)=>e!==tv||t===C))[C-1],Z=c[C+1],I=h;void 0===I&&((null==Z?void 0:Z.fixed)!==void 0?I=Z.fixed:(null==N?void 0:N.fixed)!==void 0&&(I=N.fixed)),I&&N&&(null===(n=N[ea])||void 0===n?void 0:n.columnType)==="EXPAND_COLUMN"&&void 0===N.fixed&&(N.fixed=I);let D=O()("".concat(x,"-selection-col"),{["".concat(x,"-selection-col-with-dropdown")]:g&&"checkbox"===m}),M={fixed:I,width:p,className:"".concat(x,"-selection-column"),title:(null==t?void 0:t.columnTitle)?"function"==typeof t.columnTitle?t.columnTitle(r):t.columnTitle:o,render:(e,t,n)=>{let{node:o,checked:r}=l(e,t,n);return v?v(r,t,n,o):o},onCell:t.onCell,[ea]:{className:D}};return c.map(e=>e===tv?M:e)},[E,z,t,A,W,q,p,X,w,H,f,V,L]),W]},tE=n(53346);function tw(e){return null!=e&&e===e.window}var tN=n(71744),tZ=n(91086),tO=n(64024),tK=n(33759),tI=n(28617),tR=n(13823),tP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},tD=n(55015),tM=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:tP}))}),tT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},tj=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:tT}))}),tB=n(15327),tz=n(77565),tH=n(95814),tL={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},tA=["10","20","50","100"],t_=function(e){var t=e.pageSizeOptions,n=void 0===t?tA:t,o=e.locale,r=e.changeSize,l=e.pageSize,c=e.goButton,d=e.quickGo,s=e.rootPrefixCls,u=e.selectComponentClass,f=e.selectPrefixCls,p=e.disabled,m=e.buildOptionText,g=a.useState(""),h=(0,i.Z)(g,2),v=h[0],b=h[1],y=function(){return!v||Number.isNaN(v)?void 0:Number(v)},x="function"==typeof m?m:function(e){return"".concat(e," ").concat(o.items_per_page)},k=function(e){""!==v&&(e.keyCode===tH.Z.ENTER||"click"===e.type)&&(b(""),null==d||d(y()))},C="".concat(s,"-options");if(!r&&!d)return null;var S=null,E=null,w=null;if(r&&u){var N=(n.some(function(e){return e.toString()===l.toString()})?n:n.concat([l.toString()]).sort(function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))})).map(function(e,t){return a.createElement(u.Option,{key:t,value:e.toString()},x(e))});S=a.createElement(u,{disabled:p,prefixCls:f,showSearch:!1,className:"".concat(C,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(l||n[0]).toString(),onChange:function(e){null==r||r(Number(e))},getPopupContainer:function(e){return e.parentNode},"aria-label":o.page_size,defaultOpen:!1},N)}return d&&(c&&(w="boolean"==typeof c?a.createElement("button",{type:"button",onClick:k,onKeyUp:k,disabled:p,className:"".concat(C,"-quick-jumper-button")},o.jump_to_confirm):a.createElement("span",{onClick:k,onKeyUp:k},c)),E=a.createElement("div",{className:"".concat(C,"-quick-jumper")},o.jump_to,a.createElement("input",{disabled:p,type:"text",value:v,onChange:function(e){b(e.target.value)},onKeyUp:k,onBlur:function(e){!c&&""!==v&&(b(""),e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(s,"-item-link"))>=0||e.relatedTarget.className.indexOf("".concat(s,"-item"))>=0)||null==d||d(y()))},"aria-label":o.page}),o.page,w)),a.createElement("li",{className:C},S,E)},tW=function(e){var t,n=e.rootPrefixCls,o=e.page,r=e.active,l=e.className,c=e.showTitle,i=e.onClick,d=e.onKeyPress,s=e.itemRender,u="".concat(n,"-item"),f=O()(u,"".concat(u,"-").concat(o),(t={},(0,N.Z)(t,"".concat(u,"-active"),r),(0,N.Z)(t,"".concat(u,"-disabled"),!o),t),l),p=s(o,"page",a.createElement("a",{rel:"nofollow"},o));return p?a.createElement("li",{title:c?String(o):null,className:f,onClick:function(){i(o)},onKeyDown:function(e){d(e,i,o)},tabIndex:0},p):null},tq=function(e,t,n){return n};function tF(){}function tV(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function tX(e,t,n){return Math.floor((n-1)/(void 0===e?t:e))+1}var tU=function(e){var t,n,o,r,l,c=e.prefixCls,d=void 0===c?"rc-pagination":c,s=e.selectPrefixCls,u=e.className,f=e.selectComponentClass,p=e.current,m=e.defaultCurrent,h=e.total,v=void 0===h?0:h,b=e.pageSize,y=e.defaultPageSize,x=e.onChange,k=void 0===x?tF:x,C=e.hideOnSinglePage,S=e.showPrevNextJumpers,E=e.showQuickJumper,Z=e.showLessItems,K=e.showTitle,I=void 0===K||K,R=e.onShowSizeChange,P=void 0===R?tF:R,D=e.locale,M=void 0===D?tL:D,T=e.style,j=e.totalBoundaryShowSizeChanger,B=e.disabled,z=e.simple,H=e.showTotal,L=e.showSizeChanger,A=e.pageSizeOptions,_=e.itemRender,W=void 0===_?tq:_,q=e.jumpPrevIcon,F=e.jumpNextIcon,V=e.prevIcon,U=e.nextIcon,G=a.useRef(null),Y=(0,tf.Z)(10,{value:b,defaultValue:void 0===y?10:y}),$=(0,i.Z)(Y,2),J=$[0],Q=$[1],ee=(0,tf.Z)(1,{value:p,defaultValue:void 0===m?1:m,postState:function(e){return Math.max(1,Math.min(e,tX(void 0,J,v)))}}),et=(0,i.Z)(ee,2),en=et[0],eo=et[1],er=a.useState(en),ea=(0,i.Z)(er,2),el=ea[0],ec=ea[1];(0,a.useEffect)(function(){ec(en)},[en]);var ei=Math.max(1,en-(Z?3:5)),ed=Math.min(tX(void 0,J,v),en+(Z?3:5));function es(t,n){var o=t||a.createElement("button",{type:"button","aria-label":n,className:"".concat(d,"-item-link")});return"function"==typeof t&&(o=a.createElement(t,(0,w.Z)({},e))),o}function eu(e){var t=e.target.value,n=tX(void 0,J,v);return""===t?t:Number.isNaN(Number(t))?el:t>=n?n:Number(t)}var ef=v>J&&E;function ep(e){var t=eu(e);switch(t!==el&&ec(t),e.keyCode){case tH.Z.ENTER:em(t);break;case tH.Z.UP:em(t-1);break;case tH.Z.DOWN:em(t+1)}}function em(e){if(tV(e)&&e!==en&&tV(v)&&v>0&&!B){var t=tX(void 0,J,v),n=e;return e>t?n=t:e<1&&(n=1),n!==el&&ec(n),eo(n),null==k||k(n,J),n}return en}var eg=en>1,eh=en(void 0===j?50:j);function eb(){eg&&em(en-1)}function ey(){eh&&em(en+1)}function ex(){em(ei)}function ek(){em(ed)}function eC(e,t){if("Enter"===e.key||e.charCode===tH.Z.ENTER||e.keyCode===tH.Z.ENTER){for(var n=arguments.length,o=Array(n>2?n-2:0),r=2;rv?v:en*J])),eZ=null,eO=tX(void 0,J,v);if(C&&v<=J)return null;var eK=[],eI={rootPrefixCls:d,onClick:em,onKeyPress:eC,showTitle:I,itemRender:W,page:-1},eR=en-1>0?en-1:0,eP=en+1=2*ej&&3!==en&&(eK[0]=a.cloneElement(eK[0],{className:O()("".concat(d,"-item-after-jump-prev"),eK[0].props.className)}),eK.unshift(eE)),eO-en>=2*ej&&en!==eO-2){var eF=eK[eK.length-1];eK[eK.length-1]=a.cloneElement(eF,{className:O()("".concat(d,"-item-before-jump-next"),eF.props.className)}),eK.push(eZ)}1!==e_&&eK.unshift(a.createElement(tW,(0,g.Z)({},eI,{key:1,page:1}))),eW!==eO&&eK.push(a.createElement(tW,(0,g.Z)({},eI,{key:eO,page:eO})))}var eV=(t=W(eR,"prev",es(V,"prev page")),a.isValidElement(t)?a.cloneElement(t,{disabled:!eg}):t);if(eV){var eX=!eg||!eO;eV=a.createElement("li",{title:I?M.prev_page:null,onClick:eb,tabIndex:eX?null:0,onKeyDown:function(e){eC(e,eb)},className:O()("".concat(d,"-prev"),(0,N.Z)({},"".concat(d,"-disabled"),eX)),"aria-disabled":eX},eV)}var eU=(n=W(eP,"next",es(U,"next page")),a.isValidElement(n)?a.cloneElement(n,{disabled:!eh}):n);eU&&(z?(r=!eh,l=eg?0:null):l=(r=!eh||!eO)?null:0,eU=a.createElement("li",{title:I?M.next_page:null,onClick:ey,tabIndex:l,onKeyDown:function(e){eC(e,ey)},className:O()("".concat(d,"-next"),(0,N.Z)({},"".concat(d,"-disabled"),r)),"aria-disabled":r},eU));var eG=O()(d,u,(o={},(0,N.Z)(o,"".concat(d,"-simple"),z),(0,N.Z)(o,"".concat(d,"-disabled"),B),o));return a.createElement("ul",(0,g.Z)({className:eG,style:T,ref:G},ew),eN,eV,z?eT:eK,eU,a.createElement(t_,{locale:M,rootPrefixCls:d,disabled:B,selectComponentClass:f,selectPrefixCls:void 0===s?"rc-select":s,changeSize:ev?function(e){var t=tX(e,J,v),n=en>t&&0!==t?t:en;Q(e),ec(n),null==P||P(en,e),eo(n),null==k||k(n,e)}:null,pageSize:J,pageSizeOptions:A,quickGo:ef?em:null,goButton:eM}))},tG=n(96257),tY=n(55274),t$=n(52787);let tJ=e=>a.createElement(t$.default,Object.assign({},e,{showSearch:!0,size:"small"})),tQ=e=>a.createElement(t$.default,Object.assign({},e,{showSearch:!0,size:"middle"}));tJ.Option=t$.default.Option,tQ.Option=t$.default.Option;var t0=n(352),t1=n(31282),t2=n(37433),t3=n(12918),t4=n(3104),t6=n(80669),t8=n(65265);let t5=e=>{let{componentCls:t}=e;return{["".concat(t,"-disabled")]:{"&, &:hover":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},["&".concat(t,"-disabled")]:{cursor:"not-allowed",["".concat(t,"-item")]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},["".concat(t,"-simple&")]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},["".concat(t,"-simple-pager")]:{color:e.colorTextDisabled},["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{["".concat(t,"-item-link-icon")]:{opacity:0},["".concat(t,"-item-ellipsis")]:{opacity:1}}},["&".concat(t,"-simple")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&".concat(t,"-disabled ").concat(t,"-item-link")]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},t7=e=>{let{componentCls:t}=e;return{["&".concat(t,"-mini ").concat(t,"-total-text, &").concat(t,"-mini ").concat(t,"-simple-pager")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-item")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.calc(e.itemSizeSM).sub(2).equal())},["&".concat(t,"-mini:not(").concat(t,"-disabled) ").concat(t,"-item:not(").concat(t,"-item-active)")]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},["&".concat(t,"-mini ").concat(t,"-prev, &").concat(t,"-mini ").concat(t,"-next")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini:not(").concat(t,"-disabled)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover ").concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["\n &".concat(t,"-mini ").concat(t,"-prev ").concat(t,"-item-link,\n &").concat(t,"-mini ").concat(t,"-next ").concat(t,"-item-link\n ")]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}},["&".concat(t,"-mini ").concat(t,"-jump-prev, &").concat(t,"-mini ").concat(t,"-jump-next")]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-options")]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),input:Object.assign(Object.assign({},(0,t1.x0)(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},t9=e=>{let{componentCls:t}=e;return{["\n &".concat(t,"-simple ").concat(t,"-prev,\n &").concat(t,"-simple ").concat(t,"-next\n ")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),verticalAlign:"top",["".concat(t,"-item-link")]:{height:e.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}}},["&".concat(t,"-simple ").concat(t,"-simple-pager")]:{display:"inline-block",height:e.itemSizeSM,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:e.marginXS,padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),textAlign:"center",backgroundColor:e.itemInputBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadius,outline:"none",transition:"border-color ".concat(e.motionDurationMid),color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:"".concat((0,t0.bf)(e.inputOutlineOffset)," 0 ").concat((0,t0.bf)(e.controlOutlineWidth)," ").concat(e.controlOutline)},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}}}},ne=e=>{let{componentCls:t}=e;return{["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{outline:0,["".concat(t,"-item-container")]:{position:"relative",["".concat(t,"-item-link-icon")]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:"all ".concat(e.motionDurationMid),"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},["".concat(t,"-item-ellipsis")]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:"all ".concat(e.motionDurationMid)}},"&:hover":{["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}}},["\n ".concat(t,"-prev,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{marginInlineEnd:e.marginXS},["\n ".concat(t,"-prev,\n ").concat(t,"-next,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:"".concat((0,t0.bf)(e.itemSize)),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:"all ".concat(e.motionDurationMid)},["".concat(t,"-prev, ").concat(t,"-next")]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},["".concat(t,"-item-link")]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:"none",transition:"all ".concat(e.motionDurationMid)},["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover")]:{["".concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["".concat(t,"-slash")]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},["".concat(t,"-options")]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:(0,t0.bf)(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},(0,t1.ik)(e)),(0,t8.$U)(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},(0,t8.Xy)(e)),width:e.calc(e.controlHeightLG).mul(1.25).equal(),height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},nt=e=>{let{componentCls:t}=e;return{["".concat(t,"-item")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),color:e.colorText,"&:hover":{textDecoration:"none"}},["&:not(".concat(t,"-item-active)")]:{"&:hover":{transition:"all ".concat(e.motionDurationMid),backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}}}},nn=e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,t3.Wf)(e)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},["".concat(t,"-total-text")]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),nt(e)),ne(e)),t9(e)),t7(e)),t5(e)),{["@media only screen and (max-width: ".concat(e.screenLG,"px)")]:{["".concat(t,"-item")]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},["@media only screen and (max-width: ".concat(e.screenSM,"px)")]:{["".concat(t,"-options")]:{display:"none"}}}),["&".concat(e.componentCls,"-rtl")]:{direction:"rtl"}}},no=e=>{let{componentCls:t}=e;return{["".concat(t,":not(").concat(t,"-disabled)")]:{["".concat(t,"-item")]:Object.assign({},(0,t3.Qy)(e)),["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{"&:focus-visible":Object.assign({["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}},(0,t3.oN)(e))},["".concat(t,"-prev, ").concat(t,"-next")]:{["&:focus-visible ".concat(t,"-item-link")]:Object.assign({},(0,t3.oN)(e))}}}},nr=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},(0,t2.T)(e)),na=e=>(0,t4.TS)(e,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginXXS,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},(0,t2.e)(e));var nl=(0,t6.I$)("Pagination",e=>{let t=na(e);return[nn(t),no(t)]},nr),nc=n(29961);let ni=e=>{let{componentCls:t}=e;return{["".concat(t).concat(t,"-bordered").concat(t,"-disabled:not(").concat(t,"-mini)")]:{"&, &:hover":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},"&:focus-visible":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},["".concat(t,"-item, ").concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,["&:hover:not(".concat(t,"-item-active)")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},["&".concat(t,"-item-active")]:{backgroundColor:e.itemActiveBgDisabled}},["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},["".concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},["".concat(t).concat(t,"-bordered:not(").concat(t,"-mini)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},["".concat(t,"-item-link")]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},["&:hover ".concat(t,"-item-link")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},["&".concat(t,"-disabled")]:{["".concat(t,"-item-link")]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},["".concat(t,"-item")]:{backgroundColor:e.itemBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),["&:hover:not(".concat(t,"-item-active)")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}};var nd=(0,t6.bk)(["Pagination","bordered"],e=>[ni(na(e))],nr),ns=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},nu=e=>{let{prefixCls:t,selectPrefixCls:n,className:o,rootClassName:r,style:l,size:c,locale:i,selectComponentClass:d,responsive:s,showSizeChanger:u}=e,f=ns(e,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:p}=(0,tI.Z)(s),[,m]=(0,nc.ZP)(),{getPrefixCls:g,direction:h,pagination:v={}}=a.useContext(tN.E_),b=g("pagination",t),[y,x,k]=nl(b),C=null!=u?u:v.showSizeChanger,S=a.useMemo(()=>{let e=a.createElement("span",{className:"".concat(b,"-item-ellipsis")},"•••"),t=a.createElement("button",{className:"".concat(b,"-item-link"),type:"button",tabIndex:-1},"rtl"===h?a.createElement(tz.Z,null):a.createElement(tB.Z,null));return{prevIcon:t,nextIcon:a.createElement("button",{className:"".concat(b,"-item-link"),type:"button",tabIndex:-1},"rtl"===h?a.createElement(tB.Z,null):a.createElement(tz.Z,null)),jumpPrevIcon:a.createElement("a",{className:"".concat(b,"-item-link")},a.createElement("div",{className:"".concat(b,"-item-container")},"rtl"===h?a.createElement(tj,{className:"".concat(b,"-item-link-icon")}):a.createElement(tM,{className:"".concat(b,"-item-link-icon")}),e)),jumpNextIcon:a.createElement("a",{className:"".concat(b,"-item-link")},a.createElement("div",{className:"".concat(b,"-item-container")},"rtl"===h?a.createElement(tM,{className:"".concat(b,"-item-link-icon")}):a.createElement(tj,{className:"".concat(b,"-item-link-icon")}),e))}},[h,b]),[E]=(0,tY.Z)("Pagination",tG.Z),w=Object.assign(Object.assign({},E),i),N=(0,tK.Z)(c),Z="small"===N||!!(p&&!N&&s),K=g("select",n),I=O()({["".concat(b,"-mini")]:Z,["".concat(b,"-rtl")]:"rtl"===h,["".concat(b,"-bordered")]:m.wireframe},null==v?void 0:v.className,o,r,x,k),R=Object.assign(Object.assign({},null==v?void 0:v.style),l);return y(a.createElement(a.Fragment,null,m.wireframe&&a.createElement(nd,{prefixCls:b}),a.createElement(tU,Object.assign({},S,f,{style:R,prefixCls:b,selectPrefixCls:K,className:I,selectComponentClass:d||(Z?tJ:tQ),locale:w,showSizeChanger:C}))))},nf=n(87908);function np(e,t){return"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t}function nm(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}function ng(e,t){return"function"==typeof e?e(t):e}var nh={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},nv=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:nh}))}),nb=n(51646),ny=n(73002),nx=n(85180),nk=n(45937),nC=n(88208);function nS(e){if(null==e)throw TypeError("Cannot destructure "+e)}var nE=n(47970),nw=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],nN=function(e,t){var n,o,r,l,c,d=e.className,u=e.style,f=e.motion,p=e.motionNodes,m=e.motionType,h=e.onMotionStart,v=e.onMotionEnd,b=e.active,y=e.treeNodeRequiredProps,x=(0,H.Z)(e,nw),k=a.useState(!0),C=(0,i.Z)(k,2),S=C[0],E=C[1],w=a.useContext(eG).prefixCls,N=p&&"hide"!==m;(0,s.Z)(function(){p&&N!==S&&E(N)},[p]);var Z=a.useRef(!1),K=function(){p&&!Z.current&&(Z.current=!0,v())};return(n=function(){p&&h()},o=a.useState(!1),l=(r=(0,i.Z)(o,2))[0],c=r[1],(0,s.Z)(function(){if(l)return n(),function(){K()}},[l]),(0,s.Z)(function(){return c(!0),function(){c(!1)}},[]),p)?a.createElement(nE.ZP,(0,g.Z)({ref:t,visible:S},f,{motionAppear:"show"===m,onVisibleChanged:function(e){N===e&&K()}}),function(e,t){var n=e.className,o=e.style;return a.createElement("div",{ref:t,className:O()("".concat(w,"-treenode-motion"),n),style:o},p.map(function(e){var t=(0,g.Z)({},(nS(e.data),e.data)),n=e.title,o=e.key,r=e.isStart,l=e.isEnd;delete t.children;var c=e6(o,y);return a.createElement(tt,(0,g.Z)({},t,c,{title:n,active:b,data:e.data,key:o,isStart:r,isEnd:l}))}))}):a.createElement(tt,(0,g.Z)({domRef:t,className:d,style:u},x,{active:b}))};nN.displayName="MotionTreeNode";var nZ=a.forwardRef(nN);function nO(e,t,n){var o=e.findIndex(function(e){return e.key===n}),r=e[o+1],a=t.findIndex(function(e){return e.key===n});if(r){var l=t.findIndex(function(e){return e.key===r.key});return t.slice(a+1,l)}return t.slice(a+1)}var nK=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],nI={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},nR=function(){},nP="RC_TREE_MOTION_".concat(Math.random()),nD={key:nP},nM={key:nP,level:0,index:0,pos:"0",node:nD,nodes:[nD]},nT={parent:null,children:[],pos:nM.pos,data:nD,title:null,key:nP,isStart:[],isEnd:[]};function nj(e,t,n,o){return!1!==t&&n?e.slice(0,Math.ceil(n/o)+1):e}function nB(e){return e0(e.key,e.pos)}var nz=a.forwardRef(function(e,t){var n=e.prefixCls,o=e.data,r=(e.selectable,e.checkable,e.expandedKeys),l=e.selectedKeys,c=e.checkedKeys,d=e.loadedKeys,u=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,m=e.disabled,h=e.dragging,v=e.dragOverNodeKey,b=e.dropPosition,y=e.motion,x=e.height,k=e.itemHeight,C=e.virtual,S=e.focusable,E=e.activeItem,w=e.focused,N=e.tabIndex,Z=e.onKeyDown,O=e.onFocus,K=e.onBlur,I=e.onActiveChange,R=e.onListChangeStart,P=e.onListChangeEnd,D=(0,H.Z)(e,nK),M=a.useRef(null),T=a.useRef(null);a.useImperativeHandle(t,function(){return{scrollTo:function(e){M.current.scrollTo(e)},getIndentWidth:function(){return T.current.offsetWidth}}});var j=a.useState(r),B=(0,i.Z)(j,2),z=B[0],L=B[1],A=a.useState(o),_=(0,i.Z)(A,2),W=_[0],q=_[1],F=a.useState(o),V=(0,i.Z)(F,2),X=V[0],U=V[1],G=a.useState([]),Y=(0,i.Z)(G,2),$=Y[0],J=Y[1],Q=a.useState(null),ee=(0,i.Z)(Q,2),et=ee[0],en=ee[1],eo=a.useRef(o);function er(){var e=eo.current;q(e),U(e),J([]),en(null),P()}eo.current=o,(0,s.Z)(function(){L(r);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,o=t.length;if(1!==Math.abs(n-o))return{add:!1,key:null};function r(e,t){var n=new Map;e.forEach(function(e){n.set(e,!0)});var o=t.filter(function(e){return!n.has(e)});return 1===o.length?o[0]:null}return n ").concat(t);return t}(E)),a.createElement("div",null,a.createElement("input",{style:nI,disabled:!1===S||m,tabIndex:!1!==S?N:null,onKeyDown:Z,onFocus:O,onBlur:K,value:"",onChange:nR,"aria-label":"for screen reader"})),a.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},a.createElement("div",{className:"".concat(n,"-indent")},a.createElement("div",{ref:T,className:"".concat(n,"-indent-unit")}))),a.createElement(eM.Z,(0,g.Z)({},D,{data:ea,itemKey:nB,height:x,fullHeight:!1,virtual:C,itemHeight:k,prefixCls:"".concat(n,"-list"),ref:M,onVisibleChange:function(e,t){var n=new Set(e);t.filter(function(e){return!n.has(e)}).some(function(e){return nB(e)===nP})&&er()}}),function(e){var t=e.pos,n=(0,g.Z)({},(nS(e.data),e.data)),o=e.title,r=e.key,l=e.isStart,c=e.isEnd,i=e0(r,t);delete n.key,delete n.children;var d=e6(i,el);return a.createElement(nZ,(0,g.Z)({},n,d,{title:o,active:!!E&&r===E.key,pos:t,data:e.data,isStart:l,isEnd:c,motion:y,motionNodes:r===nP?$:null,motionType:et,onMotionStart:R,onMotionEnd:er,treeNodeRequiredProps:el,onMouseMove:function(){I(null)}}))}))});nz.displayName="NodeList";var nH=function(e){(0,eX.Z)(n,e);var t=(0,eU.Z)(n);function n(){var e;(0,eq.Z)(this,n);for(var o=arguments.length,r=Array(o),l=0;l0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var n=t.key,r=t.children;o.push(n),e(r)})}(l[i].children),o),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(d),window.addEventListener("dragend",e.onWindowDragEnd),null==c||c({event:t,node:e8(n.props)})},e.onNodeDragEnter=function(t,n){var o=e.state,r=o.expandedKeys,a=o.keyEntities,l=o.dragChildrenKeys,c=o.flattenNodes,i=o.indent,d=e.props,s=d.onDragEnter,u=d.onExpand,f=d.allowDrop,p=d.direction,m=n.props,g=m.pos,h=m.eventKey,v=(0,eV.Z)(e).dragNode;if(e.currentMouseOverDroppableNodeKey!==h&&(e.currentMouseOverDroppableNodeKey=h),!v){e.resetDragState();return}var b=ta(t,v,n,i,e.dragStartMousePosition,f,c,a,r,p),y=b.dropPosition,x=b.dropLevelOffset,k=b.dropTargetKey,C=b.dropContainerKey,S=b.dropTargetPos,E=b.dropAllowed,w=b.dragOverNodeKey;if(-1!==l.indexOf(k)||!E||(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach(function(t){clearTimeout(e.delayedDragEnterLogic[t])}),v.props.eventKey!==n.props.eventKey&&(t.persist(),e.delayedDragEnterLogic[g]=window.setTimeout(function(){if(null!==e.state.draggingNodeKey){var o=(0,ei.Z)(r),l=a[n.props.eventKey];l&&(l.children||[]).length&&(o=to(r,n.props.eventKey)),"expandedKeys"in e.props||e.setExpandedKeys(o),null==u||u(o,{node:e8(n.props),expanded:!0,nativeEvent:t.nativeEvent})}},800)),v.props.eventKey===k&&0===x)){e.resetDragState();return}e.setState({dragOverNodeKey:w,dropPosition:y,dropLevelOffset:x,dropTargetKey:k,dropContainerKey:C,dropTargetPos:S,dropAllowed:E}),null==s||s({event:t,node:e8(n.props),expandedKeys:r})},e.onNodeDragOver=function(t,n){var o=e.state,r=o.dragChildrenKeys,a=o.flattenNodes,l=o.keyEntities,c=o.expandedKeys,i=o.indent,d=e.props,s=d.onDragOver,u=d.allowDrop,f=d.direction,p=(0,eV.Z)(e).dragNode;if(p){var m=ta(t,p,n,i,e.dragStartMousePosition,u,a,l,c,f),g=m.dropPosition,h=m.dropLevelOffset,v=m.dropTargetKey,b=m.dropContainerKey,y=m.dropAllowed,x=m.dropTargetPos,k=m.dragOverNodeKey;-1===r.indexOf(v)&&y&&(p.props.eventKey===v&&0===h?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():g===e.state.dropPosition&&h===e.state.dropLevelOffset&&v===e.state.dropTargetKey&&b===e.state.dropContainerKey&&x===e.state.dropTargetPos&&y===e.state.dropAllowed&&k===e.state.dragOverNodeKey||e.setState({dropPosition:g,dropLevelOffset:h,dropTargetKey:v,dropContainerKey:b,dropTargetPos:x,dropAllowed:y,dragOverNodeKey:k}),null==s||s({event:t,node:e8(n.props)}))}},e.onNodeDragLeave=function(t,n){e.currentMouseOverDroppableNodeKey!==n.props.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var o=e.props.onDragLeave;null==o||o({event:t,node:e8(n.props)})},e.onWindowDragEnd=function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDragEnd=function(t,n){var o=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==o||o({event:t,node:e8(n.props)}),e.dragNode=null,window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDrop=function(t,n){var o,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,l=a.dragChildrenKeys,c=a.dropPosition,i=a.dropTargetKey,d=a.dropTargetPos;if(a.dropAllowed){var s=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==i){var u=(0,w.Z)((0,w.Z)({},e6(i,e.getTreeNodeRequiredProps())),{},{active:(null===(o=e.getActiveItem())||void 0===o?void 0:o.key)===i,data:e.state.keyEntities[i].node}),f=-1!==l.indexOf(i);(0,R.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=tr(d),m={event:t,node:e8(u),dragNode:e.dragNode?e8(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(l),dropToGap:0!==c,dropPosition:c+Number(p[p.length-1])};r||null==s||s(m),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(t,n){var o=e.state,r=o.expandedKeys,a=o.flattenNodes,l=n.expanded,c=n.key;if(!n.isLeaf&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey){var i=a.filter(function(e){return e.key===c})[0],d=e8((0,w.Z)((0,w.Z)({},e6(c,e.getTreeNodeRequiredProps())),{},{data:i.data}));e.setExpandedKeys(l?tn(r,c):to(r,c)),e.onNodeExpand(t,d)}},e.onNodeClick=function(t,n){var o=e.props,r=o.onClick;"click"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)},e.onNodeDoubleClick=function(t,n){var o=e.props,r=o.onDoubleClick;"doubleClick"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)},e.onNodeSelect=function(t,n){var o=e.state.selectedKeys,r=e.state,a=r.keyEntities,l=r.fieldNames,c=e.props,i=c.onSelect,d=c.multiple,s=n.selected,u=n[l.key],f=!s,p=(o=f?d?to(o,u):[u]:tn(o,u)).map(function(e){var t=a[e];return t?t.node:null}).filter(function(e){return e});e.setUncontrolledState({selectedKeys:o}),null==i||i(o,{event:"select",selected:f,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,o){var r,a=e.state,l=a.keyEntities,c=a.checkedKeys,i=a.halfCheckedKeys,d=e.props,s=d.checkStrictly,u=d.onCheck,f=n.key,p={event:"check",node:n,checked:o,nativeEvent:t.nativeEvent};if(s){var m=o?to(c,f):tn(c,f);r={checked:m,halfChecked:tn(i,f)},p.checkedNodes=m.map(function(e){return l[e]}).filter(function(e){return e}).map(function(e){return e.node}),e.setUncontrolledState({checkedKeys:m})}else{var g=tu([].concat((0,ei.Z)(c),[f]),!0,l),h=g.checkedKeys,v=g.halfCheckedKeys;if(!o){var b=new Set(h);b.delete(f);var y=tu(Array.from(b),{checked:!1,halfCheckedKeys:v},l);h=y.checkedKeys,v=y.halfCheckedKeys}r=h,p.checkedNodes=[],p.checkedNodesPositions=[],p.halfCheckedKeys=v,h.forEach(function(e){var t=l[e];if(t){var n=t.node,o=t.pos;p.checkedNodes.push(n),p.checkedNodesPositions.push({node:n,pos:o})}}),e.setUncontrolledState({checkedKeys:h},!1,{halfCheckedKeys:v})}null==u||u(r,p)},e.onNodeLoad=function(t){var n=t.key,o=new Promise(function(o,r){e.setState(function(a){var l=a.loadedKeys,c=a.loadingKeys,i=void 0===c?[]:c,d=e.props,s=d.loadData,u=d.onLoad;return s&&-1===(void 0===l?[]:l).indexOf(n)&&-1===i.indexOf(n)?(s(t).then(function(){var r=to(e.state.loadedKeys,n);null==u||u(r,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:r}),e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),o()}).catch(function(t){if(e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),e.loadingRetryTimes[n]=(e.loadingRetryTimes[n]||0)+1,e.loadingRetryTimes[n]>=10){var a=e.state.loadedKeys;(0,R.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:to(a,n)}),o()}r(t)}),{loadingKeys:to(i,n)}):null})});return o.catch(function(){}),o},e.onNodeMouseEnter=function(t,n){var o=e.props.onMouseEnter;null==o||o({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var o=e.props.onMouseLeave;null==o||o({event:t,node:n})},e.onNodeContextMenu=function(t,n){var o=e.props.onRightClick;o&&(t.preventDefault(),o({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,o=Array(n),r=0;r1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var r=!1,a=!0,l={};Object.keys(t).forEach(function(n){if(n in e.props){a=!1;return}r=!0,l[n]=t[n]}),r&&(!n||a)&&e.setState((0,w.Z)((0,w.Z)({},l),o))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return(0,eF.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props,t=e.activeKey,n=e.itemScrollOffset;void 0!==t&&t!==this.state.activeKey&&(this.setState({activeKey:t}),null!==t&&this.scrollTo({key:t,offset:void 0===n?0:n}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t,n=this.state,o=n.focused,r=n.flattenNodes,l=n.keyEntities,c=n.draggingNodeKey,i=n.activeKey,d=n.dropLevelOffset,s=n.dropContainerKey,u=n.dropTargetKey,f=n.dropPosition,p=n.dragOverNodeKey,m=n.indent,h=this.props,v=h.prefixCls,b=h.className,y=h.style,x=h.showLine,k=h.focusable,C=h.tabIndex,S=h.selectable,w=h.showIcon,Z=h.icon,K=h.switcherIcon,I=h.draggable,R=h.checkable,P=h.checkStrictly,D=h.disabled,M=h.motion,T=h.loadData,j=h.filterTreeNode,B=h.height,z=h.itemHeight,H=h.virtual,L=h.titleRender,A=h.dropIndicatorRender,_=h.onContextMenu,W=h.onScroll,q=h.direction,F=h.rootClassName,V=h.rootStyle,U=(0,X.Z)(this.props,{aria:!0,data:!0});return I&&(t="object"===(0,E.Z)(I)?I:"function"==typeof I?{nodeDraggable:I}:{}),a.createElement(eG.Provider,{value:{prefixCls:v,selectable:S,showIcon:w,icon:Z,switcherIcon:K,draggable:t,draggingNodeKey:c,checkable:R,checkStrictly:P,disabled:D,keyEntities:l,dropLevelOffset:d,dropContainerKey:s,dropTargetKey:u,dropPosition:f,dragOverNodeKey:p,indent:m,direction:q,dropIndicatorRender:A,loadData:T,filterTreeNode:j,titleRender:L,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},a.createElement("div",{role:"tree",className:O()(v,b,F,(e={},(0,N.Z)(e,"".concat(v,"-show-line"),x),(0,N.Z)(e,"".concat(v,"-focused"),o),(0,N.Z)(e,"".concat(v,"-active-focused"),null!==i),e)),style:V},a.createElement(nz,(0,g.Z)({ref:this.listRef,prefixCls:v,style:y,data:r,disabled:D,selectable:S,checkable:!!R,motion:M,dragging:null!==c,height:B,itemHeight:z,virtual:H,focusable:k,focused:o,tabIndex:void 0===C?0:C,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:_,onScroll:W},this.getTreeNodeRequiredProps(),U))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,o,r=t.prevProps,a={prevProps:e};function l(t){return!r&&t in e||r&&r[t]!==e[t]}var c=t.fieldNames;if(l("fieldNames")&&(c=e1(e.fieldNames),a.fieldNames=c),l("treeData")?n=e.treeData:l("children")&&((0,R.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=e2(e.children)),n){a.treeData=n;var i=e4(n,{fieldNames:c});a.keyEntities=(0,w.Z)((0,N.Z)({},nP,nM),i.keyEntities)}var d=a.keyEntities||t.keyEntities;if(l("expandedKeys")||r&&l("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!r&&e.defaultExpandParent?ti(e.expandedKeys,d):e.expandedKeys;else if(!r&&e.defaultExpandAll){var s=(0,w.Z)({},d);delete s[nP],a.expandedKeys=Object.keys(s).map(function(e){return s[e].key})}else!r&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?ti(e.defaultExpandedKeys,d):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var u=e3(n||t.treeData,a.expandedKeys||t.expandedKeys,c);a.flattenNodes=u}if(e.selectable&&(l("selectedKeys")?a.selectedKeys=tl(e.selectedKeys,e):!r&&e.defaultSelectedKeys&&(a.selectedKeys=tl(e.defaultSelectedKeys,e))),e.checkable&&(l("checkedKeys")?o=tc(e.checkedKeys)||{}:!r&&e.defaultCheckedKeys?o=tc(e.defaultCheckedKeys)||{}:n&&(o=tc(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),o)){var f=o,p=f.checkedKeys,m=void 0===p?[]:p,g=f.halfCheckedKeys,h=void 0===g?[]:g;if(!e.checkStrictly){var v=tu(m,!0,d);m=v.checkedKeys,h=v.halfCheckedKeys}a.checkedKeys=m,a.halfCheckedKeys=h}return l("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(a.Component);nH.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,o=e.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:r.top=0,r.left=-n*o;break;case 1:r.bottom=0,r.left=-n*o;break;case 0:r.bottom=0,r.left=o}return a.createElement("div",{style:r})},allowDrop:function(){return!0},expandAction:!1},nH.TreeNode=tt;var nL={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},nA=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:nL}))}),n_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},nW=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:n_}))}),nq={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},nF=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:nq}))}),nV={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},nX=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:nV}))}),nU=n(68710),nG=n(23159),nY=n(63074);let n$=new t0.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nJ=(e,t)=>({[".".concat(e,"-switcher-icon")]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:"transform ".concat(t.motionDurationSlow)}}}),nQ=(e,t)=>({[".".concat(e,"-drop-indicator")]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:"".concat((0,t0.bf)(t.lineWidthBold)," solid ").concat(t.colorPrimary),borderRadius:"50%",content:'""'}}}),n0=(e,t)=>{let{treeCls:n,treeNodeCls:o,treeNodePadding:r,titleHeight:a,nodeSelectedBg:l,nodeHoverBg:c}=t,i=t.paddingXS;return{[n]:Object.assign(Object.assign({},(0,t3.Wf)(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:"background-color ".concat(t.motionDurationSlow),["&".concat(n,"-rtl")]:{["".concat(n,"-switcher")]:{"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(90deg)"}}}}},["&-focused:not(:hover):not(".concat(n,"-active-focused)")]:Object.assign({},(0,t3.oN)(t)),["".concat(n,"-list-holder-inner")]:{alignItems:"flex-start"},["&".concat(n,"-block-node")]:{["".concat(n,"-list-holder-inner")]:{alignItems:"stretch",["".concat(n,"-node-content-wrapper")]:{flex:"auto"},["".concat(o,".dragging")]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,border:"1px solid ".concat(t.colorPrimary),opacity:0,animationName:n$,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},["".concat(o)]:{display:"flex",alignItems:"flex-start",padding:"0 0 ".concat((0,t0.bf)(r)," 0"),outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{["".concat(n,"-node-content-wrapper")]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},["&-active ".concat(n,"-node-content-wrapper")]:{background:t.controlItemBgHover},["&:not(".concat(o,"-disabled).filter-node ").concat(n,"-title")]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",["".concat(n,"-draggable-icon")]:{flexShrink:0,width:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",visibility:"visible",opacity:.2,transition:"opacity ".concat(t.motionDurationSlow),["".concat(o,":hover &")]:{opacity:.45}},["&".concat(o,"-disabled")]:{["".concat(n,"-draggable-icon")]:{visibility:"hidden"}}}},["".concat(n,"-indent")]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:a}},["".concat(n,"-draggable-icon")]:{visibility:"hidden"},["".concat(n,"-switcher")]:Object.assign(Object.assign({},nJ(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,margin:0,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",cursor:"pointer",userSelect:"none",transition:"all ".concat(t.motionDurationSlow),borderRadius:t.borderRadius,"&-noop":{cursor:"unset"},["&:not(".concat(n,"-switcher-noop):hover")]:{backgroundColor:t.colorBgTextHover},"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:"1px solid ".concat(t.colorBorder),content:'""'}}}),["".concat(n,"-checkbox")]:{top:"initial",marginInlineEnd:i,alignSelf:"flex-start",marginTop:t.marginXXS},["".concat(n,"-node-content-wrapper, ").concat(n,"-checkbox + span")]:{position:"relative",zIndex:"auto",minHeight:a,margin:0,padding:"0 ".concat((0,t0.bf)(t.calc(t.paddingXS).div(2).equal())),color:"inherit",lineHeight:"".concat((0,t0.bf)(a)),background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:"all ".concat(t.motionDurationMid,", border 0s, line-height 0s, box-shadow 0s"),"&:hover":{backgroundColor:c},["&".concat(n,"-node-selected")]:{backgroundColor:l},["".concat(n,"-iconEle")]:{display:"inline-block",width:a,height:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},["".concat(n,"-unselectable ").concat(n,"-node-content-wrapper:hover")]:{backgroundColor:"transparent"},["".concat(n,"-node-content-wrapper")]:Object.assign({lineHeight:"".concat((0,t0.bf)(a)),userSelect:"none"},nQ(e,t)),["".concat(o,".drop-container")]:{"> [draggable]":{boxShadow:"0 0 0 2px ".concat(t.colorPrimary)}},"&-show-line":{["".concat(n,"-indent")]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&-end":{"&:before":{display:"none"}}}},["".concat(n,"-switcher")]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},["".concat(o,"-leaf-last")]:{["".concat(n,"-switcher")]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:"".concat((0,t0.bf)(t.calc(a).div(2).equal())," !important")}}}}})}},n1=e=>{let{treeCls:t,treeNodeCls:n,treeNodePadding:o,directoryNodeSelectedBg:r,directoryNodeSelectedColor:a}=e;return{["".concat(t).concat(t,"-directory")]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,transition:"background-color ".concat(e.motionDurationMid),content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},["".concat(t,"-switcher")]:{transition:"color ".concat(e.motionDurationMid)},["".concat(t,"-node-content-wrapper")]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},["&".concat(t,"-node-selected")]:{color:a,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:r},["".concat(t,"-switcher")]:{color:a},["".concat(t,"-node-content-wrapper")]:{color:a,background:"transparent"}}}}}},n2=(e,t)=>{let n=".".concat(e),o=t.calc(t.paddingXS).div(2).equal(),r=(0,t4.TS)(t,{treeCls:n,treeNodeCls:"".concat(n,"-treenode"),treeNodePadding:o});return[n0(e,r),n1(r)]},n3=e=>{let{controlHeightSM:t}=e;return{titleHeight:t,nodeHoverBg:e.controlItemBgHover,nodeSelectedBg:e.controlItemBgActive}};var n4=(0,t6.I$)("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,nG.C2)("".concat(n,"-checkbox"),e)},n2(n,e),(0,nY.Z)(e)]},e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},n3(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})});function n6(e){let{dropPosition:t,dropLevelOffset:n,prefixCls:o,indent:r,direction:l="ltr"}=e,c="ltr"===l?"left":"right",i={[c]:-n*r+4,["ltr"===l?"right":"left"]:0};switch(t){case -1:i.top=-3;break;case 1:i.bottom=-3;break;default:i.bottom=-3,i[c]=r+4}return a.createElement("div",{style:i,className:"".concat(o,"-drop-indicator")})}var n8={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},n5=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:n8}))}),n7=n(61935),n9={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},oe=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:n9}))}),ot={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},on=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:ot}))}),oo=n(19722),or=e=>{let t;let{prefixCls:n,switcherIcon:o,treeNodeProps:r,showLine:l}=e,{isLeaf:c,expanded:i,loading:d}=r;if(d)return a.createElement(n7.Z,{className:"".concat(n,"-switcher-loading-icon")});if(l&&"object"==typeof l&&(t=l.showLeafIcon),c){if(!l)return null;if("boolean"!=typeof t&&t){let e="function"==typeof t?t(r):t;return(0,oo.l$)(e)?(0,oo.Tm)(e,{className:O()(e.props.className||"","".concat(n,"-switcher-line-custom-icon"))}):e}return t?a.createElement(nA,{className:"".concat(n,"-switcher-line-icon")}):a.createElement("span",{className:"".concat(n,"-switcher-leaf-line")})}let s="".concat(n,"-switcher-icon"),u="function"==typeof o?o(r):o;return(0,oo.l$)(u)?(0,oo.Tm)(u,{className:O()(u.props.className||"",s)}):void 0!==u?u:l?i?a.createElement(oe,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(on,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(n5,{className:s})};let oa=a.forwardRef((e,t)=>{var n;let{getPrefixCls:o,direction:r,virtual:l,tree:c}=a.useContext(tN.E_),{prefixCls:i,className:d,showIcon:s=!1,showLine:u,switcherIcon:f,blockNode:p=!1,children:m,checkable:g=!1,selectable:h=!0,draggable:v,motion:b,style:y}=e,x=o("tree",i),k=o(),C=null!=b?b:Object.assign(Object.assign({},(0,nU.Z)(k)),{motionAppear:!1}),S=Object.assign(Object.assign({},e),{checkable:g,selectable:h,showIcon:s,motion:C,blockNode:p,showLine:!!u,dropIndicatorRender:n6}),[E,w,N]=n4(x),[,Z]=(0,nc.ZP)(),K=Z.paddingXS/2+((null===(n=Z.Tree)||void 0===n?void 0:n.titleHeight)||Z.controlHeightSM),I=a.useMemo(()=>{if(!v)return!1;let e={};switch(typeof v){case"function":e.nodeDraggable=v;break;case"object":e=Object.assign({},v)}return!1!==e.icon&&(e.icon=e.icon||a.createElement(nX,null)),e},[v]);return E(a.createElement(nH,Object.assign({itemHeight:K,ref:t,virtual:l},S,{style:Object.assign(Object.assign({},null==c?void 0:c.style),y),prefixCls:x,className:O()({["".concat(x,"-icon-hide")]:!s,["".concat(x,"-block-node")]:p,["".concat(x,"-unselectable")]:!h,["".concat(x,"-rtl")]:"rtl"===r},null==c?void 0:c.className,d,w,N),direction:r,checkable:g?a.createElement("span",{className:"".concat(x,"-checkbox-inner")}):g,selectable:h,switcherIcon:e=>a.createElement(or,{prefixCls:x,switcherIcon:f,treeNodeProps:e,showLine:u}),draggable:I}),m))});function ol(e,t,n){let{key:o,children:r}=n;e.forEach(function(e){let a=e[o],l=e[r];!1!==t(a,e)&&ol(l||[],t,n)})}(o=r||(r={}))[o.None=0]="None",o[o.Start=1]="Start",o[o.End=2]="End";var oc=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};function oi(e){let{isLeaf:t,expanded:n}=e;return t?a.createElement(nA,null):n?a.createElement(nW,null):a.createElement(nF,null)}function od(e){let{treeData:t,children:n}=e;return t||e2(n)}let os=a.forwardRef((e,t)=>{var{defaultExpandAll:n,defaultExpandParent:o,defaultExpandedKeys:l}=e,c=oc(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);let i=a.useRef(),d=a.useRef(),s=()=>{let{keyEntities:e}=e4(od(c));return n?Object.keys(e):o?ti(c.expandedKeys||l||[],e):c.expandedKeys||l},[u,f]=a.useState(c.selectedKeys||c.defaultSelectedKeys||[]),[p,m]=a.useState(()=>s());a.useEffect(()=>{"selectedKeys"in c&&f(c.selectedKeys)},[c.selectedKeys]),a.useEffect(()=>{"expandedKeys"in c&&m(c.expandedKeys)},[c.expandedKeys]);let{getPrefixCls:g,direction:h}=a.useContext(tN.E_),{prefixCls:v,className:b,showIcon:y=!0,expandAction:x="click"}=c,k=oc(c,["prefixCls","className","showIcon","expandAction"]),C=g("tree",v),S=O()("".concat(C,"-directory"),{["".concat(C,"-directory-rtl")]:"rtl"===h},b);return a.createElement(oa,Object.assign({icon:oi,ref:t,blockNode:!0},k,{showIcon:y,expandAction:x,prefixCls:C,className:S,expandedKeys:p,selectedKeys:u,onSelect:(e,t)=>{var n;let o;let{multiple:a,fieldNames:l}=c,{node:s,nativeEvent:u}=t,{key:m=""}=s,g=od(c),h=Object.assign(Object.assign({},t),{selected:!0}),v=(null==u?void 0:u.ctrlKey)||(null==u?void 0:u.metaKey),b=null==u?void 0:u.shiftKey;a&&v?(o=e,i.current=m,d.current=o):a&&b?o=Array.from(new Set([].concat((0,ei.Z)(d.current||[]),(0,ei.Z)(function(e){let{treeData:t,expandedKeys:n,startKey:o,endKey:a,fieldNames:l}=e,c=[],i=r.None;return o&&o===a?[o]:o&&a?(ol(t,e=>{if(i===r.End)return!1;if(e===o||e===a){if(c.push(e),i===r.None)i=r.Start;else if(i===r.Start)return i=r.End,!1}else i===r.Start&&c.push(e);return n.includes(e)},e1(l)),c):[]}({treeData:g,expandedKeys:p,startKey:m,endKey:i.current,fieldNames:l}))))):(o=[m],i.current=m,d.current=o),h.selectedNodes=function(e,t,n){let o=(0,ei.Z)(t),r=[];return ol(e,(e,t)=>{let n=o.indexOf(e);return -1!==n&&(r.push(t),o.splice(n,1)),!!o.length},e1(n)),r}(g,o,l),null===(n=c.onSelect)||void 0===n||n.call(c,o,h),"selectedKeys"in c||f(o)},onExpand:(e,t)=>{var n;return"expandedKeys"in c||m(e),null===(n=c.onExpand)||void 0===n?void 0:n.call(c,e,t)}}))});oa.DirectoryTree=os,oa.TreeNode=tt;var ou=n(29436),of=n(64482),op=function(e){let{value:t,onChange:n,filterSearch:o,tablePrefixCls:r,locale:l}=e;return o?a.createElement("div",{className:"".concat(r,"-filter-dropdown-search")},a.createElement(of.default,{prefix:a.createElement(ou.Z,null),placeholder:l.filterSearchPlaceholder,onChange:n,value:t,htmlSize:1,className:"".concat(r,"-filter-dropdown-search-input")})):null};let om=e=>{let{keyCode:t}=e;t===tH.Z.ENTER&&e.stopPropagation()},og=a.forwardRef((e,t)=>a.createElement("div",{className:e.className,onClick:e=>e.stopPropagation(),onKeyDown:om,ref:t},e.children));function oh(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:o}=e;t.push(n),o&&(t=[].concat((0,ei.Z)(t),(0,ei.Z)(oh(o))))}),t}function ov(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}var ob=function(e){var t,n;let o,r;let{tablePrefixCls:l,prefixCls:c,column:i,dropdownPrefixCls:d,columnKey:s,filterMultiple:f,filterMode:p="menu",filterSearch:m=!1,filterState:g,triggerFilter:h,locale:v,children:b,getPopupContainer:y,rootClassName:x}=e,{filterDropdownOpen:k,onFilterDropdownOpenChange:C,filterResetToDefaultFilteredValue:S,defaultFilteredValue:E,filterDropdownVisible:w,onFilterDropdownVisibleChange:N}=i,[Z,K]=a.useState(!1),I=!!(g&&((null===(t=g.filteredKeys)||void 0===t?void 0:t.length)||g.forceFiltered)),R=e=>{K(e),null==C||C(e),null==N||N(e)},P=null!==(n=null!=k?k:w)&&void 0!==n?n:Z,D=null==g?void 0:g.filteredKeys,[M,T]=function(e){let t=a.useRef(e),n=(0,nb.Z)();return[()=>t.current,e=>{t.current=e,n()}]}(D||[]),j=e=>{let{selectedKeys:t}=e;T(t)};a.useEffect(()=>{Z&&j({selectedKeys:D||[]})},[D]);let[B,z]=a.useState([]),[H,L]=a.useState(""),A=e=>{let{value:t}=e.target;L(t)};a.useEffect(()=>{Z||L("")},[Z]);let _=e=>{let t=e&&e.length?e:null;if(null===t&&(!g||!g.filteredKeys)||(0,u.Z)(t,null==g?void 0:g.filteredKeys,!0))return null;h({column:i,key:s,filteredKeys:t})},W=()=>{R(!1),_(M())},q=function(){let{confirm:e,closeDropdown:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1};e&&_([]),t&&R(!1),L(""),S?T((E||[]).map(e=>String(e))):T([])},F=O()({["".concat(d,"-menu-without-submenu")]:!(i.filters||[]).some(e=>{let{children:t}=e;return t})}),V=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),o={title:e.text,key:void 0!==e.value?n:String(t)};return e.children&&(o.children=V({filters:e.children})),o})},X=e=>{var t;return Object.assign(Object.assign({},e),{text:e.title,value:e.key,children:(null===(t=e.children)||void 0===t?void 0:t.map(e=>X(e)))||[]})};if("function"==typeof i.filterDropdown)o=i.filterDropdown({prefixCls:"".concat(d,"-custom"),setSelectedKeys:e=>j({selectedKeys:e}),selectedKeys:M(),confirm:function(){let{closeDropdown:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0};e&&R(!1),_(M())},clearFilters:q,filters:i.filters,visible:P,close:()=>{R(!1)}});else if(i.filterDropdown)o=i.filterDropdown;else{let e=M()||[];o=a.createElement(a.Fragment,null,0===(i.filters||[]).length?a.createElement(nx.Z,{image:nx.Z.PRESENTED_IMAGE_SIMPLE,description:v.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):"tree"===p?a.createElement(a.Fragment,null,a.createElement(op,{filterSearch:m,value:H,onChange:A,tablePrefixCls:l,locale:v}),a.createElement("div",{className:"".concat(l,"-filter-dropdown-tree")},f?a.createElement(tm.Z,{checked:e.length===oh(i.filters).length,indeterminate:e.length>0&&e.length{e.target.checked?T(oh(null==i?void 0:i.filters).map(e=>String(e))):T([])}},v.filterCheckall):null,a.createElement(oa,{checkable:!0,selectable:!1,blockNode:!0,multiple:f,checkStrictly:!f,className:"".concat(d,"-menu"),onCheck:(e,t)=>{let{node:n,checked:o}=t;f?j({selectedKeys:e}):j({selectedKeys:o&&n.key?[n.key]:[]})},checkedKeys:e,selectedKeys:e,showIcon:!1,treeData:V({filters:i.filters}),autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:H.trim()?e=>"function"==typeof m?m(H,X(e)):ov(H,e.title):void 0}))):a.createElement(a.Fragment,null,a.createElement(op,{filterSearch:m,value:H,onChange:A,tablePrefixCls:l,locale:v}),a.createElement(nk.Z,{selectable:!0,multiple:f,prefixCls:"".concat(d,"-menu"),className:F,onSelect:j,onDeselect:j,selectedKeys:e,getPopupContainer:y,openKeys:B,onOpenChange:e=>{z(e)},items:function e(t){let{filters:n,prefixCls:o,filteredKeys:r,filterMultiple:l,searchValue:c,filterSearch:i}=t;return n.map((t,n)=>{let d=String(t.value);if(t.children)return{key:d||n,label:t.text,popupClassName:"".concat(o,"-dropdown-submenu"),children:e({filters:t.children,prefixCls:o,filteredKeys:r,filterMultiple:l,searchValue:c,filterSearch:i})};let s=l?tm.Z:th.ZP,u={key:void 0!==t.value?d:n,label:a.createElement(a.Fragment,null,a.createElement(s,{checked:r.includes(d)}),a.createElement("span",null,t.text))};return c.trim()?"function"==typeof i?i(c,t)?u:null:ov(c,t.text)?u:null:u})}({filters:i.filters||[],filterSearch:m,prefixCls:c,filteredKeys:M(),filterMultiple:f,searchValue:H})})),a.createElement("div",{className:"".concat(c,"-dropdown-btns")},a.createElement(ny.ZP,{type:"link",size:"small",disabled:S?(0,u.Z)((E||[]).map(e=>String(e)),e,!0):0===e.length,onClick:()=>q()},v.filterReset),a.createElement(ny.ZP,{type:"primary",size:"small",onClick:W},v.filterConfirm)))}i.filterDropdown&&(o=a.createElement(nC.J,{selectable:void 0},o)),r="function"==typeof i.filterIcon?i.filterIcon(I):i.filterIcon?i.filterIcon:a.createElement(nv,null);let{direction:U}=a.useContext(tN.E_);return a.createElement("div",{className:"".concat(c,"-column")},a.createElement("span",{className:"".concat(l,"-column-title")},b),a.createElement(tg.Z,{dropdownRender:()=>a.createElement(og,{className:"".concat(c,"-dropdown")},o),trigger:["click"],open:P,onOpenChange:(e,t)=>{"trigger"===t.source&&(e&&void 0!==D&&T(D||[]),R(e),e||i.filterDropdown||W())},getPopupContainer:y,placement:"rtl"===U?"bottomLeft":"bottomRight",rootClassName:x},a.createElement("span",{role:"button",tabIndex:-1,className:O()("".concat(c,"-trigger"),{active:I}),onClick:e=>{e.stopPropagation()}},r)))};function oy(e,t,n){let o=[];return(e||[]).forEach((e,r)=>{var a;let l=nm(r,n);if(e.filters||"filterDropdown"in e||"onFilter"in e){if("filteredValue"in e){let t=e.filteredValue;"filterDropdown"in e||(t=null!==(a=null==t?void 0:t.map(String))&&void 0!==a?a:t),o.push({column:e,key:np(e,l),filteredKeys:t,forceFiltered:e.filtered})}else o.push({column:e,key:np(e,l),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered})}"children"in e&&(o=[].concat((0,ei.Z)(o),(0,ei.Z)(oy(e.children,t,l))))}),o}function ox(e){let t={};return e.forEach(e=>{let{key:n,filteredKeys:o,column:r}=e,{filters:a,filterDropdown:l}=r;if(l)t[n]=o||null;else if(Array.isArray(o)){let e=oh(a);t[n]=e.filter(e=>o.includes(String(e)))}else t[n]=null}),t}function ok(e,t){return t.reduce((e,t)=>{let{column:{onFilter:n,filters:o},filteredKeys:r}=t;return n&&r&&r.length?e.filter(e=>r.some(t=>{let r=oh(o),a=r.findIndex(e=>String(e)===String(t));return n(-1!==a?r[a]:t,e)})):e},e)}let oC=e=>e.flatMap(e=>"children"in e?[e].concat((0,ei.Z)(oC(e.children||[]))):[e]);var oS=function(e){let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:o,onFilterChange:r,getPopupContainer:l,locale:c,rootClassName:i}=e;(0,tp.ln)("Table");let d=a.useMemo(()=>oC(o||[]),[o]),[s,u]=a.useState(()=>oy(d,!0)),f=a.useMemo(()=>{let e=oy(d,!1);if(0===e.length)return e;let t=!0;if(e.forEach(e=>{let{filteredKeys:n}=e;void 0!==n&&(t=!1)}),t){let e=(d||[]).map((e,t)=>np(e,nm(t)));return s.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=d[e.findIndex(e=>e===t.key)];return Object.assign(Object.assign({},t),{column:Object.assign(Object.assign({},t.column),n),forceFiltered:n.filtered})})}return e},[d,s]),p=a.useMemo(()=>ox(f),[f]),m=e=>{let t=f.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),u(t),r(ox(t),t)};return[e=>(function e(t,n,o,r,l,c,i,d,s){return o.map((o,u)=>{let f=nm(u,d),{filterMultiple:p=!0,filterMode:m,filterSearch:g}=o,h=o;if(h.filters||h.filterDropdown){let e=np(h,f),d=r.find(t=>{let{key:n}=t;return e===n});h=Object.assign(Object.assign({},h),{title:r=>a.createElement(ob,{tablePrefixCls:t,prefixCls:"".concat(t,"-filter"),dropdownPrefixCls:n,column:h,columnKey:e,filterState:d,filterMultiple:p,filterMode:m,filterSearch:g,triggerFilter:c,locale:l,getPopupContainer:i,rootClassName:s},ng(o.title,r))})}return"children"in h&&(h=Object.assign(Object.assign({},h),{children:e(t,n,h.children,r,l,c,i,f,s)})),h})})(t,n,e,f,c,m,l,void 0,i),f,p]},oE=function(){let e=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let t=1;t{let o=n[t];void 0!==o&&(e[t]=o)})}return e},ow=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},oN=function(e,t,n){let o=n&&"object"==typeof n?n:{},{total:r=0}=o,l=ow(o,["total"]),[c,i]=(0,a.useState)(()=>({current:"defaultCurrent"in l?l.defaultCurrent:1,pageSize:"defaultPageSize"in l?l.defaultPageSize:10})),d=oE(c,l,{total:r>0?r:e}),s=Math.ceil((r||e)/d.pageSize);d.current>s&&(d.current=s||1);let u=(e,t)=>{i({current:null!=e?e:1,pageSize:t||d.pageSize})};return!1===n?[{},()=>{}]:[Object.assign(Object.assign({},d),{onChange:(e,o)=>{var r;n&&(null===(r=n.onChange)||void 0===r||r.call(n,e,o)),u(e,o),t(e,o||(null==d?void 0:d.pageSize))}}),u]},oZ={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},oO=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:oZ}))}),oK={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},oI=a.forwardRef(function(e,t){return a.createElement(tD.Z,(0,g.Z)({},e,{ref:t,icon:oK}))}),oR=n(89970);let oP="ascend",oD="descend";function oM(e){return"object"==typeof e.sorter&&"number"==typeof e.sorter.multiple&&e.sorter.multiple}function oT(e){return"function"==typeof e?e:!!e&&"object"==typeof e&&!!e.compare&&e.compare}function oj(e,t,n){let o=[];function r(e,t){o.push({column:e,key:np(e,t),multiplePriority:oM(e),sortOrder:e.sortOrder})}return(e||[]).forEach((e,a)=>{let l=nm(a,n);e.children?("sortOrder"in e&&r(e,l),o=[].concat((0,ei.Z)(o),(0,ei.Z)(oj(e.children,t,l)))):e.sorter&&("sortOrder"in e?r(e,l):t&&e.defaultSortOrder&&o.push({column:e,key:np(e,l),multiplePriority:oM(e),sortOrder:e.defaultSortOrder}))}),o}function oB(e){let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}}function oz(e){let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(oB);return 0===t.length&&e.length?Object.assign(Object.assign({},oB(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function oH(e,t,n){let o=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),r=e.slice(),a=o.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return oT(t)&&n});return a.length?r.sort((e,t)=>{for(let n=0;n{let o=e[n];return o?Object.assign(Object.assign({},e),{[n]:oH(o,t,n)}):e}):r}var oL=x(eP,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o}),oA=x(e_,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o}),o_=n(36360),oW=e=>{let{componentCls:t,lineWidth:n,lineType:o,tableBorderColor:r,tableHeaderBg:a,tablePaddingVertical:l,tablePaddingHorizontal:c,calc:i}=e,d="".concat((0,t0.bf)(n)," ").concat(o," ").concat(r),s=(e,o,r)=>({["&".concat(t,"-").concat(e)]:{["> ".concat(t,"-container")]:{["> ".concat(t,"-content, > ").concat(t,"-body")]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(i(o).mul(-1).equal()),"\n ").concat((0,t0.bf)(i(i(r).add(n)).mul(-1).equal()))}}}}}});return{["".concat(t,"-wrapper")]:{["".concat(t).concat(t,"-bordered")]:Object.assign(Object.assign(Object.assign({["> ".concat(t,"-title")]:{border:d,borderBottom:0},["> ".concat(t,"-container")]:{borderInlineStart:d,borderTop:d,["\n > ".concat(t,"-content,\n > ").concat(t,"-header,\n > ").concat(t,"-body,\n > ").concat(t,"-summary\n ")]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:d},"> thead":{"> tr:not(:last-child) > th":{borderBottom:d},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{["> ".concat(t,"-cell-fix-right-first::after")]:{borderInlineEnd:d}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(i(l).mul(-1).equal())," ").concat((0,t0.bf)(i(i(c).add(n)).mul(-1).equal())),"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:d,content:'""'}}}}}},["&".concat(t,"-scroll-horizontal")]:{["> ".concat(t,"-container > ").concat(t,"-body")]:{"> table > tbody":{["\n > tr".concat(t,"-expanded-row,\n > tr").concat(t,"-placeholder\n ")]:{"> th, > td":{borderInlineEnd:0}}}}}},s("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),s("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{["> ".concat(t,"-footer")]:{border:d,borderTop:0}}),["".concat(t,"-cell")]:{["".concat(t,"-container:first-child")]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:"0 ".concat((0,t0.bf)(n)," 0 ").concat((0,t0.bf)(n)," ").concat(a)}},["".concat(t,"-bordered ").concat(t,"-cell-scrollbar")]:{borderInlineEnd:d}}}},oq=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-cell-ellipsis")]:Object.assign(Object.assign({},t3.vS),{wordBreak:"keep-all",["\n &".concat(t,"-cell-fix-left-last,\n &").concat(t,"-cell-fix-right-first\n ")]:{overflow:"visible",["".concat(t,"-cell-content")]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},["".concat(t,"-column-title")]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},oF=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody > tr").concat(t,"-placeholder")]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},oV=n(76122),oX=e=>{let{componentCls:t,antCls:n,motionDurationSlow:o,lineWidth:r,paddingXS:a,lineType:l,tableBorderColor:c,tableExpandIconBg:i,tableExpandColumnWidth:d,borderRadius:s,tablePaddingVertical:u,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:m,expandIconMarginTop:g,expandIconSize:h,expandIconHalfInner:v,expandIconScale:b,calc:y}=e,x="".concat((0,t0.bf)(r)," ").concat(l," ").concat(c),k=y(m).sub(r).equal();return{["".concat(t,"-wrapper")]:{["".concat(t,"-expand-icon-col")]:{width:d},["".concat(t,"-row-expand-icon-cell")]:{textAlign:"center",["".concat(t,"-row-expand-icon")]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},["".concat(t,"-row-indent")]:{height:1,float:"left"},["".concat(t,"-row-expand-icon")]:Object.assign(Object.assign({},(0,oV.N)(e)),{position:"relative",float:"left",boxSizing:"border-box",width:h,height:h,padding:0,color:"inherit",lineHeight:(0,t0.bf)(h),background:i,border:x,borderRadius:s,transform:"scale(".concat(b,")"),transition:"all ".concat(o),userSelect:"none","&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:"transform ".concat(o," ease-out"),content:'""'},"&::before":{top:v,insetInlineEnd:k,insetInlineStart:k,height:r},"&::after":{top:k,bottom:k,insetInlineStart:v,width:r,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),["".concat(t,"-row-indent + ").concat(t,"-row-expand-icon")]:{marginTop:g,marginInlineEnd:a},["tr".concat(t,"-expanded-row")]:{"&, &:hover":{"> th, > td":{background:p}},["".concat(n,"-descriptions-view")]:{display:"flex",table:{flex:"auto",width:"auto"}}},["".concat(t,"-expanded-row-fixed")]:{position:"relative",margin:"".concat((0,t0.bf)(y(u).mul(-1).equal())," ").concat((0,t0.bf)(y(f).mul(-1).equal())),padding:"".concat((0,t0.bf)(u)," ").concat((0,t0.bf)(f))}}}},oU=e=>{let{componentCls:t,antCls:n,iconCls:o,tableFilterDropdownWidth:r,tableFilterDropdownSearchWidth:a,paddingXXS:l,paddingXS:c,colorText:i,lineWidth:d,lineType:s,tableBorderColor:u,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:m,borderRadius:g,motionDurationSlow:h,colorTextDescription:v,colorPrimary:b,tableHeaderFilterActiveBg:y,colorTextDisabled:x,tableFilterDropdownBg:k,tableFilterDropdownHeight:C,controlItemBgHover:S,controlItemBgActive:E,boxShadowSecondary:w,filterDropdownMenuBg:N,calc:Z}=e,O="".concat(n,"-dropdown"),K="".concat(t,"-filter-dropdown"),I="".concat(n,"-tree"),R="".concat((0,t0.bf)(d)," ").concat(s," ").concat(u);return[{["".concat(t,"-wrapper")]:{["".concat(t,"-filter-column")]:{display:"flex",justifyContent:"space-between"},["".concat(t,"-filter-trigger")]:{position:"relative",display:"flex",alignItems:"center",marginBlock:Z(l).mul(-1).equal(),marginInline:"".concat((0,t0.bf)(l)," ").concat((0,t0.bf)(Z(m).div(2).mul(-1).equal())),padding:"0 ".concat((0,t0.bf)(l)),color:f,fontSize:p,borderRadius:g,cursor:"pointer",transition:"all ".concat(h),"&:hover":{color:v,background:y},"&.active":{color:b}}}},{["".concat(n,"-dropdown")]:{[K]:Object.assign(Object.assign({},(0,t3.Wf)(e)),{minWidth:r,backgroundColor:k,borderRadius:g,boxShadow:w,overflow:"hidden",["".concat(O,"-menu")]:{maxHeight:C,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:N,"&:empty::after":{display:"block",padding:"".concat((0,t0.bf)(c)," 0"),color:x,fontSize:p,textAlign:"center",content:'"Not Found"'}},["".concat(K,"-tree")]:{paddingBlock:"".concat((0,t0.bf)(c)," 0"),paddingInline:c,[I]:{padding:0},["".concat(I,"-treenode ").concat(I,"-node-content-wrapper:hover")]:{backgroundColor:S},["".concat(I,"-treenode-checkbox-checked ").concat(I,"-node-content-wrapper")]:{"&, &:hover":{backgroundColor:E}}},["".concat(K,"-search")]:{padding:c,borderBottom:R,"&-input":{input:{minWidth:a},[o]:{color:x}}},["".concat(K,"-checkall")]:{width:"100%",marginBottom:l,marginInlineStart:l},["".concat(K,"-btns")]:{display:"flex",justifyContent:"space-between",padding:"".concat((0,t0.bf)(Z(c).sub(d).equal())," ").concat((0,t0.bf)(c)),overflow:"hidden",borderTop:R}})}},{["".concat(n,"-dropdown ").concat(K,", ").concat(K,"-submenu")]:{["".concat(n,"-checkbox-wrapper + span")]:{paddingInlineStart:c,color:i},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},oG=e=>{let{componentCls:t,lineWidth:n,colorSplit:o,motionDurationSlow:r,zIndexTableFixed:a,tableBg:l,zIndexTableSticky:c,calc:i}=e;return{["".concat(t,"-wrapper")]:{["\n ".concat(t,"-cell-fix-left,\n ").concat(t,"-cell-fix-right\n ")]:{position:"sticky !important",zIndex:a,background:l},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:i(n).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},["".concat(t,"-cell-fix-left-all::after")]:{display:"none"},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{position:"absolute",top:0,bottom:i(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},["".concat(t,"-container")]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:i(c).add(1).equal({unit:!1}),width:30,transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},["".concat(t,"-ping-left")]:{["&:not(".concat(t,"-has-fix-left) ").concat(t,"-container::before")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["".concat(t,"-cell-fix-left-last::before")]:{backgroundColor:"transparent !important"}},["".concat(t,"-ping-right")]:{["&:not(".concat(t,"-has-fix-right) ").concat(t,"-container::after")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)}}}}},oY=e=>{let{componentCls:t,antCls:n,margin:o}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-pagination").concat(n,"-pagination")]:{margin:"".concat((0,t0.bf)(o)," 0")},["".concat(t,"-pagination")]:{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"> *":{flex:"none"},"&-left":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-right":{justifyContent:"flex-end"}}}}},o$=e=>{let{componentCls:t,tableRadius:n}=e;return{["".concat(t,"-wrapper")]:{[t]:{["".concat(t,"-title, ").concat(t,"-header")]:{borderRadius:"".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n)," 0 0")},["".concat(t,"-title + ").concat(t,"-container")]:{borderStartStartRadius:0,borderStartEndRadius:0,["".concat(t,"-header, table")]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:"0 0 ".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n))}}}}},oJ=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper-rtl")]:{direction:"rtl",table:{direction:"rtl"},["".concat(t,"-pagination-left")]:{justifyContent:"flex-end"},["".concat(t,"-pagination-right")]:{justifyContent:"flex-start"},["".concat(t,"-row-expand-icon")]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},["".concat(t,"-container")]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},["".concat(t,"-row-indent")]:{float:"right"}}}}},oQ=e=>{let{componentCls:t,antCls:n,iconCls:o,fontSizeIcon:r,padding:a,paddingXS:l,headerIconColor:c,headerIconHoverColor:i,tableSelectionColumnWidth:d,tableSelectedRowBg:s,tableSelectedRowHoverBg:u,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:m}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-selection-col")]:{width:d,["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).equal()}},["".concat(t,"-bordered ").concat(t,"-selection-col")]:{width:m(d).add(m(l).mul(2)).equal(),["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).add(m(l).mul(2)).equal()}},["\n table tr th".concat(t,"-selection-column,\n table tr td").concat(t,"-selection-column,\n ").concat(t,"-selection-column\n ")]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",["".concat(n,"-radio-wrapper")]:{marginInlineEnd:0}},["table tr th".concat(t,"-selection-column").concat(t,"-cell-fix-left")]:{zIndex:e.zIndexTableFixed+1},["table tr th".concat(t,"-selection-column::after")]:{backgroundColor:"transparent !important"},["".concat(t,"-selection")]:{position:"relative",display:"inline-flex",flexDirection:"column"},["".concat(t,"-selection-extra")]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),marginInlineStart:"100%",paddingInlineStart:(0,t0.bf)(m(p).div(4).equal()),[o]:{color:c,fontSize:r,verticalAlign:"baseline","&:hover":{color:i}}},["".concat(t,"-tbody")]:{["".concat(t,"-row")]:{["&".concat(t,"-row-selected")]:{["> ".concat(t,"-cell")]:{background:s,"&-row-hover":{background:u}}},["> ".concat(t,"-cell-row-hover")]:{background:f}}}}}},o0=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:o}=e,r=(e,r,a,l)=>({["".concat(t).concat(t,"-").concat(e)]:{fontSize:l,["\n ".concat(t,"-title,\n ").concat(t,"-footer,\n ").concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(a))},["".concat(t,"-filter-trigger")]:{marginInlineEnd:(0,t0.bf)(o(a).div(2).mul(-1).equal())},["".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(o(r).mul(-1).equal())," ").concat((0,t0.bf)(o(a).mul(-1).equal()))},["".concat(t,"-tbody")]:{["".concat(t,"-wrapper:only-child ").concat(t)]:{marginBlock:(0,t0.bf)(o(r).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(o(n).sub(a).equal())," ").concat((0,t0.bf)(o(a).mul(-1).equal()))}},["".concat(t,"-selection-extra")]:{paddingInlineStart:(0,t0.bf)(o(a).div(4).equal())}}});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},r("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),r("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},o1=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:o,headerIconColor:r,headerIconHoverColor:a}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-thead th").concat(t,"-column-has-sorters")]:{outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},["\n &".concat(t,"-cell-fix-left:hover,\n &").concat(t,"-cell-fix-right:hover\n ")]:{background:e.tableFixedHeaderSortActiveBg}},["".concat(t,"-thead th").concat(t,"-column-sort")]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},["td".concat(t,"-column-sort")]:{background:e.tableBodySortBg},["".concat(t,"-column-title")]:{position:"relative",zIndex:1,flex:1},["".concat(t,"-column-sorters")]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},["".concat(t,"-column-sorter")]:{marginInlineStart:n,color:r,fontSize:0,transition:"color ".concat(e.motionDurationSlow),"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:o,"&.active":{color:e.colorPrimary}},["".concat(t,"-column-sorter-up + ").concat(t,"-column-sorter-down")]:{marginTop:"-0.3em"}},["".concat(t,"-column-sorters:hover ").concat(t,"-column-sorter")]:{color:a}}}},o2=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:o,tableScrollThumbBgHover:r,tableScrollThumbSize:a,tableScrollBg:l,zIndexTableSticky:c,stickyScrollBarBorderRadius:i,lineWidth:d,lineType:s,tableBorderColor:u}=e,f="".concat((0,t0.bf)(d)," ").concat(s," ").concat(u);return{["".concat(t,"-wrapper")]:{["".concat(t,"-sticky")]:{"&-holder":{position:"sticky",zIndex:c,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:"".concat((0,t0.bf)(a)," !important"),zIndex:c,display:"flex",alignItems:"center",background:l,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:o,borderRadius:i,transition:"all ".concat(e.motionDurationSlow,", transform none"),position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:r}}}}}}},o3=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:o,calc:r}=e,a="".concat((0,t0.bf)(n)," ").concat(e.lineType," ").concat(o);return{["".concat(t,"-wrapper")]:{["".concat(t,"-summary")]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},["div".concat(t,"-summary")]:{boxShadow:"0 ".concat((0,t0.bf)(r(n).mul(-1).equal())," 0 ").concat(o)}}}},o4=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:o,lineType:r,tableBorderColor:a,calc:l}=e,c="".concat((0,t0.bf)(o)," ").concat(r," ").concat(a),i="".concat(t,"-expanded-row-cell");return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody-virtual")]:{["".concat(t,"-row")]:{display:"flex",boxSizing:"border-box",width:"100%"},["".concat(t,"-cell")]:{borderBottom:c,transition:"background ".concat(n)},["".concat(t,"-expanded-row")]:{["".concat(i).concat(i,"-fixed")]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:"calc(var(--virtual-width) - ".concat((0,t0.bf)(o),")"),borderInlineEnd:"none"}}},["".concat(t,"-bordered")]:{["".concat(t,"-tbody-virtual")]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:c,position:"absolute"},["".concat(t,"-cell")]:{borderInlineEnd:c,["&".concat(t,"-cell-fix-right-first:before")]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:l(o).mul(-1).equal(),borderInlineStart:c}}},["&".concat(t,"-virtual")]:{["".concat(t,"-placeholder ").concat(t,"-cell")]:{borderInlineEnd:c,borderBottom:c}}}}}};let o6=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:o,tablePaddingHorizontal:r,tableExpandColumnWidth:a,lineWidth:l,lineType:c,tableBorderColor:i,tableFontSize:d,tableBg:s,tableRadius:u,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:m,tableHeaderCellSplitColor:g,tableFooterTextColor:h,tableFooterBg:v,calc:b}=e,y="".concat((0,t0.bf)(l)," ").concat(c," ").concat(i);return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({clear:"both",maxWidth:"100%"},(0,t3.dF)()),{[t]:Object.assign(Object.assign({},(0,t3.Wf)(e)),{fontSize:d,background:s,borderRadius:"".concat((0,t0.bf)(u)," ").concat((0,t0.bf)(u)," 0 0")}),table:{width:"100%",textAlign:"start",borderRadius:"".concat((0,t0.bf)(u)," ").concat((0,t0.bf)(u)," 0 0"),borderCollapse:"separate",borderSpacing:0},["\n ".concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{position:"relative",padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(r)),overflowWrap:"break-word"},["".concat(t,"-title")]:{padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(r))},["".concat(t,"-thead")]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease"),"&[colspan]:not([colspan='1'])":{textAlign:"center"},["&:not(:last-child):not(".concat(t,"-selection-column):not(").concat(t,"-row-expand-icon-cell):not([colspan])::before")]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:g,transform:"translateY(-50%)",transition:"background-color ".concat(p),content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},["".concat(t,"-tbody")]:{"> tr":{"> th, > td":{transition:"background ".concat(p,", border-color ").concat(p),borderBottom:y,["\n > ".concat(t,"-wrapper:only-child,\n > ").concat(t,"-expanded-row-fixed > ").concat(t,"-wrapper:only-child\n ")]:{[t]:{marginBlock:(0,t0.bf)(b(o).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(b(a).sub(r).equal()),"\n ").concat((0,t0.bf)(b(r).mul(-1).equal())),["".concat(t,"-tbody > tr:last-child > td")]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease")}}},["".concat(t,"-footer")]:{padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(r)),color:h,background:v}})}};var o8=(0,t6.I$)("Table",e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:o,controlInteractiveSize:r,headerBg:a,headerColor:l,headerSortActiveBg:c,headerSortHoverBg:i,bodySortBg:d,rowHoverBg:s,rowSelectedBg:u,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:m,cellPaddingInline:g,cellPaddingBlockMD:h,cellPaddingInlineMD:v,cellPaddingBlockSM:b,cellPaddingInlineSM:y,borderColor:x,footerBg:k,footerColor:C,headerBorderRadius:S,cellFontSize:E,cellFontSizeMD:w,cellFontSizeSM:N,headerSplitColor:Z,fixedHeaderSortActiveBg:O,headerFilterHoverBg:K,filterDropdownBg:I,expandIconBg:R,selectionColumnWidth:P,stickyScrollBarBg:D,calc:M}=e,T=(0,t4.TS)(e,{tableFontSize:E,tableBg:o,tableRadius:S,tablePaddingVertical:m,tablePaddingHorizontal:g,tablePaddingVerticalMiddle:h,tablePaddingHorizontalMiddle:v,tablePaddingVerticalSmall:b,tablePaddingHorizontalSmall:y,tableBorderColor:x,tableHeaderTextColor:l,tableHeaderBg:a,tableFooterTextColor:C,tableFooterBg:k,tableHeaderCellSplitColor:Z,tableHeaderSortBg:c,tableHeaderSortHoverBg:i,tableBodySortBg:d,tableFixedHeaderSortActiveBg:O,tableHeaderFilterActiveBg:K,tableFilterDropdownBg:I,tableRowHoverBg:s,tableSelectedRowBg:u,tableSelectedRowHoverBg:f,zIndexTableFixed:2,zIndexTableSticky:3,tableFontSizeMiddle:w,tableFontSizeSmall:N,tableSelectionColumnWidth:P,tableExpandIconBg:R,tableExpandColumnWidth:M(r).add(M(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:D,tableScrollThumbBgHover:t,tableScrollBg:n});return[o6(T),oY(T),o3(T),o1(T),oU(T),oW(T),o$(T),oX(T),o3(T),oF(T),oQ(T),oG(T),o2(T),oq(T),o0(T),oJ(T),o4(T)]},e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:o,colorFillSecondary:r,colorFillContent:a,controlItemBgActive:l,controlItemBgActiveHover:c,padding:i,paddingSM:d,paddingXS:s,colorBorderSecondary:u,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:m,fontSize:g,fontSizeSM:h,lineHeight:v,lineWidth:b,colorIcon:y,colorIconHover:x,opacityLoading:k,controlInteractiveSize:C}=e,S=new o_.C(r).onBackground(n).toHexShortString(),E=new o_.C(a).onBackground(n).toHexShortString(),w=new o_.C(t).onBackground(n).toHexShortString(),N=new o_.C(y),Z=new o_.C(x),O=C/2-b,K=2*O+3*b;return{headerBg:w,headerColor:o,headerSortActiveBg:S,headerSortHoverBg:E,bodySortBg:w,rowHoverBg:w,rowSelectedBg:l,rowSelectedHoverBg:c,rowExpandedBg:t,cellPaddingBlock:i,cellPaddingInline:i,cellPaddingBlockMD:d,cellPaddingInlineMD:s,cellPaddingBlockSM:s,cellPaddingInlineSM:s,borderColor:u,headerBorderRadius:f,footerBg:w,footerColor:o,cellFontSize:g,cellFontSizeMD:g,cellFontSizeSM:g,headerSplitColor:u,fixedHeaderSortActiveBg:S,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:m,stickyScrollBarBorderRadius:100,expandIconMarginTop:(g*v-3*b)/2-Math.ceil((1.4*h-3*b)/2),headerIconColor:N.clone().setAlpha(N.getAlpha()*k).toRgbString(),headerIconHoverColor:Z.clone().setAlpha(Z.getAlpha()*k).toRgbString(),expandIconHalfInner:O,expandIconSize:K,expandIconScale:C/K}},{unitless:{expandIconScale:!0}});let o5=[];var o7=a.forwardRef((e,t)=>{var n,o;let r,l,i;let{prefixCls:d,className:s,rootClassName:u,style:f,size:p,bordered:m,dropdownPrefixCls:g,dataSource:h,pagination:v,rowSelection:b,rowKey:y="key",rowClassName:x,columns:k,children:C,childrenColumnName:S,onChange:E,getPopupContainer:w,loading:N,expandIcon:Z,expandable:K,expandedRowRender:I,expandIconColumnIndex:R,indentSize:P,scroll:D,sortDirections:M,locale:T,showSorterTooltip:j=!0,virtual:B}=e;(0,tp.ln)("Table");let z=a.useMemo(()=>k||eb(C),[k,C]),H=a.useMemo(()=>z.some(e=>e.responsive),[z]),L=(0,tI.Z)(H),A=a.useMemo(()=>{let e=new Set(Object.keys(L).filter(e=>L[e]));return z.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[z,L]),_=(0,e$.Z)(e,["className","style","columns"]),{locale:W=tR.Z,direction:q,table:F,renderEmpty:V,getPrefixCls:X,getPopupContainer:U}=a.useContext(tN.E_),G=(0,tK.Z)(p),Y=Object.assign(Object.assign({},W.Table),T),$=h||o5,J=X("table",d),Q=X("dropdown",g),[,ee]=(0,nc.ZP)(),et=(0,tO.Z)(J),[en,eo,er]=o8(J,et),ea=Object.assign({childrenColumnName:S,expandIconColumnIndex:R},K),{childrenColumnName:el="children"}=ea,ec=a.useMemo(()=>$.some(e=>null==e?void 0:e[el])?"nest":I||K&&K.expandedRowRender?"row":null,[$]),ed={body:a.useRef()},es=a.useRef(null),eu=a.useRef(null);n=()=>Object.assign(Object.assign({},eu.current),{nativeElement:es.current}),(0,a.useImperativeHandle)(t,()=>{let e=n(),{nativeElement:t}=e;return"undefined"!=typeof Proxy?new Proxy(t,{get:(t,n)=>e[n]?e[n]:Reflect.get(t,n)}):(t._antProxy=t._antProxy||{},Object.keys(e).forEach(n=>{if(!(n in t._antProxy)){let o=t[n];t._antProxy[n]=o,t[n]=e[n]}}),t)});let ef=a.useMemo(()=>"function"==typeof y?y:e=>null==e?void 0:e[y],[y]),[ep]=function(e,t,n){let o=a.useRef({});return[function(r){if(!o.current||o.current.data!==e||o.current.childrenColumnName!==t||o.current.getRowKey!==n){let r=new Map;!function e(o){o.forEach((o,a)=>{let l=n(o,a);r.set(l,o),o&&"object"==typeof o&&t in o&&e(o[t]||[])})}(e),o.current={data:e,childrenColumnName:t,kvMap:r,getRowKey:n}}return o.current.kvMap.get(r)}]}($,el,ef),em={},eg=function(e,t){var n,o,r;let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=Object.assign(Object.assign({},em),e);a&&(null===(n=em.resetPagination)||void 0===n||n.call(em),(null===(o=l.pagination)||void 0===o?void 0:o.current)&&(l.pagination.current=1),v&&v.onChange&&v.onChange(1,null===(r=l.pagination)||void 0===r?void 0:r.pageSize)),D&&!1!==D.scrollToFirstRowOnChange&&ed.body.current&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{getContainer:n=()=>window,callback:o,duration:r=450}=t,a=n(),l=function(e,t){var n,o;if("undefined"==typeof window)return 0;let r=t?"scrollTop":"scrollLeft",a=0;return tw(e)?a=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?a=e.documentElement[r]:e instanceof HTMLElement?a=e[r]:e&&(a=e[r]),e&&!tw(e)&&"number"!=typeof a&&(a=null===(o=(null!==(n=e.ownerDocument)&&void 0!==n?n:e).documentElement)||void 0===o?void 0:o[r]),a}(a,!0),c=Date.now(),i=()=>{let t=Date.now()-c,n=function(e,t,n,o){let r=n-t;return(e/=o/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}(t>r?r:t,l,e,r);tw(a)?a.scrollTo(window.pageXOffset,n):a instanceof Document||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=n:a.scrollTop=n,ted.body.current}),null==E||E(l.pagination,l.filters,l.sorter,{currentDataSource:ok(oH($,l.sorterStates,el),l.filterStates),action:t})},[eh,ev,ey,ex]=function(e){let{prefixCls:t,mergedColumns:n,onSorterChange:o,sortDirections:r,tableLocale:l,showSorterTooltip:c}=e,[i,d]=a.useState(oj(n,!0)),s=a.useMemo(()=>{let e=!0,t=oj(n,!1);if(!t.length)return i;let o=[];function r(t){e?o.push(t):o.push(Object.assign(Object.assign({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{null===a?(r(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:a=!0)):(a&&!1!==t.multiplePriority||(e=!1),r(t))}),o},[n,i]),u=a.useMemo(()=>{let e=s.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:e,sortColumn:e[0]&&e[0].column,sortOrder:e[0]&&e[0].order}},[s]);function f(e){let t;d(t=!1!==e.multiplePriority&&s.length&&!1!==s[0].multiplePriority?[].concat((0,ei.Z)(s.filter(t=>{let{key:n}=t;return n!==e.key})),[e]):[e]),o(oz(t),t)}return[e=>(function e(t,n,o,r,l,c,i,d){return(n||[]).map((n,s)=>{let u=nm(s,d),f=n;if(f.sorter){let e;let d=f.sortDirections||l,s=void 0===f.showSorterTooltip?i:f.showSorterTooltip,p=np(f,u),m=o.find(e=>{let{key:t}=e;return t===p}),g=m?m.sortOrder:null,h=g?d[d.indexOf(g)+1]:d[0];if(n.sortIcon)e=n.sortIcon({sortOrder:g});else{let n=d.includes(oP)&&a.createElement(oI,{className:O()("".concat(t,"-column-sorter-up"),{active:g===oP})}),o=d.includes(oD)&&a.createElement(oO,{className:O()("".concat(t,"-column-sorter-down"),{active:g===oD})});e=a.createElement("span",{className:O()("".concat(t,"-column-sorter"),{["".concat(t,"-column-sorter-full")]:!!(n&&o)})},a.createElement("span",{className:"".concat(t,"-column-sorter-inner"),"aria-hidden":"true"},n,o))}let{cancelSort:v,triggerAsc:b,triggerDesc:y}=c||{},x=v;h===oD?x=y:h===oP&&(x=b);let k="object"==typeof s?Object.assign({title:x},s):{title:x};f=Object.assign(Object.assign({},f),{className:O()(f.className,{["".concat(t,"-column-sort")]:g}),title:o=>{let r=a.createElement("div",{className:"".concat(t,"-column-sorters")},a.createElement("span",{className:"".concat(t,"-column-title")},ng(n.title,o)),e);return s?a.createElement(oR.Z,Object.assign({},k),r):r},onHeaderCell:e=>{let o=n.onHeaderCell&&n.onHeaderCell(e)||{},a=o.onClick,l=o.onKeyDown;o.onClick=e=>{r({column:n,key:p,sortOrder:h,multiplePriority:oM(n)}),null==a||a(e)},o.onKeyDown=e=>{e.keyCode===tH.Z.ENTER&&(r({column:n,key:p,sortOrder:h,multiplePriority:oM(n)}),null==l||l(e))};let c=function(e,t){let n=ng(e,t);return"[object Object]"===Object.prototype.toString.call(n)?"":n}(n.title,{}),i=null==c?void 0:c.toString();return g?o["aria-sort"]="ascend"===g?"ascending":"descending":o["aria-label"]=i||"",o.className=O()(o.className,"".concat(t,"-column-has-sorters")),o.tabIndex=0,n.ellipsis&&(o.title=(null!=c?c:"").toString()),o}})}return"children"in f&&(f=Object.assign(Object.assign({},f),{children:e(t,f.children,o,r,l,c,i,u)})),f})})(t,e,s,f,r,l,c),s,u,()=>oz(s)]}({prefixCls:J,mergedColumns:A,onSorterChange:(e,t)=>{eg({sorter:e,sorterStates:t},"sort",!1)},sortDirections:M||["ascend","descend"],tableLocale:Y,showSorterTooltip:j}),ek=a.useMemo(()=>oH($,ev,el),[$,ev]);em.sorter=ex(),em.sorterStates=ev;let[eC,eS,eE]=oS({prefixCls:J,locale:Y,dropdownPrefixCls:Q,mergedColumns:A,onFilterChange:(e,t)=>{eg({filters:e,filterStates:t},"filter",!0)},getPopupContainer:w||U,rootClassName:O()(u,et)}),ew=ok(ek,eS);em.filters=eE,em.filterStates=eS;let[eN]=(o=a.useMemo(()=>{let e={};return Object.keys(eE).forEach(t=>{null!==eE[t]&&(e[t]=eE[t])}),Object.assign(Object.assign({},ey),{filters:e})},[ey,eE]),[a.useCallback(e=>(function e(t,n){return t.map(t=>{let o=Object.assign({},t);return o.title=ng(t.title,n),"children"in o&&(o.children=e(o.children,n)),o})})(e,o),[o])]),[eZ,eO]=oN(ew.length,(e,t)=>{eg({pagination:Object.assign(Object.assign({},em.pagination),{current:e,pageSize:t})},"paginate")},v);em.pagination=!1===v?{}:function(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&"object"==typeof t?t:{}).forEach(t=>{let o=e[t];"function"!=typeof o&&(n[t]=o)}),n}(eZ,v),em.resetPagination=eO;let eK=a.useMemo(()=>{if(!1===v||!eZ.pageSize)return ew;let{current:e=1,total:t,pageSize:n=10}=eZ;return ew.lengthn?ew.slice((e-1)*n,e*n):ew:ew.slice((e-1)*n,e*n)},[!!v,ew,eZ&&eZ.current,eZ&&eZ.pageSize,eZ&&eZ.total]),[eI,eR]=tS({prefixCls:J,data:ew,pageData:eK,getRowKey:ef,getRecordByKey:ep,expandType:ec,childrenColumnName:el,locale:Y,getPopupContainer:w||U},b);ea.__PARENT_RENDER_ICON__=ea.expandIcon,ea.expandIcon=ea.expandIcon||Z||function(e){let{prefixCls:t,onExpand:n,record:o,expanded:r,expandable:l}=e,c="".concat(t,"-row-expand-icon");return a.createElement("button",{type:"button",onClick:e=>{n(o,e),e.stopPropagation()},className:O()(c,{["".concat(c,"-spaced")]:!l,["".concat(c,"-expanded")]:l&&r,["".concat(c,"-collapsed")]:l&&!r}),"aria-label":r?Y.collapse:Y.expand,"aria-expanded":r})},"nest"===ec&&void 0===ea.expandIconColumnIndex?ea.expandIconColumnIndex=b?1:0:ea.expandIconColumnIndex>0&&b&&(ea.expandIconColumnIndex-=1),"number"!=typeof ea.indentSize&&(ea.indentSize="number"==typeof P?P:15);let eP=a.useCallback(e=>eN(eI(eC(eh(e)))),[eh,eC,eI]);if(!1!==v&&(null==eZ?void 0:eZ.total)){let e;e=eZ.size?eZ.size:"small"===G||"middle"===G?"small":void 0;let t=t=>a.createElement(nu,Object.assign({},eZ,{className:O()("".concat(J,"-pagination ").concat(J,"-pagination-").concat(t),eZ.className),size:e})),n="rtl"===q?"left":"right",{position:o}=eZ;if(null!==o&&Array.isArray(o)){let e=o.find(e=>e.includes("top")),a=o.find(e=>e.includes("bottom")),c=o.every(e=>"none"==="".concat(e));e||a||c||(l=t(n)),e&&(r=t(e.toLowerCase().replace("top",""))),a&&(l=t(a.toLowerCase().replace("bottom","")))}else l=t(n)}"boolean"==typeof N?i={spinning:N}:"object"==typeof N&&(i=Object.assign({spinning:!0},N));let eD=O()(er,et,"".concat(J,"-wrapper"),null==F?void 0:F.className,{["".concat(J,"-wrapper-rtl")]:"rtl"===q},s,u,eo),eM=Object.assign(Object.assign({},null==F?void 0:F.style),f),eT=T&&T.emptyText||(null==V?void 0:V("Table"))||a.createElement(tZ.Z,{componentName:"Table"}),ej={},eB=a.useMemo(()=>{let{fontSize:e,lineHeight:t,padding:n,paddingXS:o,paddingSM:r}=ee,a=Math.floor(e*t);switch(G){case"large":return 2*n+a;case"small":return 2*o+a;default:return 2*r+a}},[ee,G]);return B&&(ej.listItemHeight=eB),en(a.createElement("div",{ref:es,className:eD,style:eM},a.createElement(nf.Z,Object.assign({spinning:!1},i),r,a.createElement(B?oA:oL,Object.assign({},ej,_,{ref:eu,columns:A,direction:q,expandable:ea,prefixCls:J,className:O()({["".concat(J,"-middle")]:"middle"===G,["".concat(J,"-small")]:"small"===G,["".concat(J,"-bordered")]:m,["".concat(J,"-empty")]:0===$.length},er,et,eo),data:eK,rowKey:ef,rowClassName:(e,t,n)=>{let o;return o="function"==typeof x?O()(x(e,t,n)):O()(x),O()({["".concat(J,"-row-selected")]:eR.has(ef(e,t))},o)},emptyText:eT,internalHooks:c,internalRefs:ed,transformColumns:eP,getContainerWidth:(e,t)=>{let n=e.querySelector(".".concat(J,"-container")),o=t;if(n){let e=getComputedStyle(n);o=t-parseInt(e.borderLeftWidth,10)-parseInt(e.borderRightWidth,10)}return o}})),l)))});let o9=a.forwardRef((e,t)=>{let n=a.useRef(0);return n.current+=1,a.createElement(o7,Object.assign({},e,{ref:t,_renderTimes:n.current}))});o9.SELECTION_COLUMN=tv,o9.EXPAND_COLUMN=l,o9.SELECTION_ALL=tb,o9.SELECTION_INVERT=ty,o9.SELECTION_NONE=tx,o9.Column=function(e){return null},o9.ColumnGroup=function(e){return null},o9.Summary=A;var re=o9},88532:function(e,t,n){var o=n(2265);let r=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});t.Z=r}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6925-9e2db5c132fe9053.js b/litellm/proxy/_experimental/out/_next/static/chunks/6925-9e2db5c132fe9053.js deleted file mode 100644 index 724b03a1f8..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6925-9e2db5c132fe9053.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6925],{6925:function(e,l,s){s.d(l,{Z:function(){return Q}});var t=s(57437),a=s(2265),n=s(20831),i=s(12514),r=s(67101),c=s(47323),d=s(57365),o=s(92858),h=s(12485),u=s(18135),m=s(35242),x=s(29706),g=s(77991),j=s(21626),f=s(97214),p=s(28241),Z=s(58834),y=s(69552),b=s(71876),v=s(84264),k=s(49566),_=s(53410),C=s(74998),S=s(93192),w=s(13634),E=s(82680),N=s(52787),A=s(64482),T=s(73002),O=s(9114),L=s(19250),R=s(23496),F=s(87908),P=s(61994);let{Title:I}=S.default;var M=e=>{let{accessToken:l}=e,[s,r]=(0,a.useState)(!0),[c,d]=(0,a.useState)([]);(0,a.useEffect)(()=>{o()},[l]);let o=async()=>{if(l){r(!0);try{let e=await (0,L.getEmailEventSettings)(l);d(e.settings)}catch(e){console.error("Failed to fetch email event settings:",e),O.Z.fromBackend(e)}finally{r(!1)}}},h=(e,l)=>{d(c.map(s=>s.event===e?{...s,enabled:l}:s))},u=async()=>{if(l)try{await (0,L.updateEmailEventSettings)(l,{settings:c}),O.Z.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),O.Z.fromBackend(e)}},m=async()=>{if(l)try{await (0,L.resetEmailEventSettings)(l),O.Z.success("Email event settings reset to defaults"),o()}catch(e){console.error("Failed to reset email event settings:",e),O.Z.fromBackend(e)}},x=e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";{let l=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return"Receive an email notification when ".concat(l)}};return(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(I,{level:4,children:"Email Notifications"}),(0,t.jsx)(v.Z,{children:"Select which events should trigger email notifications."}),(0,t.jsx)(R.Z,{}),s?(0,t.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,t.jsx)(F.Z,{size:"large"})}):(0,t.jsx)("div",{className:"space-y-4",children:c.map(e=>(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(P.Z,{checked:e.enabled,onChange:l=>h(e.event,l.target.checked)}),(0,t.jsxs)("div",{className:"ml-3",children:[(0,t.jsx)(v.Z,{children:e.event}),(0,t.jsx)("div",{className:"text-sm text-gray-500 block",children:x(e.event)})]})]},e.event))}),(0,t.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,t.jsx)(n.Z,{onClick:u,disabled:s,children:"Save Changes"}),(0,t.jsx)(n.Z,{onClick:m,variant:"secondary",disabled:s,children:"Reset to Defaults"})]})]})};let{Title:U}=S.default;var B=e=>{let{accessToken:l,premiumUser:s,alerts:a}=e,c=async()=>{if(!l)return;let e={};a.filter(e=>"email"===e.name).forEach(l=>{var s;Object.entries(null!==(s=l.variables)&&void 0!==s?s:{}).forEach(l=>{let[s,t]=l,a=document.querySelector('input[name="'.concat(s,'"]'));a&&a.value&&(e[s]=null==a?void 0:a.value)})}),console.log("updatedVariables",e);try{await (0,L.setCallbacksCall)(l,{general_settings:{alerting:["email"]},environment_variables:e}),O.Z.success("Email settings updated successfully")}catch(e){O.Z.fromBackend(e)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mt-6 mb-6",children:(0,t.jsx)(M,{accessToken:l})}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(U,{level:4,children:"Email Server Settings"}),(0,t.jsxs)(v.Z,{children:[(0,t.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: email alerts"]})," ",(0,t.jsx)("br",{})]}),(0,t.jsx)("div",{className:"flex w-full",children:a.filter(e=>"email"===e.name).map((e,l)=>{var a;return(0,t.jsx)(p.Z,{children:(0,t.jsx)("ul",{children:(0,t.jsx)(r.Z,{numItems:2,children:Object.entries(null!==(a=e.variables)&&void 0!==a?a:{}).map(e=>{let[l,a]=e;return(0,t.jsxs)("li",{className:"mx-2 my-2",children:[!0!=s&&("EMAIL_LOGO_URL"===l||"EMAIL_SUPPORT_CONTACT"===l)?(0,t.jsxs)("div",{children:[(0,t.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,t.jsxs)(v.Z,{className:"mt-2",children:[" ✨ ",l]})}),(0,t.jsx)(k.Z,{name:l,defaultValue:a,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)(v.Z,{className:"mt-2",children:l}),(0,t.jsx)(k.Z,{name:l,defaultValue:a,type:"password",style:{width:"400px"}})]}),(0,t.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===l&&(0,t.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,t.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===l&&(0,t.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,t.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===l&&(0,t.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,t.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===l&&(0,t.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===l&&(0,t.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `sender@berri.ai`",(0,t.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===l&&(0,t.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `info@berri.ai`",(0,t.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===l&&(0,t.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===l&&(0,t.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is support@berri.ai"})]})]},l)})})})},l)})}),(0,t.jsx)(n.Z,{className:"mt-2",onClick:()=>c(),children:"Save Changes"}),(0,t.jsx)(n.Z,{onClick:async()=>{if(l)try{await (0,L.serviceHealthCheck)(l,"email"),O.Z.success("Email test triggered. Check your configured email inbox/logs.")}catch(e){O.Z.fromBackend(e)}},className:"mx-2",children:"Test Email Alerts"})]})]})},D=s(20577),q=s(44643),H=s(41649),W=e=>{let{alertingSettings:l,handleInputChange:s,handleResetField:a,handleSubmit:i,premiumUser:r}=e,[d]=w.Z.useForm();return(0,t.jsxs)(w.Z,{form:d,onFinish:()=>{console.log("INSIDE ONFINISH");let e=d.getFieldsValue(),l=Object.entries(e).every(e=>{let[l,s]=e;return"boolean"!=typeof s&&(""===s||null==s)});console.log("formData: ".concat(JSON.stringify(e),", isEmpty: ").concat(l)),l?console.log("Some form fields are empty."):i(e)},labelAlign:"left",children:[l.map((e,l)=>(0,t.jsxs)(b.Z,{children:[(0,t.jsxs)(p.Z,{align:"center",children:[(0,t.jsx)(v.Z,{children:e.field_name}),(0,t.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?r?(0,t.jsx)(w.Z.Item,{name:e.field_name,children:(0,t.jsx)(p.Z,{children:"Integer"===e.field_type?(0,t.jsx)(D.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l)}):"Boolean"===e.field_type?(0,t.jsx)(o.Z,{checked:e.field_value,onChange:l=>s(e.field_name,l)}):(0,t.jsx)(A.default,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}):(0,t.jsx)(p.Z,{children:(0,t.jsx)(n.Z,{className:"flex items-center justify-center",children:(0,t.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,t.jsx)(w.Z.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,t.jsx)(p.Z,{children:"Integer"===e.field_type?(0,t.jsx)(D.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l),className:"p-0"}):"Boolean"===e.field_type?(0,t.jsx)(o.Z,{checked:e.field_value,onChange:l=>{s(e.field_name,l),d.setFieldsValue({[e.field_name]:l})}}):(0,t.jsx)(A.default,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}),(0,t.jsx)(p.Z,{children:!0==e.stored_in_db?(0,t.jsx)(H.Z,{icon:q.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,t.jsx)(H.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,t.jsx)(H.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,t.jsx)(p.Z,{children:(0,t.jsx)(c.Z,{icon:C.Z,color:"red",onClick:()=>a(e.field_name,l),children:"Reset"})})]},l)),(0,t.jsx)("div",{children:(0,t.jsx)(T.ZP,{htmlType:"submit",children:"Update Settings"})})]})},V=e=>{let{accessToken:l,premiumUser:s}=e,[n,i]=(0,a.useState)([]);return(0,a.useEffect)(()=>{l&&(0,L.alertingSettingsCall)(l).then(e=>{i(e)})},[l]),(0,t.jsx)(W,{alertingSettings:n,handleInputChange:(e,l)=>{let s=n.map(s=>s.field_name===e?{...s,field_value:l}:s);console.log("updatedSettings: ".concat(JSON.stringify(s))),i(s)},handleResetField:(e,s)=>{if(l)try{let l=n.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:l.field_default_value}:l);i(l)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!l||(console.log("formValues: ".concat(e)),null==e||void 0==e))return;let s={};n.forEach(e=>{s[e.field_name]=e.field_value});let t={...e,...s};console.log("mergedFormValues: ".concat(JSON.stringify(t)));let{slack_alerting:a,...i}=t;console.log("slack_alerting: ".concat(a,", alertingArgs: ").concat(JSON.stringify(i)));try{(0,L.updateConfigFieldSetting)(l,"alerting_args",i),"boolean"==typeof a&&(!0==a?(0,L.updateConfigFieldSetting)(l,"alerting",["slack"]):(0,L.updateConfigFieldSetting)(l,"alerting",[])),O.Z.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:s})},z=s(38994),J=s(97434),G=s(85968);let{Title:K,Paragraph:Y}=S.default;var Q=e=>{let{accessToken:l,userRole:s,userID:S,premiumUser:R}=e,[F,P]=(0,a.useState)([]),[I,M]=(0,a.useState)([]),[U,D]=(0,a.useState)(!1),[q]=w.Z.useForm(),[H]=w.Z.useForm(),[W,Y]=(0,a.useState)(null),[Q,X]=(0,a.useState)(""),[$,ee]=(0,a.useState)({}),[el,es]=(0,a.useState)([]),[et,ea]=(0,a.useState)(!1),[en,ei]=(0,a.useState)([]),[er,ec]=(0,a.useState)([]),[ed,eo]=(0,a.useState)(!1),[eh,eu]=(0,a.useState)(null),[em,ex]=(0,a.useState)(!1),[eg,ej]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(ed&&eh){let e=Object.fromEntries(Object.entries(eh.variables||{}).map(e=>{let[l,s]=e;return[l,null!=s?s:""]}));H.setFieldsValue(e)}},[ed,eh,H]);let ef=e=>{el.includes(e)?es(el.filter(l=>l!==e)):es([...el,e])},ep={llm_exceptions:"LLM Exceptions",llm_too_slow:"LLM Responses Too Slow",llm_requests_hanging:"LLM Requests Hanging",budget_alerts:"Budget Alerts (API Keys, Users)",db_exceptions:"Database Exceptions (Read/Write)",daily_reports:"Weekly/Monthly Spend Reports",outage_alerts:"Outage Alerts",region_outage_alerts:"Region Outage Alerts"};(0,a.useEffect)(()=>{l&&s&&S&&(0,L.getCallbacksCall)(l,S,s).then(e=>{P(e.callbacks),ei(e.available_callbacks);let l=e.alerts;if(l&&l.length>0){let e=l[0],s=e.variables.SLACK_WEBHOOK_URL;es(e.active_alerts),X(s),ee(e.alerts_to_webhook)}M(l)})},[l,s,S]);let eZ=e=>el&&el.includes(e),ey=async e=>{if(!l||!eh)return;let t={};Object.entries(e).forEach(e=>{let[l,s]=e;"callback"!==l&&(t[l]=s)});let a={environment_variables:e,litellm_settings:{success_callback:[eh.name]}};try{if(await (0,L.setCallbacksCall)(l,a),O.Z.success("Callback updated successfully"),eo(!1),H.resetFields(),eu(null),S&&s){let e=await (0,L.getCallbacksCall)(l,S,s);P(e.callbacks)}}catch(e){O.Z.fromBackend(e)}},eb=async e=>{if(!l)return;let t=null==e?void 0:e.callback,a={};Object.entries(e).forEach(e=>{let[l,s]=e;"callback"!==l&&(a[l]=s)});try{await (0,L.setCallbacksCall)(l,{environment_variables:e,litellm_settings:{success_callback:[t]}}),O.Z.success("Callback ".concat(t," added successfully")),ea(!1),q.resetFields(),Y(null),ec([]);let a=await (0,L.getCallbacksCall)(l,S||"",s||"");P(a.callbacks)}catch(e){O.Z.fromBackend(e)}},ev=e=>{Y(e.litellm_callback_name),e&&e.litellm_callback_params?ec(e.litellm_callback_params):ec([])},ek=async()=>{if(!l)return;let e={};Object.entries(ep).forEach(l=>{let[s,t]=l,a=document.querySelector('input[name="'.concat(s,'"]')),n=(null==a?void 0:a.value)||"";e[s]=n});try{await (0,L.setCallbacksCall)(l,{general_settings:{alert_to_webhook_url:e,alert_types:el}})}catch(e){O.Z.fromBackend(e)}O.Z.success("Alerts updated successfully")},e_=e=>{ej(e),ex(!0)},eC=async()=>{if(eg&&l)try{if(await (0,L.deleteCallback)(l,eg),O.Z.success("Callback ".concat(eg," deleted successfully")),S&&s){let e=await (0,L.getCallbacksCall)(l,S,s);P(e.callbacks)}ex(!1),ej(null)}catch(e){console.error("Failed to delete callback:",e),O.Z.fromBackend(e)}};return l?(0,t.jsxs)("div",{className:"w-full mx-4",children:[(0,t.jsx)(r.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,t.jsxs)(u.Z,{children:[(0,t.jsxs)(m.Z,{variant:"line",defaultValue:"1",children:[(0,t.jsx)(h.Z,{value:"1",children:"Logging Callbacks"}),(0,t.jsx)(h.Z,{value:"2",children:"Alerting Types"}),(0,t.jsx)(h.Z,{value:"3",children:"Alerting Settings"}),(0,t.jsx)(h.Z,{value:"4",children:"Email Alerts"})]}),(0,t.jsxs)(g.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(K,{level:4,children:"Active Logging Callbacks"}),(0,t.jsx)(r.Z,{numItems:2,children:(0,t.jsx)(i.Z,{className:"max-h-[50vh]",children:(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(Z.Z,{children:(0,t.jsx)(b.Z,{children:(0,t.jsx)(y.Z,{children:"Callback Name"})})}),(0,t.jsx)(f.Z,{children:F.map((e,s)=>(0,t.jsxs)(b.Z,{className:"flex justify-between",children:[(0,t.jsx)(p.Z,{children:(0,t.jsx)(v.Z,{children:e.name})}),(0,t.jsx)(p.Z,{children:(0,t.jsxs)(r.Z,{numItems:2,className:"flex justify-between",children:[(0,t.jsx)(c.Z,{icon:_.Z,size:"sm",onClick:()=>{eu(e),eo(!0)}}),(0,t.jsx)(c.Z,{icon:C.Z,size:"sm",onClick:()=>e_(e.name),className:"text-red-500 hover:text-red-700 cursor-pointer"}),(0,t.jsx)(n.Z,{onClick:async()=>{try{await (0,L.serviceHealthCheck)(l,e.name),O.Z.success("Health check triggered")}catch(e){O.Z.fromBackend((0,G.O)(e))}},className:"ml-2",variant:"secondary",children:"Test Callback"})]})})]},s))})]})})}),(0,t.jsx)(n.Z,{className:"mt-2",onClick:()=>ea(!0),children:"Add Callback"})]}),(0,t.jsx)(x.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsxs)(v.Z,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,t.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(Z.Z,{children:(0,t.jsxs)(b.Z,{children:[(0,t.jsx)(y.Z,{}),(0,t.jsx)(y.Z,{}),(0,t.jsx)(y.Z,{children:"Slack Webhook URL"})]})}),(0,t.jsx)(f.Z,{children:Object.entries(ep).map((e,l)=>{let[s,a]=e;return(0,t.jsxs)(b.Z,{children:[(0,t.jsx)(p.Z,{children:"region_outage_alerts"==s?R?(0,t.jsx)(o.Z,{id:"switch",name:"switch",checked:eZ(s),onChange:()=>ef(s)}):(0,t.jsx)(n.Z,{className:"flex items-center justify-center",children:(0,t.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,t.jsx)(o.Z,{id:"switch",name:"switch",checked:eZ(s),onChange:()=>ef(s)})}),(0,t.jsx)(p.Z,{children:(0,t.jsx)(v.Z,{children:a})}),(0,t.jsx)(p.Z,{children:(0,t.jsx)(k.Z,{name:s,type:"password",defaultValue:$&&$[s]?$[s]:Q})})]},l)})})]}),(0,t.jsx)(n.Z,{size:"xs",className:"mt-2",onClick:ek,children:"Save Changes"}),(0,t.jsx)(n.Z,{onClick:async()=>{try{await (0,L.serviceHealthCheck)(l,"slack"),O.Z.success("Alert test triggered. Test request to slack made - check logs/alerts on slack to verify")}catch(e){O.Z.fromBackend((0,G.O)(e))}},className:"mx-2",children:"Test Alerts"})]})}),(0,t.jsx)(x.Z,{children:(0,t.jsx)(V,{accessToken:l,premiumUser:R})}),(0,t.jsx)(x.Z,{children:(0,t.jsx)(B,{accessToken:l,premiumUser:R,alerts:I})})]})]})}),(0,t.jsxs)(E.Z,{title:"Add Logging Callback",visible:et,width:800,onCancel:()=>{ea(!1),Y(null),ec([])},footer:null,children:[(0,t.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,t.jsx)(w.Z,{form:q,onFinish:eb,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.Z,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,t.jsx)(N.default,{onChange:e=>{let l=en[e];l&&ev(l)},children:Object.entries(J.Y5).map(e=>{var l;let[s,a]=e;return(0,t.jsx)(d.Z,{value:J.Lo[s],children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(null===(l=J.Dg[a])||void 0===l?void 0:l.logo)?(0,t.jsx)("div",{className:"w-5 h-5 flex items-center justify-center",children:(0,t.jsx)("img",{src:J.Dg[a].logo,alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{e.currentTarget.style.display="none"}})}):(0,t.jsx)("div",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:a.charAt(0).toUpperCase()}),(0,t.jsx)("span",{children:a})]})},a)})})}),er&&er.map(e=>(0,t.jsx)(z.Z,{label:e,name:e,rules:[{required:!0,message:"Please enter the value for "+e}],children:(0,t.jsx)(A.default.Password,{})},e)),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})]}),(0,t.jsx)(E.Z,{visible:ed,width:800,title:"Edit ".concat(null==eh?void 0:eh.name," Settings"),onCancel:()=>{eo(!1),eu(null)},footer:null,children:(0,t.jsxs)(w.Z,{form:H,onFinish:ey,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsx)(t.Fragment,{children:eh&&eh.variables&&Object.entries(eh.variables).map(e=>{let[l]=e;return(0,t.jsx)(z.Z,{label:l,name:l,rules:[{required:!0,message:"Please enter the value for ".concat(l)}],children:(0,t.jsx)(A.default.Password,{})},l)})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,t.jsx)(E.Z,{title:"Confirm Delete",visible:em,onOk:eC,onCancel:()=>{ex(!1),ej(null)},okText:"Delete",cancelText:"Cancel",okButtonProps:{danger:!0},children:(0,t.jsxs)("p",{children:["Are you sure you want to delete the callback - ",eg,"? This action cannot be undone."]})})]}):null}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6925-b4f07277f285ca48.js b/litellm/proxy/_experimental/out/_next/static/chunks/6925-b4f07277f285ca48.js new file mode 100644 index 0000000000..e6b69f2c08 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/6925-b4f07277f285ca48.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6925],{6925:function(e,l,s){s.d(l,{Z:function(){return X}});var a=s(57437),t=s(2265),n=s(20831),r=s(12514),i=s(67101),c=s(47323),d=s(57365),o=s(92858),u=s(12485),h=s(18135),m=s(35242),x=s(29706),g=s(77991),f=s(21626),j=s(97214),p=s(28241),b=s(58834),y=s(69552),Z=s(71876),v=s(84264),k=s(49566),_=s(53410),C=s(74998),S=s(93192),w=s(13634),N=s(82680),E=s(52787),A=s(64482),O=s(73002),L=s(9114),T=s(19250),R=s(23496),F=s(87908),P=s(4156);let{Title:I}=S.default;var M=e=>{let{accessToken:l}=e,[s,i]=(0,t.useState)(!0),[c,d]=(0,t.useState)([]);(0,t.useEffect)(()=>{o()},[l]);let o=async()=>{if(l){i(!0);try{let e=await (0,T.getEmailEventSettings)(l);d(e.settings)}catch(e){console.error("Failed to fetch email event settings:",e),L.Z.fromBackend(e)}finally{i(!1)}}},u=(e,l)=>{d(c.map(s=>s.event===e?{...s,enabled:l}:s))},h=async()=>{if(l)try{await (0,T.updateEmailEventSettings)(l,{settings:c}),L.Z.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),L.Z.fromBackend(e)}},m=async()=>{if(l)try{await (0,T.resetEmailEventSettings)(l),L.Z.success("Email event settings reset to defaults"),o()}catch(e){console.error("Failed to reset email event settings:",e),L.Z.fromBackend(e)}},x=e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";{let l=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return"Receive an email notification when ".concat(l)}};return(0,a.jsxs)(r.Z,{children:[(0,a.jsx)(I,{level:4,children:"Email Notifications"}),(0,a.jsx)(v.Z,{children:"Select which events should trigger email notifications."}),(0,a.jsx)(R.Z,{}),s?(0,a.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,a.jsx)(F.Z,{size:"large"})}):(0,a.jsx)("div",{className:"space-y-4",children:c.map(e=>(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(P.Z,{checked:e.enabled,onChange:l=>u(e.event,l.target.checked)}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)(v.Z,{children:e.event}),(0,a.jsx)("div",{className:"text-sm text-gray-500 block",children:x(e.event)})]})]},e.event))}),(0,a.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,a.jsx)(n.Z,{onClick:h,disabled:s,children:"Save Changes"}),(0,a.jsx)(n.Z,{onClick:m,variant:"secondary",disabled:s,children:"Reset to Defaults"})]})]})};let{Title:U}=S.default;var B=e=>{let{accessToken:l,premiumUser:s,alerts:t}=e,c=async()=>{if(!l)return;let e={};t.filter(e=>"email"===e.name).forEach(l=>{var s;Object.entries(null!==(s=l.variables)&&void 0!==s?s:{}).forEach(l=>{let[s,a]=l,t=document.querySelector('input[name="'.concat(s,'"]'));t&&t.value&&(e[s]=null==t?void 0:t.value)})}),console.log("updatedVariables",e);try{await (0,T.setCallbacksCall)(l,{general_settings:{alerting:["email"]},environment_variables:e}),L.Z.success("Email settings updated successfully")}catch(e){L.Z.fromBackend(e)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mt-6 mb-6",children:(0,a.jsx)(M,{accessToken:l})}),(0,a.jsxs)(r.Z,{children:[(0,a.jsx)(U,{level:4,children:"Email Server Settings"}),(0,a.jsxs)(v.Z,{children:[(0,a.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: email alerts"]})," ",(0,a.jsx)("br",{})]}),(0,a.jsx)("div",{className:"flex w-full",children:t.filter(e=>"email"===e.name).map((e,l)=>{var t;return(0,a.jsx)(p.Z,{children:(0,a.jsx)("ul",{children:(0,a.jsx)(i.Z,{numItems:2,children:Object.entries(null!==(t=e.variables)&&void 0!==t?t:{}).map(e=>{let[l,t]=e;return(0,a.jsxs)("li",{className:"mx-2 my-2",children:[!0!=s&&("EMAIL_LOGO_URL"===l||"EMAIL_SUPPORT_CONTACT"===l)?(0,a.jsxs)("div",{children:[(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,a.jsxs)(v.Z,{className:"mt-2",children:[" ✨ ",l]})}),(0,a.jsx)(k.Z,{name:l,defaultValue:t,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)(v.Z,{className:"mt-2",children:l}),(0,a.jsx)(k.Z,{name:l,defaultValue:t,type:"password",style:{width:"400px"}})]}),(0,a.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===l&&(0,a.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `sender@berri.ai`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `info@berri.ai`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===l&&(0,a.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===l&&(0,a.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is support@berri.ai"})]})]},l)})})})},l)})}),(0,a.jsx)(n.Z,{className:"mt-2",onClick:()=>c(),children:"Save Changes"}),(0,a.jsx)(n.Z,{onClick:async()=>{if(l)try{await (0,T.serviceHealthCheck)(l,"email"),L.Z.success("Email test triggered. Check your configured email inbox/logs.")}catch(e){L.Z.fromBackend(e)}},className:"mx-2",children:"Test Email Alerts"})]})]})},D=s(20577),q=s(44643),H=s(41649),W=e=>{let{alertingSettings:l,handleInputChange:s,handleResetField:t,handleSubmit:r,premiumUser:i}=e,[d]=w.Z.useForm();return(0,a.jsxs)(w.Z,{form:d,onFinish:()=>{console.log("INSIDE ONFINISH");let e=d.getFieldsValue(),l=Object.entries(e).every(e=>{let[l,s]=e;return"boolean"!=typeof s&&(""===s||null==s)});console.log("formData: ".concat(JSON.stringify(e),", isEmpty: ").concat(l)),l?console.log("Some form fields are empty."):r(e)},labelAlign:"left",children:[l.map((e,l)=>(0,a.jsxs)(Z.Z,{children:[(0,a.jsxs)(p.Z,{align:"center",children:[(0,a.jsx)(v.Z,{children:e.field_name}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?i?(0,a.jsx)(w.Z.Item,{name:e.field_name,children:(0,a.jsx)(p.Z,{children:"Integer"===e.field_type?(0,a.jsx)(D.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l)}):"Boolean"===e.field_type?(0,a.jsx)(o.Z,{checked:e.field_value,onChange:l=>s(e.field_name,l)}):(0,a.jsx)(A.default,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}):(0,a.jsx)(p.Z,{children:(0,a.jsx)(n.Z,{className:"flex items-center justify-center",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,a.jsx)(w.Z.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,a.jsx)(p.Z,{children:"Integer"===e.field_type?(0,a.jsx)(D.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l),className:"p-0"}):"Boolean"===e.field_type?(0,a.jsx)(o.Z,{checked:e.field_value,onChange:l=>{s(e.field_name,l),d.setFieldsValue({[e.field_name]:l})}}):(0,a.jsx)(A.default,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}),(0,a.jsx)(p.Z,{children:!0==e.stored_in_db?(0,a.jsx)(H.Z,{icon:q.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(H.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(H.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsx)(p.Z,{children:(0,a.jsx)(c.Z,{icon:C.Z,color:"red",onClick:()=>t(e.field_name,l),children:"Reset"})})]},l)),(0,a.jsx)("div",{children:(0,a.jsx)(O.ZP,{htmlType:"submit",children:"Update Settings"})})]})},z=e=>{let{accessToken:l,premiumUser:s}=e,[n,r]=(0,t.useState)([]);return(0,t.useEffect)(()=>{l&&(0,T.alertingSettingsCall)(l).then(e=>{r(e)})},[l]),(0,a.jsx)(W,{alertingSettings:n,handleInputChange:(e,l)=>{let s=n.map(s=>s.field_name===e?{...s,field_value:l}:s);console.log("updatedSettings: ".concat(JSON.stringify(s))),r(s)},handleResetField:(e,s)=>{if(l)try{let l=n.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:l.field_default_value}:l);r(l)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!l||(console.log("formValues: ".concat(e)),null==e||void 0==e))return;let s={};n.forEach(e=>{s[e.field_name]=e.field_value});let a={...e,...s};console.log("mergedFormValues: ".concat(JSON.stringify(a)));let{slack_alerting:t,...r}=a;console.log("slack_alerting: ".concat(t,", alertingArgs: ").concat(JSON.stringify(r)));try{(0,T.updateConfigFieldSetting)(l,"alerting_args",r),"boolean"==typeof t&&(!0==t?(0,T.updateConfigFieldSetting)(l,"alerting",["slack"]):(0,T.updateConfigFieldSetting)(l,"alerting",[])),L.Z.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:s})},V=s(38994),J=s(97434),G=s(85968);let{Title:K,Paragraph:Q}=S.default;var X=e=>{let{accessToken:l,userRole:s,userID:S,premiumUser:R}=e,[F,P]=(0,t.useState)([]),[I,M]=(0,t.useState)([]),[U,D]=(0,t.useState)(!1),[q]=w.Z.useForm(),[H]=w.Z.useForm(),[W,Q]=(0,t.useState)(null),[X,Y]=(0,t.useState)(""),[$,ee]=(0,t.useState)({}),[el,es]=(0,t.useState)([]),[ea,et]=(0,t.useState)(!1),[en,er]=(0,t.useState)([]),[ei,ec]=(0,t.useState)([]),[ed,eo]=(0,t.useState)(!1),[eu,eh]=(0,t.useState)(null),[em,ex]=(0,t.useState)(!1),[eg,ef]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(ed&&eu){let e=Object.fromEntries(Object.entries(eu.variables||{}).map(e=>{let[l,s]=e;return[l,null!=s?s:""]}));H.setFieldsValue(e)}},[ed,eu,H]);let ej=e=>{el.includes(e)?es(el.filter(l=>l!==e)):es([...el,e])},ep={llm_exceptions:"LLM Exceptions",llm_too_slow:"LLM Responses Too Slow",llm_requests_hanging:"LLM Requests Hanging",budget_alerts:"Budget Alerts (API Keys, Users)",db_exceptions:"Database Exceptions (Read/Write)",daily_reports:"Weekly/Monthly Spend Reports",outage_alerts:"Outage Alerts",region_outage_alerts:"Region Outage Alerts"};(0,t.useEffect)(()=>{l&&s&&S&&(0,T.getCallbacksCall)(l,S,s).then(e=>{P(e.callbacks),er(e.available_callbacks);let l=e.alerts;if(l&&l.length>0){let e=l[0],s=e.variables.SLACK_WEBHOOK_URL;es(e.active_alerts),Y(s),ee(e.alerts_to_webhook)}M(l)})},[l,s,S]);let eb=e=>el&&el.includes(e),ey=async e=>{if(!l||!eu)return;let a={};Object.entries(e).forEach(e=>{let[l,s]=e;"callback"!==l&&(a[l]=s)});let t={environment_variables:e,litellm_settings:{success_callback:[eu.name]}};try{if(await (0,T.setCallbacksCall)(l,t),L.Z.success("Callback updated successfully"),eo(!1),H.resetFields(),eh(null),S&&s){let e=await (0,T.getCallbacksCall)(l,S,s);P(e.callbacks)}}catch(e){L.Z.fromBackend(e)}},eZ=async e=>{if(!l)return;let a=null==e?void 0:e.callback,t={};Object.entries(e).forEach(e=>{let[l,s]=e;"callback"!==l&&(t[l]=s)});try{await (0,T.setCallbacksCall)(l,{environment_variables:e,litellm_settings:{success_callback:[a]}}),L.Z.success("Callback ".concat(a," added successfully")),et(!1),q.resetFields(),Q(null),ec([]);let t=await (0,T.getCallbacksCall)(l,S||"",s||"");P(t.callbacks)}catch(e){L.Z.fromBackend(e)}},ev=e=>{Q(e);let l=(0,J._3)(e);(null==l?void 0:l.dynamic_params)?ec(Object.keys(l.dynamic_params)):ec([])},ek=async()=>{if(!l)return;let e={};Object.entries(ep).forEach(l=>{let[s,a]=l,t=document.querySelector('input[name="'.concat(s,'"]')),n=(null==t?void 0:t.value)||"";e[s]=n});try{await (0,T.setCallbacksCall)(l,{general_settings:{alert_to_webhook_url:e,alert_types:el}})}catch(e){L.Z.fromBackend(e)}L.Z.success("Alerts updated successfully")},e_=e=>{ef(e),ex(!0)},eC=async()=>{if(eg&&l)try{if(await (0,T.deleteCallback)(l,eg),L.Z.success("Callback ".concat(eg," deleted successfully")),S&&s){let e=await (0,T.getCallbacksCall)(l,S,s);P(e.callbacks)}ex(!1),ef(null)}catch(e){console.error("Failed to delete callback:",e),L.Z.fromBackend(e)}};return l?(0,a.jsxs)("div",{className:"w-full mx-4",children:[(0,a.jsx)(i.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(m.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(u.Z,{value:"1",children:"Logging Callbacks"}),(0,a.jsx)(u.Z,{value:"2",children:"Alerting Types"}),(0,a.jsx)(u.Z,{value:"3",children:"Alerting Settings"}),(0,a.jsx)(u.Z,{value:"4",children:"Email Alerts"})]}),(0,a.jsxs)(g.Z,{children:[(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(K,{level:4,children:"Active Logging Callbacks"}),(0,a.jsx)(i.Z,{numItems:2,children:(0,a.jsx)(r.Z,{className:"max-h-[50vh]",children:(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(b.Z,{children:(0,a.jsx)(Z.Z,{children:(0,a.jsx)(y.Z,{children:"Callback Name"})})}),(0,a.jsx)(j.Z,{children:F.map((e,s)=>(0,a.jsxs)(Z.Z,{className:"flex justify-between",children:[(0,a.jsx)(p.Z,{children:(0,a.jsx)(v.Z,{children:e.name})}),(0,a.jsx)(p.Z,{children:(0,a.jsxs)(i.Z,{numItems:2,className:"flex justify-between",children:[(0,a.jsx)(c.Z,{icon:_.Z,size:"sm",onClick:()=>{eh(e),eo(!0)}}),(0,a.jsx)(c.Z,{icon:C.Z,size:"sm",onClick:()=>e_(e.name),className:"text-red-500 hover:text-red-700 cursor-pointer"}),(0,a.jsx)(n.Z,{onClick:async()=>{try{await (0,T.serviceHealthCheck)(l,e.name),L.Z.success("Health check triggered")}catch(e){L.Z.fromBackend((0,G.O)(e))}},className:"ml-2",variant:"secondary",children:"Test Callback"})]})})]},s))})]})})}),(0,a.jsx)(n.Z,{className:"mt-2",onClick:()=>et(!0),children:"Add Callback"})]}),(0,a.jsx)(x.Z,{children:(0,a.jsxs)(r.Z,{children:[(0,a.jsxs)(v.Z,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,a.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(b.Z,{children:(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(y.Z,{}),(0,a.jsx)(y.Z,{}),(0,a.jsx)(y.Z,{children:"Slack Webhook URL"})]})}),(0,a.jsx)(j.Z,{children:Object.entries(ep).map((e,l)=>{let[s,t]=e;return(0,a.jsxs)(Z.Z,{children:[(0,a.jsx)(p.Z,{children:"region_outage_alerts"==s?R?(0,a.jsx)(o.Z,{id:"switch",name:"switch",checked:eb(s),onChange:()=>ej(s)}):(0,a.jsx)(n.Z,{className:"flex items-center justify-center",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,a.jsx)(o.Z,{id:"switch",name:"switch",checked:eb(s),onChange:()=>ej(s)})}),(0,a.jsx)(p.Z,{children:(0,a.jsx)(v.Z,{children:t})}),(0,a.jsx)(p.Z,{children:(0,a.jsx)(k.Z,{name:s,type:"password",defaultValue:$&&$[s]?$[s]:X})})]},l)})})]}),(0,a.jsx)(n.Z,{size:"xs",className:"mt-2",onClick:ek,children:"Save Changes"}),(0,a.jsx)(n.Z,{onClick:async()=>{try{await (0,T.serviceHealthCheck)(l,"slack"),L.Z.success("Alert test triggered. Test request to slack made - check logs/alerts on slack to verify")}catch(e){L.Z.fromBackend((0,G.O)(e))}},className:"mx-2",children:"Test Alerts"})]})}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(z,{accessToken:l,premiumUser:R})}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(B,{accessToken:l,premiumUser:R,alerts:I})})]})]})}),(0,a.jsxs)(N.Z,{title:"Add Logging Callback",visible:ea,width:800,onCancel:()=>{et(!1),Q(null),ec([])},footer:null,children:[(0,a.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,a.jsxs)(w.Z,{form:q,onFinish:eZ,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(V.Z,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,a.jsx)(E.default,{placeholder:"Choose a logging callback...",size:"large",className:"w-full",showSearch:!0,filterOption:(e,l)=>{var s,a;return(null!==(a=null==l?void 0:null===(s=l.children)||void 0===s?void 0:s.toString())&&void 0!==a?a:"").toLowerCase().includes(e.toLowerCase())},onChange:e=>{ev(e)},children:J.O0.map(e=>(0,a.jsx)(d.Z,{value:e.id,children:(0,a.jsxs)("div",{className:"flex items-center space-x-3 py-1",children:[(0,a.jsx)("div",{className:"w-6 h-6 flex items-center justify-center",children:(0,a.jsx)("img",{src:e.logo,alt:"".concat(e.displayName," logo"),className:"w-6 h-6 rounded object-contain",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsx)("span",{className:"font-medium text-gray-900",children:e.displayName})]})},e.id))})}),ei&&ei.length>0&&(0,a.jsx)("div",{className:"space-y-4 mt-6 p-4 bg-gray-50 rounded-lg border",children:ei.map(e=>{let l=(0,J._3)(W||""),s=(null==l?void 0:l.dynamic_params[e])||"text",t=e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,a.jsx)(V.Z,{label:(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:[t,(0,a.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),name:e,className:"mb-4",rules:[{required:!0,message:"Please enter the ".concat(t.toLowerCase())}],children:"password"===s?(0,a.jsx)(A.default.Password,{size:"large",placeholder:"Enter your ".concat(t.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}):"number"===s?(0,a.jsx)(A.default,{type:"number",size:"large",placeholder:"Enter ".concat(t.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",min:0,max:1,step:.1}):(0,a.jsx)(A.default,{size:"large",placeholder:"Enter your ".concat(t.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})},e)})}),(0,a.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,a.jsx)(n.Z,{onClick:()=>{et(!1),Q(null),ec([]),q.resetFields()},children:"Cancel"}),(0,a.jsx)(O.ZP,{htmlType:"submit",children:"Add Callback"})]})]})]}),(0,a.jsx)(N.Z,{visible:ed,width:800,title:"Edit ".concat(null==eu?void 0:eu.name," Settings"),onCancel:()=>{eo(!1),eh(null)},footer:null,children:(0,a.jsxs)(w.Z,{form:H,onFinish:ey,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(a.Fragment,{children:eu&&eu.variables&&Object.entries(eu.variables).map(e=>{let[l]=e;return(0,a.jsx)(V.Z,{label:l,name:l,rules:[{required:!0,message:"Please enter the value for ".concat(l)}],children:(0,a.jsx)(A.default.Password,{})},l)})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(O.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,a.jsx)(N.Z,{title:"Confirm Delete",visible:em,onOk:eC,onCancel:()=>{ex(!1),ef(null)},okText:"Delete",cancelText:"Cancel",okButtonProps:{danger:!0},children:(0,a.jsxs)("p",{children:["Are you sure you want to delete the callback - ",eg,"? This action cannot be undone."]})})]}):null}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7155-56eb798322f1faf7.js b/litellm/proxy/_experimental/out/_next/static/chunks/7155-56eb798322f1faf7.js new file mode 100644 index 0000000000..7507240716 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/7155-56eb798322f1faf7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7155],{88913:function(e,s,l){l.d(s,{Dx:function(){return d.Z},Zb:function(){return a.Z},iz:function(){return r.Z},oi:function(){return n.Z},xv:function(){return i.Z},zx:function(){return t.Z}});var t=l(20831),a=l(12514),r=l(67982),i=l(84264),n=l(49566),d=l(96761)},77155:function(e,s,l){l.d(s,{Z:function(){return ey}});var t=l(57437),a=l(2265),r=l(58643),i=l(19250),n=l(16312),d=l(7765),o=l(57365),c=l(49566),u=l(13634),m=l(82680),x=l(52787),h=l(20577),g=l(73002),j=l(24199),p=l(65925),v=e=>{let{visible:s,possibleUIRoles:l,onCancel:r,user:i,onSubmit:n}=e,[d,v]=(0,a.useState)(i),[f]=u.Z.useForm();(0,a.useEffect)(()=>{f.resetFields()},[i]);let y=async()=>{f.resetFields(),r()},b=async e=>{n(e),f.resetFields(),r()};return i?(0,t.jsx)(m.Z,{visible:s,onCancel:y,footer:null,title:"Edit User "+i.user_id,width:1e3,children:(0,t.jsx)(u.Z,{form:f,onFinish:b,initialValues:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,t.jsx)(c.Z,{})}),(0,t.jsx)(u.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,t.jsx)(c.Z,{})}),(0,t.jsx)(u.Z.Item,{label:"User Role",name:"user_role",children:(0,t.jsx)(x.default,{children:l&&Object.entries(l).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(o.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(u.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,t.jsx)(h.Z,{min:0,step:.01})}),(0,t.jsx)(u.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,t.jsx)(j.Z,{min:0,step:.01})}),(0,t.jsx)(u.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(p.Z,{})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(g.ZP,{htmlType:"submit",children:"Save"})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(g.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},f=l(98187),y=l(93192),b=l(42264),_=l(4156),N=l(72188),w=l(23496),k=l(67960),Z=l(93142),S=l(89970),C=l(16853),U=l(46468),I=l(20347),D=l(15424);function z(e){let{userData:s,onCancel:l,onSubmit:r,teams:i,accessToken:d,userID:m,userRole:h,userModels:g,possibleUIRoles:v,isBulkEdit:f=!1}=e,[y]=u.Z.useForm();return a.useEffect(()=>{var e,l,t,a,r,i;y.setFieldsValue({user_id:s.user_id,user_email:null===(e=s.user_info)||void 0===e?void 0:e.user_email,user_role:null===(l=s.user_info)||void 0===l?void 0:l.user_role,models:(null===(t=s.user_info)||void 0===t?void 0:t.models)||[],max_budget:null===(a=s.user_info)||void 0===a?void 0:a.max_budget,budget_duration:null===(r=s.user_info)||void 0===r?void 0:r.budget_duration,metadata:(null===(i=s.user_info)||void 0===i?void 0:i.metadata)?JSON.stringify(s.user_info.metadata,null,2):void 0})},[s,y]),(0,t.jsxs)(u.Z,{form:y,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}r(e)},layout:"vertical",children:[!f&&(0,t.jsx)(u.Z.Item,{label:"User ID",name:"user_id",children:(0,t.jsx)(c.Z,{disabled:!0})}),!f&&(0,t.jsx)(u.Z.Item,{label:"Email",name:"user_email",children:(0,t.jsx)(c.Z,{})}),(0,t.jsx)(u.Z.Item,{label:(0,t.jsxs)("span",{children:["Global Proxy Role"," ",(0,t.jsx)(S.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,t.jsx)(D.Z,{})})]}),name:"user_role",children:(0,t.jsx)(x.default,{children:v&&Object.entries(v).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(o.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(u.Z.Item,{label:(0,t.jsxs)("span",{children:["Personal Models"," ",(0,t.jsx)(S.Z,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,t.jsx)(D.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,t.jsxs)(x.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!I.ZL.includes(h||""),children:[(0,t.jsx)(x.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,t.jsx)(x.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),g.map(e=>(0,t.jsx)(x.default.Option,{value:e,children:(0,U.W0)(e)},e))]})}),(0,t.jsx)(u.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(j.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(u.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(p.Z,{})}),(0,t.jsx)(u.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(C.Z,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,t.jsx)(n.z,{variant:"secondary",type:"button",onClick:l,children:"Cancel"}),(0,t.jsx)(n.z,{type:"submit",children:"Save Changes"})]})]})}var A=l(9114);let{Text:L,Title:B}=y.default;var E=e=>{let{visible:s,onCancel:l,selectedUsers:r,possibleUIRoles:n,accessToken:d,onSuccess:o,teams:c,userRole:u,userModels:g,allowAllUsers:j=!1}=e,[p,v]=(0,a.useState)(!1),[f,y]=(0,a.useState)([]),[S,C]=(0,a.useState)(null),[U,I]=(0,a.useState)(!1),[D,E]=(0,a.useState)(!1),M=()=>{y([]),C(null),I(!1),E(!1),l()},R=a.useMemo(()=>({user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:c||[]}),[c,s]),O=async e=>{if(console.log("formValues",e),!d){A.Z.fromBackend("Access token not found");return}v(!0);try{let s=r.map(e=>e.user_id),t={};e.user_role&&""!==e.user_role&&(t.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(t.max_budget=e.max_budget),e.models&&e.models.length>0&&(t.models=e.models),e.budget_duration&&""!==e.budget_duration&&(t.budget_duration=e.budget_duration),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata=e.metadata);let a=Object.keys(t).length>0,n=U&&f.length>0;if(!a&&!n){A.Z.fromBackend("Please modify at least one field or select teams to add users to");return}let c=[];if(a){if(D){let e=await (0,i.userBulkUpdateUserCall)(d,t,void 0,!0);c.push("Updated all users (".concat(e.total_requested," total)"))}else await (0,i.userBulkUpdateUserCall)(d,t,s),c.push("Updated ".concat(s.length," user(s)"))}if(n){let e=[];for(let s of f)try{let l=null;D?l=null:r.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null}));let t=await (0,i.teamBulkMemberAddCall)(d,s,l||null,S||void 0,D);console.log("result",t),e.push({teamId:s,success:!0,successfulAdditions:t.successful_additions,failedAdditions:t.failed_additions})}catch(l){console.error("Failed to add users to team ".concat(s,":"),l),e.push({teamId:s,success:!1,error:l})}let s=e.filter(e=>e.success),l=e.filter(e=>!e.success);if(s.length>0){let e=s.reduce((e,s)=>e+s.successfulAdditions,0);c.push("Added users to ".concat(s.length," team(s) (").concat(e," total additions)"))}l.length>0&&b.ZP.warning("Failed to add users to ".concat(l.length," team(s)"))}c.length>0&&A.Z.success(c.join(". ")),y([]),C(null),I(!1),E(!1),o(),l()}catch(e){console.error("Bulk operation failed:",e),A.Z.fromBackend("Failed to perform bulk operations")}finally{v(!1)}};return(0,t.jsxs)(m.Z,{visible:s,onCancel:M,footer:null,title:D?"Bulk Edit All Users":"Bulk Edit ".concat(r.length," User(s)"),width:800,children:[j&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(_.Z,{checked:D,onChange:e=>E(e.target.checked),children:(0,t.jsx)(L,{strong:!0,children:"Update ALL users in the system"})}),D&&(0,t.jsx)("div",{style:{marginTop:8},children:(0,t.jsx)(L,{type:"warning",style:{fontSize:"12px"},children:"⚠️ This will apply changes to ALL users in the system, not just the selected ones."})})]}),!D&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)(B,{level:5,children:["Selected Users (",r.length,"):"]}),(0,t.jsx)(N.Z,{size:"small",bordered:!0,dataSource:r,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,t.jsx)(L,{strong:!0,style:{fontSize:"12px"},children:e.length>20?"".concat(e.slice(0,20),"..."):e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,t.jsx)(L,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>{var s;return(0,t.jsx)(L,{style:{fontSize:"12px"},children:(null==n?void 0:null===(s=n[e])||void 0===s?void 0:s.ui_label)||e})}},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,t.jsx)(L,{style:{fontSize:"12px"},children:null!==e?"$".concat(e):"Unlimited"})}]})]}),(0,t.jsx)(w.Z,{}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsxs)(L,{children:[(0,t.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,t.jsx)(k.Z,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,t.jsxs)(Z.Z,{direction:"vertical",style:{width:"100%"},children:[(0,t.jsx)(_.Z,{checked:U,onChange:e=>I(e.target.checked),children:"Add selected users to teams"}),U&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(L,{strong:!0,children:"Select Teams:"}),(0,t.jsx)(x.default,{mode:"multiple",placeholder:"Select teams to add users to",value:f,onChange:y,style:{width:"100%",marginTop:8},options:(null==c?void 0:c.map(e=>({label:e.team_alias||e.team_id,value:e.team_id})))||[]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(L,{strong:!0,children:"Team Budget (Optional):"}),(0,t.jsx)(h.Z,{placeholder:"Max budget per user in team",value:S,onChange:e=>C(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,t.jsx)(L,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,t.jsx)(L,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,t.jsx)(z,{userData:R,onCancel:M,onSubmit:O,teams:c,accessToken:d,userID:"bulk_edit",userRole:u,userModels:g,possibleUIRoles:n,isBulkEdit:!0}),p&&(0,t.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,t.jsxs)(L,{children:["Updating ",D?"all users":r.length," user(s)..."]})})]})},M=l(41649),R=l(67101),O=l(47323),T=l(15731),P=l(53410),F=l(74998),K=l(23628),V=l(59872);let q=(e,s,l,a,r,i)=>{let n=[{header:"User ID",accessorKey:"user_id",cell:e=>{let{row:s}=e;return(0,t.jsx)(S.Z,{title:s.original.user_id,children:(0,t.jsx)("span",{className:"text-xs",children:s.original.user_id?"".concat(s.original.user_id.slice(0,7),"..."):"-"})})}},{header:"Email",accessorKey:"user_email",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.user_email||"-"})}},{header:"Global Proxy Role",accessorKey:"user_role",cell:s=>{var l;let{row:a}=s;return(0,t.jsx)("span",{className:"text-xs",children:(null==e?void 0:null===(l=e[a.original.user_role])||void 0===l?void 0:l.ui_label)||"-"})}},{header:"Spend (USD)",accessorKey:"spend",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.spend?(0,V.pw)(s.original.spend,4):"-"})}},{header:"Budget (USD)",accessorKey:"max_budget",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.max_budget?s.original.max_budget:"Unlimited"})}},{header:()=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:"SSO ID"}),(0,t.jsx)(S.Z,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,t.jsx)(T.Z,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.sso_user_id?s.original.sso_user_id:"-"})}},{header:"API Keys",accessorKey:"key_count",cell:e=>{let{row:s}=e;return(0,t.jsx)(R.Z,{numItems:2,children:s.original.key_count>0?(0,t.jsxs)(M.Z,{size:"xs",color:"indigo",children:[s.original.key_count," Keys"]}):(0,t.jsx)(M.Z,{size:"xs",color:"gray",children:"No Keys"})})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.created_at?new Date(s.original.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.updated_at?new Date(s.original.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"",cell:e=>{let{row:s}=e;return(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(S.Z,{title:"Edit user details",zIndex:9999,children:(0,t.jsx)(O.Z,{icon:P.Z,size:"sm",onClick:()=>r(s.original.user_id,!0)})}),(0,t.jsx)(S.Z,{title:"Delete user",zIndex:9999,children:(0,t.jsx)(O.Z,{icon:F.Z,size:"sm",onClick:()=>l(s.original.user_id)})}),(0,t.jsx)(S.Z,{title:"Reset Password",zIndex:9999,children:(0,t.jsx)(O.Z,{icon:K.Z,size:"sm",onClick:()=>a(s.original.user_id)})})]})}}];if(i){let{onSelectUser:e,onSelectAll:s,isUserSelected:l,isAllSelected:a,isIndeterminate:r}=i;return[{id:"select",header:()=>(0,t.jsx)(_.Z,{indeterminate:r,checked:a,onChange:e=>s(e.target.checked),onClick:e=>e.stopPropagation()}),cell:s=>{let{row:a}=s;return(0,t.jsx)(_.Z,{checked:l(a.original),onChange:s=>e(a.original,s.target.checked),onClick:e=>e.stopPropagation()})}},...n]}return n};var G=l(71594),J=l(24525),W=l(27281),Q=l(21626),$=l(97214),H=l(28241),Y=l(58834),X=l(69552),ee=l(71876),es=l(44633),el=l(86462),et=l(49084),ea=l(84717),er=l(10900),ei=l(30401),en=l(78867);function ed(e){var s,l,r,n,d,o,c,u,m,x,h,j,v,y,b,_,N,w,k,Z,S,C,U,D,L,B,E,M,R,O,T,P,q,G,J,W,Q;let{userId:$,onClose:H,accessToken:Y,userRole:X,onDelete:ee,possibleUIRoles:es,initialTab:el=0,startInEditMode:et=!1}=e,[ed,eo]=(0,a.useState)(null),[ec,eu]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(!0),[eh,eg]=(0,a.useState)(et),[ej,ep]=(0,a.useState)([]),[ev,ef]=(0,a.useState)(!1),[ey,eb]=(0,a.useState)(null),[e_,eN]=(0,a.useState)(null),[ew,ek]=(0,a.useState)(el),[eZ,eS]=(0,a.useState)({}),[eC,eU]=(0,a.useState)(!1);a.useEffect(()=>{eN((0,i.getProxyBaseUrl)())},[]),a.useEffect(()=>{console.log("userId: ".concat($,", userRole: ").concat(X,", accessToken: ").concat(Y)),(async()=>{try{if(!Y)return;let e=await (0,i.userInfoCall)(Y,$,X||"",!1,null,null,!0);eo(e);let s=(await (0,i.modelAvailableCall)(Y,$,X||"")).data.map(e=>e.id);ep(s)}catch(e){console.error("Error fetching user data:",e),A.Z.fromBackend("Failed to fetch user data")}finally{ex(!1)}})()},[Y,$,X]);let eI=async()=>{if(!Y){A.Z.fromBackend("Access token not found");return}try{A.Z.success("Generating password reset link...");let e=await (0,i.invitationCreateCall)(Y,$);eb(e),ef(!0)}catch(e){A.Z.fromBackend("Failed to generate password reset link")}},eD=async()=>{try{if(!Y)return;await (0,i.userDeleteCall)(Y,[$]),A.Z.success("User deleted successfully"),ee&&ee(),H()}catch(e){console.error("Error deleting user:",e),A.Z.fromBackend("Failed to delete user")}},ez=async e=>{try{if(!Y||!ed)return;await (0,i.userUpdateUserCall)(Y,e,null),eo({...ed,user_info:{...ed.user_info,user_email:e.user_email,models:e.models,max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:e.metadata}}),A.Z.success("User updated successfully"),eg(!1)}catch(e){console.error("Error updating user:",e),A.Z.fromBackend("Failed to update user")}};if(em)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(ea.zx,{icon:er.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(ea.xv,{children:"Loading user data..."})]});if(!ed)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(ea.zx,{icon:er.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(ea.xv,{children:"User not found"})]});let eA=async(e,s)=>{await (0,V.vQ)(e)&&(eS(e=>({...e,[s]:!0})),setTimeout(()=>{eS(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.zx,{icon:er.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(ea.Dx,{children:(null===(s=ed.user_info)||void 0===s?void 0:s.user_email)||"User"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(ea.xv,{className:"text-gray-500 font-mono",children:ed.user_id}),(0,t.jsx)(g.ZP,{type:"text",size:"small",icon:eZ["user-id"]?(0,t.jsx)(ei.Z,{size:12}):(0,t.jsx)(en.Z,{size:12}),onClick:()=>eA(ed.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eZ["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),X&&I.LQ.includes(X)&&(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(ea.zx,{icon:K.Z,variant:"secondary",onClick:eI,className:"flex items-center",children:"Reset Password"}),(0,t.jsx)(ea.zx,{icon:F.Z,variant:"secondary",onClick:()=>eu(!0),className:"flex items-center",children:"Delete User"})]})]}),ec&&(0,t.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,t.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,t.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,t.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,t.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,t.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,t.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,t.jsx)("div",{className:"sm:flex sm:items-start",children:(0,t.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,t.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"})})]})})}),(0,t.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,t.jsx)(ea.zx,{onClick:eD,color:"red",className:"ml-2",children:"Delete"}),(0,t.jsx)(ea.zx,{onClick:()=>eu(!1),children:"Cancel"})]})]})]})}),(0,t.jsxs)(ea.v0,{defaultIndex:ew,onIndexChange:ek,children:[(0,t.jsxs)(ea.td,{className:"mb-4",children:[(0,t.jsx)(ea.OK,{children:"Overview"}),(0,t.jsx)(ea.OK,{children:"Details"})]}),(0,t.jsxs)(ea.nP,{children:[(0,t.jsx)(ea.x4,{children:(0,t.jsxs)(ea.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(ea.Zb,{children:[(0,t.jsx)(ea.xv,{children:"Spend"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(ea.Dx,{children:["$",(0,V.pw)((null===(l=ed.user_info)||void 0===l?void 0:l.spend)||0,4)]}),(0,t.jsxs)(ea.xv,{children:["of"," ",(null===(r=ed.user_info)||void 0===r?void 0:r.max_budget)!==null?"$".concat((0,V.pw)(ed.user_info.max_budget,4)):"Unlimited"]})]})]}),(0,t.jsxs)(ea.Zb,{children:[(0,t.jsx)(ea.xv,{children:"Teams"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(n=ed.teams)||void 0===n?void 0:n.length)&&(null===(d=ed.teams)||void 0===d?void 0:d.length)>0?(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[null===(o=ed.teams)||void 0===o?void 0:o.slice(0,eC?ed.teams.length:20).map((e,s)=>(0,t.jsx)(ea.Ct,{color:"blue",title:e.team_alias,children:e.team_alias},s)),!eC&&(null===(c=ed.teams)||void 0===c?void 0:c.length)>20&&(0,t.jsxs)(ea.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eU(!0),children:["+",ed.teams.length-20," more"]}),eC&&(null===(u=ed.teams)||void 0===u?void 0:u.length)>20&&(0,t.jsx)(ea.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eU(!1),children:"Show Less"})]}):(0,t.jsx)(ea.xv,{children:"No teams"})})]}),(0,t.jsxs)(ea.Zb,{children:[(0,t.jsx)(ea.xv,{children:"API Keys"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsxs)(ea.xv,{children:[(null===(m=ed.keys)||void 0===m?void 0:m.length)||0," keys"]})})]}),(0,t.jsxs)(ea.Zb,{children:[(0,t.jsx)(ea.xv,{children:"Personal Models"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(h=ed.user_info)||void 0===h?void 0:null===(x=h.models)||void 0===x?void 0:x.length)&&(null===(v=ed.user_info)||void 0===v?void 0:null===(j=v.models)||void 0===j?void 0:j.length)>0?null===(b=ed.user_info)||void 0===b?void 0:null===(y=b.models)||void 0===y?void 0:y.map((e,s)=>(0,t.jsx)(ea.xv,{children:e},s)):(0,t.jsx)(ea.xv,{children:"All proxy models"})})]})]})}),(0,t.jsx)(ea.x4,{children:(0,t.jsxs)(ea.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(ea.Dx,{children:"User Settings"}),!eh&&X&&I.LQ.includes(X)&&(0,t.jsx)(ea.zx,{variant:"light",onClick:()=>eg(!0),children:"Edit Settings"})]}),eh&&ed?(0,t.jsx)(z,{userData:ed,onCancel:()=>eg(!1),onSubmit:ez,teams:ed.teams,accessToken:Y,userID:$,userRole:X,userModels:ej,possibleUIRoles:es}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"User ID"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(ea.xv,{className:"font-mono",children:ed.user_id}),(0,t.jsx)(g.ZP,{type:"text",size:"small",icon:eZ["user-id"]?(0,t.jsx)(ei.Z,{size:12}):(0,t.jsx)(en.Z,{size:12}),onClick:()=>eA(ed.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eZ["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Email"}),(0,t.jsx)(ea.xv,{children:(null===(_=ed.user_info)||void 0===_?void 0:_.user_email)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Global Proxy Role"}),(0,t.jsx)(ea.xv,{children:(null===(N=ed.user_info)||void 0===N?void 0:N.user_role)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Created"}),(0,t.jsx)(ea.xv,{children:(null===(w=ed.user_info)||void 0===w?void 0:w.created_at)?new Date(ed.user_info.created_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Last Updated"}),(0,t.jsx)(ea.xv,{children:(null===(k=ed.user_info)||void 0===k?void 0:k.updated_at)?new Date(ed.user_info.updated_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Teams"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(Z=ed.teams)||void 0===Z?void 0:Z.length)&&(null===(S=ed.teams)||void 0===S?void 0:S.length)>0?(0,t.jsxs)(t.Fragment,{children:[null===(C=ed.teams)||void 0===C?void 0:C.slice(0,eC?ed.teams.length:20).map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",title:e.team_alias||e.team_id,children:e.team_alias||e.team_id},s)),!eC&&(null===(U=ed.teams)||void 0===U?void 0:U.length)>20&&(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eU(!0),children:["+",ed.teams.length-20," more"]}),eC&&(null===(D=ed.teams)||void 0===D?void 0:D.length)>20&&(0,t.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eU(!1),children:"Show Less"})]}):(0,t.jsx)(ea.xv,{children:"No teams"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Personal Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(B=ed.user_info)||void 0===B?void 0:null===(L=B.models)||void 0===L?void 0:L.length)&&(null===(M=ed.user_info)||void 0===M?void 0:null===(E=M.models)||void 0===E?void 0:E.length)>0?null===(O=ed.user_info)||void 0===O?void 0:null===(R=O.models)||void 0===R?void 0:R.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,t.jsx)(ea.xv,{children:"All proxy models"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"API Keys"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(T=ed.keys)||void 0===T?void 0:T.length)&&(null===(P=ed.keys)||void 0===P?void 0:P.length)>0?ed.keys.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-green-100 rounded text-xs",children:e.key_alias||e.token},s)):(0,t.jsx)(ea.xv,{children:"No API keys"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Max Budget"}),(0,t.jsx)(ea.xv,{children:(null===(q=ed.user_info)||void 0===q?void 0:q.max_budget)!==null&&(null===(G=ed.user_info)||void 0===G?void 0:G.max_budget)!==void 0?"$".concat((0,V.pw)(ed.user_info.max_budget,4)):"Unlimited"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Budget Reset"}),(0,t.jsx)(ea.xv,{children:(0,p.m)(null!==(Q=null===(J=ed.user_info)||void 0===J?void 0:J.budget_duration)&&void 0!==Q?Q:null)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Metadata"}),(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify((null===(W=ed.user_info)||void 0===W?void 0:W.metadata)||{},null,2)})]})]})]})})]})]}),(0,t.jsx)(f.Z,{isInvitationLinkModalVisible:ev,setIsInvitationLinkModalVisible:ef,baseUrl:e_||"",invitationLinkData:ey,modalType:"resetPassword"})]})}function eo(e){let{data:s=[],columns:l,isLoading:r=!1,onSortChange:i,currentSort:n,accessToken:d,userRole:c,possibleUIRoles:u,handleEdit:m,handleDelete:x,handleResetPassword:h,selectedUsers:g=[],onSelectionChange:j,enableSelection:p=!1,filters:v,updateFilters:f,initialFilters:y,teams:b,userListResponse:_,currentPage:N,handlePageChange:w}=e,[k,Z]=a.useState([{id:(null==n?void 0:n.sortBy)||"created_at",desc:(null==n?void 0:n.sortOrder)==="desc"}]),[S,C]=a.useState(null),[U,I]=a.useState(!1),[D,z]=a.useState(!1),A=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];C(e),I(s)},L=(e,s)=>{j&&(s?j([...g,e]):j(g.filter(s=>s.user_id!==e.user_id)))},B=e=>{j&&(e?j(s):j([]))},E=e=>g.some(s=>s.user_id===e.user_id),M=s.length>0&&g.length===s.length,R=g.length>0&&g.lengthu?q(u,m,x,h,A,p?{selectedUsers:g,onSelectUser:L,onSelectAll:B,isUserSelected:E,isAllSelected:M,isIndeterminate:R}:void 0):l,[u,m,x,h,A,l,p,g,M,R]),T=(0,G.b7)({data:s,columns:O,state:{sorting:k},onSortingChange:e=>{if(Z(e),e.length>0){let s=e[0],l=s.id,t=s.desc?"desc":"asc";null==i||i(l,t)}},getCoreRowModel:(0,J.sC)(),getSortedRowModel:(0,J.tj)(),enableSorting:!0});return(a.useEffect(()=>{n&&Z([{id:n.sortBy,desc:"desc"===n.sortOrder}])},[n]),S)?(0,t.jsx)(ed,{userId:S,onClose:()=>{C(null),I(!1)},accessToken:d,userRole:c,possibleUIRoles:u,initialTab:U?1:0,startInEditMode:U}):(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"border-b px-6 py-4",children:(0,t.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Search by email...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:v.email,onChange:e=>f({email:e.target.value})}),(0,t.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,t.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(D?"bg-gray-100":""),onClick:()=>z(!D),children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(v.user_id||v.user_role||v.team)&&(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,t.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{f(y)},children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),D&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Filter by User ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:v.user_id,onChange:e=>f({user_id:e.target.value})}),(0,t.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(W.Z,{value:v.user_role,onValueChange:e=>f({user_role:e}),placeholder:"Select Role",children:u&&Object.entries(u).map(e=>{let[s,l]=e;return(0,t.jsx)(o.Z,{value:s,children:l.ui_label},s)})})}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(W.Z,{value:v.team,onValueChange:e=>f({team:e}),placeholder:"Select Team",children:null==b?void 0:b.map(e=>(0,t.jsx)(o.Z,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})}),(0,t.jsx)("div",{className:"relative w-64",children:(0,t.jsx)("input",{type:"text",placeholder:"Filter by SSO ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:v.sso_user_id,onChange:e=>f({sso_user_id:e.target.value})})})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",_&&_.users&&_.users.length>0?(_.page-1)*_.page_size+1:0," ","-"," ",_&&_.users?Math.min(_.page*_.page_size,_.total):0," ","of ",_?_.total:0," results"]}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>w(N-1),disabled:1===N,className:"px-3 py-1 text-sm border rounded-md ".concat(1===N?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,t.jsx)("button",{onClick:()=>w(N+1),disabled:!_||N>=_.total_pages,className:"px-3 py-1 text-sm border rounded-md ".concat(!_||N>=_.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,t.jsx)("div",{className:"overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(Q.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(Y.Z,{children:T.getHeaderGroups().map(e=>(0,t.jsx)(ee.Z,{children:e.headers.map(e=>(0,t.jsx)(X.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,G.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(es.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(el.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(et.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,t.jsx)($.Z,{children:r?(0,t.jsx)(ee.Z,{children:(0,t.jsx)(H.Z,{colSpan:O.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"\uD83D\uDE85 Loading users..."})})})}):s.length>0?T.getRowModel().rows.map(e=>(0,t.jsx)(ee.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(H.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:()=>{"user_id"===e.column.id&&A(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,G.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(ee.Z,{children:(0,t.jsx)(H.Z,{colSpan:O.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No users found"})})})})})]})})})})]})}var ec=l(88913),eu=l(63709),em=l(87908),ex=l(26349),eh=l(96473),eg=e=>{var s;let{accessToken:l,possibleUIRoles:r,userID:n,userRole:d}=e,[o,c]=(0,a.useState)(!0),[u,m]=(0,a.useState)(null),[g,j]=(0,a.useState)(!1),[v,f]=(0,a.useState)({}),[b,_]=(0,a.useState)(!1),[N,w]=(0,a.useState)([]),{Paragraph:k}=y.default,{Option:Z}=x.default;(0,a.useEffect)(()=>{(async()=>{if(!l){c(!1);return}try{let e=await (0,i.getInternalUserSettings)(l);if(m(e),f(e.values||{}),l)try{let e=await (0,i.modelAvailableCall)(l,n,d);if(e&&e.data){let s=e.data.map(e=>e.id);w(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),A.Z.fromBackend("Failed to fetch SSO settings")}finally{c(!1)}})()},[l]);let S=async()=>{if(l){_(!0);try{let e=Object.entries(v).reduce((e,s)=>{let[l,t]=s;return e[l]=""===t?null:t,e},{}),s=await (0,i.updateInternalUserSettings)(l,e);m({...u,values:s.settings}),j(!1)}catch(e){console.error("Error updating SSO settings:",e),A.Z.fromBackend("Failed to update settings: "+e)}finally{_(!1)}}},C=(e,s)=>{f(l=>({...l,[e]:s}))},I=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[],D=e=>{let s=I(e),l=(e,l,t)=>{let a=[...s];a[e]={...a[e],[l]:t},C("teams",a)},a=e=>{C("teams",s.filter((s,l)=>l!==e))};return(0,t.jsxs)("div",{className:"space-y-3",children:[s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)(ec.xv,{className:"font-medium",children:["Team ",s+1]}),(0,t.jsx)(ec.zx,{size:"sm",variant:"secondary",icon:ex.Z,onClick:()=>a(s),className:"text-red-500 hover:text-red-700",children:"Remove"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(ec.xv,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,t.jsx)(ec.oi,{value:e.team_id,onChange:e=>l(s,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ec.xv,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,t.jsx)(h.Z,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>l(s,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ec.xv,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,t.jsxs)(x.default,{style:{width:"100%"},value:e.user_role,onChange:e=>l(s,"user_role",e),children:[(0,t.jsx)(Z,{value:"user",children:"User"}),(0,t.jsx)(Z,{value:"admin",children:"Admin"})]})]})]})]},s)),(0,t.jsx)(ec.zx,{variant:"secondary",icon:eh.Z,onClick:()=>{C("teams",[...s,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]})},z=(e,s,l)=>{var a;let i=s.type;if("teams"===e)return(0,t.jsx)("div",{className:"mt-2",children:D(v[e]||[])});if("user_role"===e&&r)return(0,t.jsx)(x.default,{style:{width:"100%"},value:v[e]||"",onChange:s=>C(e,s),className:"mt-2",children:Object.entries(r).filter(e=>{let[s]=e;return s.includes("internal_user")}).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(Z,{value:s,children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{children:l}),(0,t.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:a})]})},s)})});if("budget_duration"===e)return(0,t.jsx)(p.Z,{value:v[e]||null,onChange:s=>C(e,s),className:"mt-2"});if("boolean"===i)return(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(eu.Z,{checked:!!v[e],onChange:s=>C(e,s)})});if("array"===i&&(null===(a=s.items)||void 0===a?void 0:a.enum))return(0,t.jsx)(x.default,{mode:"multiple",style:{width:"100%"},value:v[e]||[],onChange:s=>C(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});if("models"===e)return(0,t.jsxs)(x.default,{mode:"multiple",style:{width:"100%"},value:v[e]||[],onChange:s=>C(e,s),className:"mt-2",children:[(0,t.jsx)(Z,{value:"no-default-models",children:"No Default Models"}),N.map(e=>(0,t.jsx)(Z,{value:e,children:(0,U.W0)(e)},e))]});if("string"===i&&s.enum)return(0,t.jsx)(x.default,{style:{width:"100%"},value:v[e]||"",onChange:s=>C(e,s),className:"mt-2",children:s.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});else return(0,t.jsx)(ec.oi,{value:void 0!==v[e]?String(v[e]):"",onChange:s=>C(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},L=(e,s)=>{if(null==s)return(0,t.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(s)){if(0===s.length)return(0,t.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=I(s);return(0,t.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,s)=>(0,t.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,t.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,t.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?"$".concat((0,V.pw)(e.max_budget_in_team,4)):"No limit"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,t.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},s))})}if("user_role"===e&&r&&r[s]){let{ui_label:e,description:l}=r[s];return(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium",children:e}),l&&(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:l})]})}return"budget_duration"===e?(0,t.jsx)("span",{children:(0,p.m)(s)}):"boolean"==typeof s?(0,t.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,U.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,t.jsx)("span",{children:String(s)})};return o?(0,t.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,t.jsx)(em.Z,{size:"large"})}):u?(0,t.jsxs)(ec.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(ec.Dx,{children:"Default User Settings"}),!o&&u&&(g?(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(ec.zx,{variant:"secondary",onClick:()=>{j(!1),f(u.values||{})},disabled:b,children:"Cancel"}),(0,t.jsx)(ec.zx,{onClick:S,loading:b,children:"Save Changes"})]}):(0,t.jsx)(ec.zx,{onClick:()=>j(!0),children:"Edit Settings"}))]}),(null==u?void 0:null===(s=u.field_schema)||void 0===s?void 0:s.description)&&(0,t.jsx)(k,{className:"mb-4",children:u.field_schema.description}),(0,t.jsx)(ec.iz,{}),(0,t.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=u;return s&&s.properties?Object.entries(s.properties).map(s=>{let[l,a]=s,r=e[l],i=l.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,t.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,t.jsx)(ec.xv,{className:"font-medium text-lg",children:i}),(0,t.jsx)(k,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),g?(0,t.jsx)("div",{className:"mt-2",children:z(l,a,r)}):(0,t.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:L(l,r)})]},l)}):(0,t.jsx)(ec.xv,{children:"No schema information available"})})()})]}):(0,t.jsx)(ec.Zb,{children:(0,t.jsx)(ec.xv,{children:"No settings available or you do not have permission to view them."})})},ej=l(29827),ep=l(16593),ev=l(19616);let ef={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"};var ey=e=>{var s;let{accessToken:l,token:o,userRole:c,userID:u,teams:m}=e,x=(0,ej.NL)(),[h,g]=(0,a.useState)(1),[j,p]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),[_,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),[Z,S]=(0,a.useState)("users"),[C,U]=(0,a.useState)(ef),[D,z,L]=(0,ev.G)(C,{wait:300}),[B,M]=(0,a.useState)(!1),[R,O]=(0,a.useState)(null),[T,P]=(0,a.useState)(null),[F,K]=(0,a.useState)([]),[G,J]=(0,a.useState)(!1),[W,Q]=(0,a.useState)(!1),[$,H]=(0,a.useState)([]),Y=e=>{k(e),N(!0)};(0,a.useEffect)(()=>()=>{L.cancel()},[L]),(0,a.useEffect)(()=>{P((0,i.getProxyBaseUrl)())},[]),(0,a.useEffect)(()=>{(async()=>{try{if(!u||!c||!l)return;let e=(await (0,i.modelAvailableCall)(l,u,c)).data.map(e=>e.id);console.log("available_model_names:",e),H(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,u,c]);let X=e=>{U(s=>{let l={...s,...e};return z(l),l})},ee=async e=>{if(!l){A.Z.fromBackend("Access token not found");return}try{A.Z.success("Generating password reset link...");let s=await (0,i.invitationCreateCall)(l,e);O(s),M(!0)}catch(e){A.Z.fromBackend("Failed to generate password reset link")}},es=async()=>{if(w&&l)try{await (0,i.userDeleteCall)(l,[w]),x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let s=e.users.filter(e=>e.user_id!==w);return{...e,users:s}}),A.Z.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),A.Z.fromBackend("Failed to delete user")}N(!1),k(null)},el=async()=>{b(null),p(!1)},et=async e=>{if(console.log("inside handleEditSubmit:",e),l&&o&&c&&u){try{let s=await (0,i.userUpdateUserCall)(l,e,null);x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let l=e.users.map(e=>e.user_id===s.data.user_id?(0,V.nl)(e,s.data):e);return{...e,users:l}}),A.Z.success("User ".concat(e.user_id," updated successfully"))}catch(e){console.error("There was an error updating the user",e)}b(null),p(!1)}},ea=async e=>{g(e)},er=(0,ep.a)({queryKey:["userList",{debouncedFilter:D,currentPage:h}],queryFn:async()=>{if(!l)throw Error("Access token required");return await (0,i.userListCall)(l,D.user_id?[D.user_id]:null,h,25,D.email||null,D.user_role||null,D.team||null,D.sso_user_id||null,D.sort_by,D.sort_order)},enabled:!!(l&&o&&c&&u),placeholderData:e=>e}),ei=er.data,en=(0,ep.a)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!l)throw Error("Access token required");return await (0,i.getPossibleUserRoles)(l)},enabled:!!(l&&o&&c&&u)}).data;if(er.isLoading||!l||!o||!c||!u)return(0,t.jsx)("div",{children:"Loading..."});let ed=q(en,e=>{b(e),p(!0)},Y,ee,()=>{});return(0,t.jsxs)("div",{className:"w-full p-8 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsxs)("div",{className:"flex space-x-3",children:[(0,t.jsx)(d.Z,{userID:u,accessToken:l,teams:m,possibleUIRoles:en}),(0,t.jsx)(n.z,{onClick:()=>{Q(!W),K([])},variant:W?"primary":"secondary",className:"flex items-center",children:W?"Cancel Selection":"Select Users"}),W&&(0,t.jsxs)(n.z,{onClick:()=>{if(0===F.length){A.Z.fromBackend("Please select users to edit");return}J(!0)},disabled:0===F.length,className:"flex items-center",children:["Bulk Edit (",F.length," selected)"]})]})}),(0,t.jsxs)(r.v0,{defaultIndex:0,onIndexChange:e=>S(0===e?"users":"settings"),children:[(0,t.jsxs)(r.td,{className:"mb-4",children:[(0,t.jsx)(r.OK,{children:"Users"}),(0,t.jsx)(r.OK,{children:"Default User Settings"})]}),(0,t.jsxs)(r.nP,{children:[(0,t.jsx)(r.x4,{children:(0,t.jsx)(eo,{data:(null===(s=er.data)||void 0===s?void 0:s.users)||[],columns:ed,isLoading:er.isLoading,accessToken:l,userRole:c,onSortChange:(e,s)=>{X({sort_by:e,sort_order:s})},currentSort:{sortBy:C.sort_by,sortOrder:C.sort_order},possibleUIRoles:en,handleEdit:e=>{b(e),p(!0)},handleDelete:Y,handleResetPassword:ee,enableSelection:W,selectedUsers:F,onSelectionChange:e=>{K(e)},filters:C,updateFilters:X,initialFilters:ef,teams:m,userListResponse:ei,currentPage:h,handlePageChange:ea})}),(0,t.jsx)(r.x4,{children:(0,t.jsx)(eg,{accessToken:l,possibleUIRoles:en,userID:u,userRole:c})})]})]}),(0,t.jsx)(v,{visible:j,possibleUIRoles:en,onCancel:el,user:y,onSubmit:et}),_&&(0,t.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,t.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,t.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,t.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,t.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,t.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,t.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,t.jsx)("div",{className:"sm:flex sm:items-start",children:(0,t.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,t.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"}),(0,t.jsxs)("p",{className:"text-sm font-medium text-gray-900 mt-2",children:["User ID: ",w]})]})]})})}),(0,t.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,t.jsx)(n.z,{onClick:es,color:"red",className:"ml-2",children:"Delete"}),(0,t.jsx)(n.z,{onClick:()=>{N(!1),k(null)},children:"Cancel"})]})]})]})}),(0,t.jsx)(f.Z,{isInvitationLinkModalVisible:B,setIsInvitationLinkModalVisible:M,baseUrl:T||"",invitationLinkData:R,modalType:"resetPassword"}),(0,t.jsx)(E,{visible:G,onCancel:()=>J(!1),selectedUsers:F,possibleUIRoles:en,accessToken:l,onSuccess:()=>{x.invalidateQueries({queryKey:["userList"]}),K([]),Q(!1)},teams:m,userRole:c,userModels:$,allowAllUsers:!!c&&(0,I.tY)(c)})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7155-95101d73b2137e92.js b/litellm/proxy/_experimental/out/_next/static/chunks/7155-95101d73b2137e92.js deleted file mode 100644 index c1f542b6fc..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/7155-95101d73b2137e92.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7155],{88913:function(e,s,l){l.d(s,{Dx:function(){return d.Z},Zb:function(){return a.Z},iz:function(){return r.Z},oi:function(){return n.Z},xv:function(){return i.Z},zx:function(){return t.Z}});var t=l(20831),a=l(12514),r=l(67982),i=l(84264),n=l(49566),d=l(96761)},77155:function(e,s,l){l.d(s,{Z:function(){return ey}});var t=l(57437),a=l(2265),r=l(58643),i=l(19250),n=l(16312),d=l(7765),o=l(57365),c=l(49566),u=l(13634),m=l(82680),x=l(52787),h=l(20577),g=l(73002),j=l(24199),p=l(65925),v=e=>{let{visible:s,possibleUIRoles:l,onCancel:r,user:i,onSubmit:n}=e,[d,v]=(0,a.useState)(i),[f]=u.Z.useForm();(0,a.useEffect)(()=>{f.resetFields()},[i]);let y=async()=>{f.resetFields(),r()},b=async e=>{n(e),f.resetFields(),r()};return i?(0,t.jsx)(m.Z,{visible:s,onCancel:y,footer:null,title:"Edit User "+i.user_id,width:1e3,children:(0,t.jsx)(u.Z,{form:f,onFinish:b,initialValues:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,t.jsx)(c.Z,{})}),(0,t.jsx)(u.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,t.jsx)(c.Z,{})}),(0,t.jsx)(u.Z.Item,{label:"User Role",name:"user_role",children:(0,t.jsx)(x.default,{children:l&&Object.entries(l).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(o.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(u.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,t.jsx)(h.Z,{min:0,step:.01})}),(0,t.jsx)(u.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,t.jsx)(j.Z,{min:0,step:.01})}),(0,t.jsx)(u.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(p.Z,{})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(g.ZP,{htmlType:"submit",children:"Save"})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(g.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},f=l(98187),y=l(93192),b=l(42264),_=l(61994),N=l(72188),w=l(23496),k=l(67960),Z=l(93142),S=l(89970),C=l(16853),U=l(46468),I=l(20347),D=l(15424);function z(e){let{userData:s,onCancel:l,onSubmit:r,teams:i,accessToken:d,userID:m,userRole:h,userModels:g,possibleUIRoles:v,isBulkEdit:f=!1}=e,[y]=u.Z.useForm();return a.useEffect(()=>{var e,l,t,a,r,i;y.setFieldsValue({user_id:s.user_id,user_email:null===(e=s.user_info)||void 0===e?void 0:e.user_email,user_role:null===(l=s.user_info)||void 0===l?void 0:l.user_role,models:(null===(t=s.user_info)||void 0===t?void 0:t.models)||[],max_budget:null===(a=s.user_info)||void 0===a?void 0:a.max_budget,budget_duration:null===(r=s.user_info)||void 0===r?void 0:r.budget_duration,metadata:(null===(i=s.user_info)||void 0===i?void 0:i.metadata)?JSON.stringify(s.user_info.metadata,null,2):void 0})},[s,y]),(0,t.jsxs)(u.Z,{form:y,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}r(e)},layout:"vertical",children:[!f&&(0,t.jsx)(u.Z.Item,{label:"User ID",name:"user_id",children:(0,t.jsx)(c.Z,{disabled:!0})}),!f&&(0,t.jsx)(u.Z.Item,{label:"Email",name:"user_email",children:(0,t.jsx)(c.Z,{})}),(0,t.jsx)(u.Z.Item,{label:(0,t.jsxs)("span",{children:["Global Proxy Role"," ",(0,t.jsx)(S.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,t.jsx)(D.Z,{})})]}),name:"user_role",children:(0,t.jsx)(x.default,{children:v&&Object.entries(v).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(o.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(u.Z.Item,{label:(0,t.jsxs)("span",{children:["Personal Models"," ",(0,t.jsx)(S.Z,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,t.jsx)(D.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,t.jsxs)(x.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!I.ZL.includes(h||""),children:[(0,t.jsx)(x.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,t.jsx)(x.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),g.map(e=>(0,t.jsx)(x.default.Option,{value:e,children:(0,U.W0)(e)},e))]})}),(0,t.jsx)(u.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(j.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(u.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(p.Z,{})}),(0,t.jsx)(u.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(C.Z,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,t.jsx)(n.z,{variant:"secondary",type:"button",onClick:l,children:"Cancel"}),(0,t.jsx)(n.z,{type:"submit",children:"Save Changes"})]})]})}var A=l(9114);let{Text:L,Title:B}=y.default;var E=e=>{let{visible:s,onCancel:l,selectedUsers:r,possibleUIRoles:n,accessToken:d,onSuccess:o,teams:c,userRole:u,userModels:g,allowAllUsers:j=!1}=e,[p,v]=(0,a.useState)(!1),[f,y]=(0,a.useState)([]),[S,C]=(0,a.useState)(null),[U,I]=(0,a.useState)(!1),[D,E]=(0,a.useState)(!1),M=()=>{y([]),C(null),I(!1),E(!1),l()},R=a.useMemo(()=>({user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:c||[]}),[c,s]),O=async e=>{if(console.log("formValues",e),!d){A.Z.fromBackend("Access token not found");return}v(!0);try{let s=r.map(e=>e.user_id),t={};e.user_role&&""!==e.user_role&&(t.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(t.max_budget=e.max_budget),e.models&&e.models.length>0&&(t.models=e.models),e.budget_duration&&""!==e.budget_duration&&(t.budget_duration=e.budget_duration),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata=e.metadata);let a=Object.keys(t).length>0,n=U&&f.length>0;if(!a&&!n){A.Z.fromBackend("Please modify at least one field or select teams to add users to");return}let c=[];if(a){if(D){let e=await (0,i.userBulkUpdateUserCall)(d,t,void 0,!0);c.push("Updated all users (".concat(e.total_requested," total)"))}else await (0,i.userBulkUpdateUserCall)(d,t,s),c.push("Updated ".concat(s.length," user(s)"))}if(n){let e=[];for(let s of f)try{let l=null;D?l=null:r.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null}));let t=await (0,i.teamBulkMemberAddCall)(d,s,l||null,S||void 0,D);console.log("result",t),e.push({teamId:s,success:!0,successfulAdditions:t.successful_additions,failedAdditions:t.failed_additions})}catch(l){console.error("Failed to add users to team ".concat(s,":"),l),e.push({teamId:s,success:!1,error:l})}let s=e.filter(e=>e.success),l=e.filter(e=>!e.success);if(s.length>0){let e=s.reduce((e,s)=>e+s.successfulAdditions,0);c.push("Added users to ".concat(s.length," team(s) (").concat(e," total additions)"))}l.length>0&&b.ZP.warning("Failed to add users to ".concat(l.length," team(s)"))}c.length>0&&A.Z.success(c.join(". ")),y([]),C(null),I(!1),E(!1),o(),l()}catch(e){console.error("Bulk operation failed:",e),A.Z.fromBackend("Failed to perform bulk operations")}finally{v(!1)}};return(0,t.jsxs)(m.Z,{visible:s,onCancel:M,footer:null,title:D?"Bulk Edit All Users":"Bulk Edit ".concat(r.length," User(s)"),width:800,children:[j&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(_.Z,{checked:D,onChange:e=>E(e.target.checked),children:(0,t.jsx)(L,{strong:!0,children:"Update ALL users in the system"})}),D&&(0,t.jsx)("div",{style:{marginTop:8},children:(0,t.jsx)(L,{type:"warning",style:{fontSize:"12px"},children:"⚠️ This will apply changes to ALL users in the system, not just the selected ones."})})]}),!D&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)(B,{level:5,children:["Selected Users (",r.length,"):"]}),(0,t.jsx)(N.Z,{size:"small",bordered:!0,dataSource:r,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,t.jsx)(L,{strong:!0,style:{fontSize:"12px"},children:e.length>20?"".concat(e.slice(0,20),"..."):e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,t.jsx)(L,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>{var s;return(0,t.jsx)(L,{style:{fontSize:"12px"},children:(null==n?void 0:null===(s=n[e])||void 0===s?void 0:s.ui_label)||e})}},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,t.jsx)(L,{style:{fontSize:"12px"},children:null!==e?"$".concat(e):"Unlimited"})}]})]}),(0,t.jsx)(w.Z,{}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsxs)(L,{children:[(0,t.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,t.jsx)(k.Z,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,t.jsxs)(Z.Z,{direction:"vertical",style:{width:"100%"},children:[(0,t.jsx)(_.Z,{checked:U,onChange:e=>I(e.target.checked),children:"Add selected users to teams"}),U&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(L,{strong:!0,children:"Select Teams:"}),(0,t.jsx)(x.default,{mode:"multiple",placeholder:"Select teams to add users to",value:f,onChange:y,style:{width:"100%",marginTop:8},options:(null==c?void 0:c.map(e=>({label:e.team_alias||e.team_id,value:e.team_id})))||[]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(L,{strong:!0,children:"Team Budget (Optional):"}),(0,t.jsx)(h.Z,{placeholder:"Max budget per user in team",value:S,onChange:e=>C(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,t.jsx)(L,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,t.jsx)(L,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,t.jsx)(z,{userData:R,onCancel:M,onSubmit:O,teams:c,accessToken:d,userID:"bulk_edit",userRole:u,userModels:g,possibleUIRoles:n,isBulkEdit:!0}),p&&(0,t.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,t.jsxs)(L,{children:["Updating ",D?"all users":r.length," user(s)..."]})})]})},M=l(41649),R=l(67101),O=l(47323),T=l(15731),P=l(53410),F=l(74998),K=l(23628),V=l(59872);let q=(e,s,l,a,r,i)=>{let n=[{header:"User ID",accessorKey:"user_id",cell:e=>{let{row:s}=e;return(0,t.jsx)(S.Z,{title:s.original.user_id,children:(0,t.jsx)("span",{className:"text-xs",children:s.original.user_id?"".concat(s.original.user_id.slice(0,7),"..."):"-"})})}},{header:"Email",accessorKey:"user_email",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.user_email||"-"})}},{header:"Global Proxy Role",accessorKey:"user_role",cell:s=>{var l;let{row:a}=s;return(0,t.jsx)("span",{className:"text-xs",children:(null==e?void 0:null===(l=e[a.original.user_role])||void 0===l?void 0:l.ui_label)||"-"})}},{header:"Spend (USD)",accessorKey:"spend",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.spend?(0,V.pw)(s.original.spend,4):"-"})}},{header:"Budget (USD)",accessorKey:"max_budget",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.max_budget?s.original.max_budget:"Unlimited"})}},{header:()=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:"SSO ID"}),(0,t.jsx)(S.Z,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,t.jsx)(T.Z,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.sso_user_id?s.original.sso_user_id:"-"})}},{header:"API Keys",accessorKey:"key_count",cell:e=>{let{row:s}=e;return(0,t.jsx)(R.Z,{numItems:2,children:s.original.key_count>0?(0,t.jsxs)(M.Z,{size:"xs",color:"indigo",children:[s.original.key_count," Keys"]}):(0,t.jsx)(M.Z,{size:"xs",color:"gray",children:"No Keys"})})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.created_at?new Date(s.original.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.updated_at?new Date(s.original.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"",cell:e=>{let{row:s}=e;return(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(S.Z,{title:"Edit user details",zIndex:9999,children:(0,t.jsx)(O.Z,{icon:P.Z,size:"sm",onClick:()=>r(s.original.user_id,!0)})}),(0,t.jsx)(S.Z,{title:"Delete user",zIndex:9999,children:(0,t.jsx)(O.Z,{icon:F.Z,size:"sm",onClick:()=>l(s.original.user_id)})}),(0,t.jsx)(S.Z,{title:"Reset Password",zIndex:9999,children:(0,t.jsx)(O.Z,{icon:K.Z,size:"sm",onClick:()=>a(s.original.user_id)})})]})}}];if(i){let{onSelectUser:e,onSelectAll:s,isUserSelected:l,isAllSelected:a,isIndeterminate:r}=i;return[{id:"select",header:()=>(0,t.jsx)(_.Z,{indeterminate:r,checked:a,onChange:e=>s(e.target.checked),onClick:e=>e.stopPropagation()}),cell:s=>{let{row:a}=s;return(0,t.jsx)(_.Z,{checked:l(a.original),onChange:s=>e(a.original,s.target.checked),onClick:e=>e.stopPropagation()})}},...n]}return n};var G=l(71594),J=l(24525),W=l(27281),Q=l(21626),$=l(97214),H=l(28241),Y=l(58834),X=l(69552),ee=l(71876),es=l(44633),el=l(86462),et=l(49084),ea=l(84717),er=l(10900),ei=l(30401),en=l(78867);function ed(e){var s,l,r,n,d,o,c,u,m,x,h,j,v,y,b,_,N,w,k,Z,S,C,U,D,L,B,E,M,R,O,T,P,q,G,J,W,Q;let{userId:$,onClose:H,accessToken:Y,userRole:X,onDelete:ee,possibleUIRoles:es,initialTab:el=0,startInEditMode:et=!1}=e,[ed,eo]=(0,a.useState)(null),[ec,eu]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(!0),[eh,eg]=(0,a.useState)(et),[ej,ep]=(0,a.useState)([]),[ev,ef]=(0,a.useState)(!1),[ey,eb]=(0,a.useState)(null),[e_,eN]=(0,a.useState)(null),[ew,ek]=(0,a.useState)(el),[eZ,eS]=(0,a.useState)({}),[eC,eU]=(0,a.useState)(!1);a.useEffect(()=>{eN((0,i.getProxyBaseUrl)())},[]),a.useEffect(()=>{console.log("userId: ".concat($,", userRole: ").concat(X,", accessToken: ").concat(Y)),(async()=>{try{if(!Y)return;let e=await (0,i.userInfoCall)(Y,$,X||"",!1,null,null,!0);eo(e);let s=(await (0,i.modelAvailableCall)(Y,$,X||"")).data.map(e=>e.id);ep(s)}catch(e){console.error("Error fetching user data:",e),A.Z.fromBackend("Failed to fetch user data")}finally{ex(!1)}})()},[Y,$,X]);let eI=async()=>{if(!Y){A.Z.fromBackend("Access token not found");return}try{A.Z.success("Generating password reset link...");let e=await (0,i.invitationCreateCall)(Y,$);eb(e),ef(!0)}catch(e){A.Z.fromBackend("Failed to generate password reset link")}},eD=async()=>{try{if(!Y)return;await (0,i.userDeleteCall)(Y,[$]),A.Z.success("User deleted successfully"),ee&&ee(),H()}catch(e){console.error("Error deleting user:",e),A.Z.fromBackend("Failed to delete user")}},ez=async e=>{try{if(!Y||!ed)return;await (0,i.userUpdateUserCall)(Y,e,null),eo({...ed,user_info:{...ed.user_info,user_email:e.user_email,models:e.models,max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:e.metadata}}),A.Z.success("User updated successfully"),eg(!1)}catch(e){console.error("Error updating user:",e),A.Z.fromBackend("Failed to update user")}};if(em)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(ea.zx,{icon:er.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(ea.xv,{children:"Loading user data..."})]});if(!ed)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(ea.zx,{icon:er.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(ea.xv,{children:"User not found"})]});let eA=async(e,s)=>{await (0,V.vQ)(e)&&(eS(e=>({...e,[s]:!0})),setTimeout(()=>{eS(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.zx,{icon:er.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(ea.Dx,{children:(null===(s=ed.user_info)||void 0===s?void 0:s.user_email)||"User"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(ea.xv,{className:"text-gray-500 font-mono",children:ed.user_id}),(0,t.jsx)(g.ZP,{type:"text",size:"small",icon:eZ["user-id"]?(0,t.jsx)(ei.Z,{size:12}):(0,t.jsx)(en.Z,{size:12}),onClick:()=>eA(ed.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eZ["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),X&&I.LQ.includes(X)&&(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(ea.zx,{icon:K.Z,variant:"secondary",onClick:eI,className:"flex items-center",children:"Reset Password"}),(0,t.jsx)(ea.zx,{icon:F.Z,variant:"secondary",onClick:()=>eu(!0),className:"flex items-center",children:"Delete User"})]})]}),ec&&(0,t.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,t.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,t.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,t.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,t.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,t.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,t.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,t.jsx)("div",{className:"sm:flex sm:items-start",children:(0,t.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,t.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"})})]})})}),(0,t.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,t.jsx)(ea.zx,{onClick:eD,color:"red",className:"ml-2",children:"Delete"}),(0,t.jsx)(ea.zx,{onClick:()=>eu(!1),children:"Cancel"})]})]})]})}),(0,t.jsxs)(ea.v0,{defaultIndex:ew,onIndexChange:ek,children:[(0,t.jsxs)(ea.td,{className:"mb-4",children:[(0,t.jsx)(ea.OK,{children:"Overview"}),(0,t.jsx)(ea.OK,{children:"Details"})]}),(0,t.jsxs)(ea.nP,{children:[(0,t.jsx)(ea.x4,{children:(0,t.jsxs)(ea.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(ea.Zb,{children:[(0,t.jsx)(ea.xv,{children:"Spend"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(ea.Dx,{children:["$",(0,V.pw)((null===(l=ed.user_info)||void 0===l?void 0:l.spend)||0,4)]}),(0,t.jsxs)(ea.xv,{children:["of"," ",(null===(r=ed.user_info)||void 0===r?void 0:r.max_budget)!==null?"$".concat((0,V.pw)(ed.user_info.max_budget,4)):"Unlimited"]})]})]}),(0,t.jsxs)(ea.Zb,{children:[(0,t.jsx)(ea.xv,{children:"Teams"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(n=ed.teams)||void 0===n?void 0:n.length)&&(null===(d=ed.teams)||void 0===d?void 0:d.length)>0?(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[null===(o=ed.teams)||void 0===o?void 0:o.slice(0,eC?ed.teams.length:20).map((e,s)=>(0,t.jsx)(ea.Ct,{color:"blue",title:e.team_alias,children:e.team_alias},s)),!eC&&(null===(c=ed.teams)||void 0===c?void 0:c.length)>20&&(0,t.jsxs)(ea.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eU(!0),children:["+",ed.teams.length-20," more"]}),eC&&(null===(u=ed.teams)||void 0===u?void 0:u.length)>20&&(0,t.jsx)(ea.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eU(!1),children:"Show Less"})]}):(0,t.jsx)(ea.xv,{children:"No teams"})})]}),(0,t.jsxs)(ea.Zb,{children:[(0,t.jsx)(ea.xv,{children:"API Keys"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsxs)(ea.xv,{children:[(null===(m=ed.keys)||void 0===m?void 0:m.length)||0," keys"]})})]}),(0,t.jsxs)(ea.Zb,{children:[(0,t.jsx)(ea.xv,{children:"Personal Models"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(h=ed.user_info)||void 0===h?void 0:null===(x=h.models)||void 0===x?void 0:x.length)&&(null===(v=ed.user_info)||void 0===v?void 0:null===(j=v.models)||void 0===j?void 0:j.length)>0?null===(b=ed.user_info)||void 0===b?void 0:null===(y=b.models)||void 0===y?void 0:y.map((e,s)=>(0,t.jsx)(ea.xv,{children:e},s)):(0,t.jsx)(ea.xv,{children:"All proxy models"})})]})]})}),(0,t.jsx)(ea.x4,{children:(0,t.jsxs)(ea.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(ea.Dx,{children:"User Settings"}),!eh&&X&&I.LQ.includes(X)&&(0,t.jsx)(ea.zx,{variant:"light",onClick:()=>eg(!0),children:"Edit Settings"})]}),eh&&ed?(0,t.jsx)(z,{userData:ed,onCancel:()=>eg(!1),onSubmit:ez,teams:ed.teams,accessToken:Y,userID:$,userRole:X,userModels:ej,possibleUIRoles:es}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"User ID"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(ea.xv,{className:"font-mono",children:ed.user_id}),(0,t.jsx)(g.ZP,{type:"text",size:"small",icon:eZ["user-id"]?(0,t.jsx)(ei.Z,{size:12}):(0,t.jsx)(en.Z,{size:12}),onClick:()=>eA(ed.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eZ["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Email"}),(0,t.jsx)(ea.xv,{children:(null===(_=ed.user_info)||void 0===_?void 0:_.user_email)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Global Proxy Role"}),(0,t.jsx)(ea.xv,{children:(null===(N=ed.user_info)||void 0===N?void 0:N.user_role)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Created"}),(0,t.jsx)(ea.xv,{children:(null===(w=ed.user_info)||void 0===w?void 0:w.created_at)?new Date(ed.user_info.created_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Last Updated"}),(0,t.jsx)(ea.xv,{children:(null===(k=ed.user_info)||void 0===k?void 0:k.updated_at)?new Date(ed.user_info.updated_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Teams"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(Z=ed.teams)||void 0===Z?void 0:Z.length)&&(null===(S=ed.teams)||void 0===S?void 0:S.length)>0?(0,t.jsxs)(t.Fragment,{children:[null===(C=ed.teams)||void 0===C?void 0:C.slice(0,eC?ed.teams.length:20).map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",title:e.team_alias||e.team_id,children:e.team_alias||e.team_id},s)),!eC&&(null===(U=ed.teams)||void 0===U?void 0:U.length)>20&&(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eU(!0),children:["+",ed.teams.length-20," more"]}),eC&&(null===(D=ed.teams)||void 0===D?void 0:D.length)>20&&(0,t.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eU(!1),children:"Show Less"})]}):(0,t.jsx)(ea.xv,{children:"No teams"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Personal Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(B=ed.user_info)||void 0===B?void 0:null===(L=B.models)||void 0===L?void 0:L.length)&&(null===(M=ed.user_info)||void 0===M?void 0:null===(E=M.models)||void 0===E?void 0:E.length)>0?null===(O=ed.user_info)||void 0===O?void 0:null===(R=O.models)||void 0===R?void 0:R.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,t.jsx)(ea.xv,{children:"All proxy models"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"API Keys"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(T=ed.keys)||void 0===T?void 0:T.length)&&(null===(P=ed.keys)||void 0===P?void 0:P.length)>0?ed.keys.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-green-100 rounded text-xs",children:e.key_alias||e.token},s)):(0,t.jsx)(ea.xv,{children:"No API keys"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Max Budget"}),(0,t.jsx)(ea.xv,{children:(null===(q=ed.user_info)||void 0===q?void 0:q.max_budget)!==null&&(null===(G=ed.user_info)||void 0===G?void 0:G.max_budget)!==void 0?"$".concat((0,V.pw)(ed.user_info.max_budget,4)):"Unlimited"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Budget Reset"}),(0,t.jsx)(ea.xv,{children:(0,p.m)(null!==(Q=null===(J=ed.user_info)||void 0===J?void 0:J.budget_duration)&&void 0!==Q?Q:null)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ea.xv,{className:"font-medium",children:"Metadata"}),(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify((null===(W=ed.user_info)||void 0===W?void 0:W.metadata)||{},null,2)})]})]})]})})]})]}),(0,t.jsx)(f.Z,{isInvitationLinkModalVisible:ev,setIsInvitationLinkModalVisible:ef,baseUrl:e_||"",invitationLinkData:ey,modalType:"resetPassword"})]})}function eo(e){let{data:s=[],columns:l,isLoading:r=!1,onSortChange:i,currentSort:n,accessToken:d,userRole:c,possibleUIRoles:u,handleEdit:m,handleDelete:x,handleResetPassword:h,selectedUsers:g=[],onSelectionChange:j,enableSelection:p=!1,filters:v,updateFilters:f,initialFilters:y,teams:b,userListResponse:_,currentPage:N,handlePageChange:w}=e,[k,Z]=a.useState([{id:(null==n?void 0:n.sortBy)||"created_at",desc:(null==n?void 0:n.sortOrder)==="desc"}]),[S,C]=a.useState(null),[U,I]=a.useState(!1),[D,z]=a.useState(!1),A=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];C(e),I(s)},L=(e,s)=>{j&&(s?j([...g,e]):j(g.filter(s=>s.user_id!==e.user_id)))},B=e=>{j&&(e?j(s):j([]))},E=e=>g.some(s=>s.user_id===e.user_id),M=s.length>0&&g.length===s.length,R=g.length>0&&g.lengthu?q(u,m,x,h,A,p?{selectedUsers:g,onSelectUser:L,onSelectAll:B,isUserSelected:E,isAllSelected:M,isIndeterminate:R}:void 0):l,[u,m,x,h,A,l,p,g,M,R]),T=(0,G.b7)({data:s,columns:O,state:{sorting:k},onSortingChange:e=>{if(Z(e),e.length>0){let s=e[0],l=s.id,t=s.desc?"desc":"asc";null==i||i(l,t)}},getCoreRowModel:(0,J.sC)(),getSortedRowModel:(0,J.tj)(),enableSorting:!0});return(a.useEffect(()=>{n&&Z([{id:n.sortBy,desc:"desc"===n.sortOrder}])},[n]),S)?(0,t.jsx)(ed,{userId:S,onClose:()=>{C(null),I(!1)},accessToken:d,userRole:c,possibleUIRoles:u,initialTab:U?1:0,startInEditMode:U}):(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"border-b px-6 py-4",children:(0,t.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Search by email...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:v.email,onChange:e=>f({email:e.target.value})}),(0,t.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,t.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(D?"bg-gray-100":""),onClick:()=>z(!D),children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(v.user_id||v.user_role||v.team)&&(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,t.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{f(y)},children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),D&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Filter by User ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:v.user_id,onChange:e=>f({user_id:e.target.value})}),(0,t.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(W.Z,{value:v.user_role,onValueChange:e=>f({user_role:e}),placeholder:"Select Role",children:u&&Object.entries(u).map(e=>{let[s,l]=e;return(0,t.jsx)(o.Z,{value:s,children:l.ui_label},s)})})}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(W.Z,{value:v.team,onValueChange:e=>f({team:e}),placeholder:"Select Team",children:null==b?void 0:b.map(e=>(0,t.jsx)(o.Z,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})}),(0,t.jsx)("div",{className:"relative w-64",children:(0,t.jsx)("input",{type:"text",placeholder:"Filter by SSO ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:v.sso_user_id,onChange:e=>f({sso_user_id:e.target.value})})})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",_&&_.users&&_.users.length>0?(_.page-1)*_.page_size+1:0," ","-"," ",_&&_.users?Math.min(_.page*_.page_size,_.total):0," ","of ",_?_.total:0," results"]}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>w(N-1),disabled:1===N,className:"px-3 py-1 text-sm border rounded-md ".concat(1===N?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,t.jsx)("button",{onClick:()=>w(N+1),disabled:!_||N>=_.total_pages,className:"px-3 py-1 text-sm border rounded-md ".concat(!_||N>=_.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,t.jsx)("div",{className:"overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(Q.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(Y.Z,{children:T.getHeaderGroups().map(e=>(0,t.jsx)(ee.Z,{children:e.headers.map(e=>(0,t.jsx)(X.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,G.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(es.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(el.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(et.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,t.jsx)($.Z,{children:r?(0,t.jsx)(ee.Z,{children:(0,t.jsx)(H.Z,{colSpan:O.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"\uD83D\uDE85 Loading users..."})})})}):s.length>0?T.getRowModel().rows.map(e=>(0,t.jsx)(ee.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(H.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:()=>{"user_id"===e.column.id&&A(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,G.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(ee.Z,{children:(0,t.jsx)(H.Z,{colSpan:O.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No users found"})})})})})]})})})})]})}var ec=l(88913),eu=l(63709),em=l(87908),ex=l(26349),eh=l(96473),eg=e=>{var s;let{accessToken:l,possibleUIRoles:r,userID:n,userRole:d}=e,[o,c]=(0,a.useState)(!0),[u,m]=(0,a.useState)(null),[g,j]=(0,a.useState)(!1),[v,f]=(0,a.useState)({}),[b,_]=(0,a.useState)(!1),[N,w]=(0,a.useState)([]),{Paragraph:k}=y.default,{Option:Z}=x.default;(0,a.useEffect)(()=>{(async()=>{if(!l){c(!1);return}try{let e=await (0,i.getInternalUserSettings)(l);if(m(e),f(e.values||{}),l)try{let e=await (0,i.modelAvailableCall)(l,n,d);if(e&&e.data){let s=e.data.map(e=>e.id);w(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),A.Z.fromBackend("Failed to fetch SSO settings")}finally{c(!1)}})()},[l]);let S=async()=>{if(l){_(!0);try{let e=Object.entries(v).reduce((e,s)=>{let[l,t]=s;return e[l]=""===t?null:t,e},{}),s=await (0,i.updateInternalUserSettings)(l,e);m({...u,values:s.settings}),j(!1)}catch(e){console.error("Error updating SSO settings:",e),A.Z.fromBackend("Failed to update settings: "+e)}finally{_(!1)}}},C=(e,s)=>{f(l=>({...l,[e]:s}))},I=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[],D=e=>{let s=I(e),l=(e,l,t)=>{let a=[...s];a[e]={...a[e],[l]:t},C("teams",a)},a=e=>{C("teams",s.filter((s,l)=>l!==e))};return(0,t.jsxs)("div",{className:"space-y-3",children:[s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)(ec.xv,{className:"font-medium",children:["Team ",s+1]}),(0,t.jsx)(ec.zx,{size:"sm",variant:"secondary",icon:ex.Z,onClick:()=>a(s),className:"text-red-500 hover:text-red-700",children:"Remove"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(ec.xv,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,t.jsx)(ec.oi,{value:e.team_id,onChange:e=>l(s,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ec.xv,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,t.jsx)(h.Z,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>l(s,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ec.xv,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,t.jsxs)(x.default,{style:{width:"100%"},value:e.user_role,onChange:e=>l(s,"user_role",e),children:[(0,t.jsx)(Z,{value:"user",children:"User"}),(0,t.jsx)(Z,{value:"admin",children:"Admin"})]})]})]})]},s)),(0,t.jsx)(ec.zx,{variant:"secondary",icon:eh.Z,onClick:()=>{C("teams",[...s,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]})},z=(e,s,l)=>{var a;let i=s.type;if("teams"===e)return(0,t.jsx)("div",{className:"mt-2",children:D(v[e]||[])});if("user_role"===e&&r)return(0,t.jsx)(x.default,{style:{width:"100%"},value:v[e]||"",onChange:s=>C(e,s),className:"mt-2",children:Object.entries(r).filter(e=>{let[s]=e;return s.includes("internal_user")}).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(Z,{value:s,children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{children:l}),(0,t.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:a})]})},s)})});if("budget_duration"===e)return(0,t.jsx)(p.Z,{value:v[e]||null,onChange:s=>C(e,s),className:"mt-2"});if("boolean"===i)return(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(eu.Z,{checked:!!v[e],onChange:s=>C(e,s)})});if("array"===i&&(null===(a=s.items)||void 0===a?void 0:a.enum))return(0,t.jsx)(x.default,{mode:"multiple",style:{width:"100%"},value:v[e]||[],onChange:s=>C(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});if("models"===e)return(0,t.jsxs)(x.default,{mode:"multiple",style:{width:"100%"},value:v[e]||[],onChange:s=>C(e,s),className:"mt-2",children:[(0,t.jsx)(Z,{value:"no-default-models",children:"No Default Models"}),N.map(e=>(0,t.jsx)(Z,{value:e,children:(0,U.W0)(e)},e))]});if("string"===i&&s.enum)return(0,t.jsx)(x.default,{style:{width:"100%"},value:v[e]||"",onChange:s=>C(e,s),className:"mt-2",children:s.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});else return(0,t.jsx)(ec.oi,{value:void 0!==v[e]?String(v[e]):"",onChange:s=>C(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},L=(e,s)=>{if(null==s)return(0,t.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(s)){if(0===s.length)return(0,t.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=I(s);return(0,t.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,s)=>(0,t.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,t.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,t.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?"$".concat((0,V.pw)(e.max_budget_in_team,4)):"No limit"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,t.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},s))})}if("user_role"===e&&r&&r[s]){let{ui_label:e,description:l}=r[s];return(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium",children:e}),l&&(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:l})]})}return"budget_duration"===e?(0,t.jsx)("span",{children:(0,p.m)(s)}):"boolean"==typeof s?(0,t.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,U.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,t.jsx)("span",{children:String(s)})};return o?(0,t.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,t.jsx)(em.Z,{size:"large"})}):u?(0,t.jsxs)(ec.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(ec.Dx,{children:"Default User Settings"}),!o&&u&&(g?(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(ec.zx,{variant:"secondary",onClick:()=>{j(!1),f(u.values||{})},disabled:b,children:"Cancel"}),(0,t.jsx)(ec.zx,{onClick:S,loading:b,children:"Save Changes"})]}):(0,t.jsx)(ec.zx,{onClick:()=>j(!0),children:"Edit Settings"}))]}),(null==u?void 0:null===(s=u.field_schema)||void 0===s?void 0:s.description)&&(0,t.jsx)(k,{className:"mb-4",children:u.field_schema.description}),(0,t.jsx)(ec.iz,{}),(0,t.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=u;return s&&s.properties?Object.entries(s.properties).map(s=>{let[l,a]=s,r=e[l],i=l.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,t.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,t.jsx)(ec.xv,{className:"font-medium text-lg",children:i}),(0,t.jsx)(k,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),g?(0,t.jsx)("div",{className:"mt-2",children:z(l,a,r)}):(0,t.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:L(l,r)})]},l)}):(0,t.jsx)(ec.xv,{children:"No schema information available"})})()})]}):(0,t.jsx)(ec.Zb,{children:(0,t.jsx)(ec.xv,{children:"No settings available or you do not have permission to view them."})})},ej=l(29827),ep=l(16593),ev=l(19616);let ef={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"};var ey=e=>{var s;let{accessToken:l,token:o,userRole:c,userID:u,teams:m}=e,x=(0,ej.NL)(),[h,g]=(0,a.useState)(1),[j,p]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),[_,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),[Z,S]=(0,a.useState)("users"),[C,U]=(0,a.useState)(ef),[D,z,L]=(0,ev.G)(C,{wait:300}),[B,M]=(0,a.useState)(!1),[R,O]=(0,a.useState)(null),[T,P]=(0,a.useState)(null),[F,K]=(0,a.useState)([]),[G,J]=(0,a.useState)(!1),[W,Q]=(0,a.useState)(!1),[$,H]=(0,a.useState)([]),Y=e=>{k(e),N(!0)};(0,a.useEffect)(()=>()=>{L.cancel()},[L]),(0,a.useEffect)(()=>{P((0,i.getProxyBaseUrl)())},[]),(0,a.useEffect)(()=>{(async()=>{try{if(!u||!c||!l)return;let e=(await (0,i.modelAvailableCall)(l,u,c)).data.map(e=>e.id);console.log("available_model_names:",e),H(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,u,c]);let X=e=>{U(s=>{let l={...s,...e};return z(l),l})},ee=async e=>{if(!l){A.Z.fromBackend("Access token not found");return}try{A.Z.success("Generating password reset link...");let s=await (0,i.invitationCreateCall)(l,e);O(s),M(!0)}catch(e){A.Z.fromBackend("Failed to generate password reset link")}},es=async()=>{if(w&&l)try{await (0,i.userDeleteCall)(l,[w]),x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let s=e.users.filter(e=>e.user_id!==w);return{...e,users:s}}),A.Z.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),A.Z.fromBackend("Failed to delete user")}N(!1),k(null)},el=async()=>{b(null),p(!1)},et=async e=>{if(console.log("inside handleEditSubmit:",e),l&&o&&c&&u){try{let s=await (0,i.userUpdateUserCall)(l,e,null);x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let l=e.users.map(e=>e.user_id===s.data.user_id?(0,V.nl)(e,s.data):e);return{...e,users:l}}),A.Z.success("User ".concat(e.user_id," updated successfully"))}catch(e){console.error("There was an error updating the user",e)}b(null),p(!1)}},ea=async e=>{g(e)},er=(0,ep.a)({queryKey:["userList",{debouncedFilter:D,currentPage:h}],queryFn:async()=>{if(!l)throw Error("Access token required");return await (0,i.userListCall)(l,D.user_id?[D.user_id]:null,h,25,D.email||null,D.user_role||null,D.team||null,D.sso_user_id||null,D.sort_by,D.sort_order)},enabled:!!(l&&o&&c&&u),placeholderData:e=>e}),ei=er.data,en=(0,ep.a)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!l)throw Error("Access token required");return await (0,i.getPossibleUserRoles)(l)},enabled:!!(l&&o&&c&&u)}).data;if(er.isLoading||!l||!o||!c||!u)return(0,t.jsx)("div",{children:"Loading..."});let ed=q(en,e=>{b(e),p(!0)},Y,ee,()=>{});return(0,t.jsxs)("div",{className:"w-full p-8 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsxs)("div",{className:"flex space-x-3",children:[(0,t.jsx)(d.Z,{userID:u,accessToken:l,teams:m,possibleUIRoles:en}),(0,t.jsx)(n.z,{onClick:()=>{Q(!W),K([])},variant:W?"primary":"secondary",className:"flex items-center",children:W?"Cancel Selection":"Select Users"}),W&&(0,t.jsxs)(n.z,{onClick:()=>{if(0===F.length){A.Z.fromBackend("Please select users to edit");return}J(!0)},disabled:0===F.length,className:"flex items-center",children:["Bulk Edit (",F.length," selected)"]})]})}),(0,t.jsxs)(r.v0,{defaultIndex:0,onIndexChange:e=>S(0===e?"users":"settings"),children:[(0,t.jsxs)(r.td,{className:"mb-4",children:[(0,t.jsx)(r.OK,{children:"Users"}),(0,t.jsx)(r.OK,{children:"Default User Settings"})]}),(0,t.jsxs)(r.nP,{children:[(0,t.jsx)(r.x4,{children:(0,t.jsx)(eo,{data:(null===(s=er.data)||void 0===s?void 0:s.users)||[],columns:ed,isLoading:er.isLoading,accessToken:l,userRole:c,onSortChange:(e,s)=>{X({sort_by:e,sort_order:s})},currentSort:{sortBy:C.sort_by,sortOrder:C.sort_order},possibleUIRoles:en,handleEdit:e=>{b(e),p(!0)},handleDelete:Y,handleResetPassword:ee,enableSelection:W,selectedUsers:F,onSelectionChange:e=>{K(e)},filters:C,updateFilters:X,initialFilters:ef,teams:m,userListResponse:ei,currentPage:h,handlePageChange:ea})}),(0,t.jsx)(r.x4,{children:(0,t.jsx)(eg,{accessToken:l,possibleUIRoles:en,userID:u,userRole:c})})]})]}),(0,t.jsx)(v,{visible:j,possibleUIRoles:en,onCancel:el,user:y,onSubmit:et}),_&&(0,t.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,t.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,t.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,t.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,t.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,t.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,t.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,t.jsx)("div",{className:"sm:flex sm:items-start",children:(0,t.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,t.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"}),(0,t.jsxs)("p",{className:"text-sm font-medium text-gray-900 mt-2",children:["User ID: ",w]})]})]})})}),(0,t.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,t.jsx)(n.z,{onClick:es,color:"red",className:"ml-2",children:"Delete"}),(0,t.jsx)(n.z,{onClick:()=>{N(!1),k(null)},children:"Cancel"})]})]})]})}),(0,t.jsx)(f.Z,{isInvitationLinkModalVisible:B,setIsInvitationLinkModalVisible:M,baseUrl:T||"",invitationLinkData:R,modalType:"resetPassword"}),(0,t.jsx)(E,{visible:G,onCancel:()=>J(!1),selectedUsers:F,possibleUIRoles:en,accessToken:l,onSuccess:()=>{x.invalidateQueries({queryKey:["userList"]}),K([]),Q(!1)},teams:m,userRole:c,userModels:$,allowAllUsers:!!c&&(0,I.tY)(c)})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7801-2b5492cdeacaedc4.js b/litellm/proxy/_experimental/out/_next/static/chunks/7801-2b5492cdeacaedc4.js new file mode 100644 index 0000000000..4f3c207d80 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/7801-2b5492cdeacaedc4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7801],{16312:function(e,l,t){t.d(l,{z:function(){return s.Z}});var s=t(20831)},9335:function(e,l,t){t.d(l,{JO:function(){return s.Z},OK:function(){return a.Z},nP:function(){return n.Z},td:function(){return o.Z},v0:function(){return r.Z},x4:function(){return i.Z}});var s=t(47323),a=t(12485),r=t(18135),o=t(35242),i=t(29706),n=t(77991)},58643:function(e,l,t){t.d(l,{OK:function(){return s.Z},nP:function(){return i.Z},td:function(){return r.Z},v0:function(){return a.Z},x4:function(){return o.Z}});var s=t(12485),a=t(18135),r=t(35242),o=t(29706),i=t(77991)},37801:function(e,l,t){t.d(l,{Z:function(){return lO}});var s=t(57437),a=t(2265),r=t(49804),o=t(67101),i=t(84264),n=t(19250),d=t(42673),c=t(9114);let m=async(e,l,t)=>{try{console.log("handling submit for formValues:",e);let l=e.model_mappings||[];if("model_mappings"in e&&delete e.model_mappings,e.model&&e.model.includes("all-wildcard")){let t=e.custom_llm_provider,s=d.fK[t]+"/*";e.model_name=s,l.push({public_name:s,litellm_model:s}),e.model=s}let t=[];for(let s of l){let l={},a={},r=s.public_name;for(let[t,r]of(l.model=s.litellm_model,e.input_cost_per_token&&(e.input_cost_per_token=Number(e.input_cost_per_token)/1e6),e.output_cost_per_token&&(e.output_cost_per_token=Number(e.output_cost_per_token)/1e6),l.model=s.litellm_model,console.log("formValues add deployment:",e),Object.entries(e)))if(""!==r&&"custom_pricing"!==t&&"pricing_model"!==t&&"cache_control"!==t){if("model_name"==t)l.model=r;else if("custom_llm_provider"==t){console.log("custom_llm_provider:",r);let e=d.fK[r];l.custom_llm_provider=e,console.log("custom_llm_provider mappingResult:",e)}else if("model"==t)continue;else if("base_model"===t)a[t]=r;else if("team_id"===t)a.team_id=r;else if("model_access_group"===t)a.access_groups=r;else if("mode"==t)console.log("placing mode in modelInfo"),a.mode=r,delete l.mode;else if("custom_model_name"===t)l.model=r;else if("litellm_extra_params"==t){console.log("litellm_extra_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw c.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[t,s]of Object.entries(e))l[t]=s}}else if("model_info_params"==t){console.log("model_info_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw c.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[l,t]of Object.entries(e))a[l]=t}}else if("input_cost_per_token"===t||"output_cost_per_token"===t||"input_cost_per_second"===t){r&&(l[t]=Number(r));continue}else l[t]=r}t.push({litellmParamsObj:l,modelInfoObj:a,modelName:r})}return t}catch(e){c.Z.fromBackend("Failed to create model: "+e)}},u=async(e,l,t,s)=>{try{let a=await m(e,l,t);if(!a||0===a.length)return;for(let e of a){let{litellmParamsObj:t,modelInfoObj:s,modelName:a}=e,r={model_name:a,litellm_params:t,model_info:s},o=await (0,n.modelCreateCall)(l,r);console.log("response for model create call: ".concat(o.data))}s&&s(),t.resetFields()}catch(e){c.Z.fromBackend("Failed to add model: "+e)}};var h=t(62490),x=t(53410),p=t(74998),g=t(93192),f=t(13634),j=t(82680),v=t(52787),_=t(89970),y=t(73002),b=t(56522),N=t(65319),w=t(47451),k=t(69410),C=t(3632);let{Link:Z}=g.default,S={[d.Cl.OpenAI]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.OpenAI_Text]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.Vertex_AI]:[{key:"vertex_project",label:"Vertex Project",placeholder:"adroit-cadet-1234..",required:!0},{key:"vertex_location",label:"Vertex Location",placeholder:"us-east-1",required:!0},{key:"vertex_credentials",label:"Vertex Credentials",required:!0,type:"upload"}],[d.Cl.AssemblyAI]:[{key:"api_base",label:"API Base",type:"select",required:!0,options:["https://api.assemblyai.com","https://api.eu.assemblyai.com"]},{key:"api_key",label:"AssemblyAI API Key",type:"password",required:!0}],[d.Cl.Azure]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_version",label:"API Version",placeholder:"2023-07-01-preview",tooltip:"By default litellm will use the latest version. If you want to use a different version, you can specify it here"},{key:"base_model",label:"Base Model",placeholder:"azure/gpt-3.5-turbo"},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[d.Cl.Azure_AI_Studio]:[{key:"api_base",label:"API Base",placeholder:"https://.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",tooltip:"Enter your full Target URI from Azure Foundry here. Example: https://litellm8397336933.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",required:!0},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[d.Cl.OpenAI_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.Dashscope]:[{key:"api_key",label:"Dashscope API Key",type:"password",required:!0},{key:"api_base",label:"API Base",placeholder:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",defaultValue:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",required:!0,tooltip:"The base URL for your Dashscope server. Defaults to https://dashscope-intl.aliyuncs.com/compatible-mode/v1 if not specified."}],[d.Cl.OpenAI_Text_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.Bedrock]:[{key:"aws_access_key_id",label:"AWS Access Key ID",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_secret_access_key",label:"AWS Secret Access Key",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_session_token",label:"AWS Session Token",type:"password",required:!1,tooltip:"Temporary credentials session token. You can provide the raw token or the environment variable (e.g. `os.environ/MY_SESSION_TOKEN`)."},{key:"aws_region_name",label:"AWS Region Name",placeholder:"us-east-1",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_session_name",label:"AWS Session Name",placeholder:"my-session",required:!1,tooltip:"Name for the AWS session. You can provide the raw value or the environment variable (e.g. `os.environ/MY_SESSION_NAME`)."},{key:"aws_profile_name",label:"AWS Profile Name",placeholder:"default",required:!1,tooltip:"AWS profile name to use for authentication. You can provide the raw value or the environment variable (e.g. `os.environ/MY_PROFILE_NAME`)."},{key:"aws_role_name",label:"AWS Role Name",placeholder:"MyRole",required:!1,tooltip:"AWS IAM role name to assume. You can provide the raw value or the environment variable (e.g. `os.environ/MY_ROLE_NAME`)."},{key:"aws_web_identity_token",label:"AWS Web Identity Token",type:"password",required:!1,tooltip:"Web identity token for OIDC authentication. You can provide the raw token or the environment variable (e.g. `os.environ/MY_WEB_IDENTITY_TOKEN`)."},{key:"aws_bedrock_runtime_endpoint",label:"AWS Bedrock Runtime Endpoint",placeholder:"https://bedrock-runtime.us-east-1.amazonaws.com",required:!1,tooltip:"Custom Bedrock runtime endpoint URL. You can provide the raw value or the environment variable (e.g. `os.environ/MY_BEDROCK_ENDPOINT`)."}],[d.Cl.SageMaker]:[{key:"aws_access_key_id",label:"AWS Access Key ID",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_secret_access_key",label:"AWS Secret Access Key",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_region_name",label:"AWS Region Name",placeholder:"us-east-1",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."}],[d.Cl.Ollama]:[{key:"api_base",label:"API Base",placeholder:"http://localhost:11434",defaultValue:"http://localhost:11434",required:!1,tooltip:"The base URL for your Ollama server. Defaults to http://localhost:11434 if not specified."}],[d.Cl.Anthropic]:[{key:"api_key",label:"API Key",placeholder:"sk-",type:"password",required:!0}],[d.Cl.Deepgram]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.ElevenLabs]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Google_AI_Studio]:[{key:"api_key",label:"API Key",placeholder:"aig-",type:"password",required:!0}],[d.Cl.Groq]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.MistralAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Deepseek]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Cohere]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Databricks]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.xAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.AIML]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Cerebras]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Sambanova]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Perplexity]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.TogetherAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Openrouter]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.FireworksAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.GradientAI]:[{key:"api_base",label:"GradientAI Endpoint",placeholder:"https://...",required:!1},{key:"api_key",label:"GradientAI API Key",type:"password",required:!0}],[d.Cl.Triton]:[{key:"api_key",label:"API Key",type:"password",required:!1},{key:"api_base",label:"API Base",placeholder:"http://localhost:8000/generate",required:!1}],[d.Cl.Hosted_Vllm]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.Voyage]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.JinaAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.VolcEngine]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.DeepInfra]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Oracle]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Snowflake]:[{key:"api_key",label:"Snowflake API Key / JWT Key for Authentication",type:"password",required:!0},{key:"api_base",label:"Snowflake API Endpoint",placeholder:"https://1234567890.snowflakecomputing.com/api/v2/cortex/inference:complete",tooltip:"Enter the full endpoint with path here. Example: https://1234567890.snowflakecomputing.com/api/v2/cortex/inference:complete",required:!0}],[d.Cl.Infinity]:[{key:"api_base",label:"API Base",placeholder:"http://localhost:7997"}]};var A=e=>{let{selectedProvider:l,uploadProps:t}=e,r=d.Cl[l],o=f.Z.useFormInstance(),i=a.useMemo(()=>S[r]||[],[r]),n={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;console.log("Setting field value from JSON, length: ".concat(l.length)),o.setFieldsValue({vertex_credentials:l}),console.log("Form values after setting:",o.getFieldsValue())}},l.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered in ProviderSpecificFields"),console.log("Current form values:",o.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList)}};return(0,s.jsx)(s.Fragment,{children:i.map(e=>{var l;return(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(f.Z.Item,{label:e.label,name:e.key,rules:e.required?[{required:!0,message:"Required"}]:void 0,tooltip:e.tooltip,className:"vertex_credentials"===e.key?"mb-0":void 0,children:"select"===e.type?(0,s.jsx)(v.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,s.jsx)(v.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,s.jsx)(N.default,{...n,onChange:l=>{(null==t?void 0:t.onChange)&&t.onChange(l),setTimeout(()=>{let l=o.getFieldValue(e.key);console.log("".concat(e.key," value after upload:"),JSON.stringify(l))},500)},children:(0,s.jsx)(y.ZP,{icon:(0,s.jsx)(C.Z,{}),children:"Click to Upload"})}):(0,s.jsx)(b.o,{placeholder:e.placeholder,type:"password"===e.type?"password":"text"})}),"vertex_credentials"===e.key&&(0,s.jsx)(w.Z,{children:(0,s.jsx)(k.Z,{children:(0,s.jsx)(b.x,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(k.Z,{span:10}),(0,s.jsx)(k.Z,{span:10,children:(0,s.jsxs)(b.x,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,s.jsx)(Z,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})})},I=t(31283);let{Title:E,Link:P}=g.default;var M=e=>{let{isVisible:l,onCancel:t,onAddCredential:r,onUpdateCredential:o,uploadProps:i,addOrEdit:n,existingCredential:c}=e,[m]=f.Z.useForm(),[u,h]=(0,a.useState)(d.Cl.OpenAI),[x,p]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{c&&(m.setFieldsValue({credential_name:c.credential_name,custom_llm_provider:c.credential_info.custom_llm_provider,api_base:c.credential_values.api_base,api_version:c.credential_values.api_version,base_model:c.credential_values.base_model,api_key:c.credential_values.api_key}),h(c.credential_info.custom_llm_provider))},[c]),(0,s.jsx)(j.Z,{title:"add"===n?"Add New Credential":"Edit Credential",visible:l,onCancel:()=>{t(),m.resetFields()},footer:null,width:600,children:(0,s.jsxs)(f.Z,{form:m,onFinish:e=>{let l=Object.entries(e).reduce((e,l)=>{let[t,s]=l;return""!==s&&null!=s&&(e[t]=s),e},{});"add"===n?r(l):o(l),m.resetFields()},layout:"vertical",children:[(0,s.jsx)(f.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==c?void 0:c.credential_name,children:(0,s.jsx)(I.o,{placeholder:"Enter a friendly name for these credentials",disabled:null!=c&&!!c.credential_name})}),(0,s.jsx)(f.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,s.jsx)(v.default,{showSearch:!0,onChange:e=>{h(e),m.setFieldValue("custom_llm_provider",e)},children:Object.entries(d.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(v.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:d.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(A,{selectedProvider:u,uploadProps:i}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(_.Z,{title:"Get help on our github",children:(0,s.jsx)(P,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(y.ZP,{onClick:()=>{t(),m.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(y.ZP,{htmlType:"submit",children:"add"===n?"Add Credential":"Update Credential"})]})]})]})})},F=t(16312),T=t(88532),L=e=>{let{isVisible:l,onCancel:t,onConfirm:r,credentialName:o}=e,[i,n]=(0,a.useState)(""),d=i===o,c=()=>{n(""),t()};return(0,s.jsx)(j.Z,{title:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(T.Z,{className:"h-6 w-6 text-red-600 mr-2"}),"Delete Credential"]}),open:l,footer:null,onCancel:c,closable:!0,destroyOnClose:!0,maskClosable:!1,children:(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,s.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,s.jsx)(T.Z,{className:"h-5 w-5"})}),(0,s.jsx)("div",{children:(0,s.jsx)("p",{className:"text-base font-medium text-red-600",children:"This action cannot be undone and may break existing integrations."})})]}),(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,s.jsxs)("span",{className:"underline italic",children:["'",o,"'"]})," to confirm deletion:"]}),(0,s.jsx)("input",{type:"text",value:i,onChange:e=>n(e.target.value),placeholder:"Enter credential name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,s.jsx)(F.z,{onClick:c,variant:"secondary",className:"mr-2",children:"Cancel"}),(0,s.jsx)(F.z,{onClick:()=>{d&&(n(""),r())},color:"red",className:"focus:ring-red-500",disabled:!d,children:"Delete Credential"})]})]})})},R=e=>{let{accessToken:l,uploadProps:t,credentialList:r,fetchCredentials:o}=e,[i,d]=(0,a.useState)(!1),[m,u]=(0,a.useState)(!1),[g,j]=(0,a.useState)(null),[v,_]=(0,a.useState)(null),[y]=f.Z.useForm(),b=["credential_name","custom_llm_provider"],N=async e=>{if(!l)return;let t=Object.entries(e).filter(e=>{let[l]=e;return!b.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),s={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,n.credentialUpdateCall)(l,e.credential_name,s),c.Z.success("Credential updated successfully"),u(!1),o(l)},w=async e=>{if(!l)return;let t=Object.entries(e).filter(e=>{let[l]=e;return!b.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),s={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,n.credentialCreateCall)(l,s),c.Z.success("Credential added successfully"),d(!1),o(l)};(0,a.useEffect)(()=>{l&&o(l)},[l]);let k=e=>{let l={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=l[e.toLowerCase()]||l.default;return(0,s.jsx)(h.Ct,{color:t,size:"xs",children:e})},C=async e=>{l&&(await (0,n.credentialDeleteCall)(l,e),c.Z.success("Credential deleted successfully"),_(null),o(l))},Z=e=>{_(e)};return(0,s.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,s.jsx)(h.xv,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,s.jsx)(h.Zb,{children:(0,s.jsxs)(h.iA,{children:[(0,s.jsx)(h.ss,{children:(0,s.jsxs)(h.SC,{children:[(0,s.jsx)(h.xs,{children:"Credential Name"}),(0,s.jsx)(h.xs,{children:"Provider"}),(0,s.jsx)(h.xs,{children:"Description"})]})}),(0,s.jsx)(h.RM,{children:r&&0!==r.length?r.map((e,l)=>{var t,a;return(0,s.jsxs)(h.SC,{children:[(0,s.jsx)(h.pj,{children:e.credential_name}),(0,s.jsx)(h.pj,{children:k((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,s.jsx)(h.pj,{children:(null===(a=e.credential_info)||void 0===a?void 0:a.description)||"-"}),(0,s.jsxs)(h.pj,{children:[(0,s.jsx)(h.zx,{icon:x.Z,variant:"light",size:"sm",onClick:()=>{j(e),u(!0)}}),(0,s.jsx)(h.zx,{icon:p.Z,variant:"light",size:"sm",onClick:()=>Z(e.credential_name)})]})]},l)}):(0,s.jsx)(h.SC,{children:(0,s.jsx)(h.pj,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),(0,s.jsx)(h.zx,{onClick:()=>d(!0),className:"mt-4",children:"Add Credential"}),i&&(0,s.jsx)(M,{onAddCredential:w,isVisible:i,onCancel:()=>d(!1),uploadProps:t,addOrEdit:"add",onUpdateCredential:N,existingCredential:null}),m&&(0,s.jsx)(M,{onAddCredential:w,isVisible:m,existingCredential:g,onUpdateCredential:N,uploadProps:t,onCancel:()=>u(!1),addOrEdit:"edit"}),v&&(0,s.jsx)(L,{isVisible:!0,onCancel:()=>{_(null)},onConfirm:()=>C(v),credentialName:v})]})};let O=e=>{var l;return(null==e?void 0:null===(l=e.model_info)||void 0===l?void 0:l.team_public_model_name)?e.model_info.team_public_model_name:(null==e?void 0:e.model_name)||"-"};var D=t(9335),V=t(23628),q=t(33293),z=t(20831),B=t(12514),K=t(12485),U=t(18135),G=t(35242),H=t(29706),J=t(77991),W=t(49566),Y=t(96761),$=t(24199),Q=t(10900),X=t(45589),ee=t(64482),el=t(15424);let{Title:et,Link:es}=g.default;var ea=e=>{let{isVisible:l,onCancel:t,onAddCredential:a,existingCredential:r,setIsCredentialModalOpen:o}=e,[i]=f.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(r))),(0,s.jsx)(j.Z,{title:"Reuse Credentials",visible:l,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,s.jsxs)(f.Z,{form:i,onFinish:e=>{a(e),i.resetFields(),o(!1)},layout:"vertical",children:[(0,s.jsx)(f.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==r?void 0:r.credential_name,children:(0,s.jsx)(I.o,{placeholder:"Enter a friendly name for these credentials"})}),Object.entries((null==r?void 0:r.credential_values)||{}).map(e=>{let[l,t]=e;return(0,s.jsx)(f.Z.Item,{label:l,name:l,initialValue:t,children:(0,s.jsx)(I.o,{placeholder:"Enter ".concat(l),disabled:!0})},l)}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(_.Z,{title:"Get help on our github",children:(0,s.jsx)(es,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(y.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(y.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})},er=t(63709),eo=t(45246),ei=t(96473);let{Text:en}=g.default;var ed=e=>{let{form:l,showCacheControl:t,onCacheControlChange:a}=e,r=e=>{let t=l.getFieldValue("litellm_extra_params");try{let s=t?JSON.parse(t):{};e.length>0?s.cache_control_injection_points=e:delete s.cache_control_injection_points,Object.keys(s).length>0?l.setFieldValue("litellm_extra_params",JSON.stringify(s,null,2)):l.setFieldValue("litellm_extra_params","")}catch(e){console.error("Error updating cache control points:",e)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.Z.Item,{label:"Cache Control Injection Points",name:"cache_control",valuePropName:"checked",className:"mb-4",tooltip:"Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index.",children:(0,s.jsx)(er.Z,{onChange:a,className:"bg-gray-600"})}),t&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(en,{className:"text-sm text-gray-500 block mb-4",children:"Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, litellm can automatically add them for you as a cost saving feature."}),(0,s.jsx)(f.Z.List,{name:"cache_control_injection_points",initialValue:[{location:"message"}],children:(e,t)=>{let{add:a,remove:o}=t;return(0,s.jsxs)(s.Fragment,{children:[e.map((t,a)=>(0,s.jsxs)("div",{className:"flex items-center mb-4 gap-4",children:[(0,s.jsx)(f.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,s.jsx)(v.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,s.jsx)(f.Z.Item,{...t,label:"Role",name:[t.name,"role"],className:"mb-0",style:{width:"180px"},tooltip:"LiteLLM will mark all messages of this role as cacheable",children:(0,s.jsx)(v.default,{placeholder:"Select a role",allowClear:!0,options:[{value:"user",label:"User"},{value:"system",label:"System"},{value:"assistant",label:"Assistant"}],onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),(0,s.jsx)(f.Z.Item,{...t,label:"Index",name:[t.name,"index"],className:"mb-0",style:{width:"180px"},tooltip:"(Optional) If set litellm will mark the message at this index as cacheable",children:(0,s.jsx)($.Z,{type:"number",placeholder:"Optional",step:1,min:0,onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,s.jsx)(eo.Z,{className:"text-red-500 cursor-pointer text-lg ml-12",onClick:()=>{o(t.name),setTimeout(()=>{r(l.getFieldValue("cache_control_points"))},0)}})]},t.key)),(0,s.jsx)(f.Z.Item,{children:(0,s.jsxs)("button",{type:"button",className:"flex items-center justify-center w-full border border-dashed border-gray-300 py-2 px-4 text-gray-600 hover:text-blue-600 hover:border-blue-300 transition-all rounded",onClick:()=>a(),children:[(0,s.jsx)(ei.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})},ec=t(30401),em=t(78867),eu=t(59872),eh=t(51601),ex=t(44851),ep=t(67960),eg=t(20577),ef=t(70464),ej=t(26349),ev=t(92280);let{TextArea:e_}=ee.default,{Panel:ey}=ex.default;var eb=e=>{let{modelInfo:l,value:t,onChange:r}=e,[o,i]=(0,a.useState)([]),[n,d]=(0,a.useState)(!1),[c,m]=(0,a.useState)([]);(0,a.useEffect)(()=>{if(null==t?void 0:t.routes){let e=t.routes.map((e,l)=>({id:e.id||"route-".concat(l,"-").concat(Date.now()),model:e.name||e.model||"",utterances:e.utterances||[],description:e.description||"",score_threshold:e.score_threshold||.5}));i(e),m(e.map(e=>e.id))}else i([]),m([])},[t]);let u=e=>{let l=o.filter(l=>l.id!==e);i(l),x(l),m(l=>l.filter(l=>l!==e))},h=(e,l,t)=>{let s=o.map(s=>s.id===e?{...s,[l]:t}:s);i(s),x(s)},x=e=>{let l={routes:e.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))};null==r||r(l)},p=l.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsxs)("div",{className:"w-full max-w-none",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(ev.x,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,s.jsx)(_.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,s.jsx)(el.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(y.ZP,{type:"primary",icon:(0,s.jsx)(ei.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),l=[...o,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];i(l),x(l),m(l=>[...l,e])},className:"bg-blue-600 hover:bg-blue-700",children:"Add Route"})]}),0===o.length?(0,s.jsx)("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 mb-6",children:(0,s.jsx)(ev.x,{children:"No routes configured. Click “Add Route” to get started."})}):(0,s.jsx)("div",{className:"space-y-3 mb-6 w-full",children:o.map((e,l)=>(0,s.jsx)(ep.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,s.jsx)(ex.default,{ghost:!0,expandIcon:e=>{let{isActive:l}=e;return(0,s.jsx)(ef.Z,{rotate:l?180:0})},activeKey:c,onChange:e=>m(Array.isArray(e)?e:[e].filter(Boolean)),items:[{key:e.id,label:(0,s.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,s.jsxs)(ev.x,{className:"font-medium text-base",children:["Route ",l+1,": ",e.model||"Unnamed"]}),(0,s.jsx)(y.ZP,{type:"text",danger:!0,icon:(0,s.jsx)(ej.Z,{}),onClick:l=>{l.stopPropagation(),u(e.id)},className:"mr-2"})]}),children:(0,s.jsxs)("div",{className:"px-6 pb-6 w-full",children:[(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(ev.x,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,s.jsx)(v.default,{value:e.model,onChange:l=>h(e.id,"model",l),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:p})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(ev.x,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,s.jsx)(e_,{value:e.description,onChange:l=>h(e.id,"description",l.target.value),placeholder:"Describe when this route should be used...",rows:2,style:{width:"100%"}})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(ev.x,{className:"text-sm font-medium",children:"Score Threshold"}),(0,s.jsx)(_.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,s.jsx)(el.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(eg.Z,{value:e.score_threshold,onChange:l=>h(e.id,"score_threshold",l||0),min:0,max:1,step:.1,style:{width:"100%"},placeholder:"0.5"})]}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(ev.x,{className:"text-sm font-medium",children:"Example Utterances"}),(0,s.jsx)(_.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,s.jsx)(el.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(ev.x,{className:"text-xs text-gray-500 mb-2",children:"Type an utterance and press Enter to add it. You can also paste multiple lines."}),(0,s.jsx)(v.default,{mode:"tags",value:e.utterances,onChange:l=>h(e.id,"utterances",l),placeholder:"Type an utterance and press Enter...",style:{width:"100%"},tokenSeparators:["\n"],maxTagCount:"responsive",allowClear:!0})]})]})}]})},e.id))}),(0,s.jsxs)("div",{className:"border-t pt-6 w-full",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4 w-full",children:[(0,s.jsx)(ev.x,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,s.jsx)(y.ZP,{type:"link",onClick:()=>d(!n),className:"text-blue-600 p-0",children:n?"Hide":"Show"})]}),n&&(0,s.jsx)(ep.Z,{className:"bg-gray-50 w-full",children:(0,s.jsx)("pre",{className:"text-sm overflow-auto max-h-64 w-full",children:JSON.stringify({routes:o.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))},null,2)})})]})]})},eN=e=>{let{isVisible:l,onCancel:t,onSuccess:r,modelData:o,accessToken:i,userRole:d}=e,[m]=f.Z.useForm(),[u,h]=(0,a.useState)(!1),[x,p]=(0,a.useState)([]),[g,_]=(0,a.useState)([]),[N,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1),[Z,S]=(0,a.useState)(null);(0,a.useEffect)(()=>{l&&o&&A()},[l,o]),(0,a.useEffect)(()=>{let e=async()=>{if(i)try{let e=await (0,n.modelAvailableCall)(i,"","",!1,null,!0,!0);p(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(i)try{let e=await (0,eh.p)(i);_(e)}catch(e){console.error("Error fetching model info:",e)}};l&&(e(),t())},[l,i]);let A=()=>{try{var e,l,t,s,a,r;let i=null;(null===(e=o.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(i="string"==typeof o.litellm_params.auto_router_config?JSON.parse(o.litellm_params.auto_router_config):o.litellm_params.auto_router_config),S(i),m.setFieldsValue({auto_router_name:o.model_name,auto_router_default_model:(null===(l=o.litellm_params)||void 0===l?void 0:l.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=o.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(s=o.model_info)||void 0===s?void 0:s.access_groups)||[]});let n=new Set(g.map(e=>e.model_group));w(!n.has(null===(a=o.litellm_params)||void 0===a?void 0:a.auto_router_default_model)),C(!n.has(null===(r=o.litellm_params)||void 0===r?void 0:r.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),c.Z.fromBackend("Error loading auto router configuration")}},I=async()=>{try{h(!0);let e=await m.validateFields(),l={...o.litellm_params,auto_router_config:JSON.stringify(Z),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},s={...o.model_info,access_groups:e.model_access_group||[]},a={model_name:e.auto_router_name,litellm_params:l,model_info:s};await (0,n.modelPatchUpdateCall)(i,a,o.model_info.id);let d={...o,model_name:e.auto_router_name,litellm_params:l,model_info:s};c.Z.success("Auto router configuration updated successfully"),r(d),t()}catch(e){console.error("Error updating auto router:",e),c.Z.fromBackend("Failed to update auto router configuration")}finally{h(!1)}},E=g.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsx)(j.Z,{title:"Edit Auto Router Configuration",open:l,onCancel:t,footer:[(0,s.jsx)(y.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,s.jsx)(y.ZP,{loading:u,onClick:I,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(b.x,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,s.jsxs)(f.Z,{form:m,layout:"vertical",className:"space-y-4",children:[(0,s.jsx)(f.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,s.jsx)(b.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(eb,{modelInfo:g,value:Z,onChange:e=>{S(e)}})}),(0,s.jsx)(f.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,s.jsx)(v.default,{placeholder:"Select a default model",onChange:e=>{w("custom"===e)},options:[...E,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,s.jsx)(f.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,s.jsx)(v.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{C("custom"===e)},options:[...E,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===d&&(0,s.jsx)(f.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:x.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};function ew(e){var l,t,r,m,u,h,x,g,b,N,w,k,C,Z,S,A,I,E,P,M,F,T,L,R,D,V,q,et;let{modelId:es,onClose:er,modelData:eo,accessToken:ei,userID:en,userRole:eh,editModel:ex,setEditModalVisible:ep,setSelectedModel:eg,onModelUpdate:ef,modelAccessGroups:ej}=e,[ev]=f.Z.useForm(),[e_,ey]=(0,a.useState)(null),[eb,ew]=(0,a.useState)(!1),[ek,eC]=(0,a.useState)(!1),[eZ,eS]=(0,a.useState)(!1),[eA,eI]=(0,a.useState)(!1),[eE,eP]=(0,a.useState)(!1),[eM,eF]=(0,a.useState)(null),[eT,eL]=(0,a.useState)(!1),[eR,eO]=(0,a.useState)({}),[eD,eV]=(0,a.useState)(!1),[eq,ez]=(0,a.useState)([]),eB="Admin"===eh||(null==eo?void 0:null===(l=eo.model_info)||void 0===l?void 0:l.created_by)===en,eK=(null==eo?void 0:null===(t=eo.litellm_params)||void 0===t?void 0:t.auto_router_config)!=null,eU=(null==eo?void 0:null===(r=eo.litellm_params)||void 0===r?void 0:r.litellm_credential_name)!=null&&(null==eo?void 0:null===(m=eo.litellm_params)||void 0===m?void 0:m.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eU),console.log("modelData.litellm_params.litellm_credential_name, ",null==eo?void 0:null===(u=eo.litellm_params)||void 0===u?void 0:u.litellm_credential_name),(0,a.useEffect)(()=>{let e=async()=>{var e,l,t,s,a,r,o;if(!ei)return;let i=await (0,n.modelInfoV1Call)(ei,es);console.log("modelInfoResponse, ",i);let d=i.data[0];d&&!d.litellm_model_name&&(d={...d,litellm_model_name:null!==(o=null!==(r=null!==(a=null==d?void 0:null===(l=d.litellm_params)||void 0===l?void 0:l.litellm_model_name)&&void 0!==a?a:null==d?void 0:null===(t=d.litellm_params)||void 0===t?void 0:t.model)&&void 0!==r?r:null==d?void 0:null===(s=d.model_info)||void 0===s?void 0:s.key)&&void 0!==o?o:null}),ey(d),(null==d?void 0:null===(e=d.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&eL(!0)},l=async()=>{if(ei)try{let e=(await (0,n.getGuardrailsList)(ei)).guardrails.map(e=>e.guardrail_name);ez(e)}catch(e){console.error("Failed to fetch guardrails:",e)}};(async()=>{if(console.log("accessToken, ",ei),!ei||eU)return;let e=await (0,n.credentialGetCall)(ei,null,es);console.log("existingCredentialResponse, ",e),eF({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e(),l()},[ei,es]);let eG=async e=>{var l;if(console.log("values, ",e),!ei)return;let t={credential_name:e.credential_name,model_id:es,credential_info:{custom_llm_provider:null===(l=e_.litellm_params)||void 0===l?void 0:l.custom_llm_provider}};c.Z.info("Storing credential.."),console.log("credentialResponse, ",await (0,n.credentialCreateCall)(ei,t)),c.Z.success("Credential stored successfully")},eH=async e=>{try{var l;let t;if(!ei)return;eI(!0),console.log("values.model_name, ",e.model_name);let s={...e_.litellm_params,model:e.litellm_model_name,api_base:e.api_base,custom_llm_provider:e.custom_llm_provider,organization:e.organization,tpm:e.tpm,rpm:e.rpm,max_retries:e.max_retries,timeout:e.timeout,stream_timeout:e.stream_timeout,input_cost_per_token:e.input_cost/1e6,output_cost_per_token:e.output_cost/1e6};e.guardrails&&(s.guardrails=e.guardrails),e.cache_control&&(null===(l=e.cache_control_injection_points)||void 0===l?void 0:l.length)>0?s.cache_control_injection_points=e.cache_control_injection_points:delete s.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):eo.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group})}catch(e){c.Z.fromBackend("Invalid JSON in Model Info");return}let a={model_name:e.model_name,litellm_params:s,model_info:t};await (0,n.modelPatchUpdateCall)(ei,a,es);let r={...e_,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:s,model_info:t};ey(r),ef&&ef(r),c.Z.success("Model settings updated successfully"),eS(!1),eP(!1)}catch(e){console.error("Error updating model:",e),c.Z.fromBackend("Failed to update model settings")}finally{eI(!1)}};if(!eo)return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(z.Z,{icon:Q.Z,variant:"light",onClick:er,className:"mb-4",children:"Back to Models"}),(0,s.jsx)(i.Z,{children:"Model not found"})]});let eJ=async()=>{try{if(!ei)return;await (0,n.modelDeleteCall)(ei,es),c.Z.success("Model deleted successfully"),ef&&ef({deleted:!0,model_info:{id:es}}),er()}catch(e){console.error("Error deleting the model:",e),c.Z.fromBackend("Failed to delete model")}},eW=async(e,l)=>{await (0,eu.vQ)(e)&&(eO(e=>({...e,[l]:!0})),setTimeout(()=>{eO(e=>({...e,[l]:!1}))},2e3))};return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(z.Z,{icon:Q.Z,variant:"light",onClick:er,className:"mb-4",children:"Back to Models"}),(0,s.jsxs)(Y.Z,{children:["Public Model Name: ",O(eo)]}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsx)(i.Z,{className:"text-gray-500 font-mono",children:eo.model_info.id}),(0,s.jsx)(y.ZP,{type:"text",size:"small",icon:eR["model-id"]?(0,s.jsx)(ec.Z,{size:12}):(0,s.jsx)(em.Z,{size:12}),onClick:()=>eW(eo.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eR["model-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:["Admin"===eh&&(0,s.jsx)(z.Z,{icon:X.Z,variant:"secondary",onClick:()=>eC(!0),className:"flex items-center",children:"Re-use Credentials"}),eB&&(0,s.jsx)(z.Z,{icon:p.Z,variant:"secondary",onClick:()=>ew(!0),className:"flex items-center",children:"Delete Model"})]})]}),(0,s.jsxs)(U.Z,{children:[(0,s.jsxs)(G.Z,{className:"mb-6",children:[(0,s.jsx)(K.Z,{children:"Overview"}),(0,s.jsx)(K.Z,{children:"Raw JSON"})]}),(0,s.jsxs)(J.Z,{children:[(0,s.jsxs)(H.Z,{children:[(0,s.jsxs)(o.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(i.Z,{children:"Provider"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[eo.provider&&(0,s.jsx)("img",{src:(0,d.dr)(eo.provider).logo,alt:"".concat(eo.provider," logo"),className:"w-4 h-4",onError:e=>{let l=e.target,t=l.parentElement;if(t){var s;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(s=eo.provider)||void 0===s?void 0:s.charAt(0))||"-",t.replaceChild(e,l)}}}),(0,s.jsx)(Y.Z,{children:eo.provider||"Not Set"})]})]}),(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(i.Z,{children:"LiteLLM Model"}),(0,s.jsx)("div",{className:"mt-2 overflow-hidden",children:(0,s.jsx)(_.Z,{title:eo.litellm_model_name||"Not Set",children:(0,s.jsx)("div",{className:"break-all text-sm font-medium leading-relaxed cursor-pointer",children:eo.litellm_model_name||"Not Set"})})})]}),(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(i.Z,{children:"Pricing"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(i.Z,{children:["Input: $",eo.input_cost,"/1M tokens"]}),(0,s.jsxs)(i.Z,{children:["Output: $",eo.output_cost,"/1M tokens"]})]})]})]}),(0,s.jsxs)("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-x-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Created At"," ",eo.model_info.created_at?new Date(eo.model_info.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Not Set"]}),(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Created By ",eo.model_info.created_by||"Not Set"]})]}),(0,s.jsxs)(B.Z,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(Y.Z,{children:"Model Settings"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[eK&&eB&&!eE&&(0,s.jsx)(z.Z,{variant:"primary",onClick:()=>eV(!0),className:"flex items-center",children:"Edit Auto Router"}),eB&&!eE&&(0,s.jsx)(z.Z,{variant:"secondary",onClick:()=>eP(!0),className:"flex items-center",children:"Edit Model"})]})]}),e_?(0,s.jsx)(f.Z,{form:ev,onFinish:eH,initialValues:{model_name:e_.model_name,litellm_model_name:e_.litellm_model_name,api_base:e_.litellm_params.api_base,custom_llm_provider:e_.litellm_params.custom_llm_provider,organization:e_.litellm_params.organization,tpm:e_.litellm_params.tpm,rpm:e_.litellm_params.rpm,max_retries:e_.litellm_params.max_retries,timeout:e_.litellm_params.timeout,stream_timeout:e_.litellm_params.stream_timeout,input_cost:e_.litellm_params.input_cost_per_token?1e6*e_.litellm_params.input_cost_per_token:(null===(h=e_.model_info)||void 0===h?void 0:h.input_cost_per_token)*1e6||null,output_cost:(null===(x=e_.litellm_params)||void 0===x?void 0:x.output_cost_per_token)?1e6*e_.litellm_params.output_cost_per_token:(null===(g=e_.model_info)||void 0===g?void 0:g.output_cost_per_token)*1e6||null,cache_control:null!==(b=e_.litellm_params)&&void 0!==b&&!!b.cache_control_injection_points,cache_control_injection_points:(null===(N=e_.litellm_params)||void 0===N?void 0:N.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(w=e_.model_info)||void 0===w?void 0:w.access_groups)?e_.model_info.access_groups:[],guardrails:Array.isArray(null===(k=e_.litellm_params)||void 0===k?void 0:k.guardrails)?e_.litellm_params.guardrails:[]},layout:"vertical",onValuesChange:()=>eS(!0),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Model Name"}),eE?(0,s.jsx)(f.Z.Item,{name:"model_name",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:e_.model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eE?(0,s.jsx)(f.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter LiteLLM model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:e_.litellm_model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eE?(0,s.jsx)(f.Z.Item,{name:"input_cost",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter input cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==e_?void 0:null===(C=e_.litellm_params)||void 0===C?void 0:C.input_cost_per_token)?((null===(Z=e_.litellm_params)||void 0===Z?void 0:Z.input_cost_per_token)*1e6).toFixed(4):(null==e_?void 0:null===(S=e_.model_info)||void 0===S?void 0:S.input_cost_per_token)?(1e6*e_.model_info.input_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eE?(0,s.jsx)(f.Z.Item,{name:"output_cost",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter output cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==e_?void 0:null===(A=e_.litellm_params)||void 0===A?void 0:A.output_cost_per_token)?(1e6*e_.litellm_params.output_cost_per_token).toFixed(4):(null==e_?void 0:null===(I=e_.model_info)||void 0===I?void 0:I.output_cost_per_token)?(1e6*e_.model_info.output_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"API Base"}),eE?(0,s.jsx)(f.Z.Item,{name:"api_base",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter API base"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(E=e_.litellm_params)||void 0===E?void 0:E.api_base)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Custom LLM Provider"}),eE?(0,s.jsx)(f.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter custom LLM provider"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(P=e_.litellm_params)||void 0===P?void 0:P.custom_llm_provider)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Organization"}),eE?(0,s.jsx)(f.Z.Item,{name:"organization",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter organization"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(M=e_.litellm_params)||void 0===M?void 0:M.organization)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eE?(0,s.jsx)(f.Z.Item,{name:"tpm",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter TPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(F=e_.litellm_params)||void 0===F?void 0:F.tpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eE?(0,s.jsx)(f.Z.Item,{name:"rpm",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter RPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(T=e_.litellm_params)||void 0===T?void 0:T.rpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Max Retries"}),eE?(0,s.jsx)(f.Z.Item,{name:"max_retries",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter max retries"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(L=e_.litellm_params)||void 0===L?void 0:L.max_retries)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Timeout (seconds)"}),eE?(0,s.jsx)(f.Z.Item,{name:"timeout",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(R=e_.litellm_params)||void 0===R?void 0:R.timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eE?(0,s.jsx)(f.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter stream timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(D=e_.litellm_params)||void 0===D?void 0:D.stream_timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Model Access Groups"}),eE?(0,s.jsx)(f.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:null==ej?void 0:ej.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(V=e_.model_info)||void 0===V?void 0:V.access_groups)?Array.isArray(e_.model_info.access_groups)?e_.model_info.access_groups.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:e_.model_info.access_groups.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},l))}):"No groups assigned":e_.model_info.access_groups:"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(i.Z,{className:"font-medium",children:["Guardrails"," ",(0,s.jsx)(_.Z,{title:"Apply safety guardrails to this model to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(el.Z,{style:{marginLeft:"4px"}})})})]}),eE?(0,s.jsx)(f.Z.Item,{name:"guardrails",className:"mb-0",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing guardrails or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:eq.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=e_.litellm_params)||void 0===q?void 0:q.guardrails)?Array.isArray(e_.litellm_params.guardrails)?e_.litellm_params.guardrails.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:e_.litellm_params.guardrails.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:e},l))}):"No guardrails assigned":e_.litellm_params.guardrails:"Not Set"})]}),eE?(0,s.jsx)(ed,{form:ev,showCacheControl:eT,onCacheControlChange:e=>eL(e)}):(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Cache Control"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(et=e_.litellm_params)||void 0===et?void 0:et.cache_control_injection_points)?(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"Enabled"}),(0,s.jsx)("div",{className:"mt-2",children:e_.litellm_params.cache_control_injection_points.map((e,l)=>(0,s.jsxs)("div",{className:"text-sm text-gray-600 mb-1",children:["Location: ",e.location,",",e.role&&(0,s.jsxs)("span",{children:[" Role: ",e.role]}),void 0!==e.index&&(0,s.jsxs)("span",{children:[" Index: ",e.index]})]},l))})]}):"Disabled"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Model Info"}),eE?(0,s.jsx)(f.Z.Item,{name:"model_info",className:"mb-0",children:(0,s.jsx)(ee.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}',defaultValue:JSON.stringify(eo.model_info,null,2)})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,s.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(e_.model_info,null,2)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:eo.model_info.team_id||"Not Set"})]})]}),eE&&(0,s.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,s.jsx)(z.Z,{variant:"secondary",onClick:()=>{ev.resetFields(),eS(!1),eP(!1)},children:"Cancel"}),(0,s.jsx)(z.Z,{variant:"primary",onClick:()=>ev.submit(),loading:eA,children:"Save Changes"})]})]})}):(0,s.jsx)(i.Z,{children:"Loading..."})]})]}),(0,s.jsx)(H.Z,{children:(0,s.jsx)(B.Z,{children:(0,s.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify(eo,null,2)})})})]})]}),eb&&(0,s.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,s.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,s.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,s.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,s.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,s.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,s.jsx)("div",{className:"sm:flex sm:items-start",children:(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Model"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this model?"})})]})})}),(0,s.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)(y.ZP,{onClick:eJ,className:"ml-2",danger:!0,children:"Delete"}),(0,s.jsx)(y.ZP,{onClick:()=>ew(!1),children:"Cancel"})]})]})]})}),ek&&!eU?(0,s.jsx)(ea,{isVisible:ek,onCancel:()=>eC(!1),onAddCredential:eG,existingCredential:eM,setIsCredentialModalOpen:eC}):(0,s.jsx)(j.Z,{open:ek,onCancel:()=>eC(!1),title:"Using Existing Credential",children:(0,s.jsx)(i.Z,{children:eo.litellm_params.litellm_credential_name})}),(0,s.jsx)(eN,{isVisible:eD,onCancel:()=>eV(!1),onSuccess:e=>{ey(e),ef&&ef(e)},modelData:e_||eo,accessToken:ei||"",userRole:eh||""})]})}var ek=t(58643),eC=e=>{let{selectedProvider:l,providerModels:t,getPlaceholder:a}=e,r=f.Z.useFormInstance(),o=e=>{let t=e.target.value,s=(r.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?l===d.Cl.Azure?{public_name:t,litellm_model:"azure/".concat(t)}:{public_name:t,litellm_model:t}:e);r.setFieldsValue({model_mappings:s})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(f.Z.Item,{label:"LiteLLM Model Name(s)",tooltip:"The model name LiteLLM will send to the LLM API",className:"mb-0",children:[(0,s.jsx)(f.Z.Item,{name:"model",rules:[{required:!0,message:"Please enter ".concat(l===d.Cl.Azure?"a deployment name":"at least one model",".")}],noStyle:!0,children:l===d.Cl.Azure||l===d.Cl.OpenAI_Compatible||l===d.Cl.Ollama?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(b.o,{placeholder:a(l),onChange:l===d.Cl.Azure?e=>{let l=e.target.value,t=l?[{public_name:l,litellm_model:"azure/".concat(l)}]:[];r.setFieldsValue({model:l,model_mappings:t})}:void 0})}):t.length>0?(0,s.jsx)(v.default,{mode:"multiple",allowClear:!0,showSearch:!0,placeholder:"Select models",onChange:e=>{let t=Array.isArray(e)?e:[e];if(t.includes("all-wildcard"))r.setFieldsValue({model_name:void 0,model_mappings:[]});else if(JSON.stringify(r.getFieldValue("model"))!==JSON.stringify(t)){let e=t.map(e=>l===d.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});r.setFieldsValue({model:t,model_mappings:e})}},optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{label:"Custom Model Name (Enter below)",value:"custom"},{label:"All ".concat(l," Models (Wildcard)"),value:"all-wildcard"},...t.map(e=>({label:e,value:e}))],style:{width:"100%"}}):(0,s.jsx)(b.o,{placeholder:a(l)})}),(0,s.jsx)(f.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.model!==l.model,children:e=>{let{getFieldValue:t}=e,a=t("model")||[];return(Array.isArray(a)?a:[a]).includes("custom")&&(0,s.jsx)(f.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,s.jsx)(b.o,{placeholder:l===d.Cl.Azure?"Enter Azure deployment name":"Enter custom model name",onChange:o})})}})]}),(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(k.Z,{span:10}),(0,s.jsx)(k.Z,{span:14,children:(0,s.jsx)(b.x,{className:"mb-3 mt-1",children:l===d.Cl.Azure?"Your deployment name will be saved as the public model name, and LiteLLM will use 'azure/deployment-name' internally":"The model name LiteLLM will send to the LLM API"})})]})]})},eZ=t(72188),eS=t(67187);let eA=e=>{let{content:l,children:t,width:r="auto",className:o=""}=e,[i,n]=(0,a.useState)(!1),[d,c]=(0,a.useState)("top"),m=(0,a.useRef)(null),u=()=>{if(m.current){let e=m.current.getBoundingClientRect(),l=e.top,t=window.innerHeight-e.bottom;l<300&&t>300?c("bottom"):c("top")}};return(0,s.jsxs)("div",{className:"relative inline-block",ref:m,children:[t||(0,s.jsx)(eS.Z,{className:"ml-1 text-gray-500 cursor-help",onMouseEnter:()=>{u(),n(!0)},onMouseLeave:()=>n(!1)}),i&&(0,s.jsxs)("div",{className:"absolute left-1/2 -translate-x-1/2 z-50 bg-black/90 text-white p-2 rounded-md text-sm font-normal shadow-lg ".concat(o),style:{["top"===d?"bottom":"top"]:"100%",width:r,marginBottom:"top"===d?"8px":"0",marginTop:"bottom"===d?"8px":"0"},children:[l,(0,s.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 w-0 h-0",style:{top:"top"===d?"100%":"auto",bottom:"bottom"===d?"100%":"auto",borderTop:"top"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderBottom:"bottom"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderLeft:"6px solid transparent",borderRight:"6px solid transparent"}})]})]})};var eI=()=>{let e=f.Z.useFormInstance(),[l,t]=(0,a.useState)(0),r=f.Z.useWatch("model",e)||[],o=Array.isArray(r)?r:[r],i=f.Z.useWatch("custom_model_name",e),n=!o.includes("all-wildcard"),c=f.Z.useWatch("custom_llm_provider",e);if((0,a.useEffect)(()=>{if(i&&o.includes("custom")){let l=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?c===d.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:e);e.setFieldValue("model_mappings",l),t(e=>e+1)}},[i,o,c,e]),(0,a.useEffect)(()=>{if(o.length>0&&!o.includes("all-wildcard")){let l=e.getFieldValue("model_mappings")||[];if(l.length!==o.length||!o.every(e=>l.some(l=>"custom"===e?"custom"===l.litellm_model||l.litellm_model===i:c===d.Cl.Azure?l.litellm_model==="azure/".concat(e):l.litellm_model===e))){let l=o.map(e=>"custom"===e&&i?c===d.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:c===d.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});e.setFieldValue("model_mappings",l),t(e=>e+1)}}},[o,i,c,e]),!n)return null;let m=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-2 font-normal",children:"The name you specify in your API calls to LiteLLM Proxy"}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Example:"})," If you name your public model"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"example-name"}),", and choose"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"openai/qwen-plus-latest"})," as the LiteLLM model"]}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Usage:"})," You make an API call to the LiteLLM proxy with"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:'model = "example-name"'})]}),(0,s.jsxs)("div",{className:"font-normal",children:[(0,s.jsx)("strong",{children:"Result:"})," LiteLLM sends"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"qwen-plus-latest"})," to the provider"]})]}),u=(0,s.jsx)("div",{children:"The model name LiteLLM will send to the LLM API"}),h=[{title:(0,s.jsxs)("span",{className:"flex items-center",children:["Public Model Name",(0,s.jsx)(eA,{content:m,width:"500px"})]}),dataIndex:"public_name",key:"public_name",render:(l,t,a)=>(0,s.jsx)(I.o,{value:l,onChange:l=>{let t=[...e.getFieldValue("model_mappings")];t[a].public_name=l.target.value,e.setFieldValue("model_mappings",t)}})},{title:(0,s.jsxs)("span",{className:"flex items-center",children:["LiteLLM Model Name",(0,s.jsx)(eA,{content:u,width:"360px"})]}),dataIndex:"litellm_model",key:"litellm_model"}];return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(f.Z.Item,{label:"Model Mappings",name:"model_mappings",tooltip:"Map public model names to LiteLLM model names for load balancing",labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",rules:[{required:!0,validator:async(e,l)=>{if(!l||0===l.length)throw Error("At least one model mapping is required");if(l.filter(e=>!e.public_name||""===e.public_name.trim()).length>0)throw Error("All model mappings must have valid public names")}}],children:(0,s.jsx)(eZ.Z,{dataSource:e.getFieldValue("model_mappings"),columns:h,pagination:!1,size:"small"},l)})})},eE=t(26210),eP=t(90464);let{Link:eM}=g.default;var eF=e=>{let{showAdvancedSettings:l,setShowAdvancedSettings:t,teams:r,guardrailsList:o}=e,[i]=f.Z.useForm(),[n,d]=a.useState(!1),[c,m]=a.useState("per_token"),[u,h]=a.useState(!1),x=(e,l)=>l&&(isNaN(Number(l))||0>Number(l))?Promise.reject("Please enter a valid positive number"):Promise.resolve(),p=(e,l)=>{if(!l)return Promise.resolve();try{return JSON.parse(l),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}};return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(eE.UQ,{className:"mt-2 mb-4",children:[(0,s.jsx)(eE._m,{children:(0,s.jsx)("b",{children:"Advanced Settings"})}),(0,s.jsx)(eE.X1,{children:(0,s.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,s.jsx)(f.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,s.jsx)(er.Z,{onChange:e=>{d(e),e||i.setFieldsValue({input_cost_per_token:void 0,output_cost_per_token:void 0,input_cost_per_second:void 0})},className:"bg-gray-600"})}),(0,s.jsx)(f.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(_.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(el.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails. Go to 'Guardrails' tab to create new guardrails.",children:(0,s.jsx)(v.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:o.map(e=>({value:e,label:e}))})}),n&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(f.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,s.jsx)(v.default,{defaultValue:"per_token",onChange:e=>m(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,s.jsx)(eE.oi,{})}),(0,s.jsx)(f.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,s.jsx)(eE.oi,{})})]}):(0,s.jsx)(f.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:x}],className:"mb-4",children:(0,s.jsx)(eE.oi,{})})]}),(0,s.jsx)(f.Z.Item,{label:"Use in pass through routes",name:"use_in_pass_through",valuePropName:"checked",className:"mb-4 mt-4",tooltip:(0,s.jsxs)("span",{children:["Allow using these credentials in pass through routes."," ",(0,s.jsx)(eM,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,s.jsx)(er.Z,{onChange:e=>{let l=i.getFieldValue("litellm_extra_params");try{let t=l?JSON.parse(l):{};e?t.use_in_pass_through=!0:delete t.use_in_pass_through,Object.keys(t).length>0?i.setFieldValue("litellm_extra_params",JSON.stringify(t,null,2)):i.setFieldValue("litellm_extra_params","")}catch(l){e?i.setFieldValue("litellm_extra_params",JSON.stringify({use_in_pass_through:!0},null,2)):i.setFieldValue("litellm_extra_params","")}},className:"bg-gray-600"})}),(0,s.jsx)(ed,{form:i,showCacheControl:u,onCacheControlChange:e=>{if(h(e),!e){let e=i.getFieldValue("litellm_extra_params");try{let l=e?JSON.parse(e):{};delete l.cache_control_injection_points,Object.keys(l).length>0?i.setFieldValue("litellm_extra_params",JSON.stringify(l,null,2)):i.setFieldValue("litellm_extra_params","")}catch(e){i.setFieldValue("litellm_extra_params","")}}}}),(0,s.jsx)(f.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-4 mt-4",rules:[{validator:p}],children:(0,s.jsx)(eP.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,s.jsxs)(w.Z,{className:"mb-4",children:[(0,s.jsx)(k.Z,{span:10}),(0,s.jsx)(k.Z,{span:10,children:(0,s.jsxs)(eE.xv,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,s.jsx)(eM,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,s.jsx)(f.Z.Item,{label:"Model Info",name:"model_info_params",tooltip:"Optional model info params. Returned when calling `/model/info` endpoint.",className:"mb-0",rules:[{validator:p}],children:(0,s.jsx)(eP.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},eT=t(29),eL=t.n(eT),eR=t(23496),eO=t(35291),eD=t(23639);let{Text:eV}=g.default;var eq=e=>{let{formValues:l,accessToken:t,testMode:r,modelName:o="this model",onClose:i,onTestComplete:d}=e,[u,h]=a.useState(null),[x,p]=a.useState(null),[g,f]=a.useState(null),[j,v]=a.useState(!0),[_,b]=a.useState(!1),[N,w]=a.useState(!1),k=async()=>{v(!0),w(!1),h(null),p(null),f(null),b(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",l);let a=await m(l,t,null);if(!a){console.log("No result from prepareModelAddRequest"),h("Failed to prepare model data. Please check your form inputs."),b(!1),v(!1);return}console.log("Result from prepareModelAddRequest:",a);let{litellmParamsObj:r,modelInfoObj:o,modelName:i}=a[0],d=await (0,n.testConnectionRequest)(t,r,o,null==o?void 0:o.mode);if("success"===d.status)c.Z.success("Connection test successful!"),h(null),b(!0);else{var e,s;let l=(null===(e=d.result)||void 0===e?void 0:e.error)||d.message||"Unknown error";h(l),p(r),f(null===(s=d.result)||void 0===s?void 0:s.raw_request_typed_dict),b(!1)}}catch(e){console.error("Test connection error:",e),h(e instanceof Error?e.message:String(e)),b(!1)}finally{v(!1),d&&d()}};a.useEffect(()=>{let e=setTimeout(()=>{k()},200);return()=>clearTimeout(e)},[]);let C=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",Z="string"==typeof u?C(u):(null==u?void 0:u.message)?C(u.message):"Unknown error",S=g?((e,l,t)=>{let s=JSON.stringify(l,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[l,t]=e;return"-H '".concat(l,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(s,"\n }'")})(g.raw_request_api_base,g.raw_request_body,g.raw_request_headers||{}):"";return(0,s.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[j?(0,s.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-dc9a0e2d897fe63b",children:[(0,s.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-dc9a0e2d897fe63b loading-spinner",children:(0,s.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-dc9a0e2d897fe63b"})}),(0,s.jsxs)(eV,{style:{fontSize:"16px"},children:["Testing connection to ",o,"..."]}),(0,s.jsx)(eL(),{id:"dc9a0e2d897fe63b",children:"@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]}):_?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,s.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,s.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,s.jsxs)(eV,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",o," successful!"]})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,s.jsx)(eO.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,s.jsxs)(eV,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",o," failed"]})]}),(0,s.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,s.jsxs)(eV,{strong:!0,style:{display:"block",marginBottom:"8px"},children:["Error:"," "]}),(0,s.jsx)(eV,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:Z}),u&&(0,s.jsx)("div",{style:{marginTop:"12px"},children:(0,s.jsx)(y.ZP,{type:"link",onClick:()=>w(!N),style:{paddingLeft:0,height:"auto"},children:N?"Hide Details":"Show Details"})})]}),N&&(0,s.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,s.jsx)(eV,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Troubleshooting Details"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:"string"==typeof u?u:JSON.stringify(u,null,2)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(eV,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"API Request"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"250px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:S||"No request data available"}),(0,s.jsx)(y.ZP,{style:{marginTop:"8px"},icon:(0,s.jsx)(eD.Z,{}),onClick:()=>{navigator.clipboard.writeText(S||""),c.Z.success("Copied to clipboard")},children:"Copy to Clipboard"})]})]})}),(0,s.jsx)(eR.Z,{style:{margin:"24px 0 16px"}}),(0,s.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)(y.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,s.jsx)(el.Z,{}),children:"View Documentation"})})]})};let ez=[{value:"chat",label:"Chat - /chat/completions"},{value:"completion",label:"Completion - /completions"},{value:"embedding",label:"Embedding - /embeddings"},{value:"audio_speech",label:"Audio Speech - /audio/speech"},{value:"audio_transcription",label:"Audio Transcription - /audio/transcriptions"},{value:"image_generation",label:"Image Generation - /images/generations"},{value:"rerank",label:"Rerank - /rerank"},{value:"realtime",label:"Realtime - /realtime"},{value:"batch",label:"Batch - /batch"}];var eB=t(92858),eK=t(84376),eU=t(20347);let eG=async(e,l,t,s)=>{try{console.log("=== AUTO ROUTER SUBMIT HANDLER CALLED ==="),console.log("handling auto router submit for formValues:",e),console.log("Access token:",l?"Present":"Missing"),console.log("Form:",t?"Present":"Missing"),console.log("Callback:",s?"Present":"Missing");let a={model_name:e.auto_router_name,litellm_params:{model:"auto_router/".concat(e.auto_router_name),auto_router_config:JSON.stringify(e.auto_router_config),auto_router_default_model:e.auto_router_default_model},model_info:{}};e.auto_router_embedding_model&&"custom"!==e.auto_router_embedding_model?a.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(a.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(a.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(a.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",a),console.log("Auto router config (stringified):",a.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:l?"Present":"Missing",config:a});let r=await (0,n.modelCreateCall)(l,a);console.log("response for auto router create call:",r),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),c.Z.fromBackend("Failed to add auto router: "+e)}},{Title:eH,Link:eJ}=g.default;var eW=e=>{let{form:l,handleOk:t,accessToken:r,userRole:o}=e,[i,d]=(0,a.useState)(!1),[m,u]=(0,a.useState)(!1),[h,x]=(0,a.useState)(""),[p,N]=(0,a.useState)([]),[w,k]=(0,a.useState)([]),[C,Z]=(0,a.useState)(!1),[S,A]=(0,a.useState)(!1),[I,E]=(0,a.useState)(null);(0,a.useEffect)(()=>{(async()=>{N((await (0,n.modelAvailableCall)(r,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[r]),(0,a.useEffect)(()=>{(async()=>{try{let e=await (0,eh.p)(r);console.log("Fetched models for auto router:",e),k(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[r]);let P=eU.ZL.includes(o),M=async()=>{u(!0),x("test-".concat(Date.now())),d(!0)},F=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",I);let e=l.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){c.Z.fromBackend("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){c.Z.fromBackend("Please select a Default Model");return}if(l.setFieldsValue({custom_llm_provider:"auto_router",model:e.auto_router_name,api_key:"not_required_for_auto_router"}),!I||!I.routes||0===I.routes.length){c.Z.fromBackend("Please configure at least one route for the auto router");return}if(I.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){c.Z.fromBackend("Please ensure all routes have a target model, description, and at least one utterance");return}l.validateFields().then(e=>{console.log("Form validation passed, submitting with values:",e);let s={...e,auto_router_config:I};console.log("Final submit values:",s),eG(s,r,l,t)}).catch(e=>{console.error("Validation failed:",e);let l=e.errorFields||[];if(l.length>0){let e=l.map(e=>{let l=e.name[0];return({auto_router_name:"Auto Router Name",auto_router_default_model:"Default Model",auto_router_embedding_model:"Embedding Model"})[l]||l});c.Z.fromBackend("Please fill in the following required fields: ".concat(e.join(", ")))}else c.Z.fromBackend("Please fill in all required fields")})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eH,{level:2,children:"Add Auto Router"}),(0,s.jsx)(b.x,{className:"text-gray-600 mb-6",children:"Create an auto router with intelligent routing logic that automatically selects the best model based on user input patterns and semantic matching."}),(0,s.jsx)(ep.Z,{children:(0,s.jsxs)(f.Z,{form:l,onFinish:F,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,s.jsx)(f.Z.Item,{rules:[{required:!0,message:"Auto router name is required"}],label:"Auto Router Name",name:"auto_router_name",tooltip:"Unique name for this auto router configuration",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(b.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full mb-4",children:(0,s.jsx)(eb,{modelInfo:w,value:I,onChange:e=>{E(e),l.setFieldValue("auto_router_config",e)}})}),(0,s.jsx)(f.Z.Item,{rules:[{required:!0,message:"Default model is required"}],label:"Default Model",name:"auto_router_default_model",tooltip:"Fallback model to use when auto routing logic cannot determine the best model",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(v.default,{placeholder:"Select a default model",onChange:e=>{Z("custom"===e)},options:[...Array.from(new Set(w.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0})}),(0,s.jsx)(f.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",tooltip:"Optional: Embedding model to use for semantic routing decisions",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(v.default,{value:l.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{A("custom"===e),l.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(w.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0,allowClear:!0})}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),P&&(0,s.jsx)(f.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to control who can access this auto router",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:p.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(_.Z,{title:"Get help on our github",children:(0,s.jsx)(g.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(y.ZP,{onClick:M,loading:m,children:"Test Connect"}),(0,s.jsx)(y.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",I),console.log("Current form values:",l.getFieldsValue()),F()},children:"Add Auto Router"})]})]})]})}),(0,s.jsx)(j.Z,{title:"Connection Test Results",open:i,onCancel:()=>{d(!1),u(!1)},footer:[(0,s.jsx)(y.ZP,{onClick:()=>{d(!1),u(!1)},children:"Close"},"close")],width:700,children:i&&(0,s.jsx)(eq,{formValues:l.getFieldsValue(),accessToken:r,testMode:"chat",modelName:l.getFieldValue("auto_router_name"),onClose:()=>{d(!1),u(!1)},onTestComplete:()=>u(!1)},h)})]})};let{Title:eY,Link:e$}=g.default;var eQ=e=>{let{form:l,handleOk:t,selectedProvider:r,setSelectedProvider:o,providerModels:c,setProviderModelsFn:m,getPlaceholder:u,uploadProps:h,showAdvancedSettings:x,setShowAdvancedSettings:p,teams:b,credentials:N,accessToken:C,userRole:Z,premiumUser:S}=e,[I]=f.Z.useForm(),[E,P]=(0,a.useState)("chat"),[M,F]=(0,a.useState)(!1),[T,L]=(0,a.useState)(!1),[R,O]=(0,a.useState)([]),[D,V]=(0,a.useState)("");(0,a.useEffect)(()=>{(async()=>{try{let e=(await (0,n.getGuardrailsList)(C)).guardrails.map(e=>e.guardrail_name);O(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[C]);let q=async()=>{L(!0),V("test-".concat(Date.now())),F(!0)},[z,B]=(0,a.useState)(!1),[K,U]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{U((await (0,n.modelAvailableCall)(C,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[C]);let G=eU.ZL.includes(Z);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ek.v0,{className:"w-full",children:[(0,s.jsxs)(ek.td,{className:"mb-4",children:[(0,s.jsx)(ek.OK,{children:"Add Model"}),(0,s.jsx)(ek.OK,{children:"Add Auto Router"})]}),(0,s.jsxs)(ek.nP,{children:[(0,s.jsxs)(ek.x4,{children:[(0,s.jsx)(eY,{level:2,children:"Add Model"}),(0,s.jsx)(ep.Z,{children:(0,s.jsx)(f.Z,{form:l,onFinish:e=>{console.log("\uD83D\uDD25 Form onFinish triggered with values:",e),t()},onFinishFailed:e=>{console.log("\uD83D\uDCA5 Form onFinishFailed triggered:",e)},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"E.g. OpenAI, Azure OpenAI, Anthropic, Bedrock, etc.",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(v.default,{showSearch:!0,value:r,onChange:e=>{o(e),m(e),l.setFieldsValue({model:[],model_name:void 0})},children:Object.entries(d.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(v.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:d.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(eC,{selectedProvider:r,providerModels:c,getPlaceholder:u}),(0,s.jsx)(eI,{}),(0,s.jsx)(f.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,s.jsx)(v.default,{style:{width:"100%"},value:E,onChange:e=>P(e),options:ez})}),(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(k.Z,{span:10}),(0,s.jsx)(k.Z,{span:10,children:(0,s.jsxs)(i.Z,{className:"mb-5 mt-1",children:[(0,s.jsx)("strong",{children:"Optional"})," - LiteLLM endpoint to use when health checking this model"," ",(0,s.jsx)(e$,{href:"https://docs.litellm.ai/docs/proxy/health#health",target:"_blank",children:"Learn more"})]})})]}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(g.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,s.jsx)(f.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,s.jsx)(v.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...N.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,s.jsx)(f.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.litellm_credential_name!==l.litellm_credential_name||e.provider!==l.provider,children:e=>{let{getFieldValue:l}=e,t=l("litellm_credential_name");return(console.log("\uD83D\uDD11 Credential Name Changed:",t),t)?(0,s.jsx)("div",{className:"text-gray-500 text-sm text-center",children:"Using existing credentials - no additional provider fields needed"}):(0,s.jsx)(A,{selectedProvider:r,uploadProps:h})}}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Model Info Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,s.jsx)(f.Z.Item,{label:"Team-BYOK Model",tooltip:"Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys.",className:"mb-4",children:(0,s.jsx)(_.Z,{title:S?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,s.jsx)(eB.Z,{checked:z,onChange:e=>{B(e),e||l.setFieldValue("team_id",void 0)},disabled:!S})})}),z&&(0,s.jsx)(f.Z.Item,{label:"Select Team",name:"team_id",className:"mb-4",tooltip:"Only keys for this team will be able to call this model.",rules:[{required:z&&!G,message:"Please select a team."}],children:(0,s.jsx)(eK.Z,{teams:b,disabled:!S})}),G&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(f.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to give users access to select models, and add new ones to the group over time.",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:K.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,s.jsx)(eF,{showAdvancedSettings:x,setShowAdvancedSettings:p,teams:b,guardrailsList:R}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(_.Z,{title:"Get help on our github",children:(0,s.jsx)(g.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(y.ZP,{onClick:q,loading:T,children:"Test Connect"}),(0,s.jsx)(y.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})})]}),(0,s.jsx)(ek.x4,{children:(0,s.jsx)(eW,{form:I,handleOk:()=>{I.validateFields().then(e=>{eG(e,C,I,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:C,userRole:Z})})]})]}),(0,s.jsx)(j.Z,{title:"Connection Test Results",open:M,onCancel:()=>{F(!1),L(!1)},footer:[(0,s.jsx)(y.ZP,{onClick:()=>{F(!1),L(!1)},children:"Close"},"close")],width:700,children:M&&(0,s.jsx)(eq,{formValues:l.getFieldsValue(),accessToken:C,testMode:E,modelName:l.getFieldValue("model_name")||l.getFieldValue("model"),onClose:()=>{F(!1),L(!1)},onTestComplete:()=>L(!1)},D)})]})},eX=t(41649),e0=t(8048),e1=t(4156),e2=t(15731),e4=t(91126);let e5=(e,l,t,a,r,o,i,n,d,c,m)=>[{header:()=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(e1.Z,{checked:t,indeterminate:l.length>0&&!t,onChange:e=>r(e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)("span",{children:"Model ID"})]}),accessorKey:"model_info.id",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:t}=e,r=t.original,o=r.model_name,i=l.includes(o);return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(e1.Z,{checked:i,onChange:e=>a(o,e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)(_.Z,{title:r.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>m&&m(r.model_info.id),children:r.model_info.id})})]})}},{header:"Model Name",accessorKey:"model_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,t=l.original,a=n(t)||t.model_name;return(0,s.jsx)("div",{className:"font-medium text-sm",children:(0,s.jsx)(_.Z,{title:a,children:(0,s.jsx)("div",{className:"truncate max-w-[200px]",children:a})})})}},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,sortingFn:(e,l,t)=>{var s,a;let r=e.getValue("health_status")||"unknown",o=l.getValue("health_status")||"unknown",i={healthy:0,checking:1,unknown:2,unhealthy:3};return(null!==(s=i[r])&&void 0!==s?s:4)-(null!==(a=i[o])&&void 0!==a?a:4)},cell:l=>{var t;let{row:a}=l,r=a.original,o={status:r.health_status,loading:r.health_loading,error:r.health_error};if(o.loading)return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}),(0,s.jsx)(ev.x,{className:"text-gray-600 text-sm",children:"Checking..."})]});let n=r.model_name,d="healthy"===o.status&&(null===(t=e[n])||void 0===t?void 0:t.successResponse);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[i(o.status),d&&c&&(0,s.jsx)(_.Z,{title:"View response details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>{var l;return c(n,null===(l=e[n])||void 0===l?void 0:l.successResponse)},className:"p-1 text-green-600 hover:text-green-800 hover:bg-green-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(e2.Z,{className:"h-4 w-4"})})})]})}},{header:"Error Details",accessorKey:"health_error",enableSorting:!1,cell:l=>{let{row:t}=l,a=t.original.model_name,r=e[a];if(!(null==r?void 0:r.error))return(0,s.jsx)(ev.x,{className:"text-gray-400 text-sm",children:"No errors"});let o=r.error,i=r.fullError||r.error;return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"max-w-[200px]",children:(0,s.jsx)(_.Z,{title:o,placement:"top",children:(0,s.jsx)(ev.x,{className:"text-red-600 text-sm truncate",children:o})})}),d&&i!==o&&(0,s.jsx)(_.Z,{title:"View full error details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>d(a,o,i),className:"p-1 text-red-600 hover:text-red-800 hover:bg-red-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(e2.Z,{className:"h-4 w-4"})})})]})}},{header:"Last Check",accessorKey:"last_check",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_check")||"Never checked",a=l.getValue("last_check")||"Never checked";if("Never checked"===s&&"Never checked"===a)return 0;if("Never checked"===s)return 1;if("Never checked"===a)return -1;if("Check in progress..."===s&&"Check in progress..."===a)return 0;if("Check in progress..."===s)return -1;if("Check in progress..."===a)return 1;let r=new Date(s),o=new Date(a);return isNaN(r.getTime())&&isNaN(o.getTime())?0:isNaN(r.getTime())?1:isNaN(o.getTime())?-1:o.getTime()-r.getTime()},cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(ev.x,{className:"text-gray-600 text-sm",children:t.health_loading?"Check in progress...":t.last_check})}},{header:"Last Success",accessorKey:"last_success",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_success")||"Never succeeded",a=l.getValue("last_success")||"Never succeeded";if("Never succeeded"===s&&"Never succeeded"===a)return 0;if("Never succeeded"===s)return 1;if("Never succeeded"===a)return -1;if("None"===s&&"None"===a)return 0;if("None"===s)return 1;if("None"===a)return -1;let r=new Date(s),o=new Date(a);return isNaN(r.getTime())&&isNaN(o.getTime())?0:isNaN(r.getTime())?1:isNaN(o.getTime())?-1:o.getTime()-r.getTime()},cell:l=>{let{row:t}=l,a=e[t.original.model_name],r=(null==a?void 0:a.lastSuccess)||"None";return(0,s.jsx)(ev.x,{className:"text-gray-600 text-sm",children:r})}},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e,t=l.original,a=t.model_name,r=t.health_status&&"none"!==t.health_status,i=t.health_loading?"Checking...":r?"Re-run Health Check":"Run Health Check";return(0,s.jsx)(_.Z,{title:i,placement:"top",children:(0,s.jsx)("button",{className:"p-2 rounded-md transition-colors ".concat(t.health_loading?"text-gray-400 cursor-not-allowed bg-gray-100":"text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50"),onClick:()=>{t.health_loading||o(a)},disabled:t.health_loading,children:t.health_loading?(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}):r?(0,s.jsx)(V.Z,{className:"h-4 w-4"}):(0,s.jsx)(e4.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],e6=[{pattern:/Missing .* API Key/i,replacement:"Missing API Key"},{pattern:/Connection timeout/i,replacement:"Connection timeout"},{pattern:/Network.*not.*ok/i,replacement:"Network connection failed"},{pattern:/403.*Forbidden/i,replacement:"Access forbidden - check API key permissions"},{pattern:/401.*Unauthorized/i,replacement:"Unauthorized - invalid API key"},{pattern:/429.*rate limit/i,replacement:"Rate limit exceeded"},{pattern:/500.*Internal Server Error/i,replacement:"Provider internal server error"},{pattern:/litellm\.AuthenticationError/i,replacement:"Authentication failed"},{pattern:/litellm\.RateLimitError/i,replacement:"Rate limit exceeded"},{pattern:/litellm\.APIError/i,replacement:"API error"}];var e3=e=>{let{accessToken:l,modelData:t,all_models_on_proxy:r,getDisplayModelName:o,setSelectedModelId:d}=e,[c,m]=(0,a.useState)({}),[u,h]=(0,a.useState)([]),[x,p]=(0,a.useState)(!1),[g,f]=(0,a.useState)(!1),[v,_]=(0,a.useState)(null),[b,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),C=(0,a.useRef)(null);(0,a.useEffect)(()=>{l&&(null==t?void 0:t.data)&&(async()=>{let e={};t.data.forEach(l=>{e[l.model_name]={status:"none",lastCheck:"None",lastSuccess:"None",loading:!1,error:void 0,fullError:void 0,successResponse:void 0}});try{let s=await (0,n.latestHealthChecksCall)(l);s&&s.latest_health_checks&&"object"==typeof s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l;if(!a)return;let r=null,o=t.data.find(e=>e.model_name===s);if(o)r=o.model_name;else{let e=t.data.find(e=>e.model_info&&e.model_info.id===s);if(e)r=e.model_name;else if(a.model_name){let e=t.data.find(e=>e.model_name===a.model_name);e&&(r=e.model_name)}}if(r){let l=a.error_message||void 0;e[r]={status:a.status||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():"None",loading:!1,error:l?Z(l):void 0,fullError:l,successResponse:"healthy"===a.status?a:void 0}}})}catch(e){console.warn("Failed to load health check history (using default states):",e)}m(e)})()},[l,t]);let Z=e=>{var l;if(!e)return"Health check failed";let t="string"==typeof e?e:JSON.stringify(e),s=t.match(/(\w+Error):\s*(\d{3})/i);if(s)return"".concat(s[1],": ").concat(s[2]);let a=t.match(/(AuthenticationError|RateLimitError|BadRequestError|InternalServerError|TimeoutError|NotFoundError|ForbiddenError|ServiceUnavailableError|BadGatewayError|ContentPolicyViolationError|\w+Error)/i),r=t.match(/\b(400|401|403|404|408|429|500|502|503|504)\b/);if(a&&r)return"".concat(a[1],": ").concat(r[1]);if(r){let e=r[1];return"".concat({400:"BadRequestError",401:"AuthenticationError",403:"ForbiddenError",404:"NotFoundError",408:"TimeoutError",429:"RateLimitError",500:"InternalServerError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError"}[e],": ").concat(e)}if(a){let e=a[1],l={AuthenticationError:"401",RateLimitError:"429",BadRequestError:"400",InternalServerError:"500",TimeoutError:"408",NotFoundError:"404",ForbiddenError:"403",ServiceUnavailableError:"503",BadGatewayError:"502",GatewayTimeoutError:"504",ContentPolicyViolationError:"400"}[e];return l?"".concat(e,": ").concat(l):e}for(let{pattern:e,replacement:l}of e6)if(e.test(t))return l;if(/missing.*api.*key|invalid.*key|unauthorized/i.test(t))return"AuthenticationError: 401";if(/rate.*limit|too.*many.*requests/i.test(t))return"RateLimitError: 429";if(/timeout|timed.*out/i.test(t))return"TimeoutError: 408";if(/not.*found/i.test(t))return"NotFoundError: 404";if(/forbidden|access.*denied/i.test(t))return"ForbiddenError: 403";if(/internal.*server.*error/i.test(t))return"InternalServerError: 500";let o=t.replace(/[\n\r]+/g," ").replace(/\s+/g," ").trim(),i=null===(l=o.split(/[.!?]/)[0])||void 0===l?void 0:l.trim();return i&&i.length>0?i.length>100?i.substring(0,97)+"...":i:o.length>100?o.substring(0,97)+"...":o},S=async e=>{if(l){m(l=>({...l,[e]:{...l[e],loading:!0,status:"checking"}}));try{var s,a;let r=await (0,n.individualModelHealthCheckCall)(l,e),o=new Date().toLocaleString();if(r.unhealthy_count>0&&r.unhealthy_endpoints&&r.unhealthy_endpoints.length>0){let l=(null===(s=r.unhealthy_endpoints[0])||void 0===s?void 0:s.error)||"Health check failed",t=Z(l);m(s=>{var a;return{...s,[e]:{status:"unhealthy",lastCheck:o,lastSuccess:(null===(a=s[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:o,lastSuccess:o,loading:!1,successResponse:r}}));try{let s=await (0,n.latestHealthChecksCall)(l),r=t.data.find(l=>l.model_name===e);if(r){let l=r.model_info.id,t=null===(a=s.latest_health_checks)||void 0===a?void 0:a[l];if(t){let l=t.error_message||void 0;m(s=>{var a,r,o,i,n,d,c;return{...s,[e]:{status:t.status||(null===(a=s[e])||void 0===a?void 0:a.status)||"unknown",lastCheck:t.checked_at?new Date(t.checked_at).toLocaleString():(null===(r=s[e])||void 0===r?void 0:r.lastCheck)||"None",lastSuccess:"healthy"===t.status?t.checked_at?new Date(t.checked_at).toLocaleString():(null===(o=s[e])||void 0===o?void 0:o.lastSuccess)||"None":(null===(i=s[e])||void 0===i?void 0:i.lastSuccess)||"None",loading:!1,error:l?Z(l):null===(n=s[e])||void 0===n?void 0:n.error,fullError:l||(null===(d=s[e])||void 0===d?void 0:d.fullError),successResponse:"healthy"===t.status?t:null===(c=s[e])||void 0===c?void 0:c.successResponse}}})}}}catch(e){console.debug("Could not fetch updated status from database (non-critical):",e)}}catch(a){let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=Z(t);m(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}}},A=async()=>{let e=u.length>0?u:r,s=e.reduce((e,l)=>(e[l]={...c[l],loading:!0,status:"checking"},e),{});m(e=>({...e,...s}));let a={},o=e.map(async e=>{if(l)try{let s=await (0,n.individualModelHealthCheckCall)(l,e);a[e]=s;let r=new Date().toLocaleString();if(s.unhealthy_count>0&&s.unhealthy_endpoints&&s.unhealthy_endpoints.length>0){var t;let l=(null===(t=s.unhealthy_endpoints[0])||void 0===t?void 0:t.error)||"Health check failed",a=Z(l);m(t=>{var s;return{...t,[e]:{status:"unhealthy",lastCheck:r,lastSuccess:(null===(s=t[e])||void 0===s?void 0:s.lastSuccess)||"None",loading:!1,error:a,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:r,lastSuccess:r,loading:!1,successResponse:s}}))}catch(a){console.error("Health check failed for ".concat(e,":"),a);let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=Z(t);m(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}});await Promise.allSettled(o);try{if(!l)return;let s=await (0,n.latestHealthChecksCall)(l);s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l,r=t.data.find(e=>e.model_info.id===s);if(r&&e.includes(r.model_name)&&a){let e=r.model_name,l=a.error_message||void 0;m(t=>{let s=t[e];return{...t,[e]:{status:a.status||(null==s?void 0:s.status)||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastCheck)||"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastSuccess)||"None",loading:!1,error:l?Z(l):null==s?void 0:s.error,fullError:l||(null==s?void 0:s.fullError),successResponse:"healthy"===a.status?a:null==s?void 0:s.successResponse}}})}})}catch(e){console.warn("Failed to fetch updated health statuses from database (non-critical):",e)}},I=e=>{p(e),e?h(r):h([])},E=()=>{f(!1),_(null)},P=()=>{N(!1),k(null)};return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(Y.Z,{children:"Model Health Status"}),(0,s.jsx)(i.Z,{className:"text-gray-600 mt-1",children:"Run health checks on individual models to verify they are working correctly"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[u.length>0&&(0,s.jsx)(z.Z,{size:"sm",variant:"light",onClick:()=>I(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,s.jsx)(z.Z,{size:"sm",variant:"secondary",onClick:A,disabled:Object.values(c).some(e=>e.loading),className:"px-3 py-1 text-sm",children:u.length>0&&u.length{l?h(l=>[...l,e]):(h(l=>l.filter(l=>l!==e)),p(!1))},I,S,e=>{switch(e){case"healthy":return(0,s.jsx)(eX.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,s.jsx)(eX.Z,{color:"red",children:"unhealthy"});case"checking":return(0,s.jsx)(eX.Z,{color:"blue",children:"checking"});case"none":return(0,s.jsx)(eX.Z,{color:"gray",children:"none"});default:return(0,s.jsx)(eX.Z,{color:"gray",children:"unknown"})}},o,(e,l,t)=>{_({modelName:e,cleanedError:l,fullError:t}),f(!0)},(e,l)=>{k({modelName:e,response:l}),N(!0)},d),data:t.data.map(e=>{let l=c[e.model_name]||{status:"none",lastCheck:"None",loading:!1};return{model_name:e.model_name,model_info:e.model_info,provider:e.provider,litellm_model_name:e.litellm_model_name,health_status:l.status,last_check:l.lastCheck,last_success:l.lastSuccess||"None",health_loading:l.loading,health_error:l.error,health_full_error:l.fullError}}),isLoading:!1,table:C})}),(0,s.jsx)(j.Z,{title:v?"Health Check Error - ".concat(v.modelName):"Error Details",open:g,onCancel:E,footer:[(0,s.jsx)(y.ZP,{onClick:E,children:"Close"},"close")],width:800,children:v&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Error:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,s.jsx)(i.Z,{className:"text-red-800",children:v.cleanedError})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Full Error Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:v.fullError})})]})]})}),(0,s.jsx)(j.Z,{title:w?"Health Check Response - ".concat(w.modelName):"Response Details",open:b,onCancel:P,footer:[(0,s.jsx)(y.ZP,{onClick:P,children:"Close"},"close")],width:800,children:w&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Status:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-green-50 border border-green-200 rounded-md",children:(0,s.jsx)(i.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Response Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(w.response,null,2)})})]})]})})]})},e8=t(10607),e7=t(86462),e9=t(47686),le=t(77355),ll=t(93416),lt=t(95704),ls=e=>{let{accessToken:l,initialModelGroupAlias:t={},onAliasUpdate:r}=e,[o,i]=(0,a.useState)([]),[d,m]=(0,a.useState)({aliasName:"",targetModelGroup:""}),[u,h]=(0,a.useState)(null),[x,g]=(0,a.useState)(!0);(0,a.useEffect)(()=>{i(Object.entries(t).map((e,l)=>{var t;let[s,a]=e;return{id:"".concat(l,"-").concat(s),aliasName:s,targetModelGroup:"string"==typeof a?a:null!==(t=null==a?void 0:a.model)&&void 0!==t?t:""}}))},[t]);let f=async e=>{if(!l)return console.error("Access token is missing"),!1;try{let t={};return e.forEach(e=>{t[e.aliasName]=e.targetModelGroup}),console.log("Saving model group alias:",t),await (0,n.setCallbacksCall)(l,{router_settings:{model_group_alias:t}}),r&&r(t),!0}catch(e){return console.error("Failed to save model group alias settings:",e),c.Z.fromBackend("Failed to save model group alias settings"),!1}},j=async()=>{if(!d.aliasName||!d.targetModelGroup){c.Z.fromBackend("Please provide both alias name and target model group");return}if(o.some(e=>e.aliasName===d.aliasName)){c.Z.fromBackend("An alias with this name already exists");return}let e=[...o,{id:"".concat(Date.now(),"-").concat(d.aliasName),aliasName:d.aliasName,targetModelGroup:d.targetModelGroup}];await f(e)&&(i(e),m({aliasName:"",targetModelGroup:""}),c.Z.success("Alias added successfully"))},v=e=>{h({...e})},_=async()=>{if(!u)return;if(!u.aliasName||!u.targetModelGroup){c.Z.fromBackend("Please provide both alias name and target model group");return}if(o.some(e=>e.id!==u.id&&e.aliasName===u.aliasName)){c.Z.fromBackend("An alias with this name already exists");return}let e=o.map(e=>e.id===u.id?u:e);await f(e)&&(i(e),h(null),c.Z.success("Alias updated successfully"))},y=()=>{h(null)},b=async e=>{let l=o.filter(l=>l.id!==e);await f(l)&&(i(l),c.Z.success("Alias deleted successfully"))},N=o.reduce((e,l)=>(e[l.aliasName]=l.targetModelGroup,e),{});return(0,s.jsxs)(lt.Zb,{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>g(!x),children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(lt.Dx,{className:"mb-0",children:"Model Group Alias Settings"}),(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Create aliases for your model groups to simplify API calls. For example, you can create an alias 'gpt-4o' that points to 'gpt-4o-mini-openai' model group."})]}),(0,s.jsx)("div",{className:"flex items-center",children:x?(0,s.jsx)(e7.Z,{className:"w-5 h-5 text-gray-500"}):(0,s.jsx)(e9.Z,{className:"w-5 h-5 text-gray-500"})})]}),x&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(lt.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,s.jsx)("input",{type:"text",value:d.aliasName,onChange:e=>m({...d,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model Group"}),(0,s.jsx)("input",{type:"text",value:d.targetModelGroup,onChange:e=>m({...d,targetModelGroup:e.target.value}),placeholder:"e.g., gpt-4o-mini-openai",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,s.jsx)("div",{className:"flex items-end",children:(0,s.jsxs)("button",{onClick:j,disabled:!d.aliasName||!d.targetModelGroup,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(d.aliasName&&d.targetModelGroup?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,s.jsx)(le.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,s.jsx)(lt.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,s.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(lt.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,s.jsx)(lt.ss,{children:(0,s.jsxs)(lt.SC,{children:[(0,s.jsx)(lt.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,s.jsx)(lt.xs,{className:"py-1 h-8",children:"Target Model Group"}),(0,s.jsx)(lt.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,s.jsxs)(lt.RM,{children:[o.map(e=>(0,s.jsx)(lt.SC,{className:"h-8",children:u&&u.id===e.id?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lt.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.aliasName,onChange:e=>h({...u,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lt.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.targetModelGroup,onChange:e=>h({...u,targetModelGroup:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lt.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:_,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,s.jsx)("button",{onClick:y,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lt.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,s.jsx)(lt.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModelGroup}),(0,s.jsx)(lt.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:()=>v(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,s.jsx)(ll.Z,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>b(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,s.jsx)(p.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===o.length&&(0,s.jsx)(lt.SC,{children:(0,s.jsx)(lt.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),(0,s.jsxs)(lt.Zb,{children:[(0,s.jsx)(lt.Dx,{className:"mb-4",children:"Configuration Example"}),(0,s.jsx)(lt.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config.yaml:"}),(0,s.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,s.jsxs)("div",{className:"text-gray-700",children:["router_settings:",(0,s.jsx)("br",{}),"\xa0\xa0model_group_alias:",0===Object.keys(N).length?(0,s.jsxs)("span",{className:"text-gray-500",children:[(0,s.jsx)("br",{}),"\xa0\xa0\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[l,t]=e;return(0,s.jsxs)("span",{children:[(0,s.jsx)("br",{}),'\xa0\xa0\xa0\xa0"',l,'": "',t,'"']},l)})]})})]})]})]})},la=t(27281),lr=t(57365),lo=t(47323);let li=(e,l,t,a,r,o,i,n,c,m,u)=>[{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model ID"}),accessorKey:"model_info.id",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(_.Z,{title:t.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>a(t.model_info.id),children:t.model_info.id})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Information"}),accessorKey:"model_name",size:250,cell:e=>{let{row:l}=e,t=l.original,a=o(l.original)||"-",r=(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Provider:"})," ",t.provider||"-"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Public Model Name:"})," ",a]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"LiteLLM Model Name:"})," ",t.litellm_model_name||"-"]})]});return(0,s.jsx)(_.Z,{title:r,children:(0,s.jsxs)("div",{className:"flex items-start space-x-2 min-w-0 w-full max-w-[250px]",children:[(0,s.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:t.provider?(0,s.jsx)("img",{src:(0,d.dr)(t.provider).logo,alt:"".concat(t.provider," logo"),className:"w-4 h-4",onError:e=>{let l=e.target,s=l.parentElement;if(s){var a;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(a=t.provider)||void 0===a?void 0:a.charAt(0))||"-",s.replaceChild(e,l)}}}):(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,s.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate max-w-[210px]",children:a}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5 max-w-[210px]",children:t.litellm_model_name||"-"})]})]})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Credentials"}),accessorKey:"litellm_credential_name",size:180,cell:e=>{var l;let{row:t}=e,a=null===(l=t.original.litellm_params)||void 0===l?void 0:l.litellm_credential_name;return a?(0,s.jsx)(_.Z,{title:"Credential: ".concat(a),children:(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(X.Z,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs truncate",title:a,children:a})]})}):(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(X.Z,{className:"w-4 h-4 text-gray-300 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"No credentials"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Created By"}),accessorKey:"model_info.created_by",sortingFn:"datetime",size:160,cell:e=>{let{row:l}=e,t=l.original,a=t.model_info.created_by,r=t.model_info.created_at?new Date(t.model_info.created_at).toLocaleDateString():null;return(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[160px]",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate",title:a||"Unknown",children:a||"Unknown"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5",title:r||"Unknown date",children:r||"Unknown date"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Updated At"}),accessorKey:"model_info.updated_at",sortingFn:"datetime",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("span",{className:"text-xs",children:t.model_info.updated_at?new Date(t.model_info.updated_at).toLocaleDateString():"-"})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Costs"}),accessorKey:"input_cost",size:120,cell:e=>{let{row:l}=e,t=l.original,a=t.input_cost,r=t.output_cost;return a||r?(0,s.jsx)(_.Z,{title:"Cost per 1M tokens",children:(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[120px]",children:[a&&(0,s.jsxs)("div",{className:"text-xs font-medium text-gray-900 truncate",children:["In: $",a]}),r&&(0,s.jsxs)("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:["Out: $",r]})]})}):(0,s.jsx)("div",{className:"max-w-[120px]",children:(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"-"})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Team ID"}),accessorKey:"model_info.team_id",cell:e=>{let{row:l}=e,t=l.original;return t.model_info.team_id?(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(_.Z,{title:t.model_info.team_id,children:(0,s.jsxs)(z.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>r(t.model_info.team_id),children:[t.model_info.team_id.slice(0,7),"..."]})})}):"-"}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Access Group"}),accessorKey:"model_info.model_access_group",enableSorting:!1,cell:e=>{let{row:l}=e,t=l.original,a=t.model_info.access_groups;if(!a||0===a.length)return"-";let r=t.model_info.id,o=m.has(r),i=a.length>1,n=()=>{let e=new Set(m);o?e.delete(r):e.add(r),u(e)};return(0,s.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,s.jsx)(eX.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:a[0]}),(o||!i&&2===a.length)&&a.slice(1).map((e,l)=>(0,s.jsx)(eX.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:e},l+1)),i&&(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"text-xs text-blue-600 hover:text-blue-800 px-1 py-0.5 rounded hover:bg-blue-50 h-5 leading-tight flex-shrink-0 whitespace-nowrap",children:o?"−":"+".concat(a.length-1)})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Status"}),accessorKey:"model_info.db_model",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("div",{className:"\n inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium\n ".concat(t.model_info.db_model?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-600","\n "),children:t.model_info.db_model?"DB Model":"Config Model"})}},{id:"actions",header:"",cell:t=>{var r;let{row:o}=t,i=o.original,n="Admin"===e||(null===(r=i.model_info)||void 0===r?void 0:r.created_by)===l;return(0,s.jsx)("div",{className:"flex items-center justify-end gap-2 pr-4",children:(0,s.jsx)(lo.Z,{icon:p.Z,size:"sm",onClick:()=>{n&&(a(i.model_info.id),c(!1))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"})})}}];var ln=t(11318),ld=t(80443),lc=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:r,availableModelAccessGroups:n,setSelectedModelId:d,setSelectedTeamId:c,setEditModel:m,modelData:u}=e,{userId:h,userRole:x,premiumUser:p}=(0,ld.Z)(),{teams:g}=(0,ln.Z)(),[f,j]=(0,a.useState)(""),[v,_]=(0,a.useState)("current_team"),[y,b]=(0,a.useState)("personal"),[N,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(null),[Z,S]=(0,a.useState)(new Set),[A,I]=(0,a.useState)({pageIndex:0,pageSize:50}),E=(0,a.useRef)(null),P=(0,a.useMemo)(()=>u&&u.data&&0!==u.data.length?u.data.filter(e=>{var t,s,a,r,o;let i=""===f||e.model_name.toLowerCase().includes(f.toLowerCase()),n="all"===l||e.model_name===l||!l||"wildcard"===l&&(null===(t=e.model_name)||void 0===t?void 0:t.includes("*")),d="all"===k||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(k))||!k,c=!0;return"current_team"===v&&(c="personal"===y?(null===(a=e.model_info)||void 0===a?void 0:a.direct_access)===!0:(null===(o=e.model_info)||void 0===o?void 0:null===(r=o.access_via_team_ids)||void 0===r?void 0:r.includes(y))===!0),i&&n&&d&&c}):[],[u,f,l,k,y,v]),M=(0,a.useMemo)(()=>{let e=A.pageIndex*A.pageSize,l=e+A.pageSize;return P.slice(e,l)},[P,A.pageIndex,A.pageSize]);return(0,a.useEffect)(()=>{I(e=>({...e,pageIndex:0}))},[f,l,k,y,v]),(0,s.jsx)(H.Z,{children:(0,s.jsx)(o.Z,{children:(0,s.jsx)("div",{className:"flex flex-col space-y-4",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,s.jsxs)("div",{className:"border-b px-6 py-4 bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(i.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,s.jsxs)(la.Z,{className:"w-80",defaultValue:"personal",value:y,onValueChange:e=>b(e),children:[(0,s.jsx)(lr.Z,{value:"personal",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Personal"})]})}),null==g?void 0:g.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:e.team_alias?"".concat(e.team_alias.slice(0,30),"..."):"Team ".concat(e.team_id.slice(0,30),"...")})]})},e.team_id))]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(i.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),(0,s.jsxs)(la.Z,{className:"w-64",defaultValue:"current_team",value:v,onValueChange:e=>_(e),children:[(0,s.jsx)(lr.Z,{value:"current_team",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Current Team Models"})]})}),(0,s.jsx)(lr.Z,{value:"all",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"All Available Models"})]})})]})]})]}),"current_team"===v&&(0,s.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,s.jsx)(el.Z,{className:"text-gray-400 mt-0.5 flex-shrink-0 text-xs"}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"personal"===y?(0,s.jsxs)("span",{children:["To access these models: Create a Virtual Key without selecting a team on the"," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]}):(0,s.jsxs)("span",{children:['To access these models: Create a Virtual Key and select Team as "',y,'" on the'," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]})})]})]}),(0,s.jsx)("div",{className:"border-b px-6 py-4",children:(0,s.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("div",{className:"relative w-64",children:[(0,s.jsx)("input",{type:"text",placeholder:"Search model names...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:f,onChange:e=>j(e.target.value)}),(0,s.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(N?"bg-gray-100":""),onClick:()=>w(!N),children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters"]}),(0,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{j(""),t("all"),C(null),b("personal"),_("current_team"),I({pageIndex:0,pageSize:50})},children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),N&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(la.Z,{value:null!=l?l:"all",onValueChange:e=>t("all"===e?"all":e),placeholder:"Filter by Public Model Name",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Models"}),(0,s.jsx)(lr.Z,{value:"wildcard",children:"Wildcard Models (*)"}),r.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})}),(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(la.Z,{value:null!=k?k:"all",onValueChange:e=>C("all"===e?null:e),placeholder:"Filter by Model Access Group",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Model Access Groups"}),n.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-sm text-gray-700",children:P.length>0?"Showing ".concat(A.pageIndex*A.pageSize+1," - ").concat(Math.min((A.pageIndex+1)*A.pageSize,P.length)," of ").concat(P.length," results"):"Showing 0 results"}),P.length>A.pageSize&&(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("button",{onClick:()=>I(e=>({...e,pageIndex:e.pageIndex-1})),disabled:0===A.pageIndex,className:"px-3 py-1 text-sm border rounded-md ".concat(0===A.pageIndex?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,s.jsx)("button",{onClick:()=>I(e=>({...e,pageIndex:e.pageIndex+1})),disabled:A.pageIndex>=Math.ceil(P.length/A.pageSize)-1,className:"px-3 py-1 text-sm border rounded-md ".concat(A.pageIndex>=Math.ceil(P.length/A.pageSize)-1?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,s.jsx)(e0.C,{columns:li(x,h,p,d,c,O,()=>{},()=>{},m,Z,S),data:M,isLoading:!1,table:E})]})})})})},lm=t(93142),lu=t(867),lh=t(3810),lx=t(89245),lp=t(5540),lg=t(8881);let{Text:lf}=g.default;var lj=e=>{let{accessToken:l,onReloadSuccess:t,buttonText:r="Reload Price Data",showIcon:o=!0,size:i="middle",type:d="primary",className:m=""}=e,[u,h]=(0,a.useState)(!1),[x,p]=(0,a.useState)(!1),[g,f]=(0,a.useState)(!1),[v,_]=(0,a.useState)(!1),[b,N]=(0,a.useState)(6),[w,k]=(0,a.useState)(null),[C,Z]=(0,a.useState)(!1);(0,a.useEffect)(()=>{S();let e=setInterval(()=>{S()},3e4);return()=>clearInterval(e)},[l]);let S=async()=>{if(l){Z(!0);try{console.log("Fetching reload status...");let e=await (0,n.getModelCostMapReloadStatus)(l);console.log("Received status:",e),k(e)}catch(e){console.error("Failed to fetch reload status:",e),k({scheduled:!1,interval_hours:null,last_run:null,next_run:null})}finally{Z(!1)}}},A=async()=>{if(!l){c.Z.fromBackend("No access token available");return}h(!0);try{let e=await (0,n.reloadModelCostMap)(l);"success"===e.status?(c.Z.success("Price data reloaded successfully! ".concat(e.models_count||0," models updated.")),null==t||t(),await S()):c.Z.fromBackend("Failed to reload price data")}catch(e){console.error("Error reloading price data:",e),c.Z.fromBackend("Failed to reload price data. Please try again.")}finally{h(!1)}},I=async()=>{if(!l){c.Z.fromBackend("No access token available");return}if(b<=0){c.Z.fromBackend("Hours must be greater than 0");return}p(!0);try{let e=await (0,n.scheduleModelCostMapReload)(l,b);"success"===e.status?(c.Z.success("Periodic reload scheduled for every ".concat(b," hours")),_(!1),await S()):c.Z.fromBackend("Failed to schedule periodic reload")}catch(e){console.error("Error scheduling reload:",e),c.Z.fromBackend("Failed to schedule periodic reload. Please try again.")}finally{p(!1)}},E=async()=>{if(!l){c.Z.fromBackend("No access token available");return}f(!0);try{let e=await (0,n.cancelModelCostMapReload)(l);"success"===e.status?(c.Z.success("Periodic reload cancelled successfully"),await S()):c.Z.fromBackend("Failed to cancel periodic reload")}catch(e){console.error("Error cancelling reload:",e),c.Z.fromBackend("Failed to cancel periodic reload. Please try again.")}finally{f(!1)}},P=e=>{if(!e)return"Never";try{return new Date(e).toLocaleString()}catch(l){return e}};return(0,s.jsxs)("div",{className:m,children:[(0,s.jsxs)(lm.Z,{direction:"horizontal",size:"middle",style:{marginBottom:16},children:[(0,s.jsx)(lu.Z,{title:"Hard Refresh Price Data",description:"This will immediately fetch the latest pricing information from the remote source. Continue?",onConfirm:A,okText:"Yes",cancelText:"No",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"}},children:(0,s.jsx)(y.ZP,{type:d,size:i,loading:u,icon:o?(0,s.jsx)(lx.Z,{}):void 0,style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"},children:r})}),(null==w?void 0:w.scheduled)?(0,s.jsx)(y.ZP,{type:"default",size:i,danger:!0,icon:(0,s.jsx)(lg.Z,{}),loading:g,onClick:E,style:{borderColor:"#ff4d4f",color:"#ff4d4f",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Cancel Periodic Reload"}):(0,s.jsx)(y.ZP,{type:"default",size:i,icon:(0,s.jsx)(lp.Z,{}),onClick:()=>_(!0),style:{borderColor:"#d9d9d9",color:"#6366f1",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Set Up Periodic Reload"})]}),w&&(0,s.jsx)(ep.Z,{size:"small",style:{backgroundColor:"#f8f9fa",border:"1px solid #e9ecef",borderRadius:8},children:(0,s.jsxs)(lm.Z,{direction:"vertical",size:"small",style:{width:"100%"},children:[w.scheduled?(0,s.jsx)("div",{children:(0,s.jsxs)(lh.Z,{color:"green",icon:(0,s.jsx)(lp.Z,{}),children:["Scheduled every ",w.interval_hours," hours"]})}):(0,s.jsx)(lf,{type:"secondary",children:"No periodic reload scheduled"}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lf,{type:"secondary",style:{fontSize:"12px"},children:"Last run:"}),(0,s.jsx)(lf,{style:{fontSize:"12px"},children:P(w.last_run)})]}),w.scheduled&&(0,s.jsxs)(s.Fragment,{children:[w.next_run&&(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lf,{type:"secondary",style:{fontSize:"12px"},children:"Next run:"}),(0,s.jsx)(lf,{style:{fontSize:"12px"},children:P(w.next_run)})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lf,{type:"secondary",style:{fontSize:"12px"},children:"Status:"}),(0,s.jsx)(lh.Z,{color:(null==w?void 0:w.scheduled)?w.last_run?"success":"processing":"default",children:(null==w?void 0:w.scheduled)?w.last_run?"Active":"Ready":"Not scheduled"})]})]})]})}),(0,s.jsxs)(j.Z,{title:"Set Up Periodic Reload",open:v,onOk:I,onCancel:()=>_(!1),confirmLoading:x,okText:"Schedule",cancelText:"Cancel",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"}},children:[(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(lf,{children:"Set up automatic reload of price data every:"})}),(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(eg.Z,{min:1,max:168,value:b,onChange:e=>N(e||6),addonAfter:"hours",style:{width:"100%"}})}),(0,s.jsx)("div",{children:(0,s.jsxs)(lf,{type:"secondary",children:["This will automatically fetch the latest pricing data from the remote source every ",b," hours."]})})]})]})},lv=e=>{let{setModelMap:l}=e,{accessToken:t}=(0,ld.Z)();return(0,s.jsx)(H.Z,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(Y.Z,{children:"Price Data Management"}),(0,s.jsx)(i.Z,{className:"text-tremor-content",children:"Manage model pricing data and configure automatic reload schedules"})]}),(0,s.jsx)(lj,{accessToken:t,onReloadSuccess:()=>{(async()=>{l(await (0,n.modelCostMap)(t))})()},buttonText:"Reload Price Data",size:"middle",type:"primary",className:"w-full"})]})})};let l_={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var ly=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,globalRetryPolicy:r,setGlobalRetryPolicy:o,defaultRetry:n,modelGroupRetryPolicy:d,setModelGroupRetryPolicy:c,handleSaveRetrySettings:m}=e;return(0,s.jsxs)(H.Z,{children:[(0,s.jsx)("div",{className:"flex items-center gap-4 mb-6",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(i.Z,{children:"Retry Policy Scope:"}),(0,s.jsxs)(la.Z,{className:"ml-2 w-48",defaultValue:"global",value:"global"===l?"global":l||a[0],onValueChange:e=>t(e),children:[(0,s.jsx)(lr.Z,{value:"global",children:"Global Default"}),a.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>t(e),children:e},l))]})]})}),"global"===l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Y.Z,{children:"Global Retry Policy"}),(0,s.jsx)(i.Z,{className:"mb-6",children:"Default retry settings applied to all model groups unless overridden"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Y.Z,{children:["Retry Policy for ",l]}),(0,s.jsx)(i.Z,{className:"mb-6",children:"Model-specific retry settings. Falls back to global defaults if not set."})]}),l_&&(0,s.jsx)("table",{children:(0,s.jsx)("tbody",{children:Object.entries(l_).map((e,t)=>{var a,m,u,h;let x,[p,g]=e;if("global"===l)x=null!==(a=null==r?void 0:r[g])&&void 0!==a?a:n;else{let e=null==d?void 0:null===(m=d[l])||void 0===m?void 0:m[g];x=null!=e?e:null!==(u=null==r?void 0:r[g])&&void 0!==u?u:n}return(0,s.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)(i.Z,{children:p}),"global"!==l&&(0,s.jsxs)(i.Z,{className:"text-xs text-gray-500 ml-2",children:["(Global: ",null!==(h=null==r?void 0:r[g])&&void 0!==h?h:n,")"]})]}),(0,s.jsx)("td",{children:(0,s.jsx)(eg.Z,{className:"ml-5",value:x,min:0,step:1,onChange:e=>{"global"===l?o(l=>null==e?l:{...null!=l?l:{},[g]:e}):c(t=>{var s;let a=null!==(s=null==t?void 0:t[l])&&void 0!==s?s:{};return{...null!=t?t:{},[l]:{...a,[g]:e}}})}})})]},t)})})}),(0,s.jsx)(z.Z,{className:"mt-6 mr-8",onClick:m,children:"Save"})]})},lb=t(75105),lN=t(40278),lw=t(97765),lk=t(21626),lC=t(97214),lZ=t(28241),lS=t(58834),lA=t(69552),lI=t(71876),lE=t(39789),lP=t(79326),lM=t(2356),lF=t(59664),lT=e=>{let{modelMetrics:l,modelMetricsCategories:t,customTooltip:a,premiumUser:r}=e;return(0,s.jsx)(lF.Z,{title:"Time to First token (s)",className:"h-72",data:l,index:"date",showLegend:!1,categories:t,colors:["indigo","rose"],connectNulls:!0,customTooltip:a})},lL=e=>{let{setSelectedAPIKey:l,keys:t,teams:r,setSelectedCustomer:o,allEndUsers:n}=e,{premiumUser:d}=(0,ld.Z)(),[c,m]=(0,a.useState)(null);return(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"mb-1",children:"Select API Key Name"}),d?(0,s.jsxs)("div",{children:[(0,s.jsxs)(la.Z,{defaultValue:"all-keys",children:[(0,s.jsx)(lr.Z,{value:"all-keys",onClick:()=>{l(null)},children:"All Keys"},"all-keys"),null==t?void 0:t.map((e,t)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,s.jsx)(lr.Z,{value:String(t),onClick:()=>{l(e)},children:e.key_alias},t):null)]}),(0,s.jsx)(i.Z,{className:"mt-1",children:"Select Customer Name"}),(0,s.jsxs)(la.Z,{defaultValue:"all-customers",children:[(0,s.jsx)(lr.Z,{value:"all-customers",onClick:()=>{o(null)},children:"All Customers"},"all-customers"),null==n?void 0:n.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>{o(e)},children:e},l))]}),(0,s.jsx)(i.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==r?void 0:r.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==r?void 0:r.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]})]})},lR=e=>{let{dateValue:l,setDateValue:t,selectedModelGroup:d,availableModelGroups:c,setShowAdvancedFilters:m,modelMetrics:u,modelMetricsCategories:h,streamingModelMetrics:x,streamingModelMetricsCategories:p,customTooltip:g,slowResponsesData:f,modelExceptions:j,globalExceptionData:v,allExceptions:_,globalExceptionPerDeployment:y,setSelectedAPIKey:b,keys:N,setSelectedCustomer:w,teams:k,allEndUsers:C,selectedAPIKey:Z,selectedCustomer:S,selectedTeam:A,setSelectedModelGroup:I,setModelMetrics:E,setModelMetricsCategories:P,setStreamingModelMetrics:M,setStreamingModelMetricsCategories:F,setSlowResponsesData:T,setModelExceptions:L,setAllExceptions:R,setGlobalExceptionData:O,setGlobalExceptionPerDeployment:D}=e,{accessToken:V,userId:q,userRole:W,premiumUser:$}=(0,ld.Z)();(0,a.useEffect)(()=>{Q(d,l.from,l.to)},[Z,S,A]);let Q=async(e,l,t)=>{if(console.log("Updating model metrics for group:",e),!V||!q||!W||!l||!t)return;console.log("inside updateModelMetrics - startTime:",l,"endTime:",t),I(e);let s=null==Z?void 0:Z.token;void 0===s&&(s=null);let a=S;void 0===a&&(a=null);try{let r=await (0,n.modelMetricsCall)(V,q,W,e,l.toISOString(),t.toISOString(),s,a);console.log("Model metrics response:",r),E(r.data),P(r.all_api_bases);let o=await (0,n.streamingModelMetricsCall)(V,e,l.toISOString(),t.toISOString());M(o.data),F(o.all_api_bases);let i=await (0,n.modelExceptionsCall)(V,q,W,e,l.toISOString(),t.toISOString(),s,a);console.log("Model exceptions response:",i),L(i.data),R(i.exception_types);let d=await (0,n.modelMetricsSlowResponsesCall)(V,q,W,e,l.toISOString(),t.toISOString(),s,a);if(console.log("slowResponses:",d),T(d),e){let s=await (0,n.adminGlobalActivityExceptions)(V,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);O(s);let a=await (0,n.adminGlobalActivityExceptionsPerDeployment)(V,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);D(a)}}catch(e){console.error("Failed to fetch model metrics",e)}};return(0,s.jsxs)(H.Z,{children:[(0,s.jsxs)(o.Z,{numItems:4,className:"mt-2 mb-2",children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(lE.Z,{value:l,className:"mr-2",onValueChange:e=>{t(e),Q(d,e.from,e.to)}})}),(0,s.jsxs)(r.Z,{className:"ml-2",children:[(0,s.jsx)(i.Z,{children:"Select Model Group"}),(0,s.jsx)(la.Z,{defaultValue:d||c[0],value:d||c[0],children:c.map((e,t)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>Q(e,l.from,l.to),children:e},t))})]}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(lP.Z,{trigger:"click",content:(0,s.jsx)(lL,{allEndUsers:C,keys:N,setSelectedAPIKey:b,setSelectedCustomer:w,teams:k}),overlayStyle:{width:"20vw"},children:(0,s.jsx)(z.Z,{icon:lM.Z,size:"md",variant:"secondary",className:"mt-4 ml-2",style:{border:"none"},onClick:()=>m(!0)})})})]}),(0,s.jsxs)(o.Z,{numItems:2,children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(B.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,s.jsxs)(U.Z,{children:[(0,s.jsxs)(G.Z,{variant:"line",defaultValue:"1",children:[(0,s.jsx)(K.Z,{value:"1",children:"Avg. Latency per Token"}),(0,s.jsx)(K.Z,{value:"2",children:"Time to first token"})]}),(0,s.jsxs)(J.Z,{children:[(0,s.jsxs)(H.Z,{children:[(0,s.jsx)("p",{className:"text-gray-500 italic",children:" (seconds/token)"}),(0,s.jsx)(i.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),u&&h&&(0,s.jsx)(lb.Z,{title:"Model Latency",className:"h-72",data:u,showLegend:!1,index:"date",categories:h,connectNulls:!0,customTooltip:g})]}),(0,s.jsx)(H.Z,{children:(0,s.jsx)(lT,{modelMetrics:x,modelMetricsCategories:p,customTooltip:g,premiumUser:$})})]})]})})}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(B.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,s.jsxs)(lk.Z,{children:[(0,s.jsx)(lS.Z,{children:(0,s.jsxs)(lI.Z,{children:[(0,s.jsx)(lA.Z,{children:"Deployment"}),(0,s.jsx)(lA.Z,{children:"Success Responses"}),(0,s.jsxs)(lA.Z,{children:["Slow Responses ",(0,s.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,s.jsx)(lC.Z,{children:f.map((e,l)=>(0,s.jsxs)(lI.Z,{children:[(0,s.jsx)(lZ.Z,{children:e.api_base}),(0,s.jsx)(lZ.Z,{children:e.total_count}),(0,s.jsx)(lZ.Z,{children:e.slow_count})]},l))})]})})})]}),(0,s.jsx)(o.Z,{numItems:1,className:"gap-2 w-full mt-2",children:(0,s.jsxs)(B.Z,{children:[(0,s.jsxs)(Y.Z,{children:["All Exceptions for ",d]}),(0,s.jsx)(lN.Z,{className:"h-60",data:j,index:"model",categories:_,stack:!0,yAxisWidth:30})]})}),(0,s.jsxs)(o.Z,{numItems:1,className:"gap-2 w-full mt-2",children:[(0,s.jsxs)(B.Z,{children:[(0,s.jsxs)(Y.Z,{children:["All Up Rate Limit Errors (429) for ",d]}),(0,s.jsxs)(o.Z,{numItems:1,children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(lw.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",v.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lN.Z,{className:"h-40",data:v.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]}),(0,s.jsx)(r.Z,{})]})]}),$?(0,s.jsx)(s.Fragment,{children:y.map((e,l)=>(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(Y.Z,{children:e.api_base?e.api_base:"Unknown API Base"}),(0,s.jsx)(o.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(lw.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors (429) ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lN.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]},l))}):(0,s.jsx)(s.Fragment,{children:y&&y.length>0&&y.slice(0,1).map((e,l)=>(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(Y.Z,{children:"✨ Rate Limit Errors by Deployment"}),(0,s.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see exceptions for all deployments"}),(0,s.jsx)(z.Z,{variant:"primary",className:"mb-2",children:(0,s.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(Y.Z,{children:e.api_base}),(0,s.jsx)(o.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(lw.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lN.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]})]},l))})]})]})},lO=e=>{let{accessToken:l,token:t,userRole:m,userID:h,modelData:x={data:[]},keys:p,setModelData:j,premiumUser:v,teams:_}=e,[y]=f.Z.useForm(),[b,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(""),[C,Z]=(0,a.useState)([]),[S,A]=(0,a.useState)([]),[I,E]=(0,a.useState)(d.Cl.OpenAI),[P,M]=(0,a.useState)(!1),[F,T]=(0,a.useState)(null),[L,z]=(0,a.useState)([]),[B,K]=(0,a.useState)([]),[U,G]=(0,a.useState)(null),[H,J]=(0,a.useState)([]),[W,Y]=(0,a.useState)([]),[$,Q]=(0,a.useState)([]),[X,ee]=(0,a.useState)([]),[el,et]=(0,a.useState)([]),[es,ea]=(0,a.useState)([]),[er,eo]=(0,a.useState)([]),[ei,en]=(0,a.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[ed,ec]=(0,a.useState)(null),[em,eu]=(0,a.useState)(null),[eh,ex]=(0,a.useState)(0),[ep,eg]=(0,a.useState)({}),[ef,ej]=(0,a.useState)([]),[ev,e_]=(0,a.useState)(!1),[ey,eb]=(0,a.useState)(null),[eN,ek]=(0,a.useState)(null),[eC,eZ]=(0,a.useState)([]),[eS,eA]=(0,a.useState)([]),[eI,eE]=(0,a.useState)({}),[eP,eM]=(0,a.useState)(!1),[eF,eT]=(0,a.useState)(null),[eL,eR]=(0,a.useState)(!1),[eO,eD]=(0,a.useState)(null),[eV,eq]=(0,a.useState)(null),[ez,eB]=(0,a.useState)(!1),eK=(0,a.useRef)(null),[eG,eH]=(0,a.useState)(0),eJ=async e=>{try{let l=await (0,n.credentialListCall)(e);console.log("credentials: ".concat(JSON.stringify(l))),eA(l.credentials)}catch(e){console.error("Error fetching credentials:",e)}};(0,a.useEffect)(()=>{let e=e=>{eK.current&&!eK.current.contains(e.target)&&eB(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let eW={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;console.log("Resetting vertex_credentials to JSON; jsonStr: ".concat(l)),y.setFieldsValue({vertex_credentials:l}),console.log("Form values right after setting:",y.getFieldsValue())}},l.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered with values:",e),console.log("Current form values:",y.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?c.Z.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&c.Z.fromBackend("".concat(e.file.name," file upload failed."))}},eY=()=>{k(new Date().toLocaleString())},e$=async()=>{if(!l){console.error("Access token is missing");return}try{let e={router_settings:{}};"global"===U?(console.log("Saving global retry policy:",em),em&&(e.router_settings.retry_policy=em),c.Z.success("Global retry settings saved successfully")):(console.log("Saving model group retry policy for",U,":",ed),ed&&(e.router_settings.model_group_retry_policy=ed),c.Z.success("Retry settings saved successfully for ".concat(U))),await (0,n.setCallbacksCall)(l,e)}catch(e){console.error("Failed to save retry settings:",e),c.Z.fromBackend("Failed to save retry settings")}};if((0,a.useEffect)(()=>{if(!l||!t||!m||!h)return;let e=async()=>{try{var e,t,s,a,r,o,i,d,c,u,x,p;let g=await (0,n.modelInfoCall)(l,h,m);console.log("Model data response:",g.data),j(g);let f=await (0,n.modelSettingsCall)(l);f&&A(f);let v=new Set;for(let e=0;e0&&(b=_[_.length-1],console.log("_initial_model_group:",b)),console.log("selectedModelGroup:",U);let N=await (0,n.modelMetricsCall)(l,h,m,b,null===(e=ei.from)||void 0===e?void 0:e.toISOString(),null===(t=ei.to)||void 0===t?void 0:t.toISOString(),null==ey?void 0:ey.token,eN);console.log("Model metrics response:",N),J(N.data),Y(N.all_api_bases);let w=await (0,n.streamingModelMetricsCall)(l,b,null===(s=ei.from)||void 0===s?void 0:s.toISOString(),null===(a=ei.to)||void 0===a?void 0:a.toISOString());Q(w.data),ee(w.all_api_bases);let k=await (0,n.modelExceptionsCall)(l,h,m,b,null===(r=ei.from)||void 0===r?void 0:r.toISOString(),null===(o=ei.to)||void 0===o?void 0:o.toISOString(),null==ey?void 0:ey.token,eN);console.log("Model exceptions response:",k),et(k.data),ea(k.exception_types);let C=await (0,n.modelMetricsSlowResponsesCall)(l,h,m,b,null===(i=ei.from)||void 0===i?void 0:i.toISOString(),null===(d=ei.to)||void 0===d?void 0:d.toISOString(),null==ey?void 0:ey.token,eN),Z=await (0,n.adminGlobalActivityExceptions)(l,null===(c=ei.from)||void 0===c?void 0:c.toISOString().split("T")[0],null===(u=ei.to)||void 0===u?void 0:u.toISOString().split("T")[0],b);eg(Z);let S=await (0,n.adminGlobalActivityExceptionsPerDeployment)(l,null===(x=ei.from)||void 0===x?void 0:x.toISOString().split("T")[0],null===(p=ei.to)||void 0===p?void 0:p.toISOString().split("T")[0],b);ej(S),console.log("dailyExceptions:",Z),console.log("dailyExceptionsPerDeplyment:",S),console.log("slowResponses:",C),eo(C);let I=await (0,n.allEndUsersCall)(l);eZ(null==I?void 0:I.map(e=>e.user_id));let E=(await (0,n.getCallbacksCall)(l,h,m)).router_settings;console.log("routerSettingsInfo:",E);let P=E.model_group_retry_policy,M=E.num_retries;console.log("model_group_retry_policy:",P),console.log("default_retries:",M),ec(P),eu(E.retry_policy),ex(M);let F=E.model_group_alias||{};eE(F)}catch(e){console.error("There was an error fetching the model data",e)}};l&&t&&m&&h&&e();let s=async()=>{let e=await (0,n.modelCostMap)(l);console.log("received model cost map data: ".concat(Object.keys(e))),N(e)};null==b&&s(),eY()},[l,t,m,h,b,w,eV]),!x||!l||!t||!m||!h)return(0,s.jsx)("div",{children:"Loading..."});let eX=[],e0=[];for(let e=0;e(console.log("GET PROVIDER CALLED! - ".concat(b)),null!=b&&"object"==typeof b&&e in b)?b[e].litellm_provider:"openai";if(t){let e=t.split("/"),l=e[0];(r=s)||(r=1===e.length?m(t):l)}else r="-";a&&(o=null==a?void 0:a.input_cost_per_token,i=null==a?void 0:a.output_cost_per_token,n=null==a?void 0:a.max_tokens,d=null==a?void 0:a.max_input_tokens),(null==l?void 0:l.litellm_params)&&(c=Object.fromEntries(Object.entries(null==l?void 0:l.litellm_params).filter(e=>{let[l]=e;return"model"!==l&&"api_base"!==l}))),x.data[e].provider=r,x.data[e].input_cost=o,x.data[e].output_cost=i,x.data[e].litellm_model_name=t,e0.push(r),x.data[e].input_cost&&(x.data[e].input_cost=(1e6*Number(x.data[e].input_cost)).toFixed(2)),x.data[e].output_cost&&(x.data[e].output_cost=(1e6*Number(x.data[e].output_cost)).toFixed(2)),x.data[e].max_tokens=n,x.data[e].max_input_tokens=d,x.data[e].api_base=null==l?void 0:null===(e4=l.litellm_params)||void 0===e4?void 0:e4.api_base,x.data[e].cleanedLitellmParams=c,eX.push(l.model_name),console.log(x.data[e])}if(m&&"Admin Viewer"==m){let{Title:e,Paragraph:l}=g.default;return(0,s.jsxs)("div",{children:[(0,s.jsx)(e,{level:1,children:"Access Denied"}),(0,s.jsx)(l,{children:"Ask your proxy admin for access to view all models"})]})}return(console.log("selectedProvider: ".concat(I)),console.log("providerModels.length: ".concat(C.length)),Object.keys(d.Cl).find(e=>d.Cl[e]===I),eO)?(0,s.jsx)("div",{className:"w-full h-full",children:(0,s.jsx)(q.Z,{teamId:eO,onClose:()=>eD(null),accessToken:l,is_team_admin:"Admin"===m,is_proxy_admin:"Proxy Admin"===m,userModels:eX,editTeam:!1,onUpdate:eY})}):(0,s.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,s.jsx)(o.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,s.jsxs)(r.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Model Management"}),eU.ZL.includes(m)?(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add and manage models for the proxy"}):(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add models for teams you are an admin for."})]})}),eF?(0,s.jsx)(ew,{modelId:eF,editModel:!0,onClose:()=>{eT(null),eR(!1)},modelData:x.data.find(e=>e.model_info.id===eF),accessToken:l,userID:h,userRole:m,setEditModalVisible:M,setSelectedModel:T,onModelUpdate:e=>{j({...x,data:x.data.map(l=>l.model_info.id===e.model_info.id?e:l)}),eY()},modelAccessGroups:B}):(0,s.jsxs)(D.v0,{index:eG,onIndexChange:eH,className:"gap-2 h-[75vh] w-full ",children:[(0,s.jsxs)(D.td,{className:"flex justify-between mt-2 w-full items-center",children:[(0,s.jsxs)("div",{className:"flex",children:[eU.ZL.includes(m)?(0,s.jsx)(D.OK,{children:"All Models"}):(0,s.jsx)(D.OK,{children:"Your Models"}),(0,s.jsx)(D.OK,{children:"Add Model"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"LLM Credentials"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Pass-Through Endpoints"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Health Status"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Model Analytics"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Model Retry Settings"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Model Group Alias"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Price Data Reload"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[w&&(0,s.jsxs)(i.Z,{children:["Last Refreshed: ",w]}),(0,s.jsx)(D.JO,{icon:V.Z,variant:"shadow",size:"xs",className:"self-center",onClick:eY})]})]}),(0,s.jsxs)(D.nP,{children:[(0,s.jsx)(lc,{selectedModelGroup:U,setSelectedModelGroup:G,availableModelGroups:L,availableModelAccessGroups:B,setSelectedModelId:eT,setSelectedTeamId:eD,setEditModel:eR,modelData:x}),(0,s.jsx)(D.x4,{className:"h-full",children:(0,s.jsx)(eQ,{form:y,handleOk:()=>{console.log("\uD83D\uDE80 handleOk called from model dashboard!"),console.log("Current form values:",y.getFieldsValue()),y.validateFields().then(e=>{console.log("✅ Validation passed, submitting:",e),u(e,l,y,eY)}).catch(e=>{var l;console.error("❌ Validation failed:",e),console.error("Form errors:",e.errorFields);let t=(null===(l=e.errorFields)||void 0===l?void 0:l.map(e=>"".concat(e.name.join("."),": ").concat(e.errors.join(", "))).join(" | "))||"Unknown validation error";c.Z.fromBackend("Please fill in the following required fields: ".concat(t))})},selectedProvider:I,setSelectedProvider:E,providerModels:C,setProviderModelsFn:e=>{let l=(0,d.bK)(e,b);Z(l),console.log("providerModels: ".concat(l))},getPlaceholder:d.ph,uploadProps:eW,showAdvancedSettings:eP,setShowAdvancedSettings:eM,teams:_,credentials:eS,accessToken:l,userRole:m,premiumUser:v})}),(0,s.jsx)(D.x4,{children:(0,s.jsx)(R,{accessToken:l,uploadProps:eW,credentialList:eS,fetchCredentials:eJ})}),(0,s.jsx)(D.x4,{children:(0,s.jsx)(e8.Z,{accessToken:l,userRole:m,userID:h,modelData:x})}),(0,s.jsx)(D.x4,{children:(0,s.jsx)(e3,{accessToken:l,modelData:x,all_models_on_proxy:eX,getDisplayModelName:O,setSelectedModelId:eT})}),(0,s.jsx)(lR,{dateValue:ei,setDateValue:en,selectedModelGroup:U,availableModelGroups:L,setShowAdvancedFilters:e_,modelMetrics:H,modelMetricsCategories:W,streamingModelMetrics:$,streamingModelMetricsCategories:X,customTooltip:e=>{var l,t;let{payload:a,active:r}=e;if(!r||!a)return null;let o=null===(t=a[0])||void 0===t?void 0:null===(l=t.payload)||void 0===l?void 0:l.date,i=a.sort((e,l)=>l.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:a.slice(5).reduce((e,l)=>e+l.value,0),color:"gray"})}return(0,s.jsxs)("div",{className:"w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[o&&(0,s.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",o]}),i.map((e,l)=>{let t=parseFloat(e.value.toFixed(5)),a=0===t&&e.value>0?"<0.00001":t.toFixed(5);return(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,s.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,s.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:a})]},l)})]})},slowResponsesData:er,modelExceptions:el,globalExceptionData:ep,allExceptions:es,globalExceptionPerDeployment:ef,allEndUsers:eC,keys:p,setSelectedAPIKey:eb,setSelectedCustomer:ek,teams:_,selectedAPIKey:ey,selectedCustomer:eN,selectedTeam:eV,setAllExceptions:ea,setGlobalExceptionData:eg,setGlobalExceptionPerDeployment:ej,setModelExceptions:et,setModelMetrics:J,setModelMetricsCategories:Y,setSelectedModelGroup:G,setSlowResponsesData:eo,setStreamingModelMetrics:Q,setStreamingModelMetricsCategories:ee}),(0,s.jsx)(ly,{selectedModelGroup:U,setSelectedModelGroup:G,availableModelGroups:L,globalRetryPolicy:em,setGlobalRetryPolicy:eu,defaultRetry:eh,modelGroupRetryPolicy:ed,setModelGroupRetryPolicy:ec,handleSaveRetrySettings:e$}),(0,s.jsx)(D.x4,{children:(0,s.jsx)(ls,{accessToken:l,initialModelGroupAlias:eI,onAliasUpdate:eE})}),(0,s.jsx)(lv,{setModelMap:N})]})]})]})})})}},10607:function(e,l,t){t.d(l,{Z:function(){return U}});var s=t(57437),a=t(2265),r=t(20831),o=t(47323),i=t(84264),n=t(96761),d=t(19250),c=t(89970),m=t(53410),u=t(74998),h=t(92858),x=t(49566),p=t(12514),g=t(97765),f=t(52787),j=t(13634),v=t(82680),_=t(61778),y=t(24199),b=t(12660),N=t(15424),w=t(93142),k=t(73002),C=t(45246),Z=t(96473),S=t(31283),A=e=>{let{value:l={},onChange:t}=e,[r,o]=(0,a.useState)(Object.entries(l)),i=e=>{let l=r.filter((l,t)=>t!==e);o(l),null==t||t(Object.fromEntries(l))},n=(e,l,s)=>{let a=[...r];a[e]=[l,s],o(a),null==t||t(Object.fromEntries(a))};return(0,s.jsxs)("div",{children:[r.map((e,l)=>{let[t,a]=e;return(0,s.jsxs)(w.Z,{style:{display:"flex",marginBottom:8},align:"center",children:[(0,s.jsx)(S.o,{placeholder:"Header Name",value:t,onChange:e=>n(l,e.target.value,a)}),(0,s.jsx)(S.o,{placeholder:"Header Value",value:a,onChange:e=>n(l,t,e.target.value)}),(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,s.jsx)(C.Z,{onClick:()=>i(l),style:{cursor:"pointer"}})})]},l)}),(0,s.jsx)(k.ZP,{type:"dashed",onClick:()=>{o([...r,["",""]])},icon:(0,s.jsx)(Z.Z,{}),children:"Add Header"})]})},I=t(77565),E=e=>{let{pathValue:l,targetValue:t,includeSubpath:a}=e,r=(0,d.getProxyBaseUrl)();return l&&t?(0,s.jsxs)(p.Z,{className:"p-5",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Preview"}),(0,s.jsx)(g.Z,{className:"text-gray-600 mb-5",children:"How your requests will be routed"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"Basic routing:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:l?"".concat(r).concat(l):""})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(I.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:t})]})]})]}),a&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"With subpaths:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint + subpath"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[l&&"".concat(r).concat(l),(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(I.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[t,(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]})]}),(0,s.jsxs)("div",{className:"mt-3 text-sm text-gray-600",children:["Any path after ",l," will be appended to the target URL"]})]})}),!a&&(0,s.jsx)("div",{className:"mt-4 p-3 bg-blue-50 rounded-md border border-blue-200",children:(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)(N.Z,{className:"text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),(0,s.jsxs)("div",{className:"text-sm text-blue-700",children:[(0,s.jsx)("span",{className:"font-medium",children:"Not seeing the routing you wanted?"})," Try enabling - Include Subpaths - above - this allows subroutes like"," ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded font-mono text-xs",children:"/api/v1/models"})," to be forwarded automatically."]})]})})]})]}):null},P=t(9114);let{Option:M}=f.default;var F=e=>{let{accessToken:l,setPassThroughItems:t,passThroughItems:o}=e,[i]=j.Z.useForm(),[m,u]=(0,a.useState)(!1),[f,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(""),[Z,S]=(0,a.useState)(""),[I,M]=(0,a.useState)(""),[F,T]=(0,a.useState)(!0),L=()=>{i.resetFields(),S(""),M(""),T(!0),u(!1)},R=e=>{let l=e;e&&!e.startsWith("/")&&(l="/"+e),S(l),i.setFieldsValue({path:l})},O=async e=>{console.log("addPassThrough called with:",e),w(!0);try{console.log("formValues: ".concat(JSON.stringify(e)));let s=(await (0,d.createPassThroughEndpoint)(l,e)).endpoints[0],a=[...o,s];t(a),P.Z.success("Pass-through endpoint created successfully"),i.resetFields(),S(""),M(""),T(!0),u(!1)}catch(e){P.Z.fromBackend("Error creating pass-through endpoint: "+e)}finally{w(!1)}};return(0,s.jsxs)("div",{children:[(0,s.jsx)(r.Z,{className:"mx-auto mb-4 mt-4",onClick:()=>u(!0),children:"+ Add Pass-Through Endpoint"}),(0,s.jsx)(v.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,s.jsx)(b.Z,{className:"text-xl text-blue-500"}),(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Pass-Through Endpoint"})]}),open:m,width:1e3,onCancel:L,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)(_.Z,{message:"What is a Pass-Through Endpoint?",description:"Route requests from your LiteLLM proxy to any external API. Perfect for custom models, image generation APIs, or any service you want to proxy through LiteLLM.",type:"info",showIcon:!0,className:"mb-6"}),(0,s.jsxs)(j.Z,{form:i,onFinish:O,layout:"vertical",className:"space-y-6",initialValues:{include_subpath:!0,path:Z,target:I},children:[(0,s.jsxs)(p.Z,{className:"p-5",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Configuration"}),(0,s.jsx)(g.Z,{className:"text-gray-600 mb-5",children:"Configure how requests to your domain will be forwarded to the target API"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)(j.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Path Prefix"}),name:"path",rules:[{required:!0,message:"Path is required",pattern:/^\//}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example: /bria, /adobe-photoshop, /elasticsearch"}),className:"mb-4",children:(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(x.Z,{placeholder:"bria",value:Z,onChange:e=>R(e.target.value),className:"flex-1"})})}),(0,s.jsx)(j.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Target URL"}),name:"target",rules:[{required:!0,message:"Target URL is required"},{type:"url",message:"Please enter a valid URL"}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example:https://engine.prod.bria-api.com"}),className:"mb-4",children:(0,s.jsx)(x.Z,{placeholder:"https://engine.prod.bria-api.com",value:I,onChange:e=>{M(e.target.value),i.setFieldsValue({target:e.target.value})}})}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Include Subpaths"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Forward all subpaths to the target API (recommended for REST APIs)"})]}),(0,s.jsx)(j.Z.Item,{name:"include_subpath",valuePropName:"checked",className:"mb-0",children:(0,s.jsx)(h.Z,{checked:F,onChange:T})})]})]})]}),(0,s.jsx)(E,{pathValue:Z,targetValue:I,includeSubpath:F}),(0,s.jsxs)(p.Z,{className:"p-6",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Headers"}),(0,s.jsx)(g.Z,{className:"text-gray-600 mb-6",children:"Add headers that will be sent with every request to the target API"}),(0,s.jsx)(j.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Headers",(0,s.jsx)(c.Z,{title:"Authentication and other headers to forward with requests",children:(0,s.jsx)(N.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"headers",rules:[{required:!0,message:"Please configure the headers"}],extra:(0,s.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Add authentication tokens and other required headers"}),(0,s.jsx)("div",{children:"Common examples: auth_token, Authorization, x-api-key"})]}),children:(0,s.jsx)(A,{})})]}),(0,s.jsxs)(p.Z,{className:"p-6",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Billing"}),(0,s.jsx)(g.Z,{className:"text-gray-600 mb-6",children:"Optional cost tracking for this endpoint"}),(0,s.jsx)(j.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Cost Per Request (USD)",(0,s.jsx)(c.Z,{title:"Optional: Track costs for requests to this endpoint",children:(0,s.jsx)(N.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"cost_per_request",extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"The cost charged for each request through this endpoint"}),children:(0,s.jsx)(y.Z,{min:0,step:.001,precision:4,placeholder:"2.0000",size:"large"})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,s.jsx)(r.Z,{variant:"secondary",onClick:L,children:"Cancel"}),(0,s.jsx)(r.Z,{variant:"primary",loading:f,onClick:()=>{console.log("Submit button clicked"),i.submit()},children:f?"Creating...":"Add Pass-Through Endpoint"})]})]})]})})]})},T=t(30078),L=t(64482),R=t(63709),O=t(20577),D=t(87769),V=t(42208);let q=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),o=JSON.stringify(l,null,2);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("pre",{className:"font-mono text-xs bg-gray-50 p-2 rounded max-w-md overflow-auto",children:t?o:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(D.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(V.Z,{className:"w-4 h-4 text-gray-500"})})]})};var z=e=>{let{endpointData:l,onClose:t,accessToken:r,isAdmin:o,onEndpointUpdated:i}=e,[n,c]=(0,a.useState)(l),[m,u]=(0,a.useState)(!1),[h,x]=(0,a.useState)(!1),[p]=j.Z.useForm(),g=async e=>{try{if(!r||!(null==n?void 0:n.id))return;let l={};if(e.headers)try{l="string"==typeof e.headers?JSON.parse(e.headers):e.headers}catch(e){P.Z.fromBackend("Invalid JSON format for headers");return}let t={path:n.path,target:e.target,headers:l,include_subpath:e.include_subpath,cost_per_request:e.cost_per_request};await (0,d.updatePassThroughEndpoint)(r,n.id,t),c({...n,...t}),x(!1),i&&i()}catch(e){console.error("Error updating endpoint:",e),P.Z.fromBackend("Failed to update pass through endpoint")}},f=async()=>{try{if(!r||!(null==n?void 0:n.id))return;await (0,d.deletePassThroughEndpointsCall)(r,n.id),P.Z.success("Pass through endpoint deleted successfully"),t(),i&&i()}catch(e){console.error("Error deleting endpoint:",e),P.Z.fromBackend("Failed to delete pass through endpoint")}};return m?(0,s.jsx)("div",{className:"p-4",children:"Loading..."}):n?(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(k.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,s.jsxs)(T.Dx,{children:["Pass Through Endpoint: ",n.path]}),(0,s.jsx)(T.xv,{className:"text-gray-500 font-mono",children:n.id})]})}),(0,s.jsxs)(T.v0,{children:[(0,s.jsxs)(T.td,{className:"mb-4",children:[(0,s.jsx)(T.OK,{children:"Overview"},"overview"),o?(0,s.jsx)(T.OK,{children:"Settings"},"settings"):(0,s.jsx)(s.Fragment,{})]}),(0,s.jsxs)(T.nP,{children:[(0,s.jsxs)(T.x4,{children:[(0,s.jsxs)(T.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(T.Zb,{children:[(0,s.jsx)(T.xv,{children:"Path"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(T.Dx,{className:"font-mono",children:n.path})})]}),(0,s.jsxs)(T.Zb,{children:[(0,s.jsx)(T.xv,{children:"Target"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(T.Dx,{children:n.target})})]}),(0,s.jsxs)(T.Zb,{children:[(0,s.jsx)(T.xv,{children:"Configuration"}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)(T.Ct,{color:n.include_subpath?"green":"gray",children:n.include_subpath?"Include Subpath":"Exact Path"})}),void 0!==n.cost_per_request&&(0,s.jsx)("div",{children:(0,s.jsxs)(T.xv,{children:["Cost per request: $",n.cost_per_request]})})]})]})]}),(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(E,{pathValue:n.path,targetValue:n.target,includeSubpath:n.include_subpath||!1})}),n.headers&&Object.keys(n.headers).length>0&&(0,s.jsxs)(T.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Headers"}),(0,s.jsxs)(T.Ct,{color:"blue",children:[Object.keys(n.headers).length," headers configured"]})]}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(q,{value:n.headers})})]})]}),o&&(0,s.jsx)(T.x4,{children:(0,s.jsxs)(T.Zb,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(T.Dx,{children:"Pass Through Endpoint Settings"}),(0,s.jsx)("div",{className:"space-x-2",children:!h&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(T.zx,{onClick:()=>x(!0),children:"Edit Settings"}),(0,s.jsx)(T.zx,{onClick:f,variant:"secondary",color:"red",children:"Delete Endpoint"})]})})]}),h?(0,s.jsxs)(j.Z,{form:p,onFinish:g,initialValues:{target:n.target,headers:n.headers?JSON.stringify(n.headers,null,2):"",include_subpath:n.include_subpath||!1,cost_per_request:n.cost_per_request},layout:"vertical",children:[(0,s.jsx)(j.Z.Item,{label:"Target URL",name:"target",rules:[{required:!0,message:"Please input a target URL"}],children:(0,s.jsx)(T.oi,{placeholder:"https://api.example.com"})}),(0,s.jsx)(j.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,s.jsx)(L.default.TextArea,{rows:5,placeholder:'{"Authorization": "Bearer your-token", "Content-Type": "application/json"}'})}),(0,s.jsx)(j.Z.Item,{label:"Include Subpath",name:"include_subpath",valuePropName:"checked",children:(0,s.jsx)(R.Z,{})}),(0,s.jsx)(j.Z.Item,{label:"Cost per Request",name:"cost_per_request",children:(0,s.jsx)(O.Z,{min:0,step:.01,precision:2,placeholder:"0.00",addonBefore:"$"})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,s.jsx)(k.ZP,{onClick:()=>x(!1),children:"Cancel"}),(0,s.jsx)(T.zx,{children:"Save Changes"})]})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Path"}),(0,s.jsx)("div",{className:"font-mono",children:n.path})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Target URL"}),(0,s.jsx)("div",{children:n.target})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Include Subpath"}),(0,s.jsx)(T.Ct,{color:n.include_subpath?"green":"gray",children:n.include_subpath?"Yes":"No"})]}),void 0!==n.cost_per_request&&(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Cost per Request"}),(0,s.jsxs)("div",{children:["$",n.cost_per_request]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Headers"}),n.headers&&Object.keys(n.headers).length>0?(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(q,{value:n.headers})}):(0,s.jsx)("div",{className:"text-gray-500",children:"No headers configured"})]})]})]})})]})]})]}):(0,s.jsx)("div",{className:"p-4",children:"Pass through endpoint not found"})},B=t(12322);let K=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),o=JSON.stringify(l);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{className:"font-mono text-xs",children:t?o:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(D.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(V.Z,{className:"w-4 h-4 text-gray-500"})})]})};var U=e=>{let{accessToken:l,userRole:t,userID:h,modelData:x}=e,[p,g]=(0,a.useState)([]),[f,j]=(0,a.useState)(null),[v,_]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{l&&t&&h&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{g(e.endpoints)})},[l,t,h]);let N=async e=>{b(e),_(!0)},w=async()=>{if(null!=y&&l){try{await (0,d.deletePassThroughEndpointsCall)(l,y);let e=p.filter(e=>e.id!==y);g(e),P.Z.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),P.Z.fromBackend("Error deleting the endpoint: "+e)}_(!1),b(null)}},k=(e,l)=>{N(e)},C=[{header:"ID",accessorKey:"id",cell:e=>(0,s.jsx)(c.Z,{title:e.row.original.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>e.row.original.id&&j(e.row.original.id),children:e.row.original.id})})},{header:"Path",accessorKey:"path"},{header:"Target",accessorKey:"target",cell:e=>(0,s.jsx)(i.Z,{children:e.getValue()})},{header:"Headers",accessorKey:"headers",cell:e=>(0,s.jsx)(K,{value:e.getValue()||{}})},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e;return(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)(o.Z,{icon:m.Z,size:"sm",onClick:()=>l.original.id&&j(l.original.id),title:"Edit"}),(0,s.jsx)(o.Z,{icon:u.Z,size:"sm",onClick:()=>k(l.original.id,l.index),title:"Delete"})]})}}];if(!l)return null;if(f){console.log("selectedEndpointId",f),console.log("generalSettings",p);let e=p.find(e=>e.id===f);return e?(0,s.jsx)(z,{endpointData:e,onClose:()=>j(null),accessToken:l,isAdmin:"Admin"===t||"admin"===t,onEndpointUpdated:()=>{l&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{g(e.endpoints)})}}):(0,s.jsx)("div",{children:"Endpoint not found"})}return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{children:"Pass Through Endpoints"}),(0,s.jsx)(i.Z,{className:"text-tremor-content",children:"Configure and manage your pass-through endpoints"})]}),(0,s.jsx)(F,{accessToken:l,setPassThroughItems:g,passThroughItems:p}),(0,s.jsx)(B.w,{data:p,columns:C,renderSubComponent:()=>(0,s.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:!1,noDataMessage:"No pass-through endpoints configured"}),v&&(0,s.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,s.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,s.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,s.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,s.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,s.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,s.jsx)("div",{className:"sm:flex sm:items-start",children:(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Pass-Through Endpoint"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this pass-through endpoint? This action cannot be undone."})})]})})}),(0,s.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)(r.Z,{onClick:w,color:"red",className:"ml-2",children:"Delete"}),(0,s.jsx)(r.Z,{onClick:()=>{_(!1),b(null)},children:"Cancel"})]})]})]})})]})}},39789:function(e,l,t){t.d(l,{Z:function(){return i}});var s=t(57437),a=t(2265),r=t(21487),o=t(84264),i=e=>{let{value:l,onValueChange:t,label:i="Select Time Range",className:n="",showTimeRange:d=!0}=e,[c,m]=(0,a.useState)(!1),u=(0,a.useRef)(null),h=(0,a.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),t(e),requestIdleCallback(()=>{if(e.from){let l;let s={...e},a=new Date(e.from);l=new Date(e.to?e.to:e.from),a.toDateString(),l.toDateString(),a.setHours(0,0,0,0),l.setHours(23,59,59,999),s.from=a,s.to=l,t(s)}},{timeout:100})},[t]),x=(0,a.useCallback)((e,l)=>{if(!e||!l)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==l.toDateString())return"".concat(t(e)," - ").concat(t(l));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),s=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=l.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(s," - ").concat(a)}},[]);return(0,s.jsxs)("div",{className:n,children:[i&&(0,s.jsx)(o.Z,{className:"mb-2",children:i}),(0,s.jsxs)("div",{className:"relative w-fit",children:[(0,s.jsx)("div",{ref:u,children:(0,s.jsx)(r.Z,{enableSelect:!0,value:l,onValueChange:h,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,s.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,s.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,s.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,s.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),d&&l.from&&l.to&&(0,s.jsx)(o.Z,{className:"mt-2 text-xs text-gray-500",children:x(l.from,l.to)})]})}},12322:function(e,l,t){t.d(l,{w:function(){return n}});var s=t(57437),a=t(2265),r=t(71594),o=t(24525),i=t(19130);function n(e){let{data:l=[],columns:t,getRowCanExpand:n,renderSubComponent:d,isLoading:c=!1,loadingMessage:m="\uD83D\uDE85 Loading logs...",noDataMessage:u="No logs found"}=e,h=(0,r.b7)({data:l,columns:t,getRowCanExpand:n,getRowId:(e,l)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(l)},getCoreRowModel:(0,o.sC)(),getExpandedRowModel:(0,o.rV)()});return(0,s.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,s.jsxs)(i.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,s.jsx)(i.ss,{children:h.getHeaderGroups().map(e=>(0,s.jsx)(i.SC,{children:e.headers.map(e=>(0,s.jsx)(i.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,r.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,s.jsx)(i.RM,{children:c?(0,s.jsx)(i.SC,{children:(0,s.jsx)(i.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:m})})})}):h.getRowModel().rows.length>0?h.getRowModel().rows.map(e=>(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(i.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,s.jsx)(i.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,r.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,s.jsx)(i.SC,{children:(0,s.jsx)(i.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,s.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:d({row:e})})})})]},e.id)):(0,s.jsx)(i.SC,{children:(0,s.jsx)(i.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:u})})})})})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7801-631ca879181868d8.js b/litellm/proxy/_experimental/out/_next/static/chunks/7801-631ca879181868d8.js deleted file mode 100644 index 0902780c9e..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/7801-631ca879181868d8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7801],{16312:function(e,l,t){t.d(l,{z:function(){return s.Z}});var s=t(20831)},9335:function(e,l,t){t.d(l,{JO:function(){return s.Z},OK:function(){return a.Z},nP:function(){return n.Z},td:function(){return o.Z},v0:function(){return r.Z},x4:function(){return i.Z}});var s=t(47323),a=t(12485),r=t(18135),o=t(35242),i=t(29706),n=t(77991)},58643:function(e,l,t){t.d(l,{OK:function(){return s.Z},nP:function(){return i.Z},td:function(){return r.Z},v0:function(){return a.Z},x4:function(){return o.Z}});var s=t(12485),a=t(18135),r=t(35242),o=t(29706),i=t(77991)},37801:function(e,l,t){t.d(l,{Z:function(){return lO}});var s=t(57437),a=t(2265),r=t(49804),o=t(67101),i=t(84264),n=t(19250),d=t(42673),c=t(9114);let m=async(e,l,t)=>{try{console.log("handling submit for formValues:",e);let l=e.model_mappings||[];if("model_mappings"in e&&delete e.model_mappings,e.model&&e.model.includes("all-wildcard")){let t=e.custom_llm_provider,s=d.fK[t]+"/*";e.model_name=s,l.push({public_name:s,litellm_model:s}),e.model=s}let t=[];for(let s of l){let l={},a={},r=s.public_name;for(let[t,r]of(l.model=s.litellm_model,e.input_cost_per_token&&(e.input_cost_per_token=Number(e.input_cost_per_token)/1e6),e.output_cost_per_token&&(e.output_cost_per_token=Number(e.output_cost_per_token)/1e6),l.model=s.litellm_model,console.log("formValues add deployment:",e),Object.entries(e)))if(""!==r&&"custom_pricing"!==t&&"pricing_model"!==t&&"cache_control"!==t){if("model_name"==t)l.model=r;else if("custom_llm_provider"==t){console.log("custom_llm_provider:",r);let e=d.fK[r];l.custom_llm_provider=e,console.log("custom_llm_provider mappingResult:",e)}else if("model"==t)continue;else if("base_model"===t)a[t]=r;else if("team_id"===t)a.team_id=r;else if("model_access_group"===t)a.access_groups=r;else if("mode"==t)console.log("placing mode in modelInfo"),a.mode=r,delete l.mode;else if("custom_model_name"===t)l.model=r;else if("litellm_extra_params"==t){console.log("litellm_extra_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw c.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[t,s]of Object.entries(e))l[t]=s}}else if("model_info_params"==t){console.log("model_info_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw c.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[l,t]of Object.entries(e))a[l]=t}}else if("input_cost_per_token"===t||"output_cost_per_token"===t||"input_cost_per_second"===t){r&&(l[t]=Number(r));continue}else l[t]=r}t.push({litellmParamsObj:l,modelInfoObj:a,modelName:r})}return t}catch(e){c.Z.fromBackend("Failed to create model: "+e)}},u=async(e,l,t,s)=>{try{let a=await m(e,l,t);if(!a||0===a.length)return;for(let e of a){let{litellmParamsObj:t,modelInfoObj:s,modelName:a}=e,r={model_name:a,litellm_params:t,model_info:s},o=await (0,n.modelCreateCall)(l,r);console.log("response for model create call: ".concat(o.data))}s&&s(),t.resetFields()}catch(e){c.Z.fromBackend("Failed to add model: "+e)}};var h=t(62490),x=t(53410),p=t(74998),g=t(93192),f=t(13634),j=t(82680),v=t(52787),_=t(89970),y=t(73002),b=t(56522),N=t(65319),w=t(47451),k=t(69410),C=t(3632);let{Link:Z}=g.default,S={[d.Cl.OpenAI]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.OpenAI_Text]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.Vertex_AI]:[{key:"vertex_project",label:"Vertex Project",placeholder:"adroit-cadet-1234..",required:!0},{key:"vertex_location",label:"Vertex Location",placeholder:"us-east-1",required:!0},{key:"vertex_credentials",label:"Vertex Credentials",required:!0,type:"upload"}],[d.Cl.AssemblyAI]:[{key:"api_base",label:"API Base",type:"select",required:!0,options:["https://api.assemblyai.com","https://api.eu.assemblyai.com"]},{key:"api_key",label:"AssemblyAI API Key",type:"password",required:!0}],[d.Cl.Azure]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_version",label:"API Version",placeholder:"2023-07-01-preview",tooltip:"By default litellm will use the latest version. If you want to use a different version, you can specify it here"},{key:"base_model",label:"Base Model",placeholder:"azure/gpt-3.5-turbo"},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[d.Cl.Azure_AI_Studio]:[{key:"api_base",label:"API Base",placeholder:"https://.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",tooltip:"Enter your full Target URI from Azure Foundry here. Example: https://litellm8397336933.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",required:!0},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[d.Cl.OpenAI_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.Dashscope]:[{key:"api_key",label:"Dashscope API Key",type:"password",required:!0},{key:"api_base",label:"API Base",placeholder:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",defaultValue:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",required:!0,tooltip:"The base URL for your Dashscope server. Defaults to https://dashscope-intl.aliyuncs.com/compatible-mode/v1 if not specified."}],[d.Cl.OpenAI_Text_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.Bedrock]:[{key:"aws_access_key_id",label:"AWS Access Key ID",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_secret_access_key",label:"AWS Secret Access Key",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_session_token",label:"AWS Session Token",type:"password",required:!1,tooltip:"Temporary credentials session token. You can provide the raw token or the environment variable (e.g. `os.environ/MY_SESSION_TOKEN`)."},{key:"aws_region_name",label:"AWS Region Name",placeholder:"us-east-1",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_session_name",label:"AWS Session Name",placeholder:"my-session",required:!1,tooltip:"Name for the AWS session. You can provide the raw value or the environment variable (e.g. `os.environ/MY_SESSION_NAME`)."},{key:"aws_profile_name",label:"AWS Profile Name",placeholder:"default",required:!1,tooltip:"AWS profile name to use for authentication. You can provide the raw value or the environment variable (e.g. `os.environ/MY_PROFILE_NAME`)."},{key:"aws_role_name",label:"AWS Role Name",placeholder:"MyRole",required:!1,tooltip:"AWS IAM role name to assume. You can provide the raw value or the environment variable (e.g. `os.environ/MY_ROLE_NAME`)."},{key:"aws_web_identity_token",label:"AWS Web Identity Token",type:"password",required:!1,tooltip:"Web identity token for OIDC authentication. You can provide the raw token or the environment variable (e.g. `os.environ/MY_WEB_IDENTITY_TOKEN`)."},{key:"aws_bedrock_runtime_endpoint",label:"AWS Bedrock Runtime Endpoint",placeholder:"https://bedrock-runtime.us-east-1.amazonaws.com",required:!1,tooltip:"Custom Bedrock runtime endpoint URL. You can provide the raw value or the environment variable (e.g. `os.environ/MY_BEDROCK_ENDPOINT`)."}],[d.Cl.SageMaker]:[{key:"aws_access_key_id",label:"AWS Access Key ID",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_secret_access_key",label:"AWS Secret Access Key",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_region_name",label:"AWS Region Name",placeholder:"us-east-1",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."}],[d.Cl.Ollama]:[{key:"api_base",label:"API Base",placeholder:"http://localhost:11434",defaultValue:"http://localhost:11434",required:!1,tooltip:"The base URL for your Ollama server. Defaults to http://localhost:11434 if not specified."}],[d.Cl.Anthropic]:[{key:"api_key",label:"API Key",placeholder:"sk-",type:"password",required:!0}],[d.Cl.Deepgram]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.ElevenLabs]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Google_AI_Studio]:[{key:"api_key",label:"API Key",placeholder:"aig-",type:"password",required:!0}],[d.Cl.Groq]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.MistralAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Deepseek]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Cohere]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Databricks]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.xAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.AIML]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Cerebras]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Sambanova]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Perplexity]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.TogetherAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Openrouter]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.FireworksAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.GradientAI]:[{key:"api_base",label:"GradientAI Endpoint",placeholder:"https://...",required:!1},{key:"api_key",label:"GradientAI API Key",type:"password",required:!0}],[d.Cl.Triton]:[{key:"api_key",label:"API Key",type:"password",required:!1},{key:"api_base",label:"API Base",placeholder:"http://localhost:8000/generate",required:!1}],[d.Cl.Hosted_Vllm]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[d.Cl.Voyage]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.JinaAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.VolcEngine]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.DeepInfra]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Oracle]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[d.Cl.Snowflake]:[{key:"api_key",label:"Snowflake API Key / JWT Key for Authentication",type:"password",required:!0},{key:"api_base",label:"Snowflake API Endpoint",placeholder:"https://1234567890.snowflakecomputing.com/api/v2/cortex/inference:complete",tooltip:"Enter the full endpoint with path here. Example: https://1234567890.snowflakecomputing.com/api/v2/cortex/inference:complete",required:!0}],[d.Cl.Infinity]:[{key:"api_base",label:"API Base",placeholder:"http://localhost:7997"}]};var A=e=>{let{selectedProvider:l,uploadProps:t}=e,r=d.Cl[l],o=f.Z.useFormInstance(),i=a.useMemo(()=>S[r]||[],[r]),n={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;console.log("Setting field value from JSON, length: ".concat(l.length)),o.setFieldsValue({vertex_credentials:l}),console.log("Form values after setting:",o.getFieldsValue())}},l.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered in ProviderSpecificFields"),console.log("Current form values:",o.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList)}};return(0,s.jsx)(s.Fragment,{children:i.map(e=>{var l;return(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(f.Z.Item,{label:e.label,name:e.key,rules:e.required?[{required:!0,message:"Required"}]:void 0,tooltip:e.tooltip,className:"vertex_credentials"===e.key?"mb-0":void 0,children:"select"===e.type?(0,s.jsx)(v.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,s.jsx)(v.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,s.jsx)(N.default,{...n,onChange:l=>{(null==t?void 0:t.onChange)&&t.onChange(l),setTimeout(()=>{let l=o.getFieldValue(e.key);console.log("".concat(e.key," value after upload:"),JSON.stringify(l))},500)},children:(0,s.jsx)(y.ZP,{icon:(0,s.jsx)(C.Z,{}),children:"Click to Upload"})}):(0,s.jsx)(b.o,{placeholder:e.placeholder,type:"password"===e.type?"password":"text"})}),"vertex_credentials"===e.key&&(0,s.jsx)(w.Z,{children:(0,s.jsx)(k.Z,{children:(0,s.jsx)(b.x,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(k.Z,{span:10}),(0,s.jsx)(k.Z,{span:10,children:(0,s.jsxs)(b.x,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,s.jsx)(Z,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})})},I=t(31283);let{Title:E,Link:P}=g.default;var M=e=>{let{isVisible:l,onCancel:t,onAddCredential:r,onUpdateCredential:o,uploadProps:i,addOrEdit:n,existingCredential:c}=e,[m]=f.Z.useForm(),[u,h]=(0,a.useState)(d.Cl.OpenAI),[x,p]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{c&&(m.setFieldsValue({credential_name:c.credential_name,custom_llm_provider:c.credential_info.custom_llm_provider,api_base:c.credential_values.api_base,api_version:c.credential_values.api_version,base_model:c.credential_values.base_model,api_key:c.credential_values.api_key}),h(c.credential_info.custom_llm_provider))},[c]),(0,s.jsx)(j.Z,{title:"add"===n?"Add New Credential":"Edit Credential",visible:l,onCancel:()=>{t(),m.resetFields()},footer:null,width:600,children:(0,s.jsxs)(f.Z,{form:m,onFinish:e=>{let l=Object.entries(e).reduce((e,l)=>{let[t,s]=l;return""!==s&&null!=s&&(e[t]=s),e},{});"add"===n?r(l):o(l),m.resetFields()},layout:"vertical",children:[(0,s.jsx)(f.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==c?void 0:c.credential_name,children:(0,s.jsx)(I.o,{placeholder:"Enter a friendly name for these credentials",disabled:null!=c&&!!c.credential_name})}),(0,s.jsx)(f.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,s.jsx)(v.default,{showSearch:!0,onChange:e=>{h(e),m.setFieldValue("custom_llm_provider",e)},children:Object.entries(d.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(v.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:d.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(A,{selectedProvider:u,uploadProps:i}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(_.Z,{title:"Get help on our github",children:(0,s.jsx)(P,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(y.ZP,{onClick:()=>{t(),m.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(y.ZP,{htmlType:"submit",children:"add"===n?"Add Credential":"Update Credential"})]})]})]})})},F=t(16312),T=t(88532),L=e=>{let{isVisible:l,onCancel:t,onConfirm:r,credentialName:o}=e,[i,n]=(0,a.useState)(""),d=i===o,c=()=>{n(""),t()};return(0,s.jsx)(j.Z,{title:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(T.Z,{className:"h-6 w-6 text-red-600 mr-2"}),"Delete Credential"]}),open:l,footer:null,onCancel:c,closable:!0,destroyOnClose:!0,maskClosable:!1,children:(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,s.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,s.jsx)(T.Z,{className:"h-5 w-5"})}),(0,s.jsx)("div",{children:(0,s.jsx)("p",{className:"text-base font-medium text-red-600",children:"This action cannot be undone and may break existing integrations."})})]}),(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,s.jsxs)("span",{className:"underline italic",children:["'",o,"'"]})," to confirm deletion:"]}),(0,s.jsx)("input",{type:"text",value:i,onChange:e=>n(e.target.value),placeholder:"Enter credential name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,s.jsx)(F.z,{onClick:c,variant:"secondary",className:"mr-2",children:"Cancel"}),(0,s.jsx)(F.z,{onClick:()=>{d&&(n(""),r())},color:"red",className:"focus:ring-red-500",disabled:!d,children:"Delete Credential"})]})]})})},R=e=>{let{accessToken:l,uploadProps:t,credentialList:r,fetchCredentials:o}=e,[i,d]=(0,a.useState)(!1),[m,u]=(0,a.useState)(!1),[g,j]=(0,a.useState)(null),[v,_]=(0,a.useState)(null),[y]=f.Z.useForm(),b=["credential_name","custom_llm_provider"],N=async e=>{if(!l)return;let t=Object.entries(e).filter(e=>{let[l]=e;return!b.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),s={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,n.credentialUpdateCall)(l,e.credential_name,s),c.Z.success("Credential updated successfully"),u(!1),o(l)},w=async e=>{if(!l)return;let t=Object.entries(e).filter(e=>{let[l]=e;return!b.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),s={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,n.credentialCreateCall)(l,s),c.Z.success("Credential added successfully"),d(!1),o(l)};(0,a.useEffect)(()=>{l&&o(l)},[l]);let k=e=>{let l={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=l[e.toLowerCase()]||l.default;return(0,s.jsx)(h.Ct,{color:t,size:"xs",children:e})},C=async e=>{l&&(await (0,n.credentialDeleteCall)(l,e),c.Z.success("Credential deleted successfully"),_(null),o(l))},Z=e=>{_(e)};return(0,s.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,s.jsx)(h.xv,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,s.jsx)(h.Zb,{children:(0,s.jsxs)(h.iA,{children:[(0,s.jsx)(h.ss,{children:(0,s.jsxs)(h.SC,{children:[(0,s.jsx)(h.xs,{children:"Credential Name"}),(0,s.jsx)(h.xs,{children:"Provider"}),(0,s.jsx)(h.xs,{children:"Description"})]})}),(0,s.jsx)(h.RM,{children:r&&0!==r.length?r.map((e,l)=>{var t,a;return(0,s.jsxs)(h.SC,{children:[(0,s.jsx)(h.pj,{children:e.credential_name}),(0,s.jsx)(h.pj,{children:k((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,s.jsx)(h.pj,{children:(null===(a=e.credential_info)||void 0===a?void 0:a.description)||"-"}),(0,s.jsxs)(h.pj,{children:[(0,s.jsx)(h.zx,{icon:x.Z,variant:"light",size:"sm",onClick:()=>{j(e),u(!0)}}),(0,s.jsx)(h.zx,{icon:p.Z,variant:"light",size:"sm",onClick:()=>Z(e.credential_name)})]})]},l)}):(0,s.jsx)(h.SC,{children:(0,s.jsx)(h.pj,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),(0,s.jsx)(h.zx,{onClick:()=>d(!0),className:"mt-4",children:"Add Credential"}),i&&(0,s.jsx)(M,{onAddCredential:w,isVisible:i,onCancel:()=>d(!1),uploadProps:t,addOrEdit:"add",onUpdateCredential:N,existingCredential:null}),m&&(0,s.jsx)(M,{onAddCredential:w,isVisible:m,existingCredential:g,onUpdateCredential:N,uploadProps:t,onCancel:()=>u(!1),addOrEdit:"edit"}),v&&(0,s.jsx)(L,{isVisible:!0,onCancel:()=>{_(null)},onConfirm:()=>C(v),credentialName:v})]})};let O=e=>{var l;return(null==e?void 0:null===(l=e.model_info)||void 0===l?void 0:l.team_public_model_name)?e.model_info.team_public_model_name:(null==e?void 0:e.model_name)||"-"};var D=t(9335),V=t(23628),q=t(33293),z=t(20831),B=t(12514),K=t(12485),U=t(18135),G=t(35242),H=t(29706),J=t(77991),W=t(49566),Y=t(96761),$=t(24199),Q=t(10900),X=t(45589),ee=t(64482),el=t(15424);let{Title:et,Link:es}=g.default;var ea=e=>{let{isVisible:l,onCancel:t,onAddCredential:a,existingCredential:r,setIsCredentialModalOpen:o}=e,[i]=f.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(r))),(0,s.jsx)(j.Z,{title:"Reuse Credentials",visible:l,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,s.jsxs)(f.Z,{form:i,onFinish:e=>{a(e),i.resetFields(),o(!1)},layout:"vertical",children:[(0,s.jsx)(f.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==r?void 0:r.credential_name,children:(0,s.jsx)(I.o,{placeholder:"Enter a friendly name for these credentials"})}),Object.entries((null==r?void 0:r.credential_values)||{}).map(e=>{let[l,t]=e;return(0,s.jsx)(f.Z.Item,{label:l,name:l,initialValue:t,children:(0,s.jsx)(I.o,{placeholder:"Enter ".concat(l),disabled:!0})},l)}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(_.Z,{title:"Get help on our github",children:(0,s.jsx)(es,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(y.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(y.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})},er=t(63709),eo=t(45246),ei=t(96473);let{Text:en}=g.default;var ed=e=>{let{form:l,showCacheControl:t,onCacheControlChange:a}=e,r=e=>{let t=l.getFieldValue("litellm_extra_params");try{let s=t?JSON.parse(t):{};e.length>0?s.cache_control_injection_points=e:delete s.cache_control_injection_points,Object.keys(s).length>0?l.setFieldValue("litellm_extra_params",JSON.stringify(s,null,2)):l.setFieldValue("litellm_extra_params","")}catch(e){console.error("Error updating cache control points:",e)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.Z.Item,{label:"Cache Control Injection Points",name:"cache_control",valuePropName:"checked",className:"mb-4",tooltip:"Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index.",children:(0,s.jsx)(er.Z,{onChange:a,className:"bg-gray-600"})}),t&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(en,{className:"text-sm text-gray-500 block mb-4",children:"Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, litellm can automatically add them for you as a cost saving feature."}),(0,s.jsx)(f.Z.List,{name:"cache_control_injection_points",initialValue:[{location:"message"}],children:(e,t)=>{let{add:a,remove:o}=t;return(0,s.jsxs)(s.Fragment,{children:[e.map((t,a)=>(0,s.jsxs)("div",{className:"flex items-center mb-4 gap-4",children:[(0,s.jsx)(f.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,s.jsx)(v.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,s.jsx)(f.Z.Item,{...t,label:"Role",name:[t.name,"role"],className:"mb-0",style:{width:"180px"},tooltip:"LiteLLM will mark all messages of this role as cacheable",children:(0,s.jsx)(v.default,{placeholder:"Select a role",allowClear:!0,options:[{value:"user",label:"User"},{value:"system",label:"System"},{value:"assistant",label:"Assistant"}],onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),(0,s.jsx)(f.Z.Item,{...t,label:"Index",name:[t.name,"index"],className:"mb-0",style:{width:"180px"},tooltip:"(Optional) If set litellm will mark the message at this index as cacheable",children:(0,s.jsx)($.Z,{type:"number",placeholder:"Optional",step:1,min:0,onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,s.jsx)(eo.Z,{className:"text-red-500 cursor-pointer text-lg ml-12",onClick:()=>{o(t.name),setTimeout(()=>{r(l.getFieldValue("cache_control_points"))},0)}})]},t.key)),(0,s.jsx)(f.Z.Item,{children:(0,s.jsxs)("button",{type:"button",className:"flex items-center justify-center w-full border border-dashed border-gray-300 py-2 px-4 text-gray-600 hover:text-blue-600 hover:border-blue-300 transition-all rounded",onClick:()=>a(),children:[(0,s.jsx)(ei.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})},ec=t(30401),em=t(78867),eu=t(59872),eh=t(51601),ex=t(44851),ep=t(67960),eg=t(20577),ef=t(70464),ej=t(26349),ev=t(92280);let{TextArea:e_}=ee.default,{Panel:ey}=ex.default;var eb=e=>{let{modelInfo:l,value:t,onChange:r}=e,[o,i]=(0,a.useState)([]),[n,d]=(0,a.useState)(!1),[c,m]=(0,a.useState)([]);(0,a.useEffect)(()=>{if(null==t?void 0:t.routes){let e=t.routes.map((e,l)=>({id:e.id||"route-".concat(l,"-").concat(Date.now()),model:e.name||e.model||"",utterances:e.utterances||[],description:e.description||"",score_threshold:e.score_threshold||.5}));i(e),m(e.map(e=>e.id))}else i([]),m([])},[t]);let u=e=>{let l=o.filter(l=>l.id!==e);i(l),x(l),m(l=>l.filter(l=>l!==e))},h=(e,l,t)=>{let s=o.map(s=>s.id===e?{...s,[l]:t}:s);i(s),x(s)},x=e=>{let l={routes:e.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))};null==r||r(l)},p=l.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsxs)("div",{className:"w-full max-w-none",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(ev.x,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,s.jsx)(_.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,s.jsx)(el.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(y.ZP,{type:"primary",icon:(0,s.jsx)(ei.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),l=[...o,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];i(l),x(l),m(l=>[...l,e])},className:"bg-blue-600 hover:bg-blue-700",children:"Add Route"})]}),0===o.length?(0,s.jsx)("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 mb-6",children:(0,s.jsx)(ev.x,{children:"No routes configured. Click “Add Route” to get started."})}):(0,s.jsx)("div",{className:"space-y-3 mb-6 w-full",children:o.map((e,l)=>(0,s.jsx)(ep.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,s.jsx)(ex.default,{ghost:!0,expandIcon:e=>{let{isActive:l}=e;return(0,s.jsx)(ef.Z,{rotate:l?180:0})},activeKey:c,onChange:e=>m(Array.isArray(e)?e:[e].filter(Boolean)),items:[{key:e.id,label:(0,s.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,s.jsxs)(ev.x,{className:"font-medium text-base",children:["Route ",l+1,": ",e.model||"Unnamed"]}),(0,s.jsx)(y.ZP,{type:"text",danger:!0,icon:(0,s.jsx)(ej.Z,{}),onClick:l=>{l.stopPropagation(),u(e.id)},className:"mr-2"})]}),children:(0,s.jsxs)("div",{className:"px-6 pb-6 w-full",children:[(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(ev.x,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,s.jsx)(v.default,{value:e.model,onChange:l=>h(e.id,"model",l),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:p})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(ev.x,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,s.jsx)(e_,{value:e.description,onChange:l=>h(e.id,"description",l.target.value),placeholder:"Describe when this route should be used...",rows:2,style:{width:"100%"}})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(ev.x,{className:"text-sm font-medium",children:"Score Threshold"}),(0,s.jsx)(_.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,s.jsx)(el.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(eg.Z,{value:e.score_threshold,onChange:l=>h(e.id,"score_threshold",l||0),min:0,max:1,step:.1,style:{width:"100%"},placeholder:"0.5"})]}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(ev.x,{className:"text-sm font-medium",children:"Example Utterances"}),(0,s.jsx)(_.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,s.jsx)(el.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(ev.x,{className:"text-xs text-gray-500 mb-2",children:"Type an utterance and press Enter to add it. You can also paste multiple lines."}),(0,s.jsx)(v.default,{mode:"tags",value:e.utterances,onChange:l=>h(e.id,"utterances",l),placeholder:"Type an utterance and press Enter...",style:{width:"100%"},tokenSeparators:["\n"],maxTagCount:"responsive",allowClear:!0})]})]})}]})},e.id))}),(0,s.jsxs)("div",{className:"border-t pt-6 w-full",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4 w-full",children:[(0,s.jsx)(ev.x,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,s.jsx)(y.ZP,{type:"link",onClick:()=>d(!n),className:"text-blue-600 p-0",children:n?"Hide":"Show"})]}),n&&(0,s.jsx)(ep.Z,{className:"bg-gray-50 w-full",children:(0,s.jsx)("pre",{className:"text-sm overflow-auto max-h-64 w-full",children:JSON.stringify({routes:o.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))},null,2)})})]})]})},eN=e=>{let{isVisible:l,onCancel:t,onSuccess:r,modelData:o,accessToken:i,userRole:d}=e,[m]=f.Z.useForm(),[u,h]=(0,a.useState)(!1),[x,p]=(0,a.useState)([]),[g,_]=(0,a.useState)([]),[N,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1),[Z,S]=(0,a.useState)(null);(0,a.useEffect)(()=>{l&&o&&A()},[l,o]),(0,a.useEffect)(()=>{let e=async()=>{if(i)try{let e=await (0,n.modelAvailableCall)(i,"","",!1,null,!0,!0);p(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(i)try{let e=await (0,eh.p)(i);_(e)}catch(e){console.error("Error fetching model info:",e)}};l&&(e(),t())},[l,i]);let A=()=>{try{var e,l,t,s,a,r;let i=null;(null===(e=o.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(i="string"==typeof o.litellm_params.auto_router_config?JSON.parse(o.litellm_params.auto_router_config):o.litellm_params.auto_router_config),S(i),m.setFieldsValue({auto_router_name:o.model_name,auto_router_default_model:(null===(l=o.litellm_params)||void 0===l?void 0:l.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=o.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(s=o.model_info)||void 0===s?void 0:s.access_groups)||[]});let n=new Set(g.map(e=>e.model_group));w(!n.has(null===(a=o.litellm_params)||void 0===a?void 0:a.auto_router_default_model)),C(!n.has(null===(r=o.litellm_params)||void 0===r?void 0:r.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),c.Z.fromBackend("Error loading auto router configuration")}},I=async()=>{try{h(!0);let e=await m.validateFields(),l={...o.litellm_params,auto_router_config:JSON.stringify(Z),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},s={...o.model_info,access_groups:e.model_access_group||[]},a={model_name:e.auto_router_name,litellm_params:l,model_info:s};await (0,n.modelPatchUpdateCall)(i,a,o.model_info.id);let d={...o,model_name:e.auto_router_name,litellm_params:l,model_info:s};c.Z.success("Auto router configuration updated successfully"),r(d),t()}catch(e){console.error("Error updating auto router:",e),c.Z.fromBackend("Failed to update auto router configuration")}finally{h(!1)}},E=g.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsx)(j.Z,{title:"Edit Auto Router Configuration",open:l,onCancel:t,footer:[(0,s.jsx)(y.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,s.jsx)(y.ZP,{loading:u,onClick:I,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(b.x,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,s.jsxs)(f.Z,{form:m,layout:"vertical",className:"space-y-4",children:[(0,s.jsx)(f.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,s.jsx)(b.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(eb,{modelInfo:g,value:Z,onChange:e=>{S(e)}})}),(0,s.jsx)(f.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,s.jsx)(v.default,{placeholder:"Select a default model",onChange:e=>{w("custom"===e)},options:[...E,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,s.jsx)(f.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,s.jsx)(v.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{C("custom"===e)},options:[...E,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===d&&(0,s.jsx)(f.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:x.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};function ew(e){var l,t,r,m,u,h,x,g,b,N,w,k,C,Z,S,A,I,E,P,M,F,T,L,R,D,V,q,et;let{modelId:es,onClose:er,modelData:eo,accessToken:ei,userID:en,userRole:eh,editModel:ex,setEditModalVisible:ep,setSelectedModel:eg,onModelUpdate:ef,modelAccessGroups:ej}=e,[ev]=f.Z.useForm(),[e_,ey]=(0,a.useState)(null),[eb,ew]=(0,a.useState)(!1),[ek,eC]=(0,a.useState)(!1),[eZ,eS]=(0,a.useState)(!1),[eA,eI]=(0,a.useState)(!1),[eE,eP]=(0,a.useState)(!1),[eM,eF]=(0,a.useState)(null),[eT,eL]=(0,a.useState)(!1),[eR,eO]=(0,a.useState)({}),[eD,eV]=(0,a.useState)(!1),[eq,ez]=(0,a.useState)([]),eB="Admin"===eh||(null==eo?void 0:null===(l=eo.model_info)||void 0===l?void 0:l.created_by)===en,eK=(null==eo?void 0:null===(t=eo.litellm_params)||void 0===t?void 0:t.auto_router_config)!=null,eU=(null==eo?void 0:null===(r=eo.litellm_params)||void 0===r?void 0:r.litellm_credential_name)!=null&&(null==eo?void 0:null===(m=eo.litellm_params)||void 0===m?void 0:m.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eU),console.log("modelData.litellm_params.litellm_credential_name, ",null==eo?void 0:null===(u=eo.litellm_params)||void 0===u?void 0:u.litellm_credential_name),(0,a.useEffect)(()=>{let e=async()=>{var e,l,t,s,a,r,o;if(!ei)return;let i=await (0,n.modelInfoV1Call)(ei,es);console.log("modelInfoResponse, ",i);let d=i.data[0];d&&!d.litellm_model_name&&(d={...d,litellm_model_name:null!==(o=null!==(r=null!==(a=null==d?void 0:null===(l=d.litellm_params)||void 0===l?void 0:l.litellm_model_name)&&void 0!==a?a:null==d?void 0:null===(t=d.litellm_params)||void 0===t?void 0:t.model)&&void 0!==r?r:null==d?void 0:null===(s=d.model_info)||void 0===s?void 0:s.key)&&void 0!==o?o:null}),ey(d),(null==d?void 0:null===(e=d.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&eL(!0)},l=async()=>{if(ei)try{let e=(await (0,n.getGuardrailsList)(ei)).guardrails.map(e=>e.guardrail_name);ez(e)}catch(e){console.error("Failed to fetch guardrails:",e)}};(async()=>{if(console.log("accessToken, ",ei),!ei||eU)return;let e=await (0,n.credentialGetCall)(ei,null,es);console.log("existingCredentialResponse, ",e),eF({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e(),l()},[ei,es]);let eG=async e=>{var l;if(console.log("values, ",e),!ei)return;let t={credential_name:e.credential_name,model_id:es,credential_info:{custom_llm_provider:null===(l=e_.litellm_params)||void 0===l?void 0:l.custom_llm_provider}};c.Z.info("Storing credential.."),console.log("credentialResponse, ",await (0,n.credentialCreateCall)(ei,t)),c.Z.success("Credential stored successfully")},eH=async e=>{try{var l;let t;if(!ei)return;eI(!0),console.log("values.model_name, ",e.model_name);let s={...e_.litellm_params,model:e.litellm_model_name,api_base:e.api_base,custom_llm_provider:e.custom_llm_provider,organization:e.organization,tpm:e.tpm,rpm:e.rpm,max_retries:e.max_retries,timeout:e.timeout,stream_timeout:e.stream_timeout,input_cost_per_token:e.input_cost/1e6,output_cost_per_token:e.output_cost/1e6};e.guardrails&&(s.guardrails=e.guardrails),e.cache_control&&(null===(l=e.cache_control_injection_points)||void 0===l?void 0:l.length)>0?s.cache_control_injection_points=e.cache_control_injection_points:delete s.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):eo.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group})}catch(e){c.Z.fromBackend("Invalid JSON in Model Info");return}let a={model_name:e.model_name,litellm_params:s,model_info:t};await (0,n.modelPatchUpdateCall)(ei,a,es);let r={...e_,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:s,model_info:t};ey(r),ef&&ef(r),c.Z.success("Model settings updated successfully"),eS(!1),eP(!1)}catch(e){console.error("Error updating model:",e),c.Z.fromBackend("Failed to update model settings")}finally{eI(!1)}};if(!eo)return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(z.Z,{icon:Q.Z,variant:"light",onClick:er,className:"mb-4",children:"Back to Models"}),(0,s.jsx)(i.Z,{children:"Model not found"})]});let eJ=async()=>{try{if(!ei)return;await (0,n.modelDeleteCall)(ei,es),c.Z.success("Model deleted successfully"),ef&&ef({deleted:!0,model_info:{id:es}}),er()}catch(e){console.error("Error deleting the model:",e),c.Z.fromBackend("Failed to delete model")}},eW=async(e,l)=>{await (0,eu.vQ)(e)&&(eO(e=>({...e,[l]:!0})),setTimeout(()=>{eO(e=>({...e,[l]:!1}))},2e3))};return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(z.Z,{icon:Q.Z,variant:"light",onClick:er,className:"mb-4",children:"Back to Models"}),(0,s.jsxs)(Y.Z,{children:["Public Model Name: ",O(eo)]}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsx)(i.Z,{className:"text-gray-500 font-mono",children:eo.model_info.id}),(0,s.jsx)(y.ZP,{type:"text",size:"small",icon:eR["model-id"]?(0,s.jsx)(ec.Z,{size:12}):(0,s.jsx)(em.Z,{size:12}),onClick:()=>eW(eo.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eR["model-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:["Admin"===eh&&(0,s.jsx)(z.Z,{icon:X.Z,variant:"secondary",onClick:()=>eC(!0),className:"flex items-center",children:"Re-use Credentials"}),eB&&(0,s.jsx)(z.Z,{icon:p.Z,variant:"secondary",onClick:()=>ew(!0),className:"flex items-center",children:"Delete Model"})]})]}),(0,s.jsxs)(U.Z,{children:[(0,s.jsxs)(G.Z,{className:"mb-6",children:[(0,s.jsx)(K.Z,{children:"Overview"}),(0,s.jsx)(K.Z,{children:"Raw JSON"})]}),(0,s.jsxs)(J.Z,{children:[(0,s.jsxs)(H.Z,{children:[(0,s.jsxs)(o.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(i.Z,{children:"Provider"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[eo.provider&&(0,s.jsx)("img",{src:(0,d.dr)(eo.provider).logo,alt:"".concat(eo.provider," logo"),className:"w-4 h-4",onError:e=>{let l=e.target,t=l.parentElement;if(t){var s;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(s=eo.provider)||void 0===s?void 0:s.charAt(0))||"-",t.replaceChild(e,l)}}}),(0,s.jsx)(Y.Z,{children:eo.provider||"Not Set"})]})]}),(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(i.Z,{children:"LiteLLM Model"}),(0,s.jsx)("div",{className:"mt-2 overflow-hidden",children:(0,s.jsx)(_.Z,{title:eo.litellm_model_name||"Not Set",children:(0,s.jsx)("div",{className:"break-all text-sm font-medium leading-relaxed cursor-pointer",children:eo.litellm_model_name||"Not Set"})})})]}),(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(i.Z,{children:"Pricing"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(i.Z,{children:["Input: $",eo.input_cost,"/1M tokens"]}),(0,s.jsxs)(i.Z,{children:["Output: $",eo.output_cost,"/1M tokens"]})]})]})]}),(0,s.jsxs)("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-x-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Created At"," ",eo.model_info.created_at?new Date(eo.model_info.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Not Set"]}),(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Created By ",eo.model_info.created_by||"Not Set"]})]}),(0,s.jsxs)(B.Z,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(Y.Z,{children:"Model Settings"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[eK&&eB&&!eE&&(0,s.jsx)(z.Z,{variant:"primary",onClick:()=>eV(!0),className:"flex items-center",children:"Edit Auto Router"}),eB&&!eE&&(0,s.jsx)(z.Z,{variant:"secondary",onClick:()=>eP(!0),className:"flex items-center",children:"Edit Model"})]})]}),e_?(0,s.jsx)(f.Z,{form:ev,onFinish:eH,initialValues:{model_name:e_.model_name,litellm_model_name:e_.litellm_model_name,api_base:e_.litellm_params.api_base,custom_llm_provider:e_.litellm_params.custom_llm_provider,organization:e_.litellm_params.organization,tpm:e_.litellm_params.tpm,rpm:e_.litellm_params.rpm,max_retries:e_.litellm_params.max_retries,timeout:e_.litellm_params.timeout,stream_timeout:e_.litellm_params.stream_timeout,input_cost:e_.litellm_params.input_cost_per_token?1e6*e_.litellm_params.input_cost_per_token:(null===(h=e_.model_info)||void 0===h?void 0:h.input_cost_per_token)*1e6||null,output_cost:(null===(x=e_.litellm_params)||void 0===x?void 0:x.output_cost_per_token)?1e6*e_.litellm_params.output_cost_per_token:(null===(g=e_.model_info)||void 0===g?void 0:g.output_cost_per_token)*1e6||null,cache_control:null!==(b=e_.litellm_params)&&void 0!==b&&!!b.cache_control_injection_points,cache_control_injection_points:(null===(N=e_.litellm_params)||void 0===N?void 0:N.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(w=e_.model_info)||void 0===w?void 0:w.access_groups)?e_.model_info.access_groups:[],guardrails:Array.isArray(null===(k=e_.litellm_params)||void 0===k?void 0:k.guardrails)?e_.litellm_params.guardrails:[]},layout:"vertical",onValuesChange:()=>eS(!0),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Model Name"}),eE?(0,s.jsx)(f.Z.Item,{name:"model_name",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:e_.model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eE?(0,s.jsx)(f.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter LiteLLM model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:e_.litellm_model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eE?(0,s.jsx)(f.Z.Item,{name:"input_cost",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter input cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==e_?void 0:null===(C=e_.litellm_params)||void 0===C?void 0:C.input_cost_per_token)?((null===(Z=e_.litellm_params)||void 0===Z?void 0:Z.input_cost_per_token)*1e6).toFixed(4):(null==e_?void 0:null===(S=e_.model_info)||void 0===S?void 0:S.input_cost_per_token)?(1e6*e_.model_info.input_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eE?(0,s.jsx)(f.Z.Item,{name:"output_cost",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter output cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==e_?void 0:null===(A=e_.litellm_params)||void 0===A?void 0:A.output_cost_per_token)?(1e6*e_.litellm_params.output_cost_per_token).toFixed(4):(null==e_?void 0:null===(I=e_.model_info)||void 0===I?void 0:I.output_cost_per_token)?(1e6*e_.model_info.output_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"API Base"}),eE?(0,s.jsx)(f.Z.Item,{name:"api_base",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter API base"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(E=e_.litellm_params)||void 0===E?void 0:E.api_base)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Custom LLM Provider"}),eE?(0,s.jsx)(f.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter custom LLM provider"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(P=e_.litellm_params)||void 0===P?void 0:P.custom_llm_provider)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Organization"}),eE?(0,s.jsx)(f.Z.Item,{name:"organization",className:"mb-0",children:(0,s.jsx)(W.Z,{placeholder:"Enter organization"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(M=e_.litellm_params)||void 0===M?void 0:M.organization)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eE?(0,s.jsx)(f.Z.Item,{name:"tpm",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter TPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(F=e_.litellm_params)||void 0===F?void 0:F.tpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eE?(0,s.jsx)(f.Z.Item,{name:"rpm",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter RPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(T=e_.litellm_params)||void 0===T?void 0:T.rpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Max Retries"}),eE?(0,s.jsx)(f.Z.Item,{name:"max_retries",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter max retries"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(L=e_.litellm_params)||void 0===L?void 0:L.max_retries)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Timeout (seconds)"}),eE?(0,s.jsx)(f.Z.Item,{name:"timeout",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(R=e_.litellm_params)||void 0===R?void 0:R.timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eE?(0,s.jsx)(f.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,s.jsx)($.Z,{placeholder:"Enter stream timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(D=e_.litellm_params)||void 0===D?void 0:D.stream_timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Model Access Groups"}),eE?(0,s.jsx)(f.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:null==ej?void 0:ej.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(V=e_.model_info)||void 0===V?void 0:V.access_groups)?Array.isArray(e_.model_info.access_groups)?e_.model_info.access_groups.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:e_.model_info.access_groups.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},l))}):"No groups assigned":e_.model_info.access_groups:"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(i.Z,{className:"font-medium",children:["Guardrails"," ",(0,s.jsx)(_.Z,{title:"Apply safety guardrails to this model to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(el.Z,{style:{marginLeft:"4px"}})})})]}),eE?(0,s.jsx)(f.Z.Item,{name:"guardrails",className:"mb-0",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing guardrails or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:eq.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=e_.litellm_params)||void 0===q?void 0:q.guardrails)?Array.isArray(e_.litellm_params.guardrails)?e_.litellm_params.guardrails.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:e_.litellm_params.guardrails.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:e},l))}):"No guardrails assigned":e_.litellm_params.guardrails:"Not Set"})]}),eE?(0,s.jsx)(ed,{form:ev,showCacheControl:eT,onCacheControlChange:e=>eL(e)}):(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Cache Control"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(et=e_.litellm_params)||void 0===et?void 0:et.cache_control_injection_points)?(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"Enabled"}),(0,s.jsx)("div",{className:"mt-2",children:e_.litellm_params.cache_control_injection_points.map((e,l)=>(0,s.jsxs)("div",{className:"text-sm text-gray-600 mb-1",children:["Location: ",e.location,",",e.role&&(0,s.jsxs)("span",{children:[" Role: ",e.role]}),void 0!==e.index&&(0,s.jsxs)("span",{children:[" Index: ",e.index]})]},l))})]}):"Disabled"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Model Info"}),eE?(0,s.jsx)(f.Z.Item,{name:"model_info",className:"mb-0",children:(0,s.jsx)(ee.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}',defaultValue:JSON.stringify(eo.model_info,null,2)})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,s.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(e_.model_info,null,2)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:eo.model_info.team_id||"Not Set"})]})]}),eE&&(0,s.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,s.jsx)(z.Z,{variant:"secondary",onClick:()=>{ev.resetFields(),eS(!1),eP(!1)},children:"Cancel"}),(0,s.jsx)(z.Z,{variant:"primary",onClick:()=>ev.submit(),loading:eA,children:"Save Changes"})]})]})}):(0,s.jsx)(i.Z,{children:"Loading..."})]})]}),(0,s.jsx)(H.Z,{children:(0,s.jsx)(B.Z,{children:(0,s.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify(eo,null,2)})})})]})]}),eb&&(0,s.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,s.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,s.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,s.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,s.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,s.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,s.jsx)("div",{className:"sm:flex sm:items-start",children:(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Model"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this model?"})})]})})}),(0,s.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)(y.ZP,{onClick:eJ,className:"ml-2",danger:!0,children:"Delete"}),(0,s.jsx)(y.ZP,{onClick:()=>ew(!1),children:"Cancel"})]})]})]})}),ek&&!eU?(0,s.jsx)(ea,{isVisible:ek,onCancel:()=>eC(!1),onAddCredential:eG,existingCredential:eM,setIsCredentialModalOpen:eC}):(0,s.jsx)(j.Z,{open:ek,onCancel:()=>eC(!1),title:"Using Existing Credential",children:(0,s.jsx)(i.Z,{children:eo.litellm_params.litellm_credential_name})}),(0,s.jsx)(eN,{isVisible:eD,onCancel:()=>eV(!1),onSuccess:e=>{ey(e),ef&&ef(e)},modelData:e_||eo,accessToken:ei||"",userRole:eh||""})]})}var ek=t(58643),eC=e=>{let{selectedProvider:l,providerModels:t,getPlaceholder:a}=e,r=f.Z.useFormInstance(),o=e=>{let t=e.target.value,s=(r.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?l===d.Cl.Azure?{public_name:t,litellm_model:"azure/".concat(t)}:{public_name:t,litellm_model:t}:e);r.setFieldsValue({model_mappings:s})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(f.Z.Item,{label:"LiteLLM Model Name(s)",tooltip:"The model name LiteLLM will send to the LLM API",className:"mb-0",children:[(0,s.jsx)(f.Z.Item,{name:"model",rules:[{required:!0,message:"Please enter ".concat(l===d.Cl.Azure?"a deployment name":"at least one model",".")}],noStyle:!0,children:l===d.Cl.Azure||l===d.Cl.OpenAI_Compatible||l===d.Cl.Ollama?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(b.o,{placeholder:a(l),onChange:l===d.Cl.Azure?e=>{let l=e.target.value,t=l?[{public_name:l,litellm_model:"azure/".concat(l)}]:[];r.setFieldsValue({model:l,model_mappings:t})}:void 0})}):t.length>0?(0,s.jsx)(v.default,{mode:"multiple",allowClear:!0,showSearch:!0,placeholder:"Select models",onChange:e=>{let t=Array.isArray(e)?e:[e];if(t.includes("all-wildcard"))r.setFieldsValue({model_name:void 0,model_mappings:[]});else if(JSON.stringify(r.getFieldValue("model"))!==JSON.stringify(t)){let e=t.map(e=>l===d.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});r.setFieldsValue({model:t,model_mappings:e})}},optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{label:"Custom Model Name (Enter below)",value:"custom"},{label:"All ".concat(l," Models (Wildcard)"),value:"all-wildcard"},...t.map(e=>({label:e,value:e}))],style:{width:"100%"}}):(0,s.jsx)(b.o,{placeholder:a(l)})}),(0,s.jsx)(f.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.model!==l.model,children:e=>{let{getFieldValue:t}=e,a=t("model")||[];return(Array.isArray(a)?a:[a]).includes("custom")&&(0,s.jsx)(f.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,s.jsx)(b.o,{placeholder:l===d.Cl.Azure?"Enter Azure deployment name":"Enter custom model name",onChange:o})})}})]}),(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(k.Z,{span:10}),(0,s.jsx)(k.Z,{span:14,children:(0,s.jsx)(b.x,{className:"mb-3 mt-1",children:l===d.Cl.Azure?"Your deployment name will be saved as the public model name, and LiteLLM will use 'azure/deployment-name' internally":"The model name LiteLLM will send to the LLM API"})})]})]})},eZ=t(72188),eS=t(67187);let eA=e=>{let{content:l,children:t,width:r="auto",className:o=""}=e,[i,n]=(0,a.useState)(!1),[d,c]=(0,a.useState)("top"),m=(0,a.useRef)(null),u=()=>{if(m.current){let e=m.current.getBoundingClientRect(),l=e.top,t=window.innerHeight-e.bottom;l<300&&t>300?c("bottom"):c("top")}};return(0,s.jsxs)("div",{className:"relative inline-block",ref:m,children:[t||(0,s.jsx)(eS.Z,{className:"ml-1 text-gray-500 cursor-help",onMouseEnter:()=>{u(),n(!0)},onMouseLeave:()=>n(!1)}),i&&(0,s.jsxs)("div",{className:"absolute left-1/2 -translate-x-1/2 z-50 bg-black/90 text-white p-2 rounded-md text-sm font-normal shadow-lg ".concat(o),style:{["top"===d?"bottom":"top"]:"100%",width:r,marginBottom:"top"===d?"8px":"0",marginTop:"bottom"===d?"8px":"0"},children:[l,(0,s.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 w-0 h-0",style:{top:"top"===d?"100%":"auto",bottom:"bottom"===d?"100%":"auto",borderTop:"top"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderBottom:"bottom"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderLeft:"6px solid transparent",borderRight:"6px solid transparent"}})]})]})};var eI=()=>{let e=f.Z.useFormInstance(),[l,t]=(0,a.useState)(0),r=f.Z.useWatch("model",e)||[],o=Array.isArray(r)?r:[r],i=f.Z.useWatch("custom_model_name",e),n=!o.includes("all-wildcard"),c=f.Z.useWatch("custom_llm_provider",e);if((0,a.useEffect)(()=>{if(i&&o.includes("custom")){let l=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?c===d.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:e);e.setFieldValue("model_mappings",l),t(e=>e+1)}},[i,o,c,e]),(0,a.useEffect)(()=>{if(o.length>0&&!o.includes("all-wildcard")){let l=e.getFieldValue("model_mappings")||[];if(l.length!==o.length||!o.every(e=>l.some(l=>"custom"===e?"custom"===l.litellm_model||l.litellm_model===i:c===d.Cl.Azure?l.litellm_model==="azure/".concat(e):l.litellm_model===e))){let l=o.map(e=>"custom"===e&&i?c===d.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:c===d.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});e.setFieldValue("model_mappings",l),t(e=>e+1)}}},[o,i,c,e]),!n)return null;let m=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-2 font-normal",children:"The name you specify in your API calls to LiteLLM Proxy"}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Example:"})," If you name your public model"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"example-name"}),", and choose"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"openai/qwen-plus-latest"})," as the LiteLLM model"]}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Usage:"})," You make an API call to the LiteLLM proxy with"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:'model = "example-name"'})]}),(0,s.jsxs)("div",{className:"font-normal",children:[(0,s.jsx)("strong",{children:"Result:"})," LiteLLM sends"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"qwen-plus-latest"})," to the provider"]})]}),u=(0,s.jsx)("div",{children:"The model name LiteLLM will send to the LLM API"}),h=[{title:(0,s.jsxs)("span",{className:"flex items-center",children:["Public Model Name",(0,s.jsx)(eA,{content:m,width:"500px"})]}),dataIndex:"public_name",key:"public_name",render:(l,t,a)=>(0,s.jsx)(I.o,{value:l,onChange:l=>{let t=[...e.getFieldValue("model_mappings")];t[a].public_name=l.target.value,e.setFieldValue("model_mappings",t)}})},{title:(0,s.jsxs)("span",{className:"flex items-center",children:["LiteLLM Model Name",(0,s.jsx)(eA,{content:u,width:"360px"})]}),dataIndex:"litellm_model",key:"litellm_model"}];return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(f.Z.Item,{label:"Model Mappings",name:"model_mappings",tooltip:"Map public model names to LiteLLM model names for load balancing",labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",rules:[{required:!0,validator:async(e,l)=>{if(!l||0===l.length)throw Error("At least one model mapping is required");if(l.filter(e=>!e.public_name||""===e.public_name.trim()).length>0)throw Error("All model mappings must have valid public names")}}],children:(0,s.jsx)(eZ.Z,{dataSource:e.getFieldValue("model_mappings"),columns:h,pagination:!1,size:"small"},l)})})},eE=t(26210),eP=t(90464);let{Link:eM}=g.default;var eF=e=>{let{showAdvancedSettings:l,setShowAdvancedSettings:t,teams:r,guardrailsList:o}=e,[i]=f.Z.useForm(),[n,d]=a.useState(!1),[c,m]=a.useState("per_token"),[u,h]=a.useState(!1),x=(e,l)=>l&&(isNaN(Number(l))||0>Number(l))?Promise.reject("Please enter a valid positive number"):Promise.resolve(),p=(e,l)=>{if(!l)return Promise.resolve();try{return JSON.parse(l),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}};return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(eE.UQ,{className:"mt-2 mb-4",children:[(0,s.jsx)(eE._m,{children:(0,s.jsx)("b",{children:"Advanced Settings"})}),(0,s.jsx)(eE.X1,{children:(0,s.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,s.jsx)(f.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,s.jsx)(er.Z,{onChange:e=>{d(e),e||i.setFieldsValue({input_cost_per_token:void 0,output_cost_per_token:void 0,input_cost_per_second:void 0})},className:"bg-gray-600"})}),(0,s.jsx)(f.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(_.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(el.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails. Go to 'Guardrails' tab to create new guardrails.",children:(0,s.jsx)(v.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:o.map(e=>({value:e,label:e}))})}),n&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(f.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,s.jsx)(v.default,{defaultValue:"per_token",onChange:e=>m(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,s.jsx)(eE.oi,{})}),(0,s.jsx)(f.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,s.jsx)(eE.oi,{})})]}):(0,s.jsx)(f.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:x}],className:"mb-4",children:(0,s.jsx)(eE.oi,{})})]}),(0,s.jsx)(f.Z.Item,{label:"Use in pass through routes",name:"use_in_pass_through",valuePropName:"checked",className:"mb-4 mt-4",tooltip:(0,s.jsxs)("span",{children:["Allow using these credentials in pass through routes."," ",(0,s.jsx)(eM,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,s.jsx)(er.Z,{onChange:e=>{let l=i.getFieldValue("litellm_extra_params");try{let t=l?JSON.parse(l):{};e?t.use_in_pass_through=!0:delete t.use_in_pass_through,Object.keys(t).length>0?i.setFieldValue("litellm_extra_params",JSON.stringify(t,null,2)):i.setFieldValue("litellm_extra_params","")}catch(l){e?i.setFieldValue("litellm_extra_params",JSON.stringify({use_in_pass_through:!0},null,2)):i.setFieldValue("litellm_extra_params","")}},className:"bg-gray-600"})}),(0,s.jsx)(ed,{form:i,showCacheControl:u,onCacheControlChange:e=>{if(h(e),!e){let e=i.getFieldValue("litellm_extra_params");try{let l=e?JSON.parse(e):{};delete l.cache_control_injection_points,Object.keys(l).length>0?i.setFieldValue("litellm_extra_params",JSON.stringify(l,null,2)):i.setFieldValue("litellm_extra_params","")}catch(e){i.setFieldValue("litellm_extra_params","")}}}}),(0,s.jsx)(f.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-4 mt-4",rules:[{validator:p}],children:(0,s.jsx)(eP.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,s.jsxs)(w.Z,{className:"mb-4",children:[(0,s.jsx)(k.Z,{span:10}),(0,s.jsx)(k.Z,{span:10,children:(0,s.jsxs)(eE.xv,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,s.jsx)(eM,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,s.jsx)(f.Z.Item,{label:"Model Info",name:"model_info_params",tooltip:"Optional model info params. Returned when calling `/model/info` endpoint.",className:"mb-0",rules:[{validator:p}],children:(0,s.jsx)(eP.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},eT=t(29),eL=t.n(eT),eR=t(23496),eO=t(35291),eD=t(23639);let{Text:eV}=g.default;var eq=e=>{let{formValues:l,accessToken:t,testMode:r,modelName:o="this model",onClose:i,onTestComplete:d}=e,[u,h]=a.useState(null),[x,p]=a.useState(null),[g,f]=a.useState(null),[j,v]=a.useState(!0),[_,b]=a.useState(!1),[N,w]=a.useState(!1),k=async()=>{v(!0),w(!1),h(null),p(null),f(null),b(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",l);let a=await m(l,t,null);if(!a){console.log("No result from prepareModelAddRequest"),h("Failed to prepare model data. Please check your form inputs."),b(!1),v(!1);return}console.log("Result from prepareModelAddRequest:",a);let{litellmParamsObj:r,modelInfoObj:o,modelName:i}=a[0],d=await (0,n.testConnectionRequest)(t,r,o,null==o?void 0:o.mode);if("success"===d.status)c.Z.success("Connection test successful!"),h(null),b(!0);else{var e,s;let l=(null===(e=d.result)||void 0===e?void 0:e.error)||d.message||"Unknown error";h(l),p(r),f(null===(s=d.result)||void 0===s?void 0:s.raw_request_typed_dict),b(!1)}}catch(e){console.error("Test connection error:",e),h(e instanceof Error?e.message:String(e)),b(!1)}finally{v(!1),d&&d()}};a.useEffect(()=>{let e=setTimeout(()=>{k()},200);return()=>clearTimeout(e)},[]);let C=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",Z="string"==typeof u?C(u):(null==u?void 0:u.message)?C(u.message):"Unknown error",S=g?((e,l,t)=>{let s=JSON.stringify(l,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[l,t]=e;return"-H '".concat(l,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(s,"\n }'")})(g.raw_request_api_base,g.raw_request_body,g.raw_request_headers||{}):"";return(0,s.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[j?(0,s.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-dc9a0e2d897fe63b",children:[(0,s.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-dc9a0e2d897fe63b loading-spinner",children:(0,s.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-dc9a0e2d897fe63b"})}),(0,s.jsxs)(eV,{style:{fontSize:"16px"},children:["Testing connection to ",o,"..."]}),(0,s.jsx)(eL(),{id:"dc9a0e2d897fe63b",children:"@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]}):_?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,s.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,s.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,s.jsxs)(eV,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",o," successful!"]})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,s.jsx)(eO.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,s.jsxs)(eV,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",o," failed"]})]}),(0,s.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,s.jsxs)(eV,{strong:!0,style:{display:"block",marginBottom:"8px"},children:["Error:"," "]}),(0,s.jsx)(eV,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:Z}),u&&(0,s.jsx)("div",{style:{marginTop:"12px"},children:(0,s.jsx)(y.ZP,{type:"link",onClick:()=>w(!N),style:{paddingLeft:0,height:"auto"},children:N?"Hide Details":"Show Details"})})]}),N&&(0,s.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,s.jsx)(eV,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Troubleshooting Details"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:"string"==typeof u?u:JSON.stringify(u,null,2)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(eV,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"API Request"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"250px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:S||"No request data available"}),(0,s.jsx)(y.ZP,{style:{marginTop:"8px"},icon:(0,s.jsx)(eD.Z,{}),onClick:()=>{navigator.clipboard.writeText(S||""),c.Z.success("Copied to clipboard")},children:"Copy to Clipboard"})]})]})}),(0,s.jsx)(eR.Z,{style:{margin:"24px 0 16px"}}),(0,s.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)(y.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,s.jsx)(el.Z,{}),children:"View Documentation"})})]})};let ez=[{value:"chat",label:"Chat - /chat/completions"},{value:"completion",label:"Completion - /completions"},{value:"embedding",label:"Embedding - /embeddings"},{value:"audio_speech",label:"Audio Speech - /audio/speech"},{value:"audio_transcription",label:"Audio Transcription - /audio/transcriptions"},{value:"image_generation",label:"Image Generation - /images/generations"},{value:"rerank",label:"Rerank - /rerank"},{value:"realtime",label:"Realtime - /realtime"},{value:"batch",label:"Batch - /batch"}];var eB=t(92858),eK=t(84376),eU=t(20347);let eG=async(e,l,t,s)=>{try{console.log("=== AUTO ROUTER SUBMIT HANDLER CALLED ==="),console.log("handling auto router submit for formValues:",e),console.log("Access token:",l?"Present":"Missing"),console.log("Form:",t?"Present":"Missing"),console.log("Callback:",s?"Present":"Missing");let a={model_name:e.auto_router_name,litellm_params:{model:"auto_router/".concat(e.auto_router_name),auto_router_config:JSON.stringify(e.auto_router_config),auto_router_default_model:e.auto_router_default_model},model_info:{}};e.auto_router_embedding_model&&"custom"!==e.auto_router_embedding_model?a.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(a.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(a.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(a.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",a),console.log("Auto router config (stringified):",a.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:l?"Present":"Missing",config:a});let r=await (0,n.modelCreateCall)(l,a);console.log("response for auto router create call:",r),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),c.Z.fromBackend("Failed to add auto router: "+e)}},{Title:eH,Link:eJ}=g.default;var eW=e=>{let{form:l,handleOk:t,accessToken:r,userRole:o}=e,[i,d]=(0,a.useState)(!1),[m,u]=(0,a.useState)(!1),[h,x]=(0,a.useState)(""),[p,N]=(0,a.useState)([]),[w,k]=(0,a.useState)([]),[C,Z]=(0,a.useState)(!1),[S,A]=(0,a.useState)(!1),[I,E]=(0,a.useState)(null);(0,a.useEffect)(()=>{(async()=>{N((await (0,n.modelAvailableCall)(r,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[r]),(0,a.useEffect)(()=>{(async()=>{try{let e=await (0,eh.p)(r);console.log("Fetched models for auto router:",e),k(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[r]);let P=eU.ZL.includes(o),M=async()=>{u(!0),x("test-".concat(Date.now())),d(!0)},F=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",I);let e=l.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){c.Z.fromBackend("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){c.Z.fromBackend("Please select a Default Model");return}if(l.setFieldsValue({custom_llm_provider:"auto_router",model:e.auto_router_name,api_key:"not_required_for_auto_router"}),!I||!I.routes||0===I.routes.length){c.Z.fromBackend("Please configure at least one route for the auto router");return}if(I.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){c.Z.fromBackend("Please ensure all routes have a target model, description, and at least one utterance");return}l.validateFields().then(e=>{console.log("Form validation passed, submitting with values:",e);let s={...e,auto_router_config:I};console.log("Final submit values:",s),eG(s,r,l,t)}).catch(e=>{console.error("Validation failed:",e);let l=e.errorFields||[];if(l.length>0){let e=l.map(e=>{let l=e.name[0];return({auto_router_name:"Auto Router Name",auto_router_default_model:"Default Model",auto_router_embedding_model:"Embedding Model"})[l]||l});c.Z.fromBackend("Please fill in the following required fields: ".concat(e.join(", ")))}else c.Z.fromBackend("Please fill in all required fields")})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eH,{level:2,children:"Add Auto Router"}),(0,s.jsx)(b.x,{className:"text-gray-600 mb-6",children:"Create an auto router with intelligent routing logic that automatically selects the best model based on user input patterns and semantic matching."}),(0,s.jsx)(ep.Z,{children:(0,s.jsxs)(f.Z,{form:l,onFinish:F,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,s.jsx)(f.Z.Item,{rules:[{required:!0,message:"Auto router name is required"}],label:"Auto Router Name",name:"auto_router_name",tooltip:"Unique name for this auto router configuration",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(b.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full mb-4",children:(0,s.jsx)(eb,{modelInfo:w,value:I,onChange:e=>{E(e),l.setFieldValue("auto_router_config",e)}})}),(0,s.jsx)(f.Z.Item,{rules:[{required:!0,message:"Default model is required"}],label:"Default Model",name:"auto_router_default_model",tooltip:"Fallback model to use when auto routing logic cannot determine the best model",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(v.default,{placeholder:"Select a default model",onChange:e=>{Z("custom"===e)},options:[...Array.from(new Set(w.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0})}),(0,s.jsx)(f.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",tooltip:"Optional: Embedding model to use for semantic routing decisions",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(v.default,{value:l.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{A("custom"===e),l.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(w.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0,allowClear:!0})}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),P&&(0,s.jsx)(f.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to control who can access this auto router",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:p.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(_.Z,{title:"Get help on our github",children:(0,s.jsx)(g.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(y.ZP,{onClick:M,loading:m,children:"Test Connect"}),(0,s.jsx)(y.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",I),console.log("Current form values:",l.getFieldsValue()),F()},children:"Add Auto Router"})]})]})]})}),(0,s.jsx)(j.Z,{title:"Connection Test Results",open:i,onCancel:()=>{d(!1),u(!1)},footer:[(0,s.jsx)(y.ZP,{onClick:()=>{d(!1),u(!1)},children:"Close"},"close")],width:700,children:i&&(0,s.jsx)(eq,{formValues:l.getFieldsValue(),accessToken:r,testMode:"chat",modelName:l.getFieldValue("auto_router_name"),onClose:()=>{d(!1),u(!1)},onTestComplete:()=>u(!1)},h)})]})};let{Title:eY,Link:e$}=g.default;var eQ=e=>{let{form:l,handleOk:t,selectedProvider:r,setSelectedProvider:o,providerModels:c,setProviderModelsFn:m,getPlaceholder:u,uploadProps:h,showAdvancedSettings:x,setShowAdvancedSettings:p,teams:b,credentials:N,accessToken:C,userRole:Z,premiumUser:S}=e,[I]=f.Z.useForm(),[E,P]=(0,a.useState)("chat"),[M,F]=(0,a.useState)(!1),[T,L]=(0,a.useState)(!1),[R,O]=(0,a.useState)([]),[D,V]=(0,a.useState)("");(0,a.useEffect)(()=>{(async()=>{try{let e=(await (0,n.getGuardrailsList)(C)).guardrails.map(e=>e.guardrail_name);O(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[C]);let q=async()=>{L(!0),V("test-".concat(Date.now())),F(!0)},[z,B]=(0,a.useState)(!1),[K,U]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{U((await (0,n.modelAvailableCall)(C,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[C]);let G=eU.ZL.includes(Z);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ek.v0,{className:"w-full",children:[(0,s.jsxs)(ek.td,{className:"mb-4",children:[(0,s.jsx)(ek.OK,{children:"Add Model"}),(0,s.jsx)(ek.OK,{children:"Add Auto Router"})]}),(0,s.jsxs)(ek.nP,{children:[(0,s.jsxs)(ek.x4,{children:[(0,s.jsx)(eY,{level:2,children:"Add Model"}),(0,s.jsx)(ep.Z,{children:(0,s.jsx)(f.Z,{form:l,onFinish:e=>{console.log("\uD83D\uDD25 Form onFinish triggered with values:",e),t()},onFinishFailed:e=>{console.log("\uD83D\uDCA5 Form onFinishFailed triggered:",e)},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"E.g. OpenAI, Azure OpenAI, Anthropic, Bedrock, etc.",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(v.default,{showSearch:!0,value:r,onChange:e=>{o(e),m(e),l.setFieldsValue({model:[],model_name:void 0})},children:Object.entries(d.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(v.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:d.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(eC,{selectedProvider:r,providerModels:c,getPlaceholder:u}),(0,s.jsx)(eI,{}),(0,s.jsx)(f.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,s.jsx)(v.default,{style:{width:"100%"},value:E,onChange:e=>P(e),options:ez})}),(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(k.Z,{span:10}),(0,s.jsx)(k.Z,{span:10,children:(0,s.jsxs)(i.Z,{className:"mb-5 mt-1",children:[(0,s.jsx)("strong",{children:"Optional"})," - LiteLLM endpoint to use when health checking this model"," ",(0,s.jsx)(e$,{href:"https://docs.litellm.ai/docs/proxy/health#health",target:"_blank",children:"Learn more"})]})})]}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(g.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,s.jsx)(f.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,s.jsx)(v.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...N.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,s.jsx)(f.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.litellm_credential_name!==l.litellm_credential_name||e.provider!==l.provider,children:e=>{let{getFieldValue:l}=e,t=l("litellm_credential_name");return(console.log("\uD83D\uDD11 Credential Name Changed:",t),t)?(0,s.jsx)("div",{className:"text-gray-500 text-sm text-center",children:"Using existing credentials - no additional provider fields needed"}):(0,s.jsx)(A,{selectedProvider:r,uploadProps:h})}}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Model Info Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,s.jsx)(f.Z.Item,{label:"Team-BYOK Model",tooltip:"Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys.",className:"mb-4",children:(0,s.jsx)(_.Z,{title:S?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,s.jsx)(eB.Z,{checked:z,onChange:e=>{B(e),e||l.setFieldValue("team_id",void 0)},disabled:!S})})}),z&&(0,s.jsx)(f.Z.Item,{label:"Select Team",name:"team_id",className:"mb-4",tooltip:"Only keys for this team will be able to call this model.",rules:[{required:z&&!G,message:"Please select a team."}],children:(0,s.jsx)(eK.Z,{teams:b,disabled:!S})}),G&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(f.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to give users access to select models, and add new ones to the group over time.",children:(0,s.jsx)(v.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:K.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,s.jsx)(eF,{showAdvancedSettings:x,setShowAdvancedSettings:p,teams:b,guardrailsList:R}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(_.Z,{title:"Get help on our github",children:(0,s.jsx)(g.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(y.ZP,{onClick:q,loading:T,children:"Test Connect"}),(0,s.jsx)(y.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})})]}),(0,s.jsx)(ek.x4,{children:(0,s.jsx)(eW,{form:I,handleOk:()=>{I.validateFields().then(e=>{eG(e,C,I,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:C,userRole:Z})})]})]}),(0,s.jsx)(j.Z,{title:"Connection Test Results",open:M,onCancel:()=>{F(!1),L(!1)},footer:[(0,s.jsx)(y.ZP,{onClick:()=>{F(!1),L(!1)},children:"Close"},"close")],width:700,children:M&&(0,s.jsx)(eq,{formValues:l.getFieldsValue(),accessToken:C,testMode:E,modelName:l.getFieldValue("model_name")||l.getFieldValue("model"),onClose:()=>{F(!1),L(!1)},onTestComplete:()=>L(!1)},D)})]})},eX=t(41649),e0=t(8048),e1=t(61994),e2=t(15731),e4=t(91126);let e5=(e,l,t,a,r,o,i,n,d,c,m)=>[{header:()=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(e1.Z,{checked:t,indeterminate:l.length>0&&!t,onChange:e=>r(e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)("span",{children:"Model ID"})]}),accessorKey:"model_info.id",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:t}=e,r=t.original,o=r.model_name,i=l.includes(o);return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(e1.Z,{checked:i,onChange:e=>a(o,e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)(_.Z,{title:r.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>m&&m(r.model_info.id),children:r.model_info.id})})]})}},{header:"Model Name",accessorKey:"model_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,t=l.original,a=n(t)||t.model_name;return(0,s.jsx)("div",{className:"font-medium text-sm",children:(0,s.jsx)(_.Z,{title:a,children:(0,s.jsx)("div",{className:"truncate max-w-[200px]",children:a})})})}},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,sortingFn:(e,l,t)=>{var s,a;let r=e.getValue("health_status")||"unknown",o=l.getValue("health_status")||"unknown",i={healthy:0,checking:1,unknown:2,unhealthy:3};return(null!==(s=i[r])&&void 0!==s?s:4)-(null!==(a=i[o])&&void 0!==a?a:4)},cell:l=>{var t;let{row:a}=l,r=a.original,o={status:r.health_status,loading:r.health_loading,error:r.health_error};if(o.loading)return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}),(0,s.jsx)(ev.x,{className:"text-gray-600 text-sm",children:"Checking..."})]});let n=r.model_name,d="healthy"===o.status&&(null===(t=e[n])||void 0===t?void 0:t.successResponse);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[i(o.status),d&&c&&(0,s.jsx)(_.Z,{title:"View response details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>{var l;return c(n,null===(l=e[n])||void 0===l?void 0:l.successResponse)},className:"p-1 text-green-600 hover:text-green-800 hover:bg-green-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(e2.Z,{className:"h-4 w-4"})})})]})}},{header:"Error Details",accessorKey:"health_error",enableSorting:!1,cell:l=>{let{row:t}=l,a=t.original.model_name,r=e[a];if(!(null==r?void 0:r.error))return(0,s.jsx)(ev.x,{className:"text-gray-400 text-sm",children:"No errors"});let o=r.error,i=r.fullError||r.error;return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"max-w-[200px]",children:(0,s.jsx)(_.Z,{title:o,placement:"top",children:(0,s.jsx)(ev.x,{className:"text-red-600 text-sm truncate",children:o})})}),d&&i!==o&&(0,s.jsx)(_.Z,{title:"View full error details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>d(a,o,i),className:"p-1 text-red-600 hover:text-red-800 hover:bg-red-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(e2.Z,{className:"h-4 w-4"})})})]})}},{header:"Last Check",accessorKey:"last_check",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_check")||"Never checked",a=l.getValue("last_check")||"Never checked";if("Never checked"===s&&"Never checked"===a)return 0;if("Never checked"===s)return 1;if("Never checked"===a)return -1;if("Check in progress..."===s&&"Check in progress..."===a)return 0;if("Check in progress..."===s)return -1;if("Check in progress..."===a)return 1;let r=new Date(s),o=new Date(a);return isNaN(r.getTime())&&isNaN(o.getTime())?0:isNaN(r.getTime())?1:isNaN(o.getTime())?-1:o.getTime()-r.getTime()},cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(ev.x,{className:"text-gray-600 text-sm",children:t.health_loading?"Check in progress...":t.last_check})}},{header:"Last Success",accessorKey:"last_success",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_success")||"Never succeeded",a=l.getValue("last_success")||"Never succeeded";if("Never succeeded"===s&&"Never succeeded"===a)return 0;if("Never succeeded"===s)return 1;if("Never succeeded"===a)return -1;if("None"===s&&"None"===a)return 0;if("None"===s)return 1;if("None"===a)return -1;let r=new Date(s),o=new Date(a);return isNaN(r.getTime())&&isNaN(o.getTime())?0:isNaN(r.getTime())?1:isNaN(o.getTime())?-1:o.getTime()-r.getTime()},cell:l=>{let{row:t}=l,a=e[t.original.model_name],r=(null==a?void 0:a.lastSuccess)||"None";return(0,s.jsx)(ev.x,{className:"text-gray-600 text-sm",children:r})}},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e,t=l.original,a=t.model_name,r=t.health_status&&"none"!==t.health_status,i=t.health_loading?"Checking...":r?"Re-run Health Check":"Run Health Check";return(0,s.jsx)(_.Z,{title:i,placement:"top",children:(0,s.jsx)("button",{className:"p-2 rounded-md transition-colors ".concat(t.health_loading?"text-gray-400 cursor-not-allowed bg-gray-100":"text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50"),onClick:()=>{t.health_loading||o(a)},disabled:t.health_loading,children:t.health_loading?(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}):r?(0,s.jsx)(V.Z,{className:"h-4 w-4"}):(0,s.jsx)(e4.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],e6=[{pattern:/Missing .* API Key/i,replacement:"Missing API Key"},{pattern:/Connection timeout/i,replacement:"Connection timeout"},{pattern:/Network.*not.*ok/i,replacement:"Network connection failed"},{pattern:/403.*Forbidden/i,replacement:"Access forbidden - check API key permissions"},{pattern:/401.*Unauthorized/i,replacement:"Unauthorized - invalid API key"},{pattern:/429.*rate limit/i,replacement:"Rate limit exceeded"},{pattern:/500.*Internal Server Error/i,replacement:"Provider internal server error"},{pattern:/litellm\.AuthenticationError/i,replacement:"Authentication failed"},{pattern:/litellm\.RateLimitError/i,replacement:"Rate limit exceeded"},{pattern:/litellm\.APIError/i,replacement:"API error"}];var e3=e=>{let{accessToken:l,modelData:t,all_models_on_proxy:r,getDisplayModelName:o,setSelectedModelId:d}=e,[c,m]=(0,a.useState)({}),[u,h]=(0,a.useState)([]),[x,p]=(0,a.useState)(!1),[g,f]=(0,a.useState)(!1),[v,_]=(0,a.useState)(null),[b,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),C=(0,a.useRef)(null);(0,a.useEffect)(()=>{l&&(null==t?void 0:t.data)&&(async()=>{let e={};t.data.forEach(l=>{e[l.model_name]={status:"none",lastCheck:"None",lastSuccess:"None",loading:!1,error:void 0,fullError:void 0,successResponse:void 0}});try{let s=await (0,n.latestHealthChecksCall)(l);s&&s.latest_health_checks&&"object"==typeof s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l;if(!a)return;let r=null,o=t.data.find(e=>e.model_name===s);if(o)r=o.model_name;else{let e=t.data.find(e=>e.model_info&&e.model_info.id===s);if(e)r=e.model_name;else if(a.model_name){let e=t.data.find(e=>e.model_name===a.model_name);e&&(r=e.model_name)}}if(r){let l=a.error_message||void 0;e[r]={status:a.status||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():"None",loading:!1,error:l?Z(l):void 0,fullError:l,successResponse:"healthy"===a.status?a:void 0}}})}catch(e){console.warn("Failed to load health check history (using default states):",e)}m(e)})()},[l,t]);let Z=e=>{var l;if(!e)return"Health check failed";let t="string"==typeof e?e:JSON.stringify(e),s=t.match(/(\w+Error):\s*(\d{3})/i);if(s)return"".concat(s[1],": ").concat(s[2]);let a=t.match(/(AuthenticationError|RateLimitError|BadRequestError|InternalServerError|TimeoutError|NotFoundError|ForbiddenError|ServiceUnavailableError|BadGatewayError|ContentPolicyViolationError|\w+Error)/i),r=t.match(/\b(400|401|403|404|408|429|500|502|503|504)\b/);if(a&&r)return"".concat(a[1],": ").concat(r[1]);if(r){let e=r[1];return"".concat({400:"BadRequestError",401:"AuthenticationError",403:"ForbiddenError",404:"NotFoundError",408:"TimeoutError",429:"RateLimitError",500:"InternalServerError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError"}[e],": ").concat(e)}if(a){let e=a[1],l={AuthenticationError:"401",RateLimitError:"429",BadRequestError:"400",InternalServerError:"500",TimeoutError:"408",NotFoundError:"404",ForbiddenError:"403",ServiceUnavailableError:"503",BadGatewayError:"502",GatewayTimeoutError:"504",ContentPolicyViolationError:"400"}[e];return l?"".concat(e,": ").concat(l):e}for(let{pattern:e,replacement:l}of e6)if(e.test(t))return l;if(/missing.*api.*key|invalid.*key|unauthorized/i.test(t))return"AuthenticationError: 401";if(/rate.*limit|too.*many.*requests/i.test(t))return"RateLimitError: 429";if(/timeout|timed.*out/i.test(t))return"TimeoutError: 408";if(/not.*found/i.test(t))return"NotFoundError: 404";if(/forbidden|access.*denied/i.test(t))return"ForbiddenError: 403";if(/internal.*server.*error/i.test(t))return"InternalServerError: 500";let o=t.replace(/[\n\r]+/g," ").replace(/\s+/g," ").trim(),i=null===(l=o.split(/[.!?]/)[0])||void 0===l?void 0:l.trim();return i&&i.length>0?i.length>100?i.substring(0,97)+"...":i:o.length>100?o.substring(0,97)+"...":o},S=async e=>{if(l){m(l=>({...l,[e]:{...l[e],loading:!0,status:"checking"}}));try{var s,a;let r=await (0,n.individualModelHealthCheckCall)(l,e),o=new Date().toLocaleString();if(r.unhealthy_count>0&&r.unhealthy_endpoints&&r.unhealthy_endpoints.length>0){let l=(null===(s=r.unhealthy_endpoints[0])||void 0===s?void 0:s.error)||"Health check failed",t=Z(l);m(s=>{var a;return{...s,[e]:{status:"unhealthy",lastCheck:o,lastSuccess:(null===(a=s[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:o,lastSuccess:o,loading:!1,successResponse:r}}));try{let s=await (0,n.latestHealthChecksCall)(l),r=t.data.find(l=>l.model_name===e);if(r){let l=r.model_info.id,t=null===(a=s.latest_health_checks)||void 0===a?void 0:a[l];if(t){let l=t.error_message||void 0;m(s=>{var a,r,o,i,n,d,c;return{...s,[e]:{status:t.status||(null===(a=s[e])||void 0===a?void 0:a.status)||"unknown",lastCheck:t.checked_at?new Date(t.checked_at).toLocaleString():(null===(r=s[e])||void 0===r?void 0:r.lastCheck)||"None",lastSuccess:"healthy"===t.status?t.checked_at?new Date(t.checked_at).toLocaleString():(null===(o=s[e])||void 0===o?void 0:o.lastSuccess)||"None":(null===(i=s[e])||void 0===i?void 0:i.lastSuccess)||"None",loading:!1,error:l?Z(l):null===(n=s[e])||void 0===n?void 0:n.error,fullError:l||(null===(d=s[e])||void 0===d?void 0:d.fullError),successResponse:"healthy"===t.status?t:null===(c=s[e])||void 0===c?void 0:c.successResponse}}})}}}catch(e){console.debug("Could not fetch updated status from database (non-critical):",e)}}catch(a){let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=Z(t);m(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}}},A=async()=>{let e=u.length>0?u:r,s=e.reduce((e,l)=>(e[l]={...c[l],loading:!0,status:"checking"},e),{});m(e=>({...e,...s}));let a={},o=e.map(async e=>{if(l)try{let s=await (0,n.individualModelHealthCheckCall)(l,e);a[e]=s;let r=new Date().toLocaleString();if(s.unhealthy_count>0&&s.unhealthy_endpoints&&s.unhealthy_endpoints.length>0){var t;let l=(null===(t=s.unhealthy_endpoints[0])||void 0===t?void 0:t.error)||"Health check failed",a=Z(l);m(t=>{var s;return{...t,[e]:{status:"unhealthy",lastCheck:r,lastSuccess:(null===(s=t[e])||void 0===s?void 0:s.lastSuccess)||"None",loading:!1,error:a,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:r,lastSuccess:r,loading:!1,successResponse:s}}))}catch(a){console.error("Health check failed for ".concat(e,":"),a);let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=Z(t);m(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}});await Promise.allSettled(o);try{if(!l)return;let s=await (0,n.latestHealthChecksCall)(l);s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l,r=t.data.find(e=>e.model_info.id===s);if(r&&e.includes(r.model_name)&&a){let e=r.model_name,l=a.error_message||void 0;m(t=>{let s=t[e];return{...t,[e]:{status:a.status||(null==s?void 0:s.status)||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastCheck)||"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastSuccess)||"None",loading:!1,error:l?Z(l):null==s?void 0:s.error,fullError:l||(null==s?void 0:s.fullError),successResponse:"healthy"===a.status?a:null==s?void 0:s.successResponse}}})}})}catch(e){console.warn("Failed to fetch updated health statuses from database (non-critical):",e)}},I=e=>{p(e),e?h(r):h([])},E=()=>{f(!1),_(null)},P=()=>{N(!1),k(null)};return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(Y.Z,{children:"Model Health Status"}),(0,s.jsx)(i.Z,{className:"text-gray-600 mt-1",children:"Run health checks on individual models to verify they are working correctly"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[u.length>0&&(0,s.jsx)(z.Z,{size:"sm",variant:"light",onClick:()=>I(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,s.jsx)(z.Z,{size:"sm",variant:"secondary",onClick:A,disabled:Object.values(c).some(e=>e.loading),className:"px-3 py-1 text-sm",children:u.length>0&&u.length{l?h(l=>[...l,e]):(h(l=>l.filter(l=>l!==e)),p(!1))},I,S,e=>{switch(e){case"healthy":return(0,s.jsx)(eX.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,s.jsx)(eX.Z,{color:"red",children:"unhealthy"});case"checking":return(0,s.jsx)(eX.Z,{color:"blue",children:"checking"});case"none":return(0,s.jsx)(eX.Z,{color:"gray",children:"none"});default:return(0,s.jsx)(eX.Z,{color:"gray",children:"unknown"})}},o,(e,l,t)=>{_({modelName:e,cleanedError:l,fullError:t}),f(!0)},(e,l)=>{k({modelName:e,response:l}),N(!0)},d),data:t.data.map(e=>{let l=c[e.model_name]||{status:"none",lastCheck:"None",loading:!1};return{model_name:e.model_name,model_info:e.model_info,provider:e.provider,litellm_model_name:e.litellm_model_name,health_status:l.status,last_check:l.lastCheck,last_success:l.lastSuccess||"None",health_loading:l.loading,health_error:l.error,health_full_error:l.fullError}}),isLoading:!1,table:C})}),(0,s.jsx)(j.Z,{title:v?"Health Check Error - ".concat(v.modelName):"Error Details",open:g,onCancel:E,footer:[(0,s.jsx)(y.ZP,{onClick:E,children:"Close"},"close")],width:800,children:v&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Error:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,s.jsx)(i.Z,{className:"text-red-800",children:v.cleanedError})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Full Error Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:v.fullError})})]})]})}),(0,s.jsx)(j.Z,{title:w?"Health Check Response - ".concat(w.modelName):"Response Details",open:b,onCancel:P,footer:[(0,s.jsx)(y.ZP,{onClick:P,children:"Close"},"close")],width:800,children:w&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Status:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-green-50 border border-green-200 rounded-md",children:(0,s.jsx)(i.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"font-medium",children:"Response Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(w.response,null,2)})})]})]})})]})},e8=t(10607),e7=t(86462),e9=t(47686),le=t(77355),ll=t(93416),lt=t(95704),ls=e=>{let{accessToken:l,initialModelGroupAlias:t={},onAliasUpdate:r}=e,[o,i]=(0,a.useState)([]),[d,m]=(0,a.useState)({aliasName:"",targetModelGroup:""}),[u,h]=(0,a.useState)(null),[x,g]=(0,a.useState)(!0);(0,a.useEffect)(()=>{i(Object.entries(t).map((e,l)=>{var t;let[s,a]=e;return{id:"".concat(l,"-").concat(s),aliasName:s,targetModelGroup:"string"==typeof a?a:null!==(t=null==a?void 0:a.model)&&void 0!==t?t:""}}))},[t]);let f=async e=>{if(!l)return console.error("Access token is missing"),!1;try{let t={};return e.forEach(e=>{t[e.aliasName]=e.targetModelGroup}),console.log("Saving model group alias:",t),await (0,n.setCallbacksCall)(l,{router_settings:{model_group_alias:t}}),r&&r(t),!0}catch(e){return console.error("Failed to save model group alias settings:",e),c.Z.fromBackend("Failed to save model group alias settings"),!1}},j=async()=>{if(!d.aliasName||!d.targetModelGroup){c.Z.fromBackend("Please provide both alias name and target model group");return}if(o.some(e=>e.aliasName===d.aliasName)){c.Z.fromBackend("An alias with this name already exists");return}let e=[...o,{id:"".concat(Date.now(),"-").concat(d.aliasName),aliasName:d.aliasName,targetModelGroup:d.targetModelGroup}];await f(e)&&(i(e),m({aliasName:"",targetModelGroup:""}),c.Z.success("Alias added successfully"))},v=e=>{h({...e})},_=async()=>{if(!u)return;if(!u.aliasName||!u.targetModelGroup){c.Z.fromBackend("Please provide both alias name and target model group");return}if(o.some(e=>e.id!==u.id&&e.aliasName===u.aliasName)){c.Z.fromBackend("An alias with this name already exists");return}let e=o.map(e=>e.id===u.id?u:e);await f(e)&&(i(e),h(null),c.Z.success("Alias updated successfully"))},y=()=>{h(null)},b=async e=>{let l=o.filter(l=>l.id!==e);await f(l)&&(i(l),c.Z.success("Alias deleted successfully"))},N=o.reduce((e,l)=>(e[l.aliasName]=l.targetModelGroup,e),{});return(0,s.jsxs)(lt.Zb,{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>g(!x),children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(lt.Dx,{className:"mb-0",children:"Model Group Alias Settings"}),(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Create aliases for your model groups to simplify API calls. For example, you can create an alias 'gpt-4o' that points to 'gpt-4o-mini-openai' model group."})]}),(0,s.jsx)("div",{className:"flex items-center",children:x?(0,s.jsx)(e7.Z,{className:"w-5 h-5 text-gray-500"}):(0,s.jsx)(e9.Z,{className:"w-5 h-5 text-gray-500"})})]}),x&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(lt.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,s.jsx)("input",{type:"text",value:d.aliasName,onChange:e=>m({...d,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model Group"}),(0,s.jsx)("input",{type:"text",value:d.targetModelGroup,onChange:e=>m({...d,targetModelGroup:e.target.value}),placeholder:"e.g., gpt-4o-mini-openai",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,s.jsx)("div",{className:"flex items-end",children:(0,s.jsxs)("button",{onClick:j,disabled:!d.aliasName||!d.targetModelGroup,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(d.aliasName&&d.targetModelGroup?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,s.jsx)(le.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,s.jsx)(lt.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,s.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(lt.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,s.jsx)(lt.ss,{children:(0,s.jsxs)(lt.SC,{children:[(0,s.jsx)(lt.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,s.jsx)(lt.xs,{className:"py-1 h-8",children:"Target Model Group"}),(0,s.jsx)(lt.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,s.jsxs)(lt.RM,{children:[o.map(e=>(0,s.jsx)(lt.SC,{className:"h-8",children:u&&u.id===e.id?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lt.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.aliasName,onChange:e=>h({...u,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lt.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.targetModelGroup,onChange:e=>h({...u,targetModelGroup:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lt.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:_,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,s.jsx)("button",{onClick:y,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lt.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,s.jsx)(lt.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModelGroup}),(0,s.jsx)(lt.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:()=>v(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,s.jsx)(ll.Z,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>b(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,s.jsx)(p.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===o.length&&(0,s.jsx)(lt.SC,{children:(0,s.jsx)(lt.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),(0,s.jsxs)(lt.Zb,{children:[(0,s.jsx)(lt.Dx,{className:"mb-4",children:"Configuration Example"}),(0,s.jsx)(lt.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config.yaml:"}),(0,s.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,s.jsxs)("div",{className:"text-gray-700",children:["router_settings:",(0,s.jsx)("br",{}),"\xa0\xa0model_group_alias:",0===Object.keys(N).length?(0,s.jsxs)("span",{className:"text-gray-500",children:[(0,s.jsx)("br",{}),"\xa0\xa0\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[l,t]=e;return(0,s.jsxs)("span",{children:[(0,s.jsx)("br",{}),'\xa0\xa0\xa0\xa0"',l,'": "',t,'"']},l)})]})})]})]})]})},la=t(27281),lr=t(57365),lo=t(47323);let li=(e,l,t,a,r,o,i,n,c,m,u)=>[{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model ID"}),accessorKey:"model_info.id",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(_.Z,{title:t.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>a(t.model_info.id),children:t.model_info.id})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Information"}),accessorKey:"model_name",size:250,cell:e=>{let{row:l}=e,t=l.original,a=o(l.original)||"-",r=(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Provider:"})," ",t.provider||"-"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Public Model Name:"})," ",a]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"LiteLLM Model Name:"})," ",t.litellm_model_name||"-"]})]});return(0,s.jsx)(_.Z,{title:r,children:(0,s.jsxs)("div",{className:"flex items-start space-x-2 min-w-0 w-full max-w-[250px]",children:[(0,s.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:t.provider?(0,s.jsx)("img",{src:(0,d.dr)(t.provider).logo,alt:"".concat(t.provider," logo"),className:"w-4 h-4",onError:e=>{let l=e.target,s=l.parentElement;if(s){var a;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(a=t.provider)||void 0===a?void 0:a.charAt(0))||"-",s.replaceChild(e,l)}}}):(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,s.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate max-w-[210px]",children:a}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5 max-w-[210px]",children:t.litellm_model_name||"-"})]})]})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Credentials"}),accessorKey:"litellm_credential_name",size:180,cell:e=>{var l;let{row:t}=e,a=null===(l=t.original.litellm_params)||void 0===l?void 0:l.litellm_credential_name;return a?(0,s.jsx)(_.Z,{title:"Credential: ".concat(a),children:(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(X.Z,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs truncate",title:a,children:a})]})}):(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(X.Z,{className:"w-4 h-4 text-gray-300 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"No credentials"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Created By"}),accessorKey:"model_info.created_by",sortingFn:"datetime",size:160,cell:e=>{let{row:l}=e,t=l.original,a=t.model_info.created_by,r=t.model_info.created_at?new Date(t.model_info.created_at).toLocaleDateString():null;return(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[160px]",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate",title:a||"Unknown",children:a||"Unknown"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5",title:r||"Unknown date",children:r||"Unknown date"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Updated At"}),accessorKey:"model_info.updated_at",sortingFn:"datetime",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("span",{className:"text-xs",children:t.model_info.updated_at?new Date(t.model_info.updated_at).toLocaleDateString():"-"})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Costs"}),accessorKey:"input_cost",size:120,cell:e=>{let{row:l}=e,t=l.original,a=t.input_cost,r=t.output_cost;return a||r?(0,s.jsx)(_.Z,{title:"Cost per 1M tokens",children:(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[120px]",children:[a&&(0,s.jsxs)("div",{className:"text-xs font-medium text-gray-900 truncate",children:["In: $",a]}),r&&(0,s.jsxs)("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:["Out: $",r]})]})}):(0,s.jsx)("div",{className:"max-w-[120px]",children:(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"-"})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Team ID"}),accessorKey:"model_info.team_id",cell:e=>{let{row:l}=e,t=l.original;return t.model_info.team_id?(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(_.Z,{title:t.model_info.team_id,children:(0,s.jsxs)(z.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>r(t.model_info.team_id),children:[t.model_info.team_id.slice(0,7),"..."]})})}):"-"}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Access Group"}),accessorKey:"model_info.model_access_group",enableSorting:!1,cell:e=>{let{row:l}=e,t=l.original,a=t.model_info.access_groups;if(!a||0===a.length)return"-";let r=t.model_info.id,o=m.has(r),i=a.length>1,n=()=>{let e=new Set(m);o?e.delete(r):e.add(r),u(e)};return(0,s.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,s.jsx)(eX.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:a[0]}),(o||!i&&2===a.length)&&a.slice(1).map((e,l)=>(0,s.jsx)(eX.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:e},l+1)),i&&(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"text-xs text-blue-600 hover:text-blue-800 px-1 py-0.5 rounded hover:bg-blue-50 h-5 leading-tight flex-shrink-0 whitespace-nowrap",children:o?"−":"+".concat(a.length-1)})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Status"}),accessorKey:"model_info.db_model",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("div",{className:"\n inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium\n ".concat(t.model_info.db_model?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-600","\n "),children:t.model_info.db_model?"DB Model":"Config Model"})}},{id:"actions",header:"",cell:t=>{var r;let{row:o}=t,i=o.original,n="Admin"===e||(null===(r=i.model_info)||void 0===r?void 0:r.created_by)===l;return(0,s.jsx)("div",{className:"flex items-center justify-end gap-2 pr-4",children:(0,s.jsx)(lo.Z,{icon:p.Z,size:"sm",onClick:()=>{n&&(a(i.model_info.id),c(!1))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"})})}}];var ln=t(11318),ld=t(39760),lc=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:r,availableModelAccessGroups:n,setSelectedModelId:d,setSelectedTeamId:c,setEditModel:m,modelData:u}=e,{userId:h,userRole:x,premiumUser:p}=(0,ld.Z)(),{teams:g}=(0,ln.Z)(),[f,j]=(0,a.useState)(""),[v,_]=(0,a.useState)("current_team"),[y,b]=(0,a.useState)("personal"),[N,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(null),[Z,S]=(0,a.useState)(new Set),[A,I]=(0,a.useState)({pageIndex:0,pageSize:50}),E=(0,a.useRef)(null),P=(0,a.useMemo)(()=>u&&u.data&&0!==u.data.length?u.data.filter(e=>{var t,s,a,r,o;let i=""===f||e.model_name.toLowerCase().includes(f.toLowerCase()),n="all"===l||e.model_name===l||!l||"wildcard"===l&&(null===(t=e.model_name)||void 0===t?void 0:t.includes("*")),d="all"===k||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(k))||!k,c=!0;return"current_team"===v&&(c="personal"===y?(null===(a=e.model_info)||void 0===a?void 0:a.direct_access)===!0:(null===(o=e.model_info)||void 0===o?void 0:null===(r=o.access_via_team_ids)||void 0===r?void 0:r.includes(y))===!0),i&&n&&d&&c}):[],[u,f,l,k,y,v]),M=(0,a.useMemo)(()=>{let e=A.pageIndex*A.pageSize,l=e+A.pageSize;return P.slice(e,l)},[P,A.pageIndex,A.pageSize]);return(0,a.useEffect)(()=>{I(e=>({...e,pageIndex:0}))},[f,l,k,y,v]),(0,s.jsx)(H.Z,{children:(0,s.jsx)(o.Z,{children:(0,s.jsx)("div",{className:"flex flex-col space-y-4",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,s.jsxs)("div",{className:"border-b px-6 py-4 bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(i.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,s.jsxs)(la.Z,{className:"w-80",defaultValue:"personal",value:y,onValueChange:e=>b(e),children:[(0,s.jsx)(lr.Z,{value:"personal",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Personal"})]})}),null==g?void 0:g.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:e.team_alias?"".concat(e.team_alias.slice(0,30),"..."):"Team ".concat(e.team_id.slice(0,30),"...")})]})},e.team_id))]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(i.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),(0,s.jsxs)(la.Z,{className:"w-64",defaultValue:"current_team",value:v,onValueChange:e=>_(e),children:[(0,s.jsx)(lr.Z,{value:"current_team",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Current Team Models"})]})}),(0,s.jsx)(lr.Z,{value:"all",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"All Available Models"})]})})]})]})]}),"current_team"===v&&(0,s.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,s.jsx)(el.Z,{className:"text-gray-400 mt-0.5 flex-shrink-0 text-xs"}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"personal"===y?(0,s.jsxs)("span",{children:["To access these models: Create a Virtual Key without selecting a team on the"," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]}):(0,s.jsxs)("span",{children:['To access these models: Create a Virtual Key and select Team as "',y,'" on the'," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]})})]})]}),(0,s.jsx)("div",{className:"border-b px-6 py-4",children:(0,s.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("div",{className:"relative w-64",children:[(0,s.jsx)("input",{type:"text",placeholder:"Search model names...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:f,onChange:e=>j(e.target.value)}),(0,s.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(N?"bg-gray-100":""),onClick:()=>w(!N),children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters"]}),(0,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{j(""),t("all"),C(null),b("personal"),_("current_team"),I({pageIndex:0,pageSize:50})},children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),N&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(la.Z,{value:null!=l?l:"all",onValueChange:e=>t("all"===e?"all":e),placeholder:"Filter by Public Model Name",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Models"}),(0,s.jsx)(lr.Z,{value:"wildcard",children:"Wildcard Models (*)"}),r.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})}),(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(la.Z,{value:null!=k?k:"all",onValueChange:e=>C("all"===e?null:e),placeholder:"Filter by Model Access Group",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Model Access Groups"}),n.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-sm text-gray-700",children:P.length>0?"Showing ".concat(A.pageIndex*A.pageSize+1," - ").concat(Math.min((A.pageIndex+1)*A.pageSize,P.length)," of ").concat(P.length," results"):"Showing 0 results"}),P.length>A.pageSize&&(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("button",{onClick:()=>I(e=>({...e,pageIndex:e.pageIndex-1})),disabled:0===A.pageIndex,className:"px-3 py-1 text-sm border rounded-md ".concat(0===A.pageIndex?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,s.jsx)("button",{onClick:()=>I(e=>({...e,pageIndex:e.pageIndex+1})),disabled:A.pageIndex>=Math.ceil(P.length/A.pageSize)-1,className:"px-3 py-1 text-sm border rounded-md ".concat(A.pageIndex>=Math.ceil(P.length/A.pageSize)-1?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,s.jsx)(e0.C,{columns:li(x,h,p,d,c,O,()=>{},()=>{},m,Z,S),data:M,isLoading:!1,table:E})]})})})})},lm=t(93142),lu=t(867),lh=t(3810),lx=t(89245),lp=t(5540),lg=t(8881);let{Text:lf}=g.default;var lj=e=>{let{accessToken:l,onReloadSuccess:t,buttonText:r="Reload Price Data",showIcon:o=!0,size:i="middle",type:d="primary",className:m=""}=e,[u,h]=(0,a.useState)(!1),[x,p]=(0,a.useState)(!1),[g,f]=(0,a.useState)(!1),[v,_]=(0,a.useState)(!1),[b,N]=(0,a.useState)(6),[w,k]=(0,a.useState)(null),[C,Z]=(0,a.useState)(!1);(0,a.useEffect)(()=>{S();let e=setInterval(()=>{S()},3e4);return()=>clearInterval(e)},[l]);let S=async()=>{if(l){Z(!0);try{console.log("Fetching reload status...");let e=await (0,n.getModelCostMapReloadStatus)(l);console.log("Received status:",e),k(e)}catch(e){console.error("Failed to fetch reload status:",e),k({scheduled:!1,interval_hours:null,last_run:null,next_run:null})}finally{Z(!1)}}},A=async()=>{if(!l){c.Z.fromBackend("No access token available");return}h(!0);try{let e=await (0,n.reloadModelCostMap)(l);"success"===e.status?(c.Z.success("Price data reloaded successfully! ".concat(e.models_count||0," models updated.")),null==t||t(),await S()):c.Z.fromBackend("Failed to reload price data")}catch(e){console.error("Error reloading price data:",e),c.Z.fromBackend("Failed to reload price data. Please try again.")}finally{h(!1)}},I=async()=>{if(!l){c.Z.fromBackend("No access token available");return}if(b<=0){c.Z.fromBackend("Hours must be greater than 0");return}p(!0);try{let e=await (0,n.scheduleModelCostMapReload)(l,b);"success"===e.status?(c.Z.success("Periodic reload scheduled for every ".concat(b," hours")),_(!1),await S()):c.Z.fromBackend("Failed to schedule periodic reload")}catch(e){console.error("Error scheduling reload:",e),c.Z.fromBackend("Failed to schedule periodic reload. Please try again.")}finally{p(!1)}},E=async()=>{if(!l){c.Z.fromBackend("No access token available");return}f(!0);try{let e=await (0,n.cancelModelCostMapReload)(l);"success"===e.status?(c.Z.success("Periodic reload cancelled successfully"),await S()):c.Z.fromBackend("Failed to cancel periodic reload")}catch(e){console.error("Error cancelling reload:",e),c.Z.fromBackend("Failed to cancel periodic reload. Please try again.")}finally{f(!1)}},P=e=>{if(!e)return"Never";try{return new Date(e).toLocaleString()}catch(l){return e}};return(0,s.jsxs)("div",{className:m,children:[(0,s.jsxs)(lm.Z,{direction:"horizontal",size:"middle",style:{marginBottom:16},children:[(0,s.jsx)(lu.Z,{title:"Hard Refresh Price Data",description:"This will immediately fetch the latest pricing information from the remote source. Continue?",onConfirm:A,okText:"Yes",cancelText:"No",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"}},children:(0,s.jsx)(y.ZP,{type:d,size:i,loading:u,icon:o?(0,s.jsx)(lx.Z,{}):void 0,style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"},children:r})}),(null==w?void 0:w.scheduled)?(0,s.jsx)(y.ZP,{type:"default",size:i,danger:!0,icon:(0,s.jsx)(lg.Z,{}),loading:g,onClick:E,style:{borderColor:"#ff4d4f",color:"#ff4d4f",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Cancel Periodic Reload"}):(0,s.jsx)(y.ZP,{type:"default",size:i,icon:(0,s.jsx)(lp.Z,{}),onClick:()=>_(!0),style:{borderColor:"#d9d9d9",color:"#6366f1",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Set Up Periodic Reload"})]}),w&&(0,s.jsx)(ep.Z,{size:"small",style:{backgroundColor:"#f8f9fa",border:"1px solid #e9ecef",borderRadius:8},children:(0,s.jsxs)(lm.Z,{direction:"vertical",size:"small",style:{width:"100%"},children:[w.scheduled?(0,s.jsx)("div",{children:(0,s.jsxs)(lh.Z,{color:"green",icon:(0,s.jsx)(lp.Z,{}),children:["Scheduled every ",w.interval_hours," hours"]})}):(0,s.jsx)(lf,{type:"secondary",children:"No periodic reload scheduled"}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lf,{type:"secondary",style:{fontSize:"12px"},children:"Last run:"}),(0,s.jsx)(lf,{style:{fontSize:"12px"},children:P(w.last_run)})]}),w.scheduled&&(0,s.jsxs)(s.Fragment,{children:[w.next_run&&(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lf,{type:"secondary",style:{fontSize:"12px"},children:"Next run:"}),(0,s.jsx)(lf,{style:{fontSize:"12px"},children:P(w.next_run)})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lf,{type:"secondary",style:{fontSize:"12px"},children:"Status:"}),(0,s.jsx)(lh.Z,{color:(null==w?void 0:w.scheduled)?w.last_run?"success":"processing":"default",children:(null==w?void 0:w.scheduled)?w.last_run?"Active":"Ready":"Not scheduled"})]})]})]})}),(0,s.jsxs)(j.Z,{title:"Set Up Periodic Reload",open:v,onOk:I,onCancel:()=>_(!1),confirmLoading:x,okText:"Schedule",cancelText:"Cancel",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"}},children:[(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(lf,{children:"Set up automatic reload of price data every:"})}),(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(eg.Z,{min:1,max:168,value:b,onChange:e=>N(e||6),addonAfter:"hours",style:{width:"100%"}})}),(0,s.jsx)("div",{children:(0,s.jsxs)(lf,{type:"secondary",children:["This will automatically fetch the latest pricing data from the remote source every ",b," hours."]})})]})]})},lv=e=>{let{setModelMap:l}=e,{accessToken:t}=(0,ld.Z)();return(0,s.jsx)(H.Z,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(Y.Z,{children:"Price Data Management"}),(0,s.jsx)(i.Z,{className:"text-tremor-content",children:"Manage model pricing data and configure automatic reload schedules"})]}),(0,s.jsx)(lj,{accessToken:t,onReloadSuccess:()=>{(async()=>{l(await (0,n.modelCostMap)(t))})()},buttonText:"Reload Price Data",size:"middle",type:"primary",className:"w-full"})]})})};let l_={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var ly=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,globalRetryPolicy:r,setGlobalRetryPolicy:o,defaultRetry:n,modelGroupRetryPolicy:d,setModelGroupRetryPolicy:c,handleSaveRetrySettings:m}=e;return(0,s.jsxs)(H.Z,{children:[(0,s.jsx)("div",{className:"flex items-center gap-4 mb-6",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(i.Z,{children:"Retry Policy Scope:"}),(0,s.jsxs)(la.Z,{className:"ml-2 w-48",defaultValue:"global",value:"global"===l?"global":l||a[0],onValueChange:e=>t(e),children:[(0,s.jsx)(lr.Z,{value:"global",children:"Global Default"}),a.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>t(e),children:e},l))]})]})}),"global"===l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Y.Z,{children:"Global Retry Policy"}),(0,s.jsx)(i.Z,{className:"mb-6",children:"Default retry settings applied to all model groups unless overridden"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Y.Z,{children:["Retry Policy for ",l]}),(0,s.jsx)(i.Z,{className:"mb-6",children:"Model-specific retry settings. Falls back to global defaults if not set."})]}),l_&&(0,s.jsx)("table",{children:(0,s.jsx)("tbody",{children:Object.entries(l_).map((e,t)=>{var a,m,u,h;let x,[p,g]=e;if("global"===l)x=null!==(a=null==r?void 0:r[g])&&void 0!==a?a:n;else{let e=null==d?void 0:null===(m=d[l])||void 0===m?void 0:m[g];x=null!=e?e:null!==(u=null==r?void 0:r[g])&&void 0!==u?u:n}return(0,s.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)(i.Z,{children:p}),"global"!==l&&(0,s.jsxs)(i.Z,{className:"text-xs text-gray-500 ml-2",children:["(Global: ",null!==(h=null==r?void 0:r[g])&&void 0!==h?h:n,")"]})]}),(0,s.jsx)("td",{children:(0,s.jsx)(eg.Z,{className:"ml-5",value:x,min:0,step:1,onChange:e=>{"global"===l?o(l=>null==e?l:{...null!=l?l:{},[g]:e}):c(t=>{var s;let a=null!==(s=null==t?void 0:t[l])&&void 0!==s?s:{};return{...null!=t?t:{},[l]:{...a,[g]:e}}})}})})]},t)})})}),(0,s.jsx)(z.Z,{className:"mt-6 mr-8",onClick:m,children:"Save"})]})},lb=t(75105),lN=t(40278),lw=t(97765),lk=t(21626),lC=t(97214),lZ=t(28241),lS=t(58834),lA=t(69552),lI=t(71876),lE=t(39789),lP=t(79326),lM=t(2356),lF=t(59664),lT=e=>{let{modelMetrics:l,modelMetricsCategories:t,customTooltip:a,premiumUser:r}=e;return(0,s.jsx)(lF.Z,{title:"Time to First token (s)",className:"h-72",data:l,index:"date",showLegend:!1,categories:t,colors:["indigo","rose"],connectNulls:!0,customTooltip:a})},lL=e=>{let{setSelectedAPIKey:l,keys:t,teams:r,setSelectedCustomer:o,allEndUsers:n}=e,{premiumUser:d}=(0,ld.Z)(),[c,m]=(0,a.useState)(null);return(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"mb-1",children:"Select API Key Name"}),d?(0,s.jsxs)("div",{children:[(0,s.jsxs)(la.Z,{defaultValue:"all-keys",children:[(0,s.jsx)(lr.Z,{value:"all-keys",onClick:()=>{l(null)},children:"All Keys"},"all-keys"),null==t?void 0:t.map((e,t)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,s.jsx)(lr.Z,{value:String(t),onClick:()=>{l(e)},children:e.key_alias},t):null)]}),(0,s.jsx)(i.Z,{className:"mt-1",children:"Select Customer Name"}),(0,s.jsxs)(la.Z,{defaultValue:"all-customers",children:[(0,s.jsx)(lr.Z,{value:"all-customers",onClick:()=>{o(null)},children:"All Customers"},"all-customers"),null==n?void 0:n.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>{o(e)},children:e},l))]}),(0,s.jsx)(i.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==r?void 0:r.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)(i.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==r?void 0:r.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]})]})},lR=e=>{let{dateValue:l,setDateValue:t,selectedModelGroup:d,availableModelGroups:c,setShowAdvancedFilters:m,modelMetrics:u,modelMetricsCategories:h,streamingModelMetrics:x,streamingModelMetricsCategories:p,customTooltip:g,slowResponsesData:f,modelExceptions:j,globalExceptionData:v,allExceptions:_,globalExceptionPerDeployment:y,setSelectedAPIKey:b,keys:N,setSelectedCustomer:w,teams:k,allEndUsers:C,selectedAPIKey:Z,selectedCustomer:S,selectedTeam:A,setSelectedModelGroup:I,setModelMetrics:E,setModelMetricsCategories:P,setStreamingModelMetrics:M,setStreamingModelMetricsCategories:F,setSlowResponsesData:T,setModelExceptions:L,setAllExceptions:R,setGlobalExceptionData:O,setGlobalExceptionPerDeployment:D}=e,{accessToken:V,userId:q,userRole:W,premiumUser:$}=(0,ld.Z)();(0,a.useEffect)(()=>{Q(d,l.from,l.to)},[Z,S,A]);let Q=async(e,l,t)=>{if(console.log("Updating model metrics for group:",e),!V||!q||!W||!l||!t)return;console.log("inside updateModelMetrics - startTime:",l,"endTime:",t),I(e);let s=null==Z?void 0:Z.token;void 0===s&&(s=null);let a=S;void 0===a&&(a=null);try{let r=await (0,n.modelMetricsCall)(V,q,W,e,l.toISOString(),t.toISOString(),s,a);console.log("Model metrics response:",r),E(r.data),P(r.all_api_bases);let o=await (0,n.streamingModelMetricsCall)(V,e,l.toISOString(),t.toISOString());M(o.data),F(o.all_api_bases);let i=await (0,n.modelExceptionsCall)(V,q,W,e,l.toISOString(),t.toISOString(),s,a);console.log("Model exceptions response:",i),L(i.data),R(i.exception_types);let d=await (0,n.modelMetricsSlowResponsesCall)(V,q,W,e,l.toISOString(),t.toISOString(),s,a);if(console.log("slowResponses:",d),T(d),e){let s=await (0,n.adminGlobalActivityExceptions)(V,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);O(s);let a=await (0,n.adminGlobalActivityExceptionsPerDeployment)(V,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);D(a)}}catch(e){console.error("Failed to fetch model metrics",e)}};return(0,s.jsxs)(H.Z,{children:[(0,s.jsxs)(o.Z,{numItems:4,className:"mt-2 mb-2",children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(lE.Z,{value:l,className:"mr-2",onValueChange:e=>{t(e),Q(d,e.from,e.to)}})}),(0,s.jsxs)(r.Z,{className:"ml-2",children:[(0,s.jsx)(i.Z,{children:"Select Model Group"}),(0,s.jsx)(la.Z,{defaultValue:d||c[0],value:d||c[0],children:c.map((e,t)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>Q(e,l.from,l.to),children:e},t))})]}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(lP.Z,{trigger:"click",content:(0,s.jsx)(lL,{allEndUsers:C,keys:N,setSelectedAPIKey:b,setSelectedCustomer:w,teams:k}),overlayStyle:{width:"20vw"},children:(0,s.jsx)(z.Z,{icon:lM.Z,size:"md",variant:"secondary",className:"mt-4 ml-2",style:{border:"none"},onClick:()=>m(!0)})})})]}),(0,s.jsxs)(o.Z,{numItems:2,children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(B.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,s.jsxs)(U.Z,{children:[(0,s.jsxs)(G.Z,{variant:"line",defaultValue:"1",children:[(0,s.jsx)(K.Z,{value:"1",children:"Avg. Latency per Token"}),(0,s.jsx)(K.Z,{value:"2",children:"Time to first token"})]}),(0,s.jsxs)(J.Z,{children:[(0,s.jsxs)(H.Z,{children:[(0,s.jsx)("p",{className:"text-gray-500 italic",children:" (seconds/token)"}),(0,s.jsx)(i.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),u&&h&&(0,s.jsx)(lb.Z,{title:"Model Latency",className:"h-72",data:u,showLegend:!1,index:"date",categories:h,connectNulls:!0,customTooltip:g})]}),(0,s.jsx)(H.Z,{children:(0,s.jsx)(lT,{modelMetrics:x,modelMetricsCategories:p,customTooltip:g,premiumUser:$})})]})]})})}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(B.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,s.jsxs)(lk.Z,{children:[(0,s.jsx)(lS.Z,{children:(0,s.jsxs)(lI.Z,{children:[(0,s.jsx)(lA.Z,{children:"Deployment"}),(0,s.jsx)(lA.Z,{children:"Success Responses"}),(0,s.jsxs)(lA.Z,{children:["Slow Responses ",(0,s.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,s.jsx)(lC.Z,{children:f.map((e,l)=>(0,s.jsxs)(lI.Z,{children:[(0,s.jsx)(lZ.Z,{children:e.api_base}),(0,s.jsx)(lZ.Z,{children:e.total_count}),(0,s.jsx)(lZ.Z,{children:e.slow_count})]},l))})]})})})]}),(0,s.jsx)(o.Z,{numItems:1,className:"gap-2 w-full mt-2",children:(0,s.jsxs)(B.Z,{children:[(0,s.jsxs)(Y.Z,{children:["All Exceptions for ",d]}),(0,s.jsx)(lN.Z,{className:"h-60",data:j,index:"model",categories:_,stack:!0,yAxisWidth:30})]})}),(0,s.jsxs)(o.Z,{numItems:1,className:"gap-2 w-full mt-2",children:[(0,s.jsxs)(B.Z,{children:[(0,s.jsxs)(Y.Z,{children:["All Up Rate Limit Errors (429) for ",d]}),(0,s.jsxs)(o.Z,{numItems:1,children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(lw.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",v.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lN.Z,{className:"h-40",data:v.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]}),(0,s.jsx)(r.Z,{})]})]}),$?(0,s.jsx)(s.Fragment,{children:y.map((e,l)=>(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(Y.Z,{children:e.api_base?e.api_base:"Unknown API Base"}),(0,s.jsx)(o.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(lw.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors (429) ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lN.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]},l))}):(0,s.jsx)(s.Fragment,{children:y&&y.length>0&&y.slice(0,1).map((e,l)=>(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(Y.Z,{children:"✨ Rate Limit Errors by Deployment"}),(0,s.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see exceptions for all deployments"}),(0,s.jsx)(z.Z,{variant:"primary",className:"mb-2",children:(0,s.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,s.jsxs)(B.Z,{children:[(0,s.jsx)(Y.Z,{children:e.api_base}),(0,s.jsx)(o.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(lw.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lN.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]})]},l))})]})]})},lO=e=>{let{accessToken:l,token:t,userRole:m,userID:h,modelData:x={data:[]},keys:p,setModelData:j,premiumUser:v,teams:_}=e,[y]=f.Z.useForm(),[b,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(""),[C,Z]=(0,a.useState)([]),[S,A]=(0,a.useState)([]),[I,E]=(0,a.useState)(d.Cl.OpenAI),[P,M]=(0,a.useState)(!1),[F,T]=(0,a.useState)(null),[L,z]=(0,a.useState)([]),[B,K]=(0,a.useState)([]),[U,G]=(0,a.useState)(null),[H,J]=(0,a.useState)([]),[W,Y]=(0,a.useState)([]),[$,Q]=(0,a.useState)([]),[X,ee]=(0,a.useState)([]),[el,et]=(0,a.useState)([]),[es,ea]=(0,a.useState)([]),[er,eo]=(0,a.useState)([]),[ei,en]=(0,a.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[ed,ec]=(0,a.useState)(null),[em,eu]=(0,a.useState)(null),[eh,ex]=(0,a.useState)(0),[ep,eg]=(0,a.useState)({}),[ef,ej]=(0,a.useState)([]),[ev,e_]=(0,a.useState)(!1),[ey,eb]=(0,a.useState)(null),[eN,ek]=(0,a.useState)(null),[eC,eZ]=(0,a.useState)([]),[eS,eA]=(0,a.useState)([]),[eI,eE]=(0,a.useState)({}),[eP,eM]=(0,a.useState)(!1),[eF,eT]=(0,a.useState)(null),[eL,eR]=(0,a.useState)(!1),[eO,eD]=(0,a.useState)(null),[eV,eq]=(0,a.useState)(null),[ez,eB]=(0,a.useState)(!1),eK=(0,a.useRef)(null),[eG,eH]=(0,a.useState)(0),eJ=async e=>{try{let l=await (0,n.credentialListCall)(e);console.log("credentials: ".concat(JSON.stringify(l))),eA(l.credentials)}catch(e){console.error("Error fetching credentials:",e)}};(0,a.useEffect)(()=>{let e=e=>{eK.current&&!eK.current.contains(e.target)&&eB(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let eW={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;console.log("Resetting vertex_credentials to JSON; jsonStr: ".concat(l)),y.setFieldsValue({vertex_credentials:l}),console.log("Form values right after setting:",y.getFieldsValue())}},l.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered with values:",e),console.log("Current form values:",y.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?c.Z.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&c.Z.fromBackend("".concat(e.file.name," file upload failed."))}},eY=()=>{k(new Date().toLocaleString())},e$=async()=>{if(!l){console.error("Access token is missing");return}try{let e={router_settings:{}};"global"===U?(console.log("Saving global retry policy:",em),em&&(e.router_settings.retry_policy=em),c.Z.success("Global retry settings saved successfully")):(console.log("Saving model group retry policy for",U,":",ed),ed&&(e.router_settings.model_group_retry_policy=ed),c.Z.success("Retry settings saved successfully for ".concat(U))),await (0,n.setCallbacksCall)(l,e)}catch(e){console.error("Failed to save retry settings:",e),c.Z.fromBackend("Failed to save retry settings")}};if((0,a.useEffect)(()=>{if(!l||!t||!m||!h)return;let e=async()=>{try{var e,t,s,a,r,o,i,d,c,u,x,p;let g=await (0,n.modelInfoCall)(l,h,m);console.log("Model data response:",g.data),j(g);let f=await (0,n.modelSettingsCall)(l);f&&A(f);let v=new Set;for(let e=0;e0&&(b=_[_.length-1],console.log("_initial_model_group:",b)),console.log("selectedModelGroup:",U);let N=await (0,n.modelMetricsCall)(l,h,m,b,null===(e=ei.from)||void 0===e?void 0:e.toISOString(),null===(t=ei.to)||void 0===t?void 0:t.toISOString(),null==ey?void 0:ey.token,eN);console.log("Model metrics response:",N),J(N.data),Y(N.all_api_bases);let w=await (0,n.streamingModelMetricsCall)(l,b,null===(s=ei.from)||void 0===s?void 0:s.toISOString(),null===(a=ei.to)||void 0===a?void 0:a.toISOString());Q(w.data),ee(w.all_api_bases);let k=await (0,n.modelExceptionsCall)(l,h,m,b,null===(r=ei.from)||void 0===r?void 0:r.toISOString(),null===(o=ei.to)||void 0===o?void 0:o.toISOString(),null==ey?void 0:ey.token,eN);console.log("Model exceptions response:",k),et(k.data),ea(k.exception_types);let C=await (0,n.modelMetricsSlowResponsesCall)(l,h,m,b,null===(i=ei.from)||void 0===i?void 0:i.toISOString(),null===(d=ei.to)||void 0===d?void 0:d.toISOString(),null==ey?void 0:ey.token,eN),Z=await (0,n.adminGlobalActivityExceptions)(l,null===(c=ei.from)||void 0===c?void 0:c.toISOString().split("T")[0],null===(u=ei.to)||void 0===u?void 0:u.toISOString().split("T")[0],b);eg(Z);let S=await (0,n.adminGlobalActivityExceptionsPerDeployment)(l,null===(x=ei.from)||void 0===x?void 0:x.toISOString().split("T")[0],null===(p=ei.to)||void 0===p?void 0:p.toISOString().split("T")[0],b);ej(S),console.log("dailyExceptions:",Z),console.log("dailyExceptionsPerDeplyment:",S),console.log("slowResponses:",C),eo(C);let I=await (0,n.allEndUsersCall)(l);eZ(null==I?void 0:I.map(e=>e.user_id));let E=(await (0,n.getCallbacksCall)(l,h,m)).router_settings;console.log("routerSettingsInfo:",E);let P=E.model_group_retry_policy,M=E.num_retries;console.log("model_group_retry_policy:",P),console.log("default_retries:",M),ec(P),eu(E.retry_policy),ex(M);let F=E.model_group_alias||{};eE(F)}catch(e){console.error("There was an error fetching the model data",e)}};l&&t&&m&&h&&e();let s=async()=>{let e=await (0,n.modelCostMap)(l);console.log("received model cost map data: ".concat(Object.keys(e))),N(e)};null==b&&s(),eY()},[l,t,m,h,b,w,eV]),!x||!l||!t||!m||!h)return(0,s.jsx)("div",{children:"Loading..."});let eX=[],e0=[];for(let e=0;e(console.log("GET PROVIDER CALLED! - ".concat(b)),null!=b&&"object"==typeof b&&e in b)?b[e].litellm_provider:"openai";if(t){let e=t.split("/"),l=e[0];(r=s)||(r=1===e.length?m(t):l)}else r="-";a&&(o=null==a?void 0:a.input_cost_per_token,i=null==a?void 0:a.output_cost_per_token,n=null==a?void 0:a.max_tokens,d=null==a?void 0:a.max_input_tokens),(null==l?void 0:l.litellm_params)&&(c=Object.fromEntries(Object.entries(null==l?void 0:l.litellm_params).filter(e=>{let[l]=e;return"model"!==l&&"api_base"!==l}))),x.data[e].provider=r,x.data[e].input_cost=o,x.data[e].output_cost=i,x.data[e].litellm_model_name=t,e0.push(r),x.data[e].input_cost&&(x.data[e].input_cost=(1e6*Number(x.data[e].input_cost)).toFixed(2)),x.data[e].output_cost&&(x.data[e].output_cost=(1e6*Number(x.data[e].output_cost)).toFixed(2)),x.data[e].max_tokens=n,x.data[e].max_input_tokens=d,x.data[e].api_base=null==l?void 0:null===(e4=l.litellm_params)||void 0===e4?void 0:e4.api_base,x.data[e].cleanedLitellmParams=c,eX.push(l.model_name),console.log(x.data[e])}if(m&&"Admin Viewer"==m){let{Title:e,Paragraph:l}=g.default;return(0,s.jsxs)("div",{children:[(0,s.jsx)(e,{level:1,children:"Access Denied"}),(0,s.jsx)(l,{children:"Ask your proxy admin for access to view all models"})]})}return(console.log("selectedProvider: ".concat(I)),console.log("providerModels.length: ".concat(C.length)),Object.keys(d.Cl).find(e=>d.Cl[e]===I),eO)?(0,s.jsx)("div",{className:"w-full h-full",children:(0,s.jsx)(q.Z,{teamId:eO,onClose:()=>eD(null),accessToken:l,is_team_admin:"Admin"===m,is_proxy_admin:"Proxy Admin"===m,userModels:eX,editTeam:!1,onUpdate:eY})}):(0,s.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,s.jsx)(o.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,s.jsxs)(r.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Model Management"}),eU.ZL.includes(m)?(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add and manage models for the proxy"}):(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add models for teams you are an admin for."})]})}),eF?(0,s.jsx)(ew,{modelId:eF,editModel:!0,onClose:()=>{eT(null),eR(!1)},modelData:x.data.find(e=>e.model_info.id===eF),accessToken:l,userID:h,userRole:m,setEditModalVisible:M,setSelectedModel:T,onModelUpdate:e=>{j({...x,data:x.data.map(l=>l.model_info.id===e.model_info.id?e:l)}),eY()},modelAccessGroups:B}):(0,s.jsxs)(D.v0,{index:eG,onIndexChange:eH,className:"gap-2 h-[75vh] w-full ",children:[(0,s.jsxs)(D.td,{className:"flex justify-between mt-2 w-full items-center",children:[(0,s.jsxs)("div",{className:"flex",children:[eU.ZL.includes(m)?(0,s.jsx)(D.OK,{children:"All Models"}):(0,s.jsx)(D.OK,{children:"Your Models"}),(0,s.jsx)(D.OK,{children:"Add Model"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"LLM Credentials"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Pass-Through Endpoints"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Health Status"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Model Analytics"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Model Retry Settings"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Model Group Alias"}),eU.ZL.includes(m)&&(0,s.jsx)(D.OK,{children:"Price Data Reload"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[w&&(0,s.jsxs)(i.Z,{children:["Last Refreshed: ",w]}),(0,s.jsx)(D.JO,{icon:V.Z,variant:"shadow",size:"xs",className:"self-center",onClick:eY})]})]}),(0,s.jsxs)(D.nP,{children:[(0,s.jsx)(lc,{selectedModelGroup:U,setSelectedModelGroup:G,availableModelGroups:L,availableModelAccessGroups:B,setSelectedModelId:eT,setSelectedTeamId:eD,setEditModel:eR,modelData:x}),(0,s.jsx)(D.x4,{className:"h-full",children:(0,s.jsx)(eQ,{form:y,handleOk:()=>{console.log("\uD83D\uDE80 handleOk called from model dashboard!"),console.log("Current form values:",y.getFieldsValue()),y.validateFields().then(e=>{console.log("✅ Validation passed, submitting:",e),u(e,l,y,eY)}).catch(e=>{var l;console.error("❌ Validation failed:",e),console.error("Form errors:",e.errorFields);let t=(null===(l=e.errorFields)||void 0===l?void 0:l.map(e=>"".concat(e.name.join("."),": ").concat(e.errors.join(", "))).join(" | "))||"Unknown validation error";c.Z.fromBackend("Please fill in the following required fields: ".concat(t))})},selectedProvider:I,setSelectedProvider:E,providerModels:C,setProviderModelsFn:e=>{let l=(0,d.bK)(e,b);Z(l),console.log("providerModels: ".concat(l))},getPlaceholder:d.ph,uploadProps:eW,showAdvancedSettings:eP,setShowAdvancedSettings:eM,teams:_,credentials:eS,accessToken:l,userRole:m,premiumUser:v})}),(0,s.jsx)(D.x4,{children:(0,s.jsx)(R,{accessToken:l,uploadProps:eW,credentialList:eS,fetchCredentials:eJ})}),(0,s.jsx)(D.x4,{children:(0,s.jsx)(e8.Z,{accessToken:l,userRole:m,userID:h,modelData:x})}),(0,s.jsx)(D.x4,{children:(0,s.jsx)(e3,{accessToken:l,modelData:x,all_models_on_proxy:eX,getDisplayModelName:O,setSelectedModelId:eT})}),(0,s.jsx)(lR,{dateValue:ei,setDateValue:en,selectedModelGroup:U,availableModelGroups:L,setShowAdvancedFilters:e_,modelMetrics:H,modelMetricsCategories:W,streamingModelMetrics:$,streamingModelMetricsCategories:X,customTooltip:e=>{var l,t;let{payload:a,active:r}=e;if(!r||!a)return null;let o=null===(t=a[0])||void 0===t?void 0:null===(l=t.payload)||void 0===l?void 0:l.date,i=a.sort((e,l)=>l.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:a.slice(5).reduce((e,l)=>e+l.value,0),color:"gray"})}return(0,s.jsxs)("div",{className:"w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[o&&(0,s.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",o]}),i.map((e,l)=>{let t=parseFloat(e.value.toFixed(5)),a=0===t&&e.value>0?"<0.00001":t.toFixed(5);return(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,s.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,s.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:a})]},l)})]})},slowResponsesData:er,modelExceptions:el,globalExceptionData:ep,allExceptions:es,globalExceptionPerDeployment:ef,allEndUsers:eC,keys:p,setSelectedAPIKey:eb,setSelectedCustomer:ek,teams:_,selectedAPIKey:ey,selectedCustomer:eN,selectedTeam:eV,setAllExceptions:ea,setGlobalExceptionData:eg,setGlobalExceptionPerDeployment:ej,setModelExceptions:et,setModelMetrics:J,setModelMetricsCategories:Y,setSelectedModelGroup:G,setSlowResponsesData:eo,setStreamingModelMetrics:Q,setStreamingModelMetricsCategories:ee}),(0,s.jsx)(ly,{selectedModelGroup:U,setSelectedModelGroup:G,availableModelGroups:L,globalRetryPolicy:em,setGlobalRetryPolicy:eu,defaultRetry:eh,modelGroupRetryPolicy:ed,setModelGroupRetryPolicy:ec,handleSaveRetrySettings:e$}),(0,s.jsx)(D.x4,{children:(0,s.jsx)(ls,{accessToken:l,initialModelGroupAlias:eI,onAliasUpdate:eE})}),(0,s.jsx)(lv,{setModelMap:N})]})]})]})})})}},10607:function(e,l,t){t.d(l,{Z:function(){return U}});var s=t(57437),a=t(2265),r=t(20831),o=t(47323),i=t(84264),n=t(96761),d=t(19250),c=t(89970),m=t(53410),u=t(74998),h=t(92858),x=t(49566),p=t(12514),g=t(97765),f=t(52787),j=t(13634),v=t(82680),_=t(61778),y=t(24199),b=t(12660),N=t(15424),w=t(93142),k=t(73002),C=t(45246),Z=t(96473),S=t(31283),A=e=>{let{value:l={},onChange:t}=e,[r,o]=(0,a.useState)(Object.entries(l)),i=e=>{let l=r.filter((l,t)=>t!==e);o(l),null==t||t(Object.fromEntries(l))},n=(e,l,s)=>{let a=[...r];a[e]=[l,s],o(a),null==t||t(Object.fromEntries(a))};return(0,s.jsxs)("div",{children:[r.map((e,l)=>{let[t,a]=e;return(0,s.jsxs)(w.Z,{style:{display:"flex",marginBottom:8},align:"center",children:[(0,s.jsx)(S.o,{placeholder:"Header Name",value:t,onChange:e=>n(l,e.target.value,a)}),(0,s.jsx)(S.o,{placeholder:"Header Value",value:a,onChange:e=>n(l,t,e.target.value)}),(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,s.jsx)(C.Z,{onClick:()=>i(l),style:{cursor:"pointer"}})})]},l)}),(0,s.jsx)(k.ZP,{type:"dashed",onClick:()=>{o([...r,["",""]])},icon:(0,s.jsx)(Z.Z,{}),children:"Add Header"})]})},I=t(77565),E=e=>{let{pathValue:l,targetValue:t,includeSubpath:a}=e,r=(0,d.getProxyBaseUrl)();return l&&t?(0,s.jsxs)(p.Z,{className:"p-5",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Preview"}),(0,s.jsx)(g.Z,{className:"text-gray-600 mb-5",children:"How your requests will be routed"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"Basic routing:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:l?"".concat(r).concat(l):""})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(I.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:t})]})]})]}),a&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"With subpaths:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint + subpath"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[l&&"".concat(r).concat(l),(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(I.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[t,(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]})]}),(0,s.jsxs)("div",{className:"mt-3 text-sm text-gray-600",children:["Any path after ",l," will be appended to the target URL"]})]})}),!a&&(0,s.jsx)("div",{className:"mt-4 p-3 bg-blue-50 rounded-md border border-blue-200",children:(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)(N.Z,{className:"text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),(0,s.jsxs)("div",{className:"text-sm text-blue-700",children:[(0,s.jsx)("span",{className:"font-medium",children:"Not seeing the routing you wanted?"})," Try enabling - Include Subpaths - above - this allows subroutes like"," ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded font-mono text-xs",children:"/api/v1/models"})," to be forwarded automatically."]})]})})]})]}):null},P=t(9114);let{Option:M}=f.default;var F=e=>{let{accessToken:l,setPassThroughItems:t,passThroughItems:o}=e,[i]=j.Z.useForm(),[m,u]=(0,a.useState)(!1),[f,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(""),[Z,S]=(0,a.useState)(""),[I,M]=(0,a.useState)(""),[F,T]=(0,a.useState)(!0),L=()=>{i.resetFields(),S(""),M(""),T(!0),u(!1)},R=e=>{let l=e;e&&!e.startsWith("/")&&(l="/"+e),S(l),i.setFieldsValue({path:l})},O=async e=>{console.log("addPassThrough called with:",e),w(!0);try{console.log("formValues: ".concat(JSON.stringify(e)));let s=(await (0,d.createPassThroughEndpoint)(l,e)).endpoints[0],a=[...o,s];t(a),P.Z.success("Pass-through endpoint created successfully"),i.resetFields(),S(""),M(""),T(!0),u(!1)}catch(e){P.Z.fromBackend("Error creating pass-through endpoint: "+e)}finally{w(!1)}};return(0,s.jsxs)("div",{children:[(0,s.jsx)(r.Z,{className:"mx-auto mb-4 mt-4",onClick:()=>u(!0),children:"+ Add Pass-Through Endpoint"}),(0,s.jsx)(v.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,s.jsx)(b.Z,{className:"text-xl text-blue-500"}),(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Pass-Through Endpoint"})]}),open:m,width:1e3,onCancel:L,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)(_.Z,{message:"What is a Pass-Through Endpoint?",description:"Route requests from your LiteLLM proxy to any external API. Perfect for custom models, image generation APIs, or any service you want to proxy through LiteLLM.",type:"info",showIcon:!0,className:"mb-6"}),(0,s.jsxs)(j.Z,{form:i,onFinish:O,layout:"vertical",className:"space-y-6",initialValues:{include_subpath:!0,path:Z,target:I},children:[(0,s.jsxs)(p.Z,{className:"p-5",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Configuration"}),(0,s.jsx)(g.Z,{className:"text-gray-600 mb-5",children:"Configure how requests to your domain will be forwarded to the target API"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)(j.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Path Prefix"}),name:"path",rules:[{required:!0,message:"Path is required",pattern:/^\//}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example: /bria, /adobe-photoshop, /elasticsearch"}),className:"mb-4",children:(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(x.Z,{placeholder:"bria",value:Z,onChange:e=>R(e.target.value),className:"flex-1"})})}),(0,s.jsx)(j.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Target URL"}),name:"target",rules:[{required:!0,message:"Target URL is required"},{type:"url",message:"Please enter a valid URL"}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example:https://engine.prod.bria-api.com"}),className:"mb-4",children:(0,s.jsx)(x.Z,{placeholder:"https://engine.prod.bria-api.com",value:I,onChange:e=>{M(e.target.value),i.setFieldsValue({target:e.target.value})}})}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Include Subpaths"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Forward all subpaths to the target API (recommended for REST APIs)"})]}),(0,s.jsx)(j.Z.Item,{name:"include_subpath",valuePropName:"checked",className:"mb-0",children:(0,s.jsx)(h.Z,{checked:F,onChange:T})})]})]})]}),(0,s.jsx)(E,{pathValue:Z,targetValue:I,includeSubpath:F}),(0,s.jsxs)(p.Z,{className:"p-6",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Headers"}),(0,s.jsx)(g.Z,{className:"text-gray-600 mb-6",children:"Add headers that will be sent with every request to the target API"}),(0,s.jsx)(j.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Headers",(0,s.jsx)(c.Z,{title:"Authentication and other headers to forward with requests",children:(0,s.jsx)(N.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"headers",rules:[{required:!0,message:"Please configure the headers"}],extra:(0,s.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Add authentication tokens and other required headers"}),(0,s.jsx)("div",{children:"Common examples: auth_token, Authorization, x-api-key"})]}),children:(0,s.jsx)(A,{})})]}),(0,s.jsxs)(p.Z,{className:"p-6",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Billing"}),(0,s.jsx)(g.Z,{className:"text-gray-600 mb-6",children:"Optional cost tracking for this endpoint"}),(0,s.jsx)(j.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Cost Per Request (USD)",(0,s.jsx)(c.Z,{title:"Optional: Track costs for requests to this endpoint",children:(0,s.jsx)(N.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"cost_per_request",extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"The cost charged for each request through this endpoint"}),children:(0,s.jsx)(y.Z,{min:0,step:.001,precision:4,placeholder:"2.0000",size:"large"})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,s.jsx)(r.Z,{variant:"secondary",onClick:L,children:"Cancel"}),(0,s.jsx)(r.Z,{variant:"primary",loading:f,onClick:()=>{console.log("Submit button clicked"),i.submit()},children:f?"Creating...":"Add Pass-Through Endpoint"})]})]})]})})]})},T=t(30078),L=t(64482),R=t(63709),O=t(20577),D=t(87769),V=t(42208);let q=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),o=JSON.stringify(l,null,2);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("pre",{className:"font-mono text-xs bg-gray-50 p-2 rounded max-w-md overflow-auto",children:t?o:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(D.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(V.Z,{className:"w-4 h-4 text-gray-500"})})]})};var z=e=>{let{endpointData:l,onClose:t,accessToken:r,isAdmin:o,onEndpointUpdated:i}=e,[n,c]=(0,a.useState)(l),[m,u]=(0,a.useState)(!1),[h,x]=(0,a.useState)(!1),[p]=j.Z.useForm(),g=async e=>{try{if(!r||!(null==n?void 0:n.id))return;let l={};if(e.headers)try{l="string"==typeof e.headers?JSON.parse(e.headers):e.headers}catch(e){P.Z.fromBackend("Invalid JSON format for headers");return}let t={path:n.path,target:e.target,headers:l,include_subpath:e.include_subpath,cost_per_request:e.cost_per_request};await (0,d.updatePassThroughEndpoint)(r,n.id,t),c({...n,...t}),x(!1),i&&i()}catch(e){console.error("Error updating endpoint:",e),P.Z.fromBackend("Failed to update pass through endpoint")}},f=async()=>{try{if(!r||!(null==n?void 0:n.id))return;await (0,d.deletePassThroughEndpointsCall)(r,n.id),P.Z.success("Pass through endpoint deleted successfully"),t(),i&&i()}catch(e){console.error("Error deleting endpoint:",e),P.Z.fromBackend("Failed to delete pass through endpoint")}};return m?(0,s.jsx)("div",{className:"p-4",children:"Loading..."}):n?(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(k.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,s.jsxs)(T.Dx,{children:["Pass Through Endpoint: ",n.path]}),(0,s.jsx)(T.xv,{className:"text-gray-500 font-mono",children:n.id})]})}),(0,s.jsxs)(T.v0,{children:[(0,s.jsxs)(T.td,{className:"mb-4",children:[(0,s.jsx)(T.OK,{children:"Overview"},"overview"),o?(0,s.jsx)(T.OK,{children:"Settings"},"settings"):(0,s.jsx)(s.Fragment,{})]}),(0,s.jsxs)(T.nP,{children:[(0,s.jsxs)(T.x4,{children:[(0,s.jsxs)(T.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(T.Zb,{children:[(0,s.jsx)(T.xv,{children:"Path"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(T.Dx,{className:"font-mono",children:n.path})})]}),(0,s.jsxs)(T.Zb,{children:[(0,s.jsx)(T.xv,{children:"Target"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(T.Dx,{children:n.target})})]}),(0,s.jsxs)(T.Zb,{children:[(0,s.jsx)(T.xv,{children:"Configuration"}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)(T.Ct,{color:n.include_subpath?"green":"gray",children:n.include_subpath?"Include Subpath":"Exact Path"})}),void 0!==n.cost_per_request&&(0,s.jsx)("div",{children:(0,s.jsxs)(T.xv,{children:["Cost per request: $",n.cost_per_request]})})]})]})]}),(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(E,{pathValue:n.path,targetValue:n.target,includeSubpath:n.include_subpath||!1})}),n.headers&&Object.keys(n.headers).length>0&&(0,s.jsxs)(T.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Headers"}),(0,s.jsxs)(T.Ct,{color:"blue",children:[Object.keys(n.headers).length," headers configured"]})]}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(q,{value:n.headers})})]})]}),o&&(0,s.jsx)(T.x4,{children:(0,s.jsxs)(T.Zb,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(T.Dx,{children:"Pass Through Endpoint Settings"}),(0,s.jsx)("div",{className:"space-x-2",children:!h&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(T.zx,{onClick:()=>x(!0),children:"Edit Settings"}),(0,s.jsx)(T.zx,{onClick:f,variant:"secondary",color:"red",children:"Delete Endpoint"})]})})]}),h?(0,s.jsxs)(j.Z,{form:p,onFinish:g,initialValues:{target:n.target,headers:n.headers?JSON.stringify(n.headers,null,2):"",include_subpath:n.include_subpath||!1,cost_per_request:n.cost_per_request},layout:"vertical",children:[(0,s.jsx)(j.Z.Item,{label:"Target URL",name:"target",rules:[{required:!0,message:"Please input a target URL"}],children:(0,s.jsx)(T.oi,{placeholder:"https://api.example.com"})}),(0,s.jsx)(j.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,s.jsx)(L.default.TextArea,{rows:5,placeholder:'{"Authorization": "Bearer your-token", "Content-Type": "application/json"}'})}),(0,s.jsx)(j.Z.Item,{label:"Include Subpath",name:"include_subpath",valuePropName:"checked",children:(0,s.jsx)(R.Z,{})}),(0,s.jsx)(j.Z.Item,{label:"Cost per Request",name:"cost_per_request",children:(0,s.jsx)(O.Z,{min:0,step:.01,precision:2,placeholder:"0.00",addonBefore:"$"})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,s.jsx)(k.ZP,{onClick:()=>x(!1),children:"Cancel"}),(0,s.jsx)(T.zx,{children:"Save Changes"})]})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Path"}),(0,s.jsx)("div",{className:"font-mono",children:n.path})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Target URL"}),(0,s.jsx)("div",{children:n.target})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Include Subpath"}),(0,s.jsx)(T.Ct,{color:n.include_subpath?"green":"gray",children:n.include_subpath?"Yes":"No"})]}),void 0!==n.cost_per_request&&(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Cost per Request"}),(0,s.jsxs)("div",{children:["$",n.cost_per_request]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(T.xv,{className:"font-medium",children:"Headers"}),n.headers&&Object.keys(n.headers).length>0?(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(q,{value:n.headers})}):(0,s.jsx)("div",{className:"text-gray-500",children:"No headers configured"})]})]})]})})]})]})]}):(0,s.jsx)("div",{className:"p-4",children:"Pass through endpoint not found"})},B=t(12322);let K=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),o=JSON.stringify(l);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{className:"font-mono text-xs",children:t?o:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(D.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(V.Z,{className:"w-4 h-4 text-gray-500"})})]})};var U=e=>{let{accessToken:l,userRole:t,userID:h,modelData:x}=e,[p,g]=(0,a.useState)([]),[f,j]=(0,a.useState)(null),[v,_]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{l&&t&&h&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{g(e.endpoints)})},[l,t,h]);let N=async e=>{b(e),_(!0)},w=async()=>{if(null!=y&&l){try{await (0,d.deletePassThroughEndpointsCall)(l,y);let e=p.filter(e=>e.id!==y);g(e),P.Z.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),P.Z.fromBackend("Error deleting the endpoint: "+e)}_(!1),b(null)}},k=(e,l)=>{N(e)},C=[{header:"ID",accessorKey:"id",cell:e=>(0,s.jsx)(c.Z,{title:e.row.original.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>e.row.original.id&&j(e.row.original.id),children:e.row.original.id})})},{header:"Path",accessorKey:"path"},{header:"Target",accessorKey:"target",cell:e=>(0,s.jsx)(i.Z,{children:e.getValue()})},{header:"Headers",accessorKey:"headers",cell:e=>(0,s.jsx)(K,{value:e.getValue()||{}})},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e;return(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)(o.Z,{icon:m.Z,size:"sm",onClick:()=>l.original.id&&j(l.original.id),title:"Edit"}),(0,s.jsx)(o.Z,{icon:u.Z,size:"sm",onClick:()=>k(l.original.id,l.index),title:"Delete"})]})}}];if(!l)return null;if(f){console.log("selectedEndpointId",f),console.log("generalSettings",p);let e=p.find(e=>e.id===f);return e?(0,s.jsx)(z,{endpointData:e,onClose:()=>j(null),accessToken:l,isAdmin:"Admin"===t||"admin"===t,onEndpointUpdated:()=>{l&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{g(e.endpoints)})}}):(0,s.jsx)("div",{children:"Endpoint not found"})}return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{children:"Pass Through Endpoints"}),(0,s.jsx)(i.Z,{className:"text-tremor-content",children:"Configure and manage your pass-through endpoints"})]}),(0,s.jsx)(F,{accessToken:l,setPassThroughItems:g,passThroughItems:p}),(0,s.jsx)(B.w,{data:p,columns:C,renderSubComponent:()=>(0,s.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:!1,noDataMessage:"No pass-through endpoints configured"}),v&&(0,s.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,s.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,s.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,s.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,s.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,s.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,s.jsx)("div",{className:"sm:flex sm:items-start",children:(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Pass-Through Endpoint"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this pass-through endpoint? This action cannot be undone."})})]})})}),(0,s.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)(r.Z,{onClick:w,color:"red",className:"ml-2",children:"Delete"}),(0,s.jsx)(r.Z,{onClick:()=>{_(!1),b(null)},children:"Cancel"})]})]})]})})]})}},39789:function(e,l,t){t.d(l,{Z:function(){return i}});var s=t(57437),a=t(2265),r=t(21487),o=t(84264),i=e=>{let{value:l,onValueChange:t,label:i="Select Time Range",className:n="",showTimeRange:d=!0}=e,[c,m]=(0,a.useState)(!1),u=(0,a.useRef)(null),h=(0,a.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),t(e),requestIdleCallback(()=>{if(e.from){let l;let s={...e},a=new Date(e.from);l=new Date(e.to?e.to:e.from),a.toDateString(),l.toDateString(),a.setHours(0,0,0,0),l.setHours(23,59,59,999),s.from=a,s.to=l,t(s)}},{timeout:100})},[t]),x=(0,a.useCallback)((e,l)=>{if(!e||!l)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==l.toDateString())return"".concat(t(e)," - ").concat(t(l));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),s=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=l.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(s," - ").concat(a)}},[]);return(0,s.jsxs)("div",{className:n,children:[i&&(0,s.jsx)(o.Z,{className:"mb-2",children:i}),(0,s.jsxs)("div",{className:"relative w-fit",children:[(0,s.jsx)("div",{ref:u,children:(0,s.jsx)(r.Z,{enableSelect:!0,value:l,onValueChange:h,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,s.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,s.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,s.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,s.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),d&&l.from&&l.to&&(0,s.jsx)(o.Z,{className:"mt-2 text-xs text-gray-500",children:x(l.from,l.to)})]})}},12322:function(e,l,t){t.d(l,{w:function(){return n}});var s=t(57437),a=t(2265),r=t(71594),o=t(24525),i=t(19130);function n(e){let{data:l=[],columns:t,getRowCanExpand:n,renderSubComponent:d,isLoading:c=!1,loadingMessage:m="\uD83D\uDE85 Loading logs...",noDataMessage:u="No logs found"}=e,h=(0,r.b7)({data:l,columns:t,getRowCanExpand:n,getRowId:(e,l)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(l)},getCoreRowModel:(0,o.sC)(),getExpandedRowModel:(0,o.rV)()});return(0,s.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,s.jsxs)(i.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,s.jsx)(i.ss,{children:h.getHeaderGroups().map(e=>(0,s.jsx)(i.SC,{children:e.headers.map(e=>(0,s.jsx)(i.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,r.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,s.jsx)(i.RM,{children:c?(0,s.jsx)(i.SC,{children:(0,s.jsx)(i.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:m})})})}):h.getRowModel().rows.length>0?h.getRowModel().rows.map(e=>(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(i.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,s.jsx)(i.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,r.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,s.jsx)(i.SC,{children:(0,s.jsx)(i.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,s.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:d({row:e})})})})]},e.id)):(0,s.jsx)(i.SC,{children:(0,s.jsx)(i.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:u})})})})})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8160-292eaad6e0da51a9.js b/litellm/proxy/_experimental/out/_next/static/chunks/8160-292eaad6e0da51a9.js new file mode 100644 index 0000000000..42fe43562c --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/8160-292eaad6e0da51a9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8160],{18160:function(e,s,l){l.d(s,{Z:function(){return B}});var t=l(57437),a=l(2265),r=l(99376),i=l(19250),n=l(8048),c=l(41649),o=l(20831),d=l(84264),m=l(89970),x=l(3810),u=l(23639),p=l(15424);let h=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),g=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),j=e=>"$".concat((1e6*e).toFixed(2)),b=e=>e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),y=function(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(d.Z,{className:"font-medium text-sm",children:a.model_group}),(0,t.jsx)(m.Z,{title:"Copy model name",children:(0,t.jsx)(u.Z,{onClick:()=>s(a.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(d.Z,{className:"text-xs text-gray-600",children:a.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,s)=>{let l=e.original.providers.join(", "),t=s.original.providers.join(", ");return l.localeCompare(t)},cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,t.jsx)(x.Z,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,t.jsxs)(d.Z,{className:"text-xs text-gray-500",children:["+",l.providers.length-2]})]})},meta:{className:"hidden md:table-cell"}},{header:"Mode",accessorKey:"mode",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return l.mode?(0,t.jsx)(c.Z,{color:"green",size:"sm",children:l.mode}):(0,t.jsx)(d.Z,{className:"text-gray-500",children:"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Tokens",accessorKey:"max_input_tokens",enableSorting:!0,sortingFn:(e,s)=>(e.original.max_input_tokens||0)+(e.original.max_output_tokens||0)-((s.original.max_input_tokens||0)+(s.original.max_output_tokens||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsxs)(d.Z,{className:"text-xs",children:[l.max_input_tokens?b(l.max_input_tokens):"-"," /"," ",l.max_output_tokens?b(l.max_output_tokens):"-"]})})},meta:{className:"hidden lg:table-cell"}},{header:"Cost/1M",accessorKey:"input_cost_per_token",enableSorting:!0,sortingFn:(e,s)=>(e.original.input_cost_per_token||0)+(e.original.output_cost_per_token||0)-((s.original.input_cost_per_token||0)+(s.original.output_cost_per_token||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(d.Z,{className:"text-xs",children:l.input_cost_per_token?j(l.input_cost_per_token):"-"}),(0,t.jsx)(d.Z,{className:"text-xs text-gray-500",children:l.output_cost_per_token?j(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=g(s.original),a=["green","blue","purple","orange","red","yellow"];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(d.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,s)=>(0,t.jsx)(c.Z,{color:a[s%a.length],size:"xs",children:h(e)},e))})}},{header:"Public",accessorKey:"is_public_model_group",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public_model_group?1:0)-(!0===s.original.is_public_model_group?1:0),cell:e=>{let{row:s}=e;return!0===s.original.is_public_model_group?(0,t.jsx)(c.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(c.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,a=l.original;return(0,t.jsxs)(o.Z,{size:"xs",variant:"secondary",onClick:()=>e(a),icon:p.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return l?a.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):a};var N=l(72162),v=l(91810),f=l(13634),_=l(4156),k=l(73002),Z=l(82680),w=l(96761),C=l(12514),S=e=>{let{modelHubData:s,onFilteredDataChange:l,showFiltersCard:r=!0,className:i=""}=e,[n,c]=(0,a.useState)(""),[o,m]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),[p,h]=(0,a.useState)(""),g=(0,a.useRef)([]),j=(0,a.useMemo)(()=>(null==s?void 0:s.filter(e=>{let s=e.model_group.toLowerCase().includes(n.toLowerCase()),l=""===o||e.providers.includes(o),t=""===x||e.mode===x,a=""===p||Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).some(e=>{let[s]=e;return s.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")===p});return s&&l&&t&&a}))||[],[s,n,o,x,p]);(0,a.useEffect)(()=>{(j.length!==g.current.length||j.some((e,s)=>{var l;return e.model_group!==(null===(l=g.current[s])||void 0===l?void 0:l.model_group)}))&&(g.current=j,l(j))},[j,l]);let b=(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names...",value:n,onChange:e=>c(e.target.value),className:"border rounded px-3 py-2 w-64 h-10 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,t.jsxs)("select",{value:o,onChange:e=>m(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-40 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Providers"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.providers.forEach(e=>s.add(e))}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Mode:"}),(0,t.jsxs)("select",{value:x,onChange:e=>u(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-32 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Modes"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.mode&&s.add(e.mode)}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,t.jsxs)("select",{value:p,onChange:e=>h(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-48 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Features"}),s&&(e=>{let s=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).forEach(e=>{let[l]=e,t=l.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");s.add(t)})}),Array.from(s).sort()})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(n||o||x||p)&&(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsx)("button",{onClick:()=>{c(""),m(""),u(""),h("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return r?(0,t.jsx)(C.Z,{className:"mb-6 ".concat(i),children:b}):(0,t.jsx)("div",{className:i,children:b})},M=l(9114);let{Step:P}=v.default;var L=e=>{let{visible:s,onClose:l,accessToken:r,modelHubData:n,onSuccess:o}=e,[m,x]=(0,a.useState)(0),[u,p]=(0,a.useState)(new Set),[h,g]=(0,a.useState)([]),[j,b]=(0,a.useState)(!1),[y]=f.Z.useForm(),N=()=>{x(0),p(new Set),g([]),y.resetFields(),l()},C=(e,s)=>{let l=new Set(u);s?l.add(e):l.delete(e),p(l)},L=e=>{e?p(new Set(h.map(e=>e.model_group))):p(new Set)},A=(0,a.useCallback)(e=>{g(e)},[]);(0,a.useEffect)(()=>{s&&n.length>0&&(g(n),p(new Set(n.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[s,n]);let F=async()=>{if(0===u.size){M.Z.fromBackend("Please select at least one model to make public");return}b(!0);try{let e=Array.from(u);await (0,i.makeModelGroupPublic)(r,e),M.Z.success("Successfully made ".concat(e.length," model group(s) public!")),N(),o()}catch(e){console.error("Error making model groups public:",e),M.Z.fromBackend("Failed to make model groups public. Please try again.")}finally{b(!1)}},U=()=>{let e=h.length>0&&h.every(e=>u.has(e.model_group)),s=u.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(w.Z,{children:"Select Models to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(_.Z,{checked:e,indeterminate:s,onChange:e=>L(e.target.checked),disabled:0===h.length,children:["Select All ",h.length>0&&"(".concat(h.length,")")]})})]}),(0,t.jsx)(d.Z,{className:"text-sm text-gray-600",children:"Select the models you want to be visible on the public model hub. Users will still require a valid API key to use these models."}),(0,t.jsx)(S,{modelHubData:n,onFilteredDataChange:A,showFiltersCard:!1,className:"border rounded-lg p-4 bg-gray-50"}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:0===h.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(d.Z,{children:"No models match the current filters."})}):h.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(_.Z,{checked:u.has(e.model_group),onChange:s=>C(e.model_group,s.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(d.Z,{className:"font-medium",children:e.model_group}),e.mode&&(0,t.jsx)(c.Z,{color:"green",size:"sm",children:e.mode})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),u.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(d.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:u.size})," model",1!==u.size?"s":""," selected"]})})]})},z=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(w.Z,{children:"Confirm Making Models Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(d.Z,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these models public, anyone who can go to the"," ",(0,t.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Models to be made public:"}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,t.jsx)("div",{className:"space-y-2",children:Array.from(u).map(e=>{let s=n.find(s=>s.model_group===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:e}),s&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:s.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",size:"xs",children:e},e))})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(d.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:u.size})," model",1!==u.size?"s":""," will be made public"]})})]});return(0,t.jsx)(Z.Z,{title:"Make Models Public",open:s,onCancel:N,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(f.Z,{form:y,layout:"vertical",children:[(0,t.jsxs)(v.default,{current:m,className:"mb-6",children:[(0,t.jsx)(P,{title:"Select Models"}),(0,t.jsx)(P,{title:"Confirm"})]}),(()=>{switch(m){case 0:return U();case 1:return z();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(k.ZP,{onClick:0===m?N:()=>{1===m&&x(0)},children:0===m?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===m&&(0,t.jsx)(k.ZP,{onClick:()=>{if(0===m){if(0===u.size){M.Z.fromBackend("Please select at least one model to make public");return}x(1)}},disabled:0===u.size,children:"Next"}),1===m&&(0,t.jsx)(k.ZP,{onClick:F,loading:j,children:"Make Public"})]})]})]})})},A=l(86462),F=l(47686),U=l(77355),z=l(93416),E=l(74998),R=l(20347),H=l(95704),O=e=>{let{accessToken:s,userRole:l}=e,[r,n]=(0,a.useState)([]),[c,o]=(0,a.useState)({url:"",displayName:""}),[d,m]=(0,a.useState)(null),[x,u]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!0),g=async()=>{if(s)try{u(!0);let e=await (0,i.getPublicModelHubInfo)();if(e&&e.useful_links){let s=e.useful_links||{},l=Object.entries(s).map((e,s)=>{let[l,t]=e;return{id:"".concat(s,"-").concat(l),displayName:l,url:t}});n(l)}else n([])}catch(e){console.error("Error fetching useful links:",e),n([])}finally{u(!1)}};if((0,a.useEffect)(()=>{g()},[s]),!(0,R.tY)(l||""))return null;let j=async e=>{if(!s)return!1;try{let l={};return e.forEach(e=>{l[e.displayName]=e.url}),await (0,i.updateUsefulLinksCall)(s,l),Z.Z.success({title:"Links Saved Successfully",content:(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)("p",{className:"text-gray-600 mb-4",children:"Your useful links have been saved and are now visible on the public model hub."}),(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,t.jsx)("p",{className:"text-sm text-blue-800 mb-2 font-medium",children:"View your updated model hub:"}),(0,t.jsx)("a",{href:"".concat((0,i.getProxyBaseUrl)(),"/ui/model_hub_table"),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-blue-600 hover:text-blue-800 underline text-sm font-medium",children:"Open Public Model Hub →"})]})]}),width:500,okText:"Close",maskClosable:!0,keyboard:!0}),!0}catch(e){return console.error("Error saving links:",e),M.Z.fromBackend("Failed to save links - ".concat(e)),!1}},b=async()=>{if(!c.url||!c.displayName)return;try{new URL(c.url)}catch(e){M.Z.fromBackend("Please enter a valid URL");return}if(r.some(e=>e.displayName===c.displayName)){M.Z.fromBackend("A link with this display name already exists");return}let e=[...r,{id:"".concat(Date.now(),"-").concat(c.displayName),displayName:c.displayName,url:c.url}];await j(e)&&(n(e),o({url:"",displayName:""}),M.Z.success("Link added successfully"))},y=e=>{m({...e})},N=async()=>{if(!d)return;try{new URL(d.url)}catch(e){M.Z.fromBackend("Please enter a valid URL");return}if(r.some(e=>e.id!==d.id&&e.displayName===d.displayName)){M.Z.fromBackend("A link with this display name already exists");return}let e=r.map(e=>e.id===d.id?d:e);await j(e)&&(n(e),m(null),M.Z.success("Link updated successfully"))},v=()=>{m(null)},f=async e=>{let s=r.filter(s=>s.id!==e);await j(s)&&(n(s),M.Z.success("Link deleted successfully"))},_=e=>{window.open(e,"_blank")};return(0,t.jsxs)(H.Zb,{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>h(!p),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(H.Dx,{className:"mb-0",children:"Link Management"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Manage the links that are displayed under 'Useful Links' on the public model hub."})]}),(0,t.jsx)("div",{className:"flex items-center",children:p?(0,t.jsx)(A.Z,{className:"w-5 h-5 text-gray-500"}):(0,t.jsx)(F.Z,{className:"w-5 h-5 text-gray-500"})})]}),p&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(H.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Link"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"URL"}),(0,t.jsx)("input",{type:"text",value:c.url,onChange:e=>o({...c,url:e.target.value}),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Display Name"}),(0,t.jsx)("input",{type:"text",value:c.displayName,onChange:e=>o({...c,displayName:e.target.value}),placeholder:"Friendly name",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:b,disabled:!c.url||!c.displayName,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(c.url&&c.displayName?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,t.jsx)(U.Z,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,t.jsx)(H.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Links"}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(H.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(H.ss,{children:(0,t.jsxs)(H.SC,{children:[(0,t.jsx)(H.xs,{className:"py-1 h-8",children:"Display Name"}),(0,t.jsx)(H.xs,{className:"py-1 h-8",children:"URL"}),(0,t.jsx)(H.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(H.RM,{children:[r.map(e=>(0,t.jsx)(H.SC,{className:"h-8",children:d&&d.id===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:d.displayName,onChange:e=>m({...d,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(H.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:d.url,onChange:e=>m({...d,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(H.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:N,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,t.jsx)("button",{onClick:v,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.pj,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,t.jsx)(H.pj,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,t.jsx)(H.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>_(e.url),className:"text-xs bg-green-50 text-green-600 px-2 py-1 rounded hover:bg-green-100",children:"Use"}),(0,t.jsx)("button",{onClick:()=>y(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,t.jsx)(z.Z,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>f(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,t.jsx)(E.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===r.length&&(0,t.jsx)(H.SC,{children:(0,t.jsx)(H.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})},T=l(17906),D=l(78867),B=e=>{var s,l;let{accessToken:m,publicPage:x,premiumUser:u,userRole:p}=e,[h,g]=(0,a.useState)(!1),[j,b]=(0,a.useState)(null),[v,f]=(0,a.useState)(!0),[_,k]=(0,a.useState)(!1),[P,A]=(0,a.useState)(!1),[F,U]=(0,a.useState)(null),[z,E]=(0,a.useState)([]),[H,B]=(0,a.useState)(!1),K=(0,r.useRouter)(),I=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=async e=>{try{f(!0);let s=await (0,i.modelHubCall)(e);console.log("ModelHubData:",s),b(s.data),(0,i.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&g(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{f(!1)}},s=async()=>{try{var e,s;f(!0);let l=await (0,i.modelHubPublicModelsCall)();console.log("ModelHubData:",l),console.log("First model structure:",l[0]),console.log("Model has model_group?",null===(e=l[0])||void 0===e?void 0:e.model_group),console.log("Model has providers?",null===(s=l[0])||void 0===s?void 0:s.providers),b(l),g(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{f(!1)}};m?e(m):x&&s()},[m,x]);let Y=()=>{m&&B(!0)},W=()=>{k(!1),A(!1),U(null)},q=()=>{k(!1),A(!1),U(null)},G=e=>{navigator.clipboard.writeText(e),M.Z.success("Copied to clipboard!")},$=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),J=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),V=e=>"$".concat((1e6*e).toFixed(2)),Q=(0,a.useCallback)(e=>{E(e)},[]);return(console.log("publicPage: ",x),console.log("publicPageAllowed: ",h),x&&h)?(0,t.jsx)(N.Z,{accessToken:m}):(0,t.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==x?(0,t.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsx)(w.Z,{className:"text-center",children:"Model Hub"}),(0,R.tY)(p||"")?(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Make models public for developers to know what models are available on the proxy."}):(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"A list of all public model names personally available to you."})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)(d.Z,{children:"Model Hub URL:"}),(0,t.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,t.jsx)(d.Z,{className:"mr-2",children:"".concat((0,i.getProxyBaseUrl)(),"/ui/model_hub_table")}),(0,t.jsx)("button",{onClick:()=>G("".concat((0,i.getProxyBaseUrl)(),"/ui/model_hub_table")),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,t.jsx)(D.Z,{size:16,className:"text-gray-600"})})]}),!1==x&&(0,R.tY)(p||"")&&(0,t.jsx)(o.Z,{className:"ml-4",onClick:()=>Y(),children:"Make Public"})]})]}),(0,R.tY)(p||"")&&(0,t.jsx)("div",{className:"mt-8 mb-2",children:(0,t.jsx)(O,{accessToken:m,userRole:p})}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(S,{modelHubData:j||[],onFilteredDataChange:Q}),(0,t.jsx)(n.C,{columns:y(e=>{U(e),k(!0)},G,x),data:z,isLoading:v,table:I,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(d.Z,{className:"text-sm text-gray-600",children:["Showing ",z.length," of ",(null==j?void 0:j.length)||0," models"]})})]}):(0,t.jsxs)(C.Z,{className:"mx-auto max-w-xl mt-10",children:[(0,t.jsx)(d.Z,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,t.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,t.jsx)(Z.Z,{title:"Public Model Hub",width:600,visible:P,footer:null,onOk:W,onCancel:q,children:(0,t.jsxs)("div",{className:"pt-5 pb-5",children:[(0,t.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,t.jsx)(d.Z,{className:"text-base mr-2",children:"Shareable Link:"}),(0,t.jsx)(d.Z,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:"".concat((0,i.getProxyBaseUrl)(),"/ui/model_hub_table")})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(o.Z,{onClick:()=>{K.replace("/model_hub_table?key=".concat(m))},children:"See Page"})})]})}),(0,t.jsx)(Z.Z,{title:(null==F?void 0:F.model_group)||"Model Details",width:1e3,visible:_,footer:null,onOk:W,onCancel:q,children:F&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Model Group:"}),(0,t.jsx)(d.Z,{children:F.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(d.Z,{children:F.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:F.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",children:e},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(d.Z,{children:(null===(s=F.max_input_tokens)||void 0===s?void 0:s.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(d.Z,{children:(null===(l=F.max_output_tokens)||void 0===l?void 0:l.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(d.Z,{children:F.input_cost_per_token?V(F.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(d.Z,{children:F.output_cost_per_token?V(F.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=J(F),s=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,t.jsx)(d.Z,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,l)=>(0,t.jsx)(c.Z,{color:s[l%s.length],children:$(e)},e))})()})]}),(F.tpm||F.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[F.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(d.Z,{children:F.tpm.toLocaleString()})]}),F.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(d.Z,{children:F.rpm.toLocaleString()})]})]})]}),F.supported_openai_params&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:F.supported_openai_params.map(e=>(0,t.jsx)(c.Z,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(T.Z,{language:"python",className:"text-sm",children:'import openai\n\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # Your LiteLLM Proxy URL\n)\n\nresponse = client.chat.completions.create(\n model="'.concat(F.model_group,'",\n messages=[\n {\n "role": "user",\n "content": "Hello, how are you?"\n }\n ]\n)\n\nprint(response.choices[0].message.content)')})]})]})}),(0,t.jsx)(L,{visible:H,onClose:()=>B(!1),accessToken:m||"",modelHubData:j||[],onSuccess:()=>{m&&(async()=>{try{let e=await (0,i.modelHubCall)(m);b(e.data)}catch(e){console.error("Error refreshing model data:",e)}})()}})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8160-978f9adc46a12a56.js b/litellm/proxy/_experimental/out/_next/static/chunks/8160-978f9adc46a12a56.js deleted file mode 100644 index 9e102b0a4a..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/8160-978f9adc46a12a56.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8160],{18160:function(e,s,l){l.d(s,{Z:function(){return B}});var t=l(57437),a=l(2265),r=l(99376),i=l(19250),n=l(8048),c=l(41649),o=l(20831),d=l(84264),m=l(89970),x=l(3810),u=l(23639),p=l(15424);let h=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),g=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),j=e=>"$".concat((1e6*e).toFixed(2)),b=e=>e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),y=function(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(d.Z,{className:"font-medium text-sm",children:a.model_group}),(0,t.jsx)(m.Z,{title:"Copy model name",children:(0,t.jsx)(u.Z,{onClick:()=>s(a.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(d.Z,{className:"text-xs text-gray-600",children:a.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,s)=>{let l=e.original.providers.join(", "),t=s.original.providers.join(", ");return l.localeCompare(t)},cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,t.jsx)(x.Z,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,t.jsxs)(d.Z,{className:"text-xs text-gray-500",children:["+",l.providers.length-2]})]})},meta:{className:"hidden md:table-cell"}},{header:"Mode",accessorKey:"mode",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return l.mode?(0,t.jsx)(c.Z,{color:"green",size:"sm",children:l.mode}):(0,t.jsx)(d.Z,{className:"text-gray-500",children:"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Tokens",accessorKey:"max_input_tokens",enableSorting:!0,sortingFn:(e,s)=>(e.original.max_input_tokens||0)+(e.original.max_output_tokens||0)-((s.original.max_input_tokens||0)+(s.original.max_output_tokens||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsxs)(d.Z,{className:"text-xs",children:[l.max_input_tokens?b(l.max_input_tokens):"-"," /"," ",l.max_output_tokens?b(l.max_output_tokens):"-"]})})},meta:{className:"hidden lg:table-cell"}},{header:"Cost/1M",accessorKey:"input_cost_per_token",enableSorting:!0,sortingFn:(e,s)=>(e.original.input_cost_per_token||0)+(e.original.output_cost_per_token||0)-((s.original.input_cost_per_token||0)+(s.original.output_cost_per_token||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(d.Z,{className:"text-xs",children:l.input_cost_per_token?j(l.input_cost_per_token):"-"}),(0,t.jsx)(d.Z,{className:"text-xs text-gray-500",children:l.output_cost_per_token?j(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=g(s.original),a=["green","blue","purple","orange","red","yellow"];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(d.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,s)=>(0,t.jsx)(c.Z,{color:a[s%a.length],size:"xs",children:h(e)},e))})}},{header:"Public",accessorKey:"is_public_model_group",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public_model_group?1:0)-(!0===s.original.is_public_model_group?1:0),cell:e=>{let{row:s}=e;return!0===s.original.is_public_model_group?(0,t.jsx)(c.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(c.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,a=l.original;return(0,t.jsxs)(o.Z,{size:"xs",variant:"secondary",onClick:()=>e(a),icon:p.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return l?a.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):a};var N=l(72162),v=l(91810),f=l(13634),_=l(61994),k=l(73002),Z=l(82680),w=l(96761),C=l(12514),S=e=>{let{modelHubData:s,onFilteredDataChange:l,showFiltersCard:r=!0,className:i=""}=e,[n,c]=(0,a.useState)(""),[o,m]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),[p,h]=(0,a.useState)(""),g=(0,a.useRef)([]),j=(0,a.useMemo)(()=>(null==s?void 0:s.filter(e=>{let s=e.model_group.toLowerCase().includes(n.toLowerCase()),l=""===o||e.providers.includes(o),t=""===x||e.mode===x,a=""===p||Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).some(e=>{let[s]=e;return s.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")===p});return s&&l&&t&&a}))||[],[s,n,o,x,p]);(0,a.useEffect)(()=>{(j.length!==g.current.length||j.some((e,s)=>{var l;return e.model_group!==(null===(l=g.current[s])||void 0===l?void 0:l.model_group)}))&&(g.current=j,l(j))},[j,l]);let b=(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names...",value:n,onChange:e=>c(e.target.value),className:"border rounded px-3 py-2 w-64 h-10 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,t.jsxs)("select",{value:o,onChange:e=>m(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-40 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Providers"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.providers.forEach(e=>s.add(e))}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Mode:"}),(0,t.jsxs)("select",{value:x,onChange:e=>u(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-32 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Modes"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.mode&&s.add(e.mode)}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,t.jsxs)("select",{value:p,onChange:e=>h(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-48 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Features"}),s&&(e=>{let s=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).forEach(e=>{let[l]=e,t=l.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");s.add(t)})}),Array.from(s).sort()})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(n||o||x||p)&&(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsx)("button",{onClick:()=>{c(""),m(""),u(""),h("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return r?(0,t.jsx)(C.Z,{className:"mb-6 ".concat(i),children:b}):(0,t.jsx)("div",{className:i,children:b})},M=l(9114);let{Step:P}=v.default;var L=e=>{let{visible:s,onClose:l,accessToken:r,modelHubData:n,onSuccess:o}=e,[m,x]=(0,a.useState)(0),[u,p]=(0,a.useState)(new Set),[h,g]=(0,a.useState)([]),[j,b]=(0,a.useState)(!1),[y]=f.Z.useForm(),N=()=>{x(0),p(new Set),g([]),y.resetFields(),l()},C=(e,s)=>{let l=new Set(u);s?l.add(e):l.delete(e),p(l)},L=e=>{e?p(new Set(h.map(e=>e.model_group))):p(new Set)},A=(0,a.useCallback)(e=>{g(e)},[]);(0,a.useEffect)(()=>{s&&n.length>0&&(g(n),p(new Set(n.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[s,n]);let F=async()=>{if(0===u.size){M.Z.fromBackend("Please select at least one model to make public");return}b(!0);try{let e=Array.from(u);await (0,i.makeModelGroupPublic)(r,e),M.Z.success("Successfully made ".concat(e.length," model group(s) public!")),N(),o()}catch(e){console.error("Error making model groups public:",e),M.Z.fromBackend("Failed to make model groups public. Please try again.")}finally{b(!1)}},U=()=>{let e=h.length>0&&h.every(e=>u.has(e.model_group)),s=u.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(w.Z,{children:"Select Models to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(_.Z,{checked:e,indeterminate:s,onChange:e=>L(e.target.checked),disabled:0===h.length,children:["Select All ",h.length>0&&"(".concat(h.length,")")]})})]}),(0,t.jsx)(d.Z,{className:"text-sm text-gray-600",children:"Select the models you want to be visible on the public model hub. Users will still require a valid API key to use these models."}),(0,t.jsx)(S,{modelHubData:n,onFilteredDataChange:A,showFiltersCard:!1,className:"border rounded-lg p-4 bg-gray-50"}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:0===h.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(d.Z,{children:"No models match the current filters."})}):h.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(_.Z,{checked:u.has(e.model_group),onChange:s=>C(e.model_group,s.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(d.Z,{className:"font-medium",children:e.model_group}),e.mode&&(0,t.jsx)(c.Z,{color:"green",size:"sm",children:e.mode})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),u.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(d.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:u.size})," model",1!==u.size?"s":""," selected"]})})]})},z=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(w.Z,{children:"Confirm Making Models Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(d.Z,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these models public, anyone who can go to the"," ",(0,t.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Models to be made public:"}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,t.jsx)("div",{className:"space-y-2",children:Array.from(u).map(e=>{let s=n.find(s=>s.model_group===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:e}),s&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:s.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",size:"xs",children:e},e))})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(d.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:u.size})," model",1!==u.size?"s":""," will be made public"]})})]});return(0,t.jsx)(Z.Z,{title:"Make Models Public",open:s,onCancel:N,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(f.Z,{form:y,layout:"vertical",children:[(0,t.jsxs)(v.default,{current:m,className:"mb-6",children:[(0,t.jsx)(P,{title:"Select Models"}),(0,t.jsx)(P,{title:"Confirm"})]}),(()=>{switch(m){case 0:return U();case 1:return z();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(k.ZP,{onClick:0===m?N:()=>{1===m&&x(0)},children:0===m?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===m&&(0,t.jsx)(k.ZP,{onClick:()=>{if(0===m){if(0===u.size){M.Z.fromBackend("Please select at least one model to make public");return}x(1)}},disabled:0===u.size,children:"Next"}),1===m&&(0,t.jsx)(k.ZP,{onClick:F,loading:j,children:"Make Public"})]})]})]})})},A=l(86462),F=l(47686),U=l(77355),z=l(93416),E=l(74998),R=l(20347),H=l(95704),O=e=>{let{accessToken:s,userRole:l}=e,[r,n]=(0,a.useState)([]),[c,o]=(0,a.useState)({url:"",displayName:""}),[d,m]=(0,a.useState)(null),[x,u]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!0),g=async()=>{if(s)try{u(!0);let e=await (0,i.getPublicModelHubInfo)();if(e&&e.useful_links){let s=e.useful_links||{},l=Object.entries(s).map((e,s)=>{let[l,t]=e;return{id:"".concat(s,"-").concat(l),displayName:l,url:t}});n(l)}else n([])}catch(e){console.error("Error fetching useful links:",e),n([])}finally{u(!1)}};if((0,a.useEffect)(()=>{g()},[s]),!(0,R.tY)(l||""))return null;let j=async e=>{if(!s)return!1;try{let l={};return e.forEach(e=>{l[e.displayName]=e.url}),await (0,i.updateUsefulLinksCall)(s,l),Z.Z.success({title:"Links Saved Successfully",content:(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)("p",{className:"text-gray-600 mb-4",children:"Your useful links have been saved and are now visible on the public model hub."}),(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,t.jsx)("p",{className:"text-sm text-blue-800 mb-2 font-medium",children:"View your updated model hub:"}),(0,t.jsx)("a",{href:"".concat((0,i.getProxyBaseUrl)(),"/ui/model_hub_table"),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-blue-600 hover:text-blue-800 underline text-sm font-medium",children:"Open Public Model Hub →"})]})]}),width:500,okText:"Close",maskClosable:!0,keyboard:!0}),!0}catch(e){return console.error("Error saving links:",e),M.Z.fromBackend("Failed to save links - ".concat(e)),!1}},b=async()=>{if(!c.url||!c.displayName)return;try{new URL(c.url)}catch(e){M.Z.fromBackend("Please enter a valid URL");return}if(r.some(e=>e.displayName===c.displayName)){M.Z.fromBackend("A link with this display name already exists");return}let e=[...r,{id:"".concat(Date.now(),"-").concat(c.displayName),displayName:c.displayName,url:c.url}];await j(e)&&(n(e),o({url:"",displayName:""}),M.Z.success("Link added successfully"))},y=e=>{m({...e})},N=async()=>{if(!d)return;try{new URL(d.url)}catch(e){M.Z.fromBackend("Please enter a valid URL");return}if(r.some(e=>e.id!==d.id&&e.displayName===d.displayName)){M.Z.fromBackend("A link with this display name already exists");return}let e=r.map(e=>e.id===d.id?d:e);await j(e)&&(n(e),m(null),M.Z.success("Link updated successfully"))},v=()=>{m(null)},f=async e=>{let s=r.filter(s=>s.id!==e);await j(s)&&(n(s),M.Z.success("Link deleted successfully"))},_=e=>{window.open(e,"_blank")};return(0,t.jsxs)(H.Zb,{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>h(!p),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(H.Dx,{className:"mb-0",children:"Link Management"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Manage the links that are displayed under 'Useful Links' on the public model hub."})]}),(0,t.jsx)("div",{className:"flex items-center",children:p?(0,t.jsx)(A.Z,{className:"w-5 h-5 text-gray-500"}):(0,t.jsx)(F.Z,{className:"w-5 h-5 text-gray-500"})})]}),p&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(H.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Link"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"URL"}),(0,t.jsx)("input",{type:"text",value:c.url,onChange:e=>o({...c,url:e.target.value}),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Display Name"}),(0,t.jsx)("input",{type:"text",value:c.displayName,onChange:e=>o({...c,displayName:e.target.value}),placeholder:"Friendly name",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:b,disabled:!c.url||!c.displayName,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(c.url&&c.displayName?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,t.jsx)(U.Z,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,t.jsx)(H.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Links"}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(H.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(H.ss,{children:(0,t.jsxs)(H.SC,{children:[(0,t.jsx)(H.xs,{className:"py-1 h-8",children:"Display Name"}),(0,t.jsx)(H.xs,{className:"py-1 h-8",children:"URL"}),(0,t.jsx)(H.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(H.RM,{children:[r.map(e=>(0,t.jsx)(H.SC,{className:"h-8",children:d&&d.id===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:d.displayName,onChange:e=>m({...d,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(H.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:d.url,onChange:e=>m({...d,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(H.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:N,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,t.jsx)("button",{onClick:v,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.pj,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,t.jsx)(H.pj,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,t.jsx)(H.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>_(e.url),className:"text-xs bg-green-50 text-green-600 px-2 py-1 rounded hover:bg-green-100",children:"Use"}),(0,t.jsx)("button",{onClick:()=>y(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,t.jsx)(z.Z,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>f(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,t.jsx)(E.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===r.length&&(0,t.jsx)(H.SC,{children:(0,t.jsx)(H.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})},T=l(17906),D=l(78867),B=e=>{var s,l;let{accessToken:m,publicPage:x,premiumUser:u,userRole:p}=e,[h,g]=(0,a.useState)(!1),[j,b]=(0,a.useState)(null),[v,f]=(0,a.useState)(!0),[_,k]=(0,a.useState)(!1),[P,A]=(0,a.useState)(!1),[F,U]=(0,a.useState)(null),[z,E]=(0,a.useState)([]),[H,B]=(0,a.useState)(!1),K=(0,r.useRouter)(),I=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=async e=>{try{f(!0);let s=await (0,i.modelHubCall)(e);console.log("ModelHubData:",s),b(s.data),(0,i.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&g(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{f(!1)}},s=async()=>{try{var e,s;f(!0);let l=await (0,i.modelHubPublicModelsCall)();console.log("ModelHubData:",l),console.log("First model structure:",l[0]),console.log("Model has model_group?",null===(e=l[0])||void 0===e?void 0:e.model_group),console.log("Model has providers?",null===(s=l[0])||void 0===s?void 0:s.providers),b(l),g(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{f(!1)}};m?e(m):x&&s()},[m,x]);let Y=()=>{m&&B(!0)},W=()=>{k(!1),A(!1),U(null)},q=()=>{k(!1),A(!1),U(null)},G=e=>{navigator.clipboard.writeText(e),M.Z.success("Copied to clipboard!")},$=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),J=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),V=e=>"$".concat((1e6*e).toFixed(2)),Q=(0,a.useCallback)(e=>{E(e)},[]);return(console.log("publicPage: ",x),console.log("publicPageAllowed: ",h),x&&h)?(0,t.jsx)(N.Z,{accessToken:m}):(0,t.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==x?(0,t.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsx)(w.Z,{className:"text-center",children:"Model Hub"}),(0,R.tY)(p||"")?(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Make models public for developers to know what models are available on the proxy."}):(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"A list of all public model names personally available to you."})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)(d.Z,{children:"Model Hub URL:"}),(0,t.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,t.jsx)(d.Z,{className:"mr-2",children:"".concat((0,i.getProxyBaseUrl)(),"/ui/model_hub_table")}),(0,t.jsx)("button",{onClick:()=>G("".concat((0,i.getProxyBaseUrl)(),"/ui/model_hub_table")),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,t.jsx)(D.Z,{size:16,className:"text-gray-600"})})]}),!1==x&&(0,R.tY)(p||"")&&(0,t.jsx)(o.Z,{className:"ml-4",onClick:()=>Y(),children:"Make Public"})]})]}),(0,R.tY)(p||"")&&(0,t.jsx)("div",{className:"mt-8 mb-2",children:(0,t.jsx)(O,{accessToken:m,userRole:p})}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(S,{modelHubData:j||[],onFilteredDataChange:Q}),(0,t.jsx)(n.C,{columns:y(e=>{U(e),k(!0)},G,x),data:z,isLoading:v,table:I,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(d.Z,{className:"text-sm text-gray-600",children:["Showing ",z.length," of ",(null==j?void 0:j.length)||0," models"]})})]}):(0,t.jsxs)(C.Z,{className:"mx-auto max-w-xl mt-10",children:[(0,t.jsx)(d.Z,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,t.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,t.jsx)(Z.Z,{title:"Public Model Hub",width:600,visible:P,footer:null,onOk:W,onCancel:q,children:(0,t.jsxs)("div",{className:"pt-5 pb-5",children:[(0,t.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,t.jsx)(d.Z,{className:"text-base mr-2",children:"Shareable Link:"}),(0,t.jsx)(d.Z,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:"".concat((0,i.getProxyBaseUrl)(),"/ui/model_hub_table")})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(o.Z,{onClick:()=>{K.replace("/model_hub_table?key=".concat(m))},children:"See Page"})})]})}),(0,t.jsx)(Z.Z,{title:(null==F?void 0:F.model_group)||"Model Details",width:1e3,visible:_,footer:null,onOk:W,onCancel:q,children:F&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Model Group:"}),(0,t.jsx)(d.Z,{children:F.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(d.Z,{children:F.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:F.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",children:e},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(d.Z,{children:(null===(s=F.max_input_tokens)||void 0===s?void 0:s.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(d.Z,{children:(null===(l=F.max_output_tokens)||void 0===l?void 0:l.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(d.Z,{children:F.input_cost_per_token?V(F.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(d.Z,{children:F.output_cost_per_token?V(F.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=J(F),s=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,t.jsx)(d.Z,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,l)=>(0,t.jsx)(c.Z,{color:s[l%s.length],children:$(e)},e))})()})]}),(F.tpm||F.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[F.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(d.Z,{children:F.tpm.toLocaleString()})]}),F.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(d.Z,{children:F.rpm.toLocaleString()})]})]})]}),F.supported_openai_params&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:F.supported_openai_params.map(e=>(0,t.jsx)(c.Z,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(T.Z,{language:"python",className:"text-sm",children:'import openai\n\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # Your LiteLLM Proxy URL\n)\n\nresponse = client.chat.completions.create(\n model="'.concat(F.model_group,'",\n messages=[\n {\n "role": "user",\n "content": "Hello, how are you?"\n }\n ]\n)\n\nprint(response.choices[0].message.content)')})]})]})}),(0,t.jsx)(L,{visible:H,onClose:()=>B(!1),accessToken:m||"",modelHubData:j||[],onSuccess:()=>{m&&(async()=>{try{let e=await (0,i.modelHubCall)(m);b(e.data)}catch(e){console.error("Error refreshing model data:",e)}})()}})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/874-728ff7d42c7bffc9.js b/litellm/proxy/_experimental/out/_next/static/chunks/874-728ff7d42c7bffc9.js deleted file mode 100644 index 2fcafb6fba..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/874-728ff7d42c7bffc9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[874],{62099:function(e,s,l){var t=l(57437),a=l(2265),r=l(52787),i=l(89970),n=l(23496),o=l(63709),d=l(15424),c=l(31283);let{Option:m}=r.default;s.Z=e=>{let{form:s,autoRotationEnabled:l,onAutoRotationChange:u,rotationInterval:h,onRotationIntervalChange:x}=e,p=h&&!["7d","30d","90d","180d","365d"].includes(h),[g,j]=(0,a.useState)(p),[y,f]=(0,a.useState)(p?h:"");return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Key Expiry Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Expire Key"}),(0,t.jsx)(i.Z,{title:"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days)",children:(0,t.jsx)(d.Z,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,t.jsx)(c.o,{name:"duration",placeholder:"e.g., 30d",className:"w-full"})]})]}),(0,t.jsx)(n.Z,{}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Auto-Rotation Settings"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Enable Auto-Rotation"}),(0,t.jsx)(i.Z,{title:"Key will automatically regenerate at the specified interval for enhanced security.",children:(0,t.jsx)(d.Z,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,t.jsx)(o.Z,{checked:l,onChange:u,size:"default",className:l?"":"bg-gray-400"})]}),l&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Rotation Interval"}),(0,t.jsx)(i.Z,{title:"How often the key should be automatically rotated. Choose the interval that best fits your security requirements.",children:(0,t.jsx)(d.Z,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(r.default,{value:g?"custom":h,onChange:e=>{"custom"===e?j(!0):(j(!1),f(""),x(e))},className:"w-full",placeholder:"Select interval",children:[(0,t.jsx)(m,{value:"7d",children:"7 days"}),(0,t.jsx)(m,{value:"30d",children:"30 days"}),(0,t.jsx)(m,{value:"90d",children:"90 days"}),(0,t.jsx)(m,{value:"180d",children:"180 days"}),(0,t.jsx)(m,{value:"365d",children:"365 days"}),(0,t.jsx)(m,{value:"custom",children:"Custom interval"})]}),g&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(c.o,{value:y,onChange:e=>{let s=e.target.value;f(s),x(s)},placeholder:"e.g., 1s, 5m, 2h, 14d"}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Supported formats: seconds (s), minutes (m), hours (h), days (d)"})]})]})]})]}),l&&(0,t.jsx)("div",{className:"bg-blue-50 p-3 rounded-md text-sm text-blue-700",children:"When rotation occurs, you'll receive a notification with the new key. The old key will be deactivated after a brief grace period."})]})]})}},51750:function(e,s,l){l.d(s,{Z:function(){return p}});var t=l(57437),a=l(2265),r=l(77355),i=l(93416),n=l(74998),o=l(95704),d=l(56522),c=l(52787),m=l(69993),u=l(51601),h=e=>{let{accessToken:s,value:l,placeholder:r="Select a Model",onChange:i,disabled:n=!1,style:o,className:h,showLabel:x=!0,labelText:p="Select Model"}=e,[g,j]=(0,a.useState)(l),[y,f]=(0,a.useState)(!1),[b,v]=(0,a.useState)([]),_=(0,a.useRef)(null);return(0,a.useEffect)(()=>{j(l)},[l]),(0,a.useEffect)(()=>{s&&(async()=>{try{let e=await (0,u.p)(s);console.log("Fetched models for selector:",e),e.length>0&&v(e)}catch(e){console.error("Error fetching model info:",e)}})()},[s]),(0,t.jsxs)("div",{children:[x&&(0,t.jsxs)(d.x,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(m.Z,{className:"mr-2"})," ",p]}),(0,t.jsx)(c.default,{value:g,placeholder:r,onChange:e=>{"custom"===e?(f(!0),j(void 0)):(f(!1),j(e),i&&i(e))},options:[...Array.from(new Set(b.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...o},showSearch:!0,className:"rounded-md ".concat(h||""),disabled:n}),y&&(0,t.jsx)(d.o,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{j(e),i&&i(e)},500)},disabled:n})]})},x=l(9114),p=e=>{let{accessToken:s,initialModelAliases:l={},onAliasUpdate:d,showExampleConfig:c=!0}=e,[m,u]=(0,a.useState)([]),[p,g]=(0,a.useState)({aliasName:"",targetModel:""}),[j,y]=(0,a.useState)(null);(0,a.useEffect)(()=>{u(Object.entries(l).map((e,s)=>{let[l,t]=e;return{id:"".concat(s,"-").concat(l),aliasName:l,targetModel:t}}))},[l]);let f=e=>{y({...e})},b=()=>{if(!j)return;if(!j.aliasName||!j.targetModel){x.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.id!==j.id&&e.aliasName===j.aliasName)){x.Z.fromBackend("An alias with this name already exists");return}let e=m.map(e=>e.id===j.id?j:e);u(e),y(null);let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),d&&d(s),x.Z.success("Alias updated successfully")},v=()=>{y(null)},_=e=>{let s=m.filter(s=>s.id!==e);u(s);let l={};s.forEach(e=>{l[e.aliasName]=e.targetModel}),d&&d(l),x.Z.success("Alias deleted successfully")},N=m.reduce((e,s)=>(e[s.aliasName]=s.targetModel,e),{});return(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(o.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,t.jsx)("input",{type:"text",value:p.aliasName,onChange:e=>g({...p,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model"}),(0,t.jsx)(h,{accessToken:s,value:p.targetModel,placeholder:"Select target model",onChange:e=>g({...p,targetModel:e}),showLabel:!1})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:()=>{if(!p.aliasName||!p.targetModel){x.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.aliasName===p.aliasName)){x.Z.fromBackend("An alias with this name already exists");return}let e=[...m,{id:"".concat(Date.now(),"-").concat(p.aliasName),aliasName:p.aliasName,targetModel:p.targetModel}];u(e),g({aliasName:"",targetModel:""});let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),d&&d(s),x.Z.success("Alias added successfully")},disabled:!p.aliasName||!p.targetModel,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(p.aliasName&&p.targetModel?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,t.jsx)(r.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,t.jsx)(o.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(o.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(o.ss,{children:(0,t.jsxs)(o.SC,{children:[(0,t.jsx)(o.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,t.jsx)(o.xs,{className:"py-1 h-8",children:"Target Model"}),(0,t.jsx)(o.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(o.RM,{children:[m.map(e=>(0,t.jsx)(o.SC,{className:"h-8",children:j&&j.id===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:j.aliasName,onChange:e=>y({...j,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(o.pj,{className:"py-0.5",children:(0,t.jsx)(h,{accessToken:s,value:j.targetModel,onChange:e=>y({...j,targetModel:e}),showLabel:!1,style:{height:"32px"}})}),(0,t.jsx)(o.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:b,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,t.jsx)("button",{onClick:v,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,t.jsx)(o.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModel}),(0,t.jsx)(o.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>f(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,t.jsx)(i.Z,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>_(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,t.jsx)(n.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===m.length&&(0,t.jsx)(o.SC,{children:(0,t.jsx)(o.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),c&&(0,t.jsxs)(o.Zb,{children:[(0,t.jsx)(o.Dx,{className:"mb-4",children:"Configuration Example"}),(0,t.jsx)(o.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config:"}),(0,t.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,t.jsxs)("div",{className:"text-gray-700",children:["model_aliases:",0===Object.keys(N).length?(0,t.jsxs)("span",{className:"text-gray-500",children:[(0,t.jsx)("br",{}),"\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[s,l]=e;return(0,t.jsxs)("span",{children:[(0,t.jsx)("br",{}),'\xa0\xa0"',s,'": "',l,'"']},s)})]})})]})]})}},2597:function(e,s,l){var t=l(57437);l(2265);var a=l(92280),r=l(54507);s.Z=function(e){let{value:s,onChange:l,premiumUser:i=!1,disabledCallbacks:n=[],onDisabledCallbacksChange:o}=e;return i?(0,t.jsx)(r.Z,{value:s,onChange:l,disabledCallbacks:n,onDisabledCallbacksChange:o}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,t.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,t.jsxs)(a.x,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key"," ",(0,t.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})}},65895:function(e,s,l){var t=l(57437);l(2265);var a=l(52787),r=l(13634),i=l(89970),n=l(15424);let{Option:o}=a.default;s.Z=e=>{let{type:s,name:l,showDetailedDescriptions:d=!0,className:c="",initialValue:m=null,form:u,onChange:h}=e,x=s.toUpperCase(),p=s.toLowerCase(),g="Select 'guaranteed_throughput' to prevent overallocating ".concat(x," limit when the key belongs to a Team with specific ").concat(x," limits.");return(0,t.jsx)(r.Z.Item,{label:(0,t.jsxs)("span",{children:[x," Rate Limit Type"," ",(0,t.jsx)(i.Z,{title:g,children:(0,t.jsx)(n.Z,{style:{marginLeft:"4px"}})})]}),name:l,initialValue:m,className:c,children:(0,t.jsx)(a.default,{defaultValue:d?"default":void 0,placeholder:"Select rate limit type",style:{width:"100%"},optionLabelProp:d?"label":void 0,onChange:e=>{u&&u.setFieldValue(l,e),h&&h(e)},children:d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o,{value:"best_effort_throughput",label:"Default",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Best effort throughput - no error if we're overallocating ",p," (Team/Key Limits checked at runtime)."]})]})}),(0,t.jsx)(o,{value:"guaranteed_throughput",label:"Guaranteed throughput",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Guaranteed throughput"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Guaranteed throughput - raise an error if we're overallocating ",p," (also checks model-specific limits)"]})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o,{value:"best_effort_throughput",children:"Best effort throughput"}),(0,t.jsx)(o,{value:"guaranteed_throughput",children:"Guaranteed throughput"})]})})})}},84376:function(e,s,l){var t=l(57437);l(2265);var a=l(52787);s.Z=e=>{let{teams:s,value:l,onChange:r,disabled:i}=e;return console.log("disabled",i),(0,t.jsx)(a.default,{showSearch:!0,placeholder:"Search or select a team",value:l,onChange:r,disabled:i,filterOption:(e,l)=>{if(!l)return!1;let t=null==s?void 0:s.find(e=>e.team_id===l.key);if(!t)return!1;let a=e.toLowerCase().trim(),r=(t.team_alias||"").toLowerCase(),i=(t.team_id||"").toLowerCase();return r.includes(a)||i.includes(a)},optionFilterProp:"children",children:null==s?void 0:s.map(e=>(0,t.jsxs)(a.default.Option,{value:e.team_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,t.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})}},30874:function(e,s,l){l.d(s,{ZP:function(){return z},wk:function(){return W},Nr:function(){return J}});var t=l(57437),a=l(2265),r=l(20831),i=l(49804),n=l(67101),o=l(49566),d=l(87452),c=l(88829),m=l(72208),u=l(84264),h=l(96761),x=l(29233),p=l(52787),g=l(13634),j=l(82680),y=l(29967),f=l(73002),b=l(64482),v=l(24199),_=l(46468),N=l(63610),w=l(19250),Z=l(97415),k=l(95096),S=l(84376),C=l(15424),P=l(89970),M=l(2597),A=l(7765),L=l(7310),I=l.n(L),T=l(20347),E=l(65925),F=l(59872),U=l(97434),R=l(95920),V=l(68473),D=l(51750),K=l(9114),O=l(62099),B=l(65895);let{Option:q}=p.default,G=e=>{let s=[];if(console.log("data:",JSON.stringify(e)),e)for(let l of e)l.metadata&&l.metadata.tags&&s.push(...l.metadata.tags);let l=Array.from(new Set(s)).map(e=>({value:e,label:e}));return console.log("uniqueTags:",l),l},W=async(e,s,l,t)=>{try{if(null===e||null===s)return[];if(null!==l){let a=(await (0,w.modelAvailableCall)(l,e,s,!0,t,!0)).data.map(e=>e.id);return console.log("available_model_names:",a),a}return[]}catch(e){return console.error("Error fetching user models:",e),[]}},J=async(e,s,l,t)=>{try{if(null===e||null===s)return;if(null!==l){let a=(await (0,w.modelAvailableCall)(l,e,s)).data.map(e=>e.id);console.log("available_model_names:",a),t(a)}}catch(e){console.error("Error fetching user models:",e)}};var z=e=>{let{userID:s,team:l,teams:L,userRole:z,accessToken:H,data:$,addKey:Q,premiumUser:Y=!1}=e,[X]=g.Z.useForm(),[ee,es]=(0,a.useState)(!1),[el,et]=(0,a.useState)(null),[ea,er]=(0,a.useState)(null),[ei,en]=(0,a.useState)([]),[eo,ed]=(0,a.useState)([]),[ec,em]=(0,a.useState)("you"),[eu,eh]=(0,a.useState)(G($)),[ex,ep]=(0,a.useState)([]),[eg,ej]=(0,a.useState)([]),[ey,ef]=(0,a.useState)([]),[eb,ev]=(0,a.useState)(l),[e_,eN]=(0,a.useState)(!1),[ew,eZ]=(0,a.useState)(null),[ek,eS]=(0,a.useState)({}),[eC,eP]=(0,a.useState)([]),[eM,eA]=(0,a.useState)(!1),[eL,eI]=(0,a.useState)([]),[eT,eE]=(0,a.useState)(!1),[eF,eU]=(0,a.useState)([]),[eR,eV]=(0,a.useState)("default"),[eD,eK]=(0,a.useState)({}),[eO,eB]=(0,a.useState)(!1),[eq,eG]=(0,a.useState)("30d"),eW=()=>{es(!1),X.resetFields(),ef([]),eU([]),eV("default"),eK({}),eB(!1),eG("30d")},eJ=()=>{es(!1),et(null),ev(null),X.resetFields(),ef([]),eU([]),eV("default"),eK({}),eB(!1),eG("30d")};(0,a.useEffect)(()=>{s&&z&&H&&J(s,z,H,en)},[H,s,z]);let ez=async()=>{try{if(null==H)return;let e=await (0,w.fetchMCPAccessGroups)(H);eI(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,a.useEffect)(()=>{ez()},[H]),(0,a.useEffect)(()=>{let e=async()=>{try{let e=await (0,w.getPromptsList)(H);ej(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}};(async()=>{try{let e=(await (0,w.getGuardrailsList)(H)).guardrails.map(e=>e.guardrail_name);ep(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})(),e()},[H]),(0,a.useEffect)(()=>{(async()=>{try{if(H){let e=sessionStorage.getItem("possibleUserRoles");if(e)eS(JSON.parse(e));else{let e=await (0,w.getPossibleUserRoles)(H);sessionStorage.setItem("possibleUserRoles",JSON.stringify(e)),eS(e)}}}catch(e){console.error("Error fetching possible user roles:",e)}})()},[H]);let eH=eo.includes("no-default-models")&&!eb,e$=async e=>{try{var l,t,a,r,i;let n;let o=null!==(a=null==e?void 0:e.key_alias)&&void 0!==a?a:"",d=null!==(r=null==e?void 0:e.team_id)&&void 0!==r?r:null;if((null!==(i=null==$?void 0:$.filter(e=>e.team_id===d).map(e=>e.key_alias))&&void 0!==i?i:[]).includes(o))throw Error("Key alias ".concat(o," already exists for team with ID ").concat(d,", please provide another key alias"));K.Z.info("Making API Call"),es(!0),"you"===ec&&(e.user_id=s);let c={};try{c=JSON.parse(e.metadata||"{}")}catch(e){console.error("Error parsing metadata:",e)}if("service_account"===ec&&(c.service_account_id=e.key_alias),ey.length>0&&(c={...c,logging:ey.filter(e=>e.callback_name)}),eF.length>0){let e=(0,U.Z3)(eF);c={...c,litellm_disabled_callbacks:e}}if(eO&&(e.auto_rotate=!0,e.rotation_interval=eq),e.duration&&(e.duration=e.duration),e.metadata=JSON.stringify(c),e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission={vector_stores:e.allowed_vector_store_ids},delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(l=e.allowed_mcp_servers_and_groups.servers)||void 0===l?void 0:l.length)>0||(null===(t=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===t?void 0:t.length)>0)){e.object_permission||(e.object_permission={});let{servers:s,accessGroups:l}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),l&&l.length>0&&(e.object_permission.mcp_access_groups=l),delete e.allowed_mcp_servers_and_groups}let m=e.mcp_tool_permissions||{};Object.keys(m).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=m),delete e.mcp_tool_permissions,e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(eD).length>0&&(e.aliases=JSON.stringify(eD)),n="service_account"===ec?await (0,w.keyCreateServiceAccountCall)(H,e):await (0,w.keyCreateCall)(H,s,e),console.log("key create Response:",n),Q(n),et(n.key),er(n.soft_budget),K.Z.success("API Key Created"),X.resetFields(),localStorage.removeItem("userData"+s)}catch(e){console.log("error in create key:",e),K.Z.fromBackend("Error creating the key: ".concat(e))}};(0,a.useEffect)(()=>{if(s&&z&&H){var e;W(s,z,H,null!==(e=null==eb?void 0:eb.team_id)&&void 0!==e?e:null).then(e=>{var s;ed(Array.from(new Set([...null!==(s=null==eb?void 0:eb.models)&&void 0!==s?s:[],...e])))})}X.setFieldValue("models",[])},[eb,H,s,z]);let eQ=async e=>{if(!e){eP([]);return}eA(!0);try{let s=new URLSearchParams;if(s.append("user_email",e),null==H)return;let l=(await (0,w.userFilterUICall)(H,s)).map(e=>({label:"".concat(e.user_email," (").concat(e.user_id,")"),value:e.user_id,user:e}));eP(l)}catch(e){console.error("Error fetching users:",e),K.Z.fromBackend("Failed to search for users")}finally{eA(!1)}},eY=(0,a.useCallback)(I()(e=>eQ(e),300),[H]),eX=(e,s)=>{let l=s.user;X.setFieldsValue({user_id:l.user_id})};return(0,t.jsxs)("div",{children:[z&&T.LQ.includes(z)&&(0,t.jsx)(r.Z,{className:"mx-auto",onClick:()=>es(!0),children:"+ Create New Key"}),(0,t.jsx)(j.Z,{visible:ee,width:1e3,footer:null,onOk:eW,onCancel:eJ,children:(0,t.jsxs)(g.Z,{form:X,onFinish:e$,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(h.Z,{className:"mb-4",children:"Key Ownership"}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Owned By"," ",(0,t.jsx)(P.Z,{title:"Select who will own this API key",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),className:"mb-4",children:(0,t.jsxs)(y.ZP.Group,{onChange:e=>em(e.target.value),value:ec,children:[(0,t.jsx)(y.ZP,{value:"you",children:"You"}),(0,t.jsx)(y.ZP,{value:"service_account",children:"Service Account"}),"Admin"===z&&(0,t.jsx)(y.ZP,{value:"another_user",children:"Another User"})]})}),"another_user"===ec&&(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["User ID"," ",(0,t.jsx)(P.Z,{title:"The user who will own this key and be responsible for its usage",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"user_id",className:"mt-4",rules:[{required:"another_user"===ec,message:"Please input the user ID of the user you are assigning the key to"}],children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",marginBottom:"8px"},children:[(0,t.jsx)(p.default,{showSearch:!0,placeholder:"Type email to search for users",filterOption:!1,onSearch:e=>{eY(e)},onSelect:(e,s)=>eX(e,s),options:eC,loading:eM,allowClear:!0,style:{width:"100%"},notFoundContent:eM?"Searching...":"No users found"}),(0,t.jsx)(f.ZP,{onClick:()=>eN(!0),style:{marginLeft:"8px"},children:"Create User"})]}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Search by email to find users"})]})}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Team"," ",(0,t.jsx)(P.Z,{title:"The team this key belongs to, which determines available models and budget limits",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"team_id",initialValue:l?l.team_id:null,className:"mt-4",rules:[{required:"service_account"===ec,message:"Please select a team for the service account"}],help:"service_account"===ec?"required":"",children:(0,t.jsx)(S.Z,{teams:L,onChange:e=>{ev((null==L?void 0:L.find(s=>s.team_id===e))||null)}})})]}),eH&&(0,t.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,t.jsx)(u.Z,{className:"text-blue-800 text-sm",children:"Please select a team to continue configuring your API key. If you do not see any teams, please contact your Proxy Admin to either provide you with access to models or to add you to a team."})}),!eH&&(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(h.Z,{className:"mb-4",children:"Key Details"}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["you"===ec||"another_user"===ec?"Key Name":"Service Account ID"," ",(0,t.jsx)(P.Z,{title:"you"===ec||"another_user"===ec?"A descriptive name to identify this key":"Unique identifier for this service account",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"key_alias",rules:[{required:!0,message:"Please input a ".concat("you"===ec?"key name":"service account ID")}],help:"required",children:(0,t.jsx)(o.Z,{placeholder:""})}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Models"," ",(0,t.jsx)(P.Z,{title:"Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"models",rules:"management"===eR||"read_only"===eR?[]:[{required:!0,message:"Please select a model"}],help:"management"===eR||"read_only"===eR?"Models field is disabled for this key type":"required",className:"mt-4",children:(0,t.jsxs)(p.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:"management"===eR||"read_only"===eR,onChange:e=>{e.includes("all-team-models")&&X.setFieldsValue({models:["all-team-models"]})},children:[(0,t.jsx)(q,{value:"all-team-models",children:"All Team Models"},"all-team-models"),eo.map(e=>(0,t.jsx)(q,{value:e,children:(0,_.W0)(e)},e))]})}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Key Type"," ",(0,t.jsx)(P.Z,{title:"Select the type of key to determine what routes and operations this key can access",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"key_type",initialValue:"default",className:"mt-4",children:(0,t.jsxs)(p.default,{defaultValue:"default",placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",onChange:e=>{eV(e),("management"===e||"read_only"===e)&&X.setFieldsValue({models:[]})},children:[(0,t.jsx)(q,{value:"default",label:"Default",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call LLM API + Management routes"})]})}),(0,t.jsx)(q,{value:"llm_api",label:"LLM API",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"LLM API"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only LLM API routes (chat/completions, embeddings, etc.)"})]})}),(0,t.jsx)(q,{value:"management",label:"Management",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})})]})})]}),!eH&&(0,t.jsx)("div",{className:"mb-8",children:(0,t.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,t.jsx)(m.Z,{children:(0,t.jsx)(h.Z,{className:"m-0",children:"Optional Settings"})}),(0,t.jsxs)(c.Z,{children:[(0,t.jsx)(g.Z.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Max Budget (USD)"," ",(0,t.jsx)(P.Z,{title:"Maximum amount in USD this key can spend. When reached, the key will be blocked from making further requests",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==l?void 0:l.max_budget)!==null&&(null==l?void 0:l.max_budget)!==void 0?null==l?void 0:l.max_budget:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&l&&null!==l.max_budget&&s>l.max_budget)throw Error("Budget cannot exceed team max budget: $".concat((0,F.pw)(l.max_budget,4)))}}],children:(0,t.jsx)(v.Z,{step:.01,precision:2,width:200})}),(0,t.jsx)(g.Z.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Reset Budget"," ",(0,t.jsx)(P.Z,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",help:"Team Reset Budget: ".concat((null==l?void 0:l.budget_duration)!==null&&(null==l?void 0:l.budget_duration)!==void 0?null==l?void 0:l.budget_duration:"None"),children:(0,t.jsx)(E.Z,{onChange:e=>X.setFieldValue("budget_duration",e)})}),(0,t.jsx)(g.Z.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Tokens per minute Limit (TPM)"," ",(0,t.jsx)(P.Z,{title:"Maximum number of tokens this key can process per minute. Helps control usage and costs",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==l?void 0:l.tpm_limit)!==null&&(null==l?void 0:l.tpm_limit)!==void 0?null==l?void 0:l.tpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&l&&null!==l.tpm_limit&&s>l.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(l.tpm_limit))}}],children:(0,t.jsx)(v.Z,{step:1,width:400})}),(0,t.jsx)(B.Z,{type:"tpm",name:"tpm_limit_type",className:"mt-4",initialValue:null,form:X,showDetailedDescriptions:!0}),(0,t.jsx)(g.Z.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Requests per minute Limit (RPM)"," ",(0,t.jsx)(P.Z,{title:"Maximum number of API requests this key can make per minute. Helps prevent abuse and manage load",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==l?void 0:l.rpm_limit)!==null&&(null==l?void 0:l.rpm_limit)!==void 0?null==l?void 0:l.rpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&l&&null!==l.rpm_limit&&s>l.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(l.rpm_limit))}}],children:(0,t.jsx)(v.Z,{step:1,width:400})}),(0,t.jsx)(B.Z,{type:"rpm",name:"rpm_limit_type",className:"mt-4",initialValue:null,form:X,showDetailedDescriptions:!0}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(P.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:Y?"Select existing guardrails or enter new ones":"Premium feature - Upgrade to set guardrails by key",children:(0,t.jsx)(p.default,{mode:"tags",style:{width:"100%"},disabled:!Y,placeholder:Y?"Select or enter guardrails":"Premium feature - Upgrade to set guardrails by key",options:ex.map(e=>({value:e,label:e}))})}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Prompts"," ",(0,t.jsx)(P.Z,{title:"Allow this key to use specific prompt templates",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/prompt_management",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})})]}),name:"prompts",className:"mt-4",help:Y?"Select existing prompts or enter new ones":"Premium feature - Upgrade to set prompts by key",children:(0,t.jsx)(p.default,{mode:"tags",style:{width:"100%"},disabled:!Y,placeholder:Y?"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:eg.map(e=>({value:e,label:e}))})}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Allowed Pass Through Routes"," ",(0,t.jsx)(P.Z,{title:"Allow this key to use specific pass through routes",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/pass_through",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})})]}),name:"allowed_passthrough_routes",className:"mt-4",help:Y?"Select existing pass through routes or enter new ones":"Premium feature - Upgrade to set pass through routes by key",children:(0,t.jsx)(k.Z,{onChange:e=>X.setFieldValue("allowed_passthrough_routes",e),value:X.getFieldValue("allowed_passthrough_routes"),accessToken:H,placeholder:Y?"Select or enter pass through routes":"Premium feature - Upgrade to set pass through routes by key",disabled:!Y,teamId:eb?eb.team_id:null})}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,t.jsx)(P.Z,{title:"Select which vector stores this key can access. If none selected, the key will have access to all available vector stores",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this key can access. Leave empty for access to all vector stores",children:(0,t.jsx)(Z.Z,{onChange:e=>X.setFieldValue("allowed_vector_store_ids",e),value:X.getFieldValue("allowed_vector_store_ids"),accessToken:H,placeholder:"Select vector stores (optional)"})}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Metadata"," ",(0,t.jsx)(P.Z,{title:"JSON object with additional information about this key. Used for tracking or custom logic",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"metadata",className:"mt-4",children:(0,t.jsx)(b.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Tags"," ",(0,t.jsx)(P.Z,{title:"Tags for tracking spend and/or doing tag-based routing. Used for analytics and filtering",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"tags",className:"mt-4",help:"Tags for tracking spend and/or doing tag-based routing.",children:(0,t.jsx)(p.default,{mode:"tags",style:{width:"100%"},placeholder:"Enter tags",tokenSeparators:[","],options:eu})}),(0,t.jsxs)(d.Z,{className:"mt-4 mb-4",onClick:()=>{eT||(ez(),eE(!0))},children:[(0,t.jsx)(m.Z,{children:(0,t.jsx)("b",{children:"MCP Settings"})}),(0,t.jsxs)(c.Z,{children:[(0,t.jsx)(g.Z.Item,{label:(0,t.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,t.jsx)(P.Z,{title:"Select which MCP servers or access groups this key can access",children:(0,t.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",help:"Select MCP servers or access groups this key can access",children:(0,t.jsx)(R.Z,{onChange:e=>X.setFieldValue("allowed_mcp_servers_and_groups",e),value:X.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:H,placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(g.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(b.default,{type:"hidden"})}),(0,t.jsx)(g.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(V.Z,{accessToken:H,selectedServers:(null===(e=X.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:X.getFieldValue("mcp_tool_permissions")||{},onChange:e=>X.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),Y?(0,t.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,t.jsx)(m.Z,{children:(0,t.jsx)("b",{children:"Logging Settings"})}),(0,t.jsx)(c.Z,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(M.Z,{value:ey,onChange:ef,premiumUser:!0,disabledCallbacks:eF,onDisabledCallbacksChange:eU})})})]}):(0,t.jsx)(P.Z,{title:(0,t.jsxs)("span",{children:["Key-level logging settings is an enterprise feature, get in touch -",(0,t.jsx)("a",{href:"https://www.litellm.ai/enterprise",target:"_blank",children:"https://www.litellm.ai/enterprise"})]}),placement:"top",children:(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsx)("div",{style:{opacity:.5},children:(0,t.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,t.jsx)(m.Z,{children:(0,t.jsx)("b",{children:"Logging Settings"})}),(0,t.jsx)(c.Z,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(M.Z,{value:ey,onChange:ef,premiumUser:!1,disabledCallbacks:eF,onDisabledCallbacksChange:eU})})})]})}),(0,t.jsx)("div",{style:{position:"absolute",inset:0,cursor:"not-allowed"}})]})}),(0,t.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,t.jsx)(m.Z,{children:(0,t.jsx)("b",{children:"Model Aliases"})}),(0,t.jsx)(c.Z,{children:(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)(u.Z,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used in API calls. This allows you to create shortcuts for specific models."}),(0,t.jsx)(D.Z,{accessToken:H,initialModelAliases:eD,onAliasUpdate:eK,showExampleConfig:!1})]})})]}),(0,t.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,t.jsx)(m.Z,{children:(0,t.jsx)("b",{children:"Key Lifecycle"})}),(0,t.jsx)(c.Z,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(O.Z,{form:X,autoRotationEnabled:eO,onAutoRotationChange:eB,rotationInterval:eq,onRotationIntervalChange:eG})})})]}),(0,t.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,t.jsx)(m.Z,{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("b",{children:"Advanced Settings"}),(0,t.jsx)(P.Z,{title:(0,t.jsxs)("span",{children:["Learn more about advanced settings in our"," ",(0,t.jsx)("a",{href:w.proxyBaseUrl?"".concat(w.proxyBaseUrl,"/#/key%20management/generate_key_fn_key_generate_post"):"/#/key%20management/generate_key_fn_key_generate_post",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:"documentation"})]}),children:(0,t.jsx)(C.Z,{className:"text-gray-400 hover:text-gray-300 cursor-help"})})]})}),(0,t.jsx)(c.Z,{children:(0,t.jsx)(N.Z,{schemaComponent:"GenerateKeyRequest",form:X,excludedFields:["key_alias","team_id","models","duration","metadata","tags","guardrails","max_budget","budget_duration","tpm_limit","rpm_limit"]})})]})]})]})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(f.ZP,{htmlType:"submit",disabled:eH,style:{opacity:eH?.5:1},children:"Create Key"})})]})}),e_&&(0,t.jsx)(j.Z,{title:"Create New User",visible:e_,onCancel:()=>eN(!1),footer:null,width:800,children:(0,t.jsx)(A.Z,{userID:s,accessToken:H,teams:L,possibleUIRoles:ek,onUserCreated:e=>{eZ(e),X.setFieldsValue({user_id:e}),eN(!1)},isEmbedded:!0})}),el&&(0,t.jsx)(j.Z,{visible:ee,onOk:eW,onCancel:eJ,footer:null,children:(0,t.jsxs)(n.Z,{numItems:1,className:"gap-2 w-full",children:[(0,t.jsx)(h.Z,{children:"Save your Key"}),(0,t.jsx)(i.Z,{numColSpan:1,children:(0,t.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons,"," ",(0,t.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,t.jsx)(i.Z,{numColSpan:1,children:null!=el?(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"mt-3",children:"API Key:"}),(0,t.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,t.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:el})}),(0,t.jsx)(x.CopyToClipboard,{text:el,onCopy:()=>{K.Z.success("API Key copied to clipboard")},children:(0,t.jsx)(r.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,t.jsx)(u.Z,{children:"Key being created, this might take 30s"})})]})})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/874-e84ea35ec9a8042c.js b/litellm/proxy/_experimental/out/_next/static/chunks/874-e84ea35ec9a8042c.js new file mode 100644 index 0000000000..c44fce85f1 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/874-e84ea35ec9a8042c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[874],{62099:function(e,s,l){var a=l(57437),t=l(2265),r=l(52787),i=l(89970),n=l(23496),o=l(63709),d=l(15424),c=l(31283);let{Option:m}=r.default;s.Z=e=>{let{form:s,autoRotationEnabled:l,onAutoRotationChange:u,rotationInterval:h,onRotationIntervalChange:x}=e,p=h&&!["7d","30d","90d","180d","365d"].includes(h),[g,j]=(0,t.useState)(p),[y,f]=(0,t.useState)(p?h:"");return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Key Expiry Settings"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,a.jsx)("span",{children:"Expire Key"}),(0,a.jsx)(i.Z,{title:"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days)",children:(0,a.jsx)(d.Z,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,a.jsx)(c.o,{name:"duration",placeholder:"e.g., 30d",className:"w-full"})]})]}),(0,a.jsx)(n.Z,{}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Auto-Rotation Settings"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,a.jsx)("span",{children:"Enable Auto-Rotation"}),(0,a.jsx)(i.Z,{title:"Key will automatically regenerate at the specified interval for enhanced security.",children:(0,a.jsx)(d.Z,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,a.jsx)(o.Z,{checked:l,onChange:u,size:"default",className:l?"":"bg-gray-400"})]}),l&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,a.jsx)("span",{children:"Rotation Interval"}),(0,a.jsx)(i.Z,{title:"How often the key should be automatically rotated. Choose the interval that best fits your security requirements.",children:(0,a.jsx)(d.Z,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(r.default,{value:g?"custom":h,onChange:e=>{"custom"===e?j(!0):(j(!1),f(""),x(e))},className:"w-full",placeholder:"Select interval",children:[(0,a.jsx)(m,{value:"7d",children:"7 days"}),(0,a.jsx)(m,{value:"30d",children:"30 days"}),(0,a.jsx)(m,{value:"90d",children:"90 days"}),(0,a.jsx)(m,{value:"180d",children:"180 days"}),(0,a.jsx)(m,{value:"365d",children:"365 days"}),(0,a.jsx)(m,{value:"custom",children:"Custom interval"})]}),g&&(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(c.o,{value:y,onChange:e=>{let s=e.target.value;f(s),x(s)},placeholder:"e.g., 1s, 5m, 2h, 14d"}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:"Supported formats: seconds (s), minutes (m), hours (h), days (d)"})]})]})]})]}),l&&(0,a.jsx)("div",{className:"bg-blue-50 p-3 rounded-md text-sm text-blue-700",children:"When rotation occurs, you'll receive a notification with the new key. The old key will be deactivated after a brief grace period."})]})]})}},51750:function(e,s,l){l.d(s,{Z:function(){return p}});var a=l(57437),t=l(2265),r=l(77355),i=l(93416),n=l(74998),o=l(95704),d=l(56522),c=l(52787),m=l(69993),u=l(51601),h=e=>{let{accessToken:s,value:l,placeholder:r="Select a Model",onChange:i,disabled:n=!1,style:o,className:h,showLabel:x=!0,labelText:p="Select Model"}=e,[g,j]=(0,t.useState)(l),[y,f]=(0,t.useState)(!1),[b,v]=(0,t.useState)([]),_=(0,t.useRef)(null);return(0,t.useEffect)(()=>{j(l)},[l]),(0,t.useEffect)(()=>{s&&(async()=>{try{let e=await (0,u.p)(s);console.log("Fetched models for selector:",e),e.length>0&&v(e)}catch(e){console.error("Error fetching model info:",e)}})()},[s]),(0,a.jsxs)("div",{children:[x&&(0,a.jsxs)(d.x,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-2"})," ",p]}),(0,a.jsx)(c.default,{value:g,placeholder:r,onChange:e=>{"custom"===e?(f(!0),j(void 0)):(f(!1),j(e),i&&i(e))},options:[...Array.from(new Set(b.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...o},showSearch:!0,className:"rounded-md ".concat(h||""),disabled:n}),y&&(0,a.jsx)(d.o,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{j(e),i&&i(e)},500)},disabled:n})]})},x=l(9114),p=e=>{let{accessToken:s,initialModelAliases:l={},onAliasUpdate:d,showExampleConfig:c=!0}=e,[m,u]=(0,t.useState)([]),[p,g]=(0,t.useState)({aliasName:"",targetModel:""}),[j,y]=(0,t.useState)(null);(0,t.useEffect)(()=>{u(Object.entries(l).map((e,s)=>{let[l,a]=e;return{id:"".concat(s,"-").concat(l),aliasName:l,targetModel:a}}))},[l]);let f=e=>{y({...e})},b=()=>{if(!j)return;if(!j.aliasName||!j.targetModel){x.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.id!==j.id&&e.aliasName===j.aliasName)){x.Z.fromBackend("An alias with this name already exists");return}let e=m.map(e=>e.id===j.id?j:e);u(e),y(null);let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),d&&d(s),x.Z.success("Alias updated successfully")},v=()=>{y(null)},_=e=>{let s=m.filter(s=>s.id!==e);u(s);let l={};s.forEach(e=>{l[e.aliasName]=e.targetModel}),d&&d(l),x.Z.success("Alias deleted successfully")},N=m.reduce((e,s)=>(e[s.aliasName]=s.targetModel,e),{});return(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(o.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,a.jsx)("input",{type:"text",value:p.aliasName,onChange:e=>g({...p,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model"}),(0,a.jsx)(h,{accessToken:s,value:p.targetModel,placeholder:"Select target model",onChange:e=>g({...p,targetModel:e}),showLabel:!1})]}),(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsxs)("button",{onClick:()=>{if(!p.aliasName||!p.targetModel){x.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.aliasName===p.aliasName)){x.Z.fromBackend("An alias with this name already exists");return}let e=[...m,{id:"".concat(Date.now(),"-").concat(p.aliasName),aliasName:p.aliasName,targetModel:p.targetModel}];u(e),g({aliasName:"",targetModel:""});let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),d&&d(s),x.Z.success("Alias added successfully")},disabled:!p.aliasName||!p.targetModel,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(p.aliasName&&p.targetModel?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,a.jsx)(r.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,a.jsx)(o.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,a.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)(o.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,a.jsx)(o.ss,{children:(0,a.jsxs)(o.SC,{children:[(0,a.jsx)(o.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,a.jsx)(o.xs,{className:"py-1 h-8",children:"Target Model"}),(0,a.jsx)(o.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,a.jsxs)(o.RM,{children:[m.map(e=>(0,a.jsx)(o.SC,{className:"h-8",children:j&&j.id===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:j.aliasName,onChange:e=>y({...j,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(o.pj,{className:"py-0.5",children:(0,a.jsx)(h,{accessToken:s,value:j.targetModel,onChange:e=>y({...j,targetModel:e}),showLabel:!1,style:{height:"32px"}})}),(0,a.jsx)(o.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:b,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,a.jsx)("button",{onClick:v,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,a.jsx)(o.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModel}),(0,a.jsx)(o.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>f(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,a.jsx)(i.Z,{className:"w-3 h-3"})}),(0,a.jsx)("button",{onClick:()=>_(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,a.jsx)(n.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===m.length&&(0,a.jsx)(o.SC,{children:(0,a.jsx)(o.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),c&&(0,a.jsxs)(o.Zb,{children:[(0,a.jsx)(o.Dx,{className:"mb-4",children:"Configuration Example"}),(0,a.jsx)(o.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config:"}),(0,a.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,a.jsxs)("div",{className:"text-gray-700",children:["model_aliases:",0===Object.keys(N).length?(0,a.jsxs)("span",{className:"text-gray-500",children:[(0,a.jsx)("br",{}),"\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[s,l]=e;return(0,a.jsxs)("span",{children:[(0,a.jsx)("br",{}),'\xa0\xa0"',s,'": "',l,'"']},s)})]})})]})]})}},2597:function(e,s,l){var a=l(57437);l(2265);var t=l(92280),r=l(54507);s.Z=function(e){let{value:s,onChange:l,premiumUser:i=!1,disabledCallbacks:n=[],onDisabledCallbacksChange:o}=e;return i?(0,a.jsx)(r.Z,{value:s,onChange:l,disabledCallbacks:n,onDisabledCallbacksChange:o}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,a.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,a.jsxs)(t.x,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key"," ",(0,a.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})}},65895:function(e,s,l){var a=l(57437);l(2265);var t=l(52787),r=l(13634),i=l(89970),n=l(15424);let{Option:o}=t.default;s.Z=e=>{let{type:s,name:l,showDetailedDescriptions:d=!0,className:c="",initialValue:m=null,form:u,onChange:h}=e,x=s.toUpperCase(),p=s.toLowerCase(),g="Select 'guaranteed_throughput' to prevent overallocating ".concat(x," limit when the key belongs to a Team with specific ").concat(x," limits.");return(0,a.jsx)(r.Z.Item,{label:(0,a.jsxs)("span",{children:[x," Rate Limit Type"," ",(0,a.jsx)(i.Z,{title:g,children:(0,a.jsx)(n.Z,{style:{marginLeft:"4px"}})})]}),name:l,initialValue:m,className:c,children:(0,a.jsx)(t.default,{defaultValue:d?"default":void 0,placeholder:"Select rate limit type",style:{width:"100%"},optionLabelProp:d?"label":void 0,onChange:e=>{u&&u.setFieldValue(l,e),h&&h(e)},children:d?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{value:"best_effort_throughput",label:"Default",children:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(0,a.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,a.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Best effort throughput - no error if we're overallocating ",p," (Team/Key Limits checked at runtime)."]})]})}),(0,a.jsx)(o,{value:"guaranteed_throughput",label:"Guaranteed throughput",children:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(0,a.jsx)("div",{style:{fontWeight:500},children:"Guaranteed throughput"}),(0,a.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Guaranteed throughput - raise an error if we're overallocating ",p," (also checks model-specific limits)"]})]})}),(0,a.jsx)(o,{value:"dynamic",label:"Dynamic",children:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(0,a.jsx)("div",{style:{fontWeight:500},children:"Dynamic"}),(0,a.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["If the key has a set ",x," (e.g. 2 ",x,") and there are no 429 errors, it can dynamically exceed the limit when the model being called is not erroring."]})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{value:"best_effort_throughput",children:"Best effort throughput"}),(0,a.jsx)(o,{value:"guaranteed_throughput",children:"Guaranteed throughput"}),(0,a.jsx)(o,{value:"dynamic",children:"Dynamic"})]})})})}},84376:function(e,s,l){var a=l(57437);l(2265);var t=l(52787);s.Z=e=>{let{teams:s,value:l,onChange:r,disabled:i}=e;return console.log("disabled",i),(0,a.jsx)(t.default,{showSearch:!0,placeholder:"Search or select a team",value:l,onChange:r,disabled:i,filterOption:(e,l)=>{if(!l)return!1;let a=null==s?void 0:s.find(e=>e.team_id===l.key);if(!a)return!1;let t=e.toLowerCase().trim(),r=(a.team_alias||"").toLowerCase(),i=(a.team_id||"").toLowerCase();return r.includes(t)||i.includes(t)},optionFilterProp:"children",children:null==s?void 0:s.map(e=>(0,a.jsxs)(t.default.Option,{value:e.team_id,children:[(0,a.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,a.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})}},30874:function(e,s,l){l.d(s,{ZP:function(){return z},wk:function(){return W},Nr:function(){return J}});var a=l(57437),t=l(2265),r=l(20831),i=l(49804),n=l(67101),o=l(49566),d=l(87452),c=l(88829),m=l(72208),u=l(84264),h=l(96761),x=l(29233),p=l(52787),g=l(13634),j=l(82680),y=l(29967),f=l(73002),b=l(64482),v=l(24199),_=l(46468),N=l(63610),w=l(19250),Z=l(97415),k=l(95096),S=l(84376),C=l(15424),P=l(89970),M=l(2597),A=l(7765),L=l(7310),I=l.n(L),T=l(20347),E=l(65925),F=l(59872),U=l(97434),D=l(95920),R=l(68473),V=l(51750),K=l(9114),O=l(62099),B=l(65895);let{Option:q}=p.default,G=e=>{let s=[];if(console.log("data:",JSON.stringify(e)),e)for(let l of e)l.metadata&&l.metadata.tags&&s.push(...l.metadata.tags);let l=Array.from(new Set(s)).map(e=>({value:e,label:e}));return console.log("uniqueTags:",l),l},W=async(e,s,l,a)=>{try{if(null===e||null===s)return[];if(null!==l){let t=(await (0,w.modelAvailableCall)(l,e,s,!0,a,!0)).data.map(e=>e.id);return console.log("available_model_names:",t),t}return[]}catch(e){return console.error("Error fetching user models:",e),[]}},J=async(e,s,l,a)=>{try{if(null===e||null===s)return;if(null!==l){let t=(await (0,w.modelAvailableCall)(l,e,s)).data.map(e=>e.id);console.log("available_model_names:",t),a(t)}}catch(e){console.error("Error fetching user models:",e)}};var z=e=>{let{userID:s,team:l,teams:L,userRole:z,accessToken:H,data:$,addKey:Q,premiumUser:Y=!1}=e,[X]=g.Z.useForm(),[ee,es]=(0,t.useState)(!1),[el,ea]=(0,t.useState)(null),[et,er]=(0,t.useState)(null),[ei,en]=(0,t.useState)([]),[eo,ed]=(0,t.useState)([]),[ec,em]=(0,t.useState)("you"),[eu,eh]=(0,t.useState)(G($)),[ex,ep]=(0,t.useState)([]),[eg,ej]=(0,t.useState)([]),[ey,ef]=(0,t.useState)([]),[eb,ev]=(0,t.useState)(l),[e_,eN]=(0,t.useState)(!1),[ew,eZ]=(0,t.useState)(null),[ek,eS]=(0,t.useState)({}),[eC,eP]=(0,t.useState)([]),[eM,eA]=(0,t.useState)(!1),[eL,eI]=(0,t.useState)([]),[eT,eE]=(0,t.useState)(!1),[eF,eU]=(0,t.useState)([]),[eD,eR]=(0,t.useState)("default"),[eV,eK]=(0,t.useState)({}),[eO,eB]=(0,t.useState)(!1),[eq,eG]=(0,t.useState)("30d"),eW=()=>{es(!1),X.resetFields(),ef([]),eU([]),eR("default"),eK({}),eB(!1),eG("30d")},eJ=()=>{es(!1),ea(null),ev(null),X.resetFields(),ef([]),eU([]),eR("default"),eK({}),eB(!1),eG("30d")};(0,t.useEffect)(()=>{s&&z&&H&&J(s,z,H,en)},[H,s,z]);let ez=async()=>{try{if(null==H)return;let e=await (0,w.fetchMCPAccessGroups)(H);eI(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,t.useEffect)(()=>{ez()},[H]),(0,t.useEffect)(()=>{let e=async()=>{try{let e=await (0,w.getPromptsList)(H);ej(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}};(async()=>{try{let e=(await (0,w.getGuardrailsList)(H)).guardrails.map(e=>e.guardrail_name);ep(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})(),e()},[H]),(0,t.useEffect)(()=>{(async()=>{try{if(H){let e=sessionStorage.getItem("possibleUserRoles");if(e)eS(JSON.parse(e));else{let e=await (0,w.getPossibleUserRoles)(H);sessionStorage.setItem("possibleUserRoles",JSON.stringify(e)),eS(e)}}}catch(e){console.error("Error fetching possible user roles:",e)}})()},[H]);let eH=eo.includes("no-default-models")&&!eb,e$=async e=>{try{var l,a,t,r,i;let n;let o=null!==(t=null==e?void 0:e.key_alias)&&void 0!==t?t:"",d=null!==(r=null==e?void 0:e.team_id)&&void 0!==r?r:null;if((null!==(i=null==$?void 0:$.filter(e=>e.team_id===d).map(e=>e.key_alias))&&void 0!==i?i:[]).includes(o))throw Error("Key alias ".concat(o," already exists for team with ID ").concat(d,", please provide another key alias"));K.Z.info("Making API Call"),es(!0),"you"===ec&&(e.user_id=s);let c={};try{c=JSON.parse(e.metadata||"{}")}catch(e){console.error("Error parsing metadata:",e)}if("service_account"===ec&&(c.service_account_id=e.key_alias),ey.length>0&&(c={...c,logging:ey.filter(e=>e.callback_name)}),eF.length>0){let e=(0,U.Z3)(eF);c={...c,litellm_disabled_callbacks:e}}if(eO&&(e.auto_rotate=!0,e.rotation_interval=eq),e.duration&&(e.duration=e.duration),e.metadata=JSON.stringify(c),e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission={vector_stores:e.allowed_vector_store_ids},delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(l=e.allowed_mcp_servers_and_groups.servers)||void 0===l?void 0:l.length)>0||(null===(a=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===a?void 0:a.length)>0)){e.object_permission||(e.object_permission={});let{servers:s,accessGroups:l}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),l&&l.length>0&&(e.object_permission.mcp_access_groups=l),delete e.allowed_mcp_servers_and_groups}let m=e.mcp_tool_permissions||{};Object.keys(m).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=m),delete e.mcp_tool_permissions,e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(eV).length>0&&(e.aliases=JSON.stringify(eV)),n="service_account"===ec?await (0,w.keyCreateServiceAccountCall)(H,e):await (0,w.keyCreateCall)(H,s,e),console.log("key create Response:",n),Q(n),ea(n.key),er(n.soft_budget),K.Z.success("API Key Created"),X.resetFields(),localStorage.removeItem("userData"+s)}catch(e){console.log("error in create key:",e),K.Z.fromBackend("Error creating the key: ".concat(e))}};(0,t.useEffect)(()=>{if(s&&z&&H){var e;W(s,z,H,null!==(e=null==eb?void 0:eb.team_id)&&void 0!==e?e:null).then(e=>{var s;ed(Array.from(new Set([...null!==(s=null==eb?void 0:eb.models)&&void 0!==s?s:[],...e])))})}X.setFieldValue("models",[])},[eb,H,s,z]);let eQ=async e=>{if(!e){eP([]);return}eA(!0);try{let s=new URLSearchParams;if(s.append("user_email",e),null==H)return;let l=(await (0,w.userFilterUICall)(H,s)).map(e=>({label:"".concat(e.user_email," (").concat(e.user_id,")"),value:e.user_id,user:e}));eP(l)}catch(e){console.error("Error fetching users:",e),K.Z.fromBackend("Failed to search for users")}finally{eA(!1)}},eY=(0,t.useCallback)(I()(e=>eQ(e),300),[H]),eX=(e,s)=>{let l=s.user;X.setFieldsValue({user_id:l.user_id})};return(0,a.jsxs)("div",{children:[z&&T.LQ.includes(z)&&(0,a.jsx)(r.Z,{className:"mx-auto",onClick:()=>es(!0),children:"+ Create New Key"}),(0,a.jsx)(j.Z,{visible:ee,width:1e3,footer:null,onOk:eW,onCancel:eJ,children:(0,a.jsxs)(g.Z,{form:X,onFinish:e$,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)(h.Z,{className:"mb-4",children:"Key Ownership"}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Owned By"," ",(0,a.jsx)(P.Z,{title:"Select who will own this API key",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),className:"mb-4",children:(0,a.jsxs)(y.ZP.Group,{onChange:e=>em(e.target.value),value:ec,children:[(0,a.jsx)(y.ZP,{value:"you",children:"You"}),(0,a.jsx)(y.ZP,{value:"service_account",children:"Service Account"}),"Admin"===z&&(0,a.jsx)(y.ZP,{value:"another_user",children:"Another User"})]})}),"another_user"===ec&&(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["User ID"," ",(0,a.jsx)(P.Z,{title:"The user who will own this key and be responsible for its usage",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"user_id",className:"mt-4",rules:[{required:"another_user"===ec,message:"Please input the user ID of the user you are assigning the key to"}],children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{style:{display:"flex",marginBottom:"8px"},children:[(0,a.jsx)(p.default,{showSearch:!0,placeholder:"Type email to search for users",filterOption:!1,onSearch:e=>{eY(e)},onSelect:(e,s)=>eX(e,s),options:eC,loading:eM,allowClear:!0,style:{width:"100%"},notFoundContent:eM?"Searching...":"No users found"}),(0,a.jsx)(f.ZP,{onClick:()=>eN(!0),style:{marginLeft:"8px"},children:"Create User"})]}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:"Search by email to find users"})]})}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Team"," ",(0,a.jsx)(P.Z,{title:"The team this key belongs to, which determines available models and budget limits",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"team_id",initialValue:l?l.team_id:null,className:"mt-4",rules:[{required:"service_account"===ec,message:"Please select a team for the service account"}],help:"service_account"===ec?"required":"",children:(0,a.jsx)(S.Z,{teams:L,onChange:e=>{ev((null==L?void 0:L.find(s=>s.team_id===e))||null)}})})]}),eH&&(0,a.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,a.jsx)(u.Z,{className:"text-blue-800 text-sm",children:"Please select a team to continue configuring your API key. If you do not see any teams, please contact your Proxy Admin to either provide you with access to models or to add you to a team."})}),!eH&&(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)(h.Z,{className:"mb-4",children:"Key Details"}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["you"===ec||"another_user"===ec?"Key Name":"Service Account ID"," ",(0,a.jsx)(P.Z,{title:"you"===ec||"another_user"===ec?"A descriptive name to identify this key":"Unique identifier for this service account",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"key_alias",rules:[{required:!0,message:"Please input a ".concat("you"===ec?"key name":"service account ID")}],help:"required",children:(0,a.jsx)(o.Z,{placeholder:""})}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Models"," ",(0,a.jsx)(P.Z,{title:"Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"models",rules:"management"===eD||"read_only"===eD?[]:[{required:!0,message:"Please select a model"}],help:"management"===eD||"read_only"===eD?"Models field is disabled for this key type":"required",className:"mt-4",children:(0,a.jsxs)(p.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:"management"===eD||"read_only"===eD,onChange:e=>{e.includes("all-team-models")&&X.setFieldsValue({models:["all-team-models"]})},children:[(0,a.jsx)(q,{value:"all-team-models",children:"All Team Models"},"all-team-models"),eo.map(e=>(0,a.jsx)(q,{value:e,children:(0,_.W0)(e)},e))]})}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Key Type"," ",(0,a.jsx)(P.Z,{title:"Select the type of key to determine what routes and operations this key can access",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"key_type",initialValue:"default",className:"mt-4",children:(0,a.jsxs)(p.default,{defaultValue:"default",placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",onChange:e=>{eR(e),("management"===e||"read_only"===e)&&X.setFieldsValue({models:[]})},children:[(0,a.jsx)(q,{value:"default",label:"Default",children:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(0,a.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,a.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call LLM API + Management routes"})]})}),(0,a.jsx)(q,{value:"llm_api",label:"LLM API",children:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(0,a.jsx)("div",{style:{fontWeight:500},children:"LLM API"}),(0,a.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only LLM API routes (chat/completions, embeddings, etc.)"})]})}),(0,a.jsx)(q,{value:"management",label:"Management",children:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(0,a.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,a.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})})]})})]}),!eH&&(0,a.jsx)("div",{className:"mb-8",children:(0,a.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)(h.Z,{className:"m-0",children:"Optional Settings"})}),(0,a.jsxs)(c.Z,{children:[(0,a.jsx)(g.Z.Item,{className:"mt-4",label:(0,a.jsxs)("span",{children:["Max Budget (USD)"," ",(0,a.jsx)(P.Z,{title:"Maximum amount in USD this key can spend. When reached, the key will be blocked from making further requests",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==l?void 0:l.max_budget)!==null&&(null==l?void 0:l.max_budget)!==void 0?null==l?void 0:l.max_budget:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&l&&null!==l.max_budget&&s>l.max_budget)throw Error("Budget cannot exceed team max budget: $".concat((0,F.pw)(l.max_budget,4)))}}],children:(0,a.jsx)(v.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(g.Z.Item,{className:"mt-4",label:(0,a.jsxs)("span",{children:["Reset Budget"," ",(0,a.jsx)(P.Z,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",help:"Team Reset Budget: ".concat((null==l?void 0:l.budget_duration)!==null&&(null==l?void 0:l.budget_duration)!==void 0?null==l?void 0:l.budget_duration:"None"),children:(0,a.jsx)(E.Z,{onChange:e=>X.setFieldValue("budget_duration",e)})}),(0,a.jsx)(g.Z.Item,{className:"mt-4",label:(0,a.jsxs)("span",{children:["Tokens per minute Limit (TPM)"," ",(0,a.jsx)(P.Z,{title:"Maximum number of tokens this key can process per minute. Helps control usage and costs",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==l?void 0:l.tpm_limit)!==null&&(null==l?void 0:l.tpm_limit)!==void 0?null==l?void 0:l.tpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&l&&null!==l.tpm_limit&&s>l.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(l.tpm_limit))}}],children:(0,a.jsx)(v.Z,{step:1,width:400})}),(0,a.jsx)(B.Z,{type:"tpm",name:"tpm_limit_type",className:"mt-4",initialValue:null,form:X,showDetailedDescriptions:!0}),(0,a.jsx)(g.Z.Item,{className:"mt-4",label:(0,a.jsxs)("span",{children:["Requests per minute Limit (RPM)"," ",(0,a.jsx)(P.Z,{title:"Maximum number of API requests this key can make per minute. Helps prevent abuse and manage load",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==l?void 0:l.rpm_limit)!==null&&(null==l?void 0:l.rpm_limit)!==void 0?null==l?void 0:l.rpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&l&&null!==l.rpm_limit&&s>l.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(l.rpm_limit))}}],children:(0,a.jsx)(v.Z,{step:1,width:400})}),(0,a.jsx)(B.Z,{type:"rpm",name:"rpm_limit_type",className:"mt-4",initialValue:null,form:X,showDetailedDescriptions:!0}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Guardrails"," ",(0,a.jsx)(P.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:Y?"Select existing guardrails or enter new ones":"Premium feature - Upgrade to set guardrails by key",children:(0,a.jsx)(p.default,{mode:"tags",style:{width:"100%"},disabled:!Y,placeholder:Y?"Select or enter guardrails":"Premium feature - Upgrade to set guardrails by key",options:ex.map(e=>({value:e,label:e}))})}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Prompts"," ",(0,a.jsx)(P.Z,{title:"Allow this key to use specific prompt templates",children:(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/prompt_management",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})})]}),name:"prompts",className:"mt-4",help:Y?"Select existing prompts or enter new ones":"Premium feature - Upgrade to set prompts by key",children:(0,a.jsx)(p.default,{mode:"tags",style:{width:"100%"},disabled:!Y,placeholder:Y?"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:eg.map(e=>({value:e,label:e}))})}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed Pass Through Routes"," ",(0,a.jsx)(P.Z,{title:"Allow this key to use specific pass through routes",children:(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/pass_through",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})})]}),name:"allowed_passthrough_routes",className:"mt-4",help:Y?"Select existing pass through routes or enter new ones":"Premium feature - Upgrade to set pass through routes by key",children:(0,a.jsx)(k.Z,{onChange:e=>X.setFieldValue("allowed_passthrough_routes",e),value:X.getFieldValue("allowed_passthrough_routes"),accessToken:H,placeholder:Y?"Select or enter pass through routes":"Premium feature - Upgrade to set pass through routes by key",disabled:!Y,teamId:eb?eb.team_id:null})}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,a.jsx)(P.Z,{title:"Select which vector stores this key can access. If none selected, the key will have access to all available vector stores",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this key can access. Leave empty for access to all vector stores",children:(0,a.jsx)(Z.Z,{onChange:e=>X.setFieldValue("allowed_vector_store_ids",e),value:X.getFieldValue("allowed_vector_store_ids"),accessToken:H,placeholder:"Select vector stores (optional)"})}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Metadata"," ",(0,a.jsx)(P.Z,{title:"JSON object with additional information about this key. Used for tracking or custom logic",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"metadata",className:"mt-4",children:(0,a.jsx)(b.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Tags"," ",(0,a.jsx)(P.Z,{title:"Tags for tracking spend and/or doing tag-based routing. Used for analytics and filtering",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"tags",className:"mt-4",help:"Tags for tracking spend and/or doing tag-based routing.",children:(0,a.jsx)(p.default,{mode:"tags",style:{width:"100%"},placeholder:"Enter tags",tokenSeparators:[","],options:eu})}),(0,a.jsxs)(d.Z,{className:"mt-4 mb-4",onClick:()=>{eT||(ez(),eE(!0))},children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)("b",{children:"MCP Settings"})}),(0,a.jsxs)(c.Z,{children:[(0,a.jsx)(g.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,a.jsx)(P.Z,{title:"Select which MCP servers or access groups this key can access",children:(0,a.jsx)(C.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",help:"Select MCP servers or access groups this key can access",children:(0,a.jsx)(D.Z,{onChange:e=>X.setFieldValue("allowed_mcp_servers_and_groups",e),value:X.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:H,placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(g.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(b.default,{type:"hidden"})}),(0,a.jsx)(g.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,a.jsx)("div",{className:"mt-6",children:(0,a.jsx)(R.Z,{accessToken:H,selectedServers:(null===(e=X.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:X.getFieldValue("mcp_tool_permissions")||{},onChange:e=>X.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),Y?(0,a.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)("b",{children:"Logging Settings"})}),(0,a.jsx)(c.Z,{children:(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(M.Z,{value:ey,onChange:ef,premiumUser:!0,disabledCallbacks:eF,onDisabledCallbacksChange:eU})})})]}):(0,a.jsx)(P.Z,{title:(0,a.jsxs)("span",{children:["Key-level logging settings is an enterprise feature, get in touch -",(0,a.jsx)("a",{href:"https://www.litellm.ai/enterprise",target:"_blank",children:"https://www.litellm.ai/enterprise"})]}),placement:"top",children:(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("div",{style:{opacity:.5},children:(0,a.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)("b",{children:"Logging Settings"})}),(0,a.jsx)(c.Z,{children:(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(M.Z,{value:ey,onChange:ef,premiumUser:!1,disabledCallbacks:eF,onDisabledCallbacksChange:eU})})})]})}),(0,a.jsx)("div",{style:{position:"absolute",inset:0,cursor:"not-allowed"}})]})}),(0,a.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)("b",{children:"Model Aliases"})}),(0,a.jsx)(c.Z,{children:(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)(u.Z,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used in API calls. This allows you to create shortcuts for specific models."}),(0,a.jsx)(V.Z,{accessToken:H,initialModelAliases:eV,onAliasUpdate:eK,showExampleConfig:!1})]})})]}),(0,a.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)("b",{children:"Key Lifecycle"})}),(0,a.jsx)(c.Z,{children:(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(O.Z,{form:X,autoRotationEnabled:eO,onAutoRotationChange:eB,rotationInterval:eq,onRotationIntervalChange:eG})})})]}),(0,a.jsxs)(d.Z,{className:"mt-4 mb-4",children:[(0,a.jsx)(m.Z,{children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("b",{children:"Advanced Settings"}),(0,a.jsx)(P.Z,{title:(0,a.jsxs)("span",{children:["Learn more about advanced settings in our"," ",(0,a.jsx)("a",{href:w.proxyBaseUrl?"".concat(w.proxyBaseUrl,"/#/key%20management/generate_key_fn_key_generate_post"):"/#/key%20management/generate_key_fn_key_generate_post",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:"documentation"})]}),children:(0,a.jsx)(C.Z,{className:"text-gray-400 hover:text-gray-300 cursor-help"})})]})}),(0,a.jsx)(c.Z,{children:(0,a.jsx)(N.Z,{schemaComponent:"GenerateKeyRequest",form:X,excludedFields:["key_alias","team_id","models","duration","metadata","tags","guardrails","max_budget","budget_duration","tpm_limit","rpm_limit"]})})]})]})]})}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(f.ZP,{htmlType:"submit",disabled:eH,style:{opacity:eH?.5:1},children:"Create Key"})})]})}),e_&&(0,a.jsx)(j.Z,{title:"Create New User",visible:e_,onCancel:()=>eN(!1),footer:null,width:800,children:(0,a.jsx)(A.Z,{userID:s,accessToken:H,teams:L,possibleUIRoles:ek,onUserCreated:e=>{eZ(e),X.setFieldsValue({user_id:e}),eN(!1)},isEmbedded:!0})}),el&&(0,a.jsx)(j.Z,{visible:ee,onOk:eW,onCancel:eJ,footer:null,children:(0,a.jsxs)(n.Z,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(h.Z,{children:"Save your Key"}),(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons,"," ",(0,a.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,a.jsx)(i.Z,{numColSpan:1,children:null!=el?(0,a.jsxs)("div",{children:[(0,a.jsx)(u.Z,{className:"mt-3",children:"API Key:"}),(0,a.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,a.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:el})}),(0,a.jsx)(x.CopyToClipboard,{text:el,onCopy:()=>{K.Z.success("API Key copied to clipboard")},children:(0,a.jsx)(r.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,a.jsx)(u.Z,{children:"Key being created, this might take 30s"})})]})})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9681-49ea01accf85cac1.js b/litellm/proxy/_experimental/out/_next/static/chunks/9681-49ea01accf85cac1.js new file mode 100644 index 0000000000..79f32cbefa --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/9681-49ea01accf85cac1.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9681],{19046:function(e,t,s){s.d(t,{Dx:function(){return r.Z},Zb:function(){return a.Z},oi:function(){return l.Z},xv:function(){return n.Z},zx:function(){return o.Z}});var o=s(20831),a=s(12514),n=s(84264),l=s(49566),r=s(96761)},39681:function(e,t,s){s.d(t,{Z:function(){return eU}});var o=s(57437),a=s(2265),n=s(243),l=s(19046),r=s(93837),i=s(64482),c=s(65319),d=s(93192),m=s(52787),g=s(89970),u=s(87908),p=s(82680),x=s(73002),h=s(26433),f=s(19250);async function v(e,t,s,o,a,n,l,r,i,c,d,m,g,u,p){console.log=function(){},console.log("isLocal:",!1);let x=(0,f.getProxyBaseUrl)(),v={};a&&a.length>0&&(v["x-litellm-tags"]=a.join(","));let b=new h.ZP.OpenAI({apiKey:o,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:v});try{let a;let h=Date.now(),f=!1,v=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",allowed_tools:g,headers:{"x-litellm-api-key":"Bearer ".concat(o)}}]:void 0;for await(let o of(await b.chat.completions.create({model:s,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:c,messages:e,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...v?{tools:v,tool_choice:"auto"}:{}},{signal:n}))){var y,j,w,N,S,k,P,C,_;console.log("Stream chunk:",o);let e=null===(y=o.choices[0])||void 0===y?void 0:y.delta;if(console.log("Delta content:",null===(w=o.choices[0])||void 0===w?void 0:null===(j=w.delta)||void 0===j?void 0:j.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!f&&((null===(S=o.choices[0])||void 0===S?void 0:null===(N=S.delta)||void 0===N?void 0:N.content)||e&&e.reasoning_content)&&(f=!0,a=Date.now()-h,console.log("First token received! Time:",a,"ms"),r?(console.log("Calling onTimingData with:",a),r(a)):console.log("onTimingData callback is not defined!")),null===(P=o.choices[0])||void 0===P?void 0:null===(k=P.delta)||void 0===k?void 0:k.content){let e=o.choices[0].delta.content;t(e,o.model)}if(e&&e.image&&u&&(console.log("Image generated:",e.image),u(e.image.url,o.model)),e&&e.reasoning_content){let t=e.reasoning_content;l&&l(t)}if(e&&(null===(C=e.provider_specific_fields)||void 0===C?void 0:C.search_results)&&p&&(console.log("Search results found:",e.provider_specific_fields.search_results),p(e.provider_specific_fields.search_results)),o.usage&&i){console.log("Usage data found:",o.usage);let e={completionTokens:o.usage.completion_tokens,promptTokens:o.usage.prompt_tokens,totalTokens:o.usage.total_tokens};(null===(_=o.usage.completion_tokens_details)||void 0===_?void 0:_.reasoning_tokens)&&(e.reasoningTokens=o.usage.completion_tokens_details.reasoning_tokens),i(e)}}}catch(e){throw(null==n?void 0:n.aborted)&&console.log("Chat completion request was cancelled"),e}}var b=s(9114);async function y(e,t,s,o,a,n){console.log=function(){},console.log("isLocal:",!1);let l=(0,f.getProxyBaseUrl)(),r=new h.ZP.OpenAI({apiKey:o,baseURL:l,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{let o=await r.images.generate({model:s,prompt:e},{signal:n});if(console.log(o.data),o.data&&o.data[0]){if(o.data[0].url)t(o.data[0].url,s);else if(o.data[0].b64_json){let e=o.data[0].b64_json;t("data:image/png;base64,".concat(e),s)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==n?void 0:n.aborted)?console.log("Image generation request was cancelled"):b.Z.fromBackend("Error occurred while generating image. Please try again. Error: ".concat(e)),e}}async function j(e,t,s,o,a,n,l){console.log=function(){},console.log("isLocal:",!1);let r=(0,f.getProxyBaseUrl)(),i=new h.ZP.OpenAI({apiKey:a,baseURL:r,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let a=Array.isArray(e)?e:[e],n=[];for(let e=0;e1&&b.Z.success("Successfully processed ".concat(n.length," images"))}catch(e){if(console.error("Error making image edit request:",e),null==l?void 0:l.aborted)console.log("Image edits request was cancelled");else{var c;let t="Failed to edit image(s)";(null==e?void 0:null===(c=e.error)||void 0===c?void 0:c.message)?t=e.error.message:(null==e?void 0:e.message)&&(t=e.message),b.Z.fromBackend("Image edit failed: ".concat(t))}throw e}}async function w(e,t,s,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,r=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,g=arguments.length>12?arguments[12]:void 0,u=arguments.length>13?arguments[13]:void 0,p=arguments.length>14?arguments[14]:void 0,x=arguments.length>15?arguments[15]:void 0;if(!o)throw Error("API key is required");console.log=function(){};let v=(0,f.getProxyBaseUrl)(),y={};a&&a.length>0&&(y["x-litellm-tags"]=a.join(","));let j=new h.ZP.OpenAI({apiKey:o,baseURL:v,dangerouslyAllowBrowser:!0,defaultHeaders:y});try{let o=Date.now(),a=!1,h=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),f=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never",allowed_tools:g}]:void 0,v=await j.responses.create({model:s,input:h,stream:!0,litellm_trace_id:c,...u?{previous_response_id:u}:{},...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...f?{tools:f,tool_choice:"required"}:{}},{signal:n}),b="";for await(let e of v)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var w,N,S,k,P,C,_;if(((null===(w=e.type)||void 0===w?void 0:w.startsWith("response.mcp_"))||"response.output_item.done"===e.type&&((null===(N=e.item)||void 0===N?void 0:N.type)==="mcp_list_tools"||(null===(S=e.item)||void 0===S?void 0:S.type)==="mcp_call"))&&(console.log("MCP event received:",e),x)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||(null===(C=e.item)||void 0===C?void 0:C.id),item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};x(t)}if("response.output_item.done"===e.type&&(null===(k=e.item)||void 0===k?void 0:k.type)==="mcp_call"&&(null===(P=e.item)||void 0===P?void 0:P.name)&&(b=e.item.name,console.log("MCP tool used:",b)),"response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let n=e.delta;if(console.log("Text delta",n),n.trim().length>0&&(t("assistant",n,s),!a)){a=!0;let e=Date.now()-o;console.log("First token received! Time:",e,"ms"),r&&r(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&l&&l(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,s=t.usage;if(console.log("Usage data:",s),console.log("Response completed event:",t),t.id&&p&&(console.log("Response ID for session management:",t.id),p(t.id)),s&&i){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(_=s.completion_tokens_details)||void 0===_?void 0:_.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),i(e,b)}}}return v}catch(e){throw(null==n?void 0:n.aborted)?console.log("Responses API request was cancelled"):b.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var N=s(85498);async function S(e,t,s,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,r=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,g=arguments.length>12?arguments[12]:void 0;if(!o)throw Error("API key is required");console.log=function(){};let u=(0,f.getProxyBaseUrl)(),p={};a&&a.length>0&&(p["x-litellm-tags"]=a.join(","));let x=new N.ZP({apiKey:o,baseURL:u,dangerouslyAllowBrowser:!0,defaultHeaders:p});try{let a=Date.now(),p=!1,h=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(u,"/mcp"),require_approval:"never",allowed_tools:g,headers:{"x-litellm-api-key":"Bearer ".concat(o)}}]:void 0,f={model:s,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(f.vector_store_ids=d),m&&(f.guardrails=m),h&&(f.tools=h,f.tool_choice="auto"),x.messages.stream(f,{signal:n}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let o=e.delta;if(!p){p=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),r&&r(e)}"text_delta"===o.type?t("assistant",o.text,s):"reasoning_delta"===o.type&&l&&l(o.text)}if("message_delta"===e.type&&e.usage&&i){let t=e.usage;console.log("Usage data found:",t);let s={completionTokens:t.output_tokens,promptTokens:t.input_tokens,totalTokens:t.input_tokens+t.output_tokens};i(s)}}}catch(e){throw(null==n?void 0:n.aborted)?console.log("Anthropic messages request was cancelled"):b.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var k=s(51601);async function P(e){try{return(await (0,f.mcpToolsCall)(e)).tools||[]}catch(e){return console.error("Error fetching MCP tools:",e),[]}}var C=s(49817),_=s(17906),I=s(94263),Z=s(92280),T=e=>{let{endpointType:t,onEndpointChange:s,className:a}=e,n=[{value:C.KP.CHAT,label:"/v1/chat/completions"},{value:C.KP.RESPONSES,label:"/v1/responses"},{value:C.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:C.KP.IMAGE,label:"/v1/images/generations"},{value:C.KP.IMAGE_EDITS,label:"/v1/images/edits"}];return(0,o.jsxs)("div",{className:a,children:[(0,o.jsx)(Z.x,{children:"Endpoint Type:"}),(0,o.jsx)(m.default,{showSearch:!0,value:t,style:{width:"100%"},onChange:s,options:n,className:"rounded-md"})]})},E=e=>{let{onChange:t,value:s,className:n,accessToken:l}=e,[r,i]=(0,a.useState)([]),[c,d]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{(async()=>{if(l)try{let e=await (0,f.tagListCall)(l);console.log("List tags response:",e),i(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}})()},[]),(0,o.jsx)(m.default,{mode:"multiple",placeholder:"Select tags",onChange:t,value:s,loading:c,className:n,options:r.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})},A=s(97415),R=s(67479),U=s(88658),L=s(83322),M=s(70464),D=s(77565),K=e=>{let{reasoningContent:t}=e,[s,l]=(0,a.useState)(!0);return t?(0,o.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,o.jsxs)(x.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>l(!s),icon:(0,o.jsx)(L.Z,{}),children:[s?"Hide reasoning":"Show reasoning",s?(0,o.jsx)(M.Z,{className:"ml-1"}):(0,o.jsx)(D.Z,{className:"ml-1"})]}),s&&(0,o.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,o.jsx)(n.U,{components:{code(e){let{node:t,inline:s,className:a,children:n,...l}=e,r=/language-(\w+)/.exec(a||"");return!s&&r?(0,o.jsx)(_.Z,{style:I.Z,language:r[1],PreTag:"div",className:"rounded-md my-2",...l,children:String(n).replace(/\n$/,"")}):(0,o.jsx)("code",{className:"".concat(a," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...l,children:n})}},children:t})})]}):null},O=s(5540),z=s(71282),F=s(11741),H=s(16601),B=s(58630),G=e=>{let{timeToFirstToken:t,usage:s,toolName:a}=e;return t||s?(0,o.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==t&&(0,o.jsx)(g.Z,{title:"Time to first token",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(O.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:[(t/1e3).toFixed(2),"s"]})]})}),(null==s?void 0:s.promptTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Prompt tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(z.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["In: ",s.promptTokens]})]})}),(null==s?void 0:s.completionTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Completion tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(F.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Out: ",s.completionTokens]})]})}),(null==s?void 0:s.reasoningTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Reasoning tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(L.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Reasoning: ",s.reasoningTokens]})]})}),(null==s?void 0:s.totalTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Total tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(H.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Total: ",s.totalTokens]})]})}),a&&(0,o.jsx)(g.Z,{title:"Tool used",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(B.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Tool: ",a]})]})})]}):null},q=s(53508);let{Dragger:J}=c.default;var W=e=>{let{responsesUploadedImage:t,responsesImagePreviewUrl:s,onImageUpload:a,onRemoveImage:n}=e;return(0,o.jsx)(o.Fragment,{children:!t&&(0,o.jsx)(J,{beforeUpload:a,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,o.jsx)(g.Z,{title:"Attach image or PDF",children:(0,o.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,o.jsx)(q.Z,{style:{fontSize:"16px"}})})})})})};let V=e=>new Promise((t,s)=>{let o=new FileReader;o.onload=()=>{t(o.result.split(",")[1])},o.onerror=s,o.readAsDataURL(e)}),Y=async(e,t)=>{let s=await V(t),o=t.type||(t.name.toLowerCase().endsWith(".pdf")?"application/pdf":"image/jpeg");return{role:"user",content:[{type:"input_text",text:e},{type:"input_image",image_url:"data:".concat(o,";base64,").concat(s)}]}},X=(e,t,s,o)=>{let a="";t&&o&&(a=o.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(a):e};return t&&s&&(n.imagePreviewUrl=s),n},$=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;var Q=s(50010),ee=e=>{let{message:t}=e;if(!$(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,o.jsx)("div",{className:"mb-2",children:s?(0,o.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,o.jsx)("img",{src:t.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})};let{Dragger:et}=c.default;var es=e=>{let{chatUploadedImage:t,chatImagePreviewUrl:s,onImageUpload:a,onRemoveImage:n}=e;return(0,o.jsx)(o.Fragment,{children:!t&&(0,o.jsx)(et,{beforeUpload:a,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,o.jsx)(g.Z,{title:"Attach image or PDF",children:(0,o.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,o.jsx)(q.Z,{style:{fontSize:"16px"}})})})})})};let eo=e=>new Promise((t,s)=>{let o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=s,o.readAsDataURL(e)}),ea=async(e,t)=>({role:"user",content:[{type:"text",text:e},{type:"image_url",image_url:{url:await eo(t)}}]}),en=(e,t,s,o)=>{let a="";t&&o&&(a=o.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(a):e};return t&&s&&(n.imagePreviewUrl=s),n},el=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;var er=e=>{let{message:t}=e;if(!el(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,o.jsx)("div",{className:"mb-2",children:s?(0,o.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,o.jsx)("img",{src:t.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})},ei=s(63709),ec=s(15424),ed=s(23639),em=e=>{let{endpointType:t,responsesSessionId:s,useApiSessionManagement:a,onToggleSessionManagement:n}=e;return t!==C.KP.RESPONSES?null:(0,o.jsxs)("div",{className:"mb-4",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Session Management"}),(0,o.jsx)(g.Z,{title:"Choose between LiteLLM API session management (using previous_response_id) or UI-based session management (using chat history)",children:(0,o.jsx)(ec.Z,{className:"text-gray-400",style:{fontSize:"12px"}})})]}),(0,o.jsx)(ei.Z,{checked:a,onChange:n,checkedChildren:"API",unCheckedChildren:"UI",size:"small"})]}),(0,o.jsxs)("div",{className:"text-xs p-2 rounded-md ".concat(s?"bg-green-50 text-green-700 border border-green-200":"bg-blue-50 text-blue-700 border border-blue-200"),children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)(ec.Z,{style:{fontSize:"12px"}}),(()=>{if(!s)return a?"API Session: Ready":"UI Session: Ready";let e=a?"Response ID":"UI Session",t=s.slice(0,10);return"".concat(e,": ").concat(t,"...")})()]}),s&&(0,o.jsx)(g.Z,{title:(0,o.jsxs)("div",{className:"text-xs",children:[(0,o.jsx)("div",{className:"mb-1",children:"Copy response ID to continue session:"}),(0,o.jsx)("div",{className:"bg-gray-800 text-gray-100 p-2 rounded font-mono text-xs whitespace-pre-wrap",children:'curl -X POST "your-proxy-url/v1/responses" \\\n -H "Authorization: Bearer your-api-key" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "model": "your-model",\n "input": [{"role": "user", "content": "your message", "type": "message"}],\n "previous_response_id": "'.concat(s,'",\n "stream": true\n }\'')})]}),overlayStyle:{maxWidth:"500px"},children:(0,o.jsx)("button",{onClick:()=>{s&&(navigator.clipboard.writeText(s),b.Z.success("Response ID copied to clipboard!"))},className:"ml-2 p-1 hover:bg-green-100 rounded transition-colors",children:(0,o.jsx)(ed.Z,{style:{fontSize:"12px"}})})})]}),(0,o.jsx)("div",{className:"text-xs opacity-75 mt-1",children:s?a?"LiteLLM API session active - context maintained server-side":"UI session active - context maintained client-side":a?"LiteLLM will manage session using previous_response_id":"UI will manage session using chat history"})]})]})},eg=s(29),eu=s.n(eg),ep=s(44851);let{Text:ex}=d.default,{Panel:eh}=ep.default;var ef=e=>{var t,s;let{events:a,className:n}=e;if(console.log("MCPEventsDisplay: Received events:",a),!a||0===a.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let l=a.find(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0}),r=a.filter(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_call"});return(console.log("MCPEventsDisplay: toolsEvent:",l),console.log("MCPEventsDisplay: mcpCallEvents:",r),l||0!==r.length)?(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac "+"mcp-events-display ".concat(n||""),children:[(0,o.jsx)(eu(),{id:"32b14b04f420f3ac",children:'.openai-mcp-tools.jsx-32b14b04f420f3ac{position:relative;margin:0;padding:0}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac{background:transparent!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{padding:0 0 0 20px!important;background:transparent!important;border:none!important;font-size:14px!important;color:#9ca3af!important;font-weight:400!important;line-height:20px!important;min-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{background:transparent!important;color:#6b7280!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{position:absolute!important;left:2px!important;top:2px!important;color:#9ca3af!important;font-size:10px!important;width:16px!important;height:16px!important;display:-webkit-box!important;display:-webkit-flex!important;display:-moz-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-webkit-align-items:center!important;-moz-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:center!important;-webkit-justify-content:center!important;-moz-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{position:absolute;left:9px;top:18px;bottom:0;width:.5px;background-color:#f3f4f6;opacity:.8}.tool-item.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:13px;color:#4b5563;line-height:18px;padding:0;margin:0;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac{margin-bottom:12px;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{font-size:13px;color:#6b7280;font-weight:500;margin-bottom:4px}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid#f3f4f6;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;color:#374151;margin:0;white-space:pre-wrap;word-wrap:break-word}.mcp-approved.jsx-32b14b04f420f3ac{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;color:#6b7280}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:bold}.mcp-response-content.jsx-32b14b04f420f3ac{font-size:13px;color:#374151;line-height:1.5;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace}'}),(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,o.jsxs)(ep.default,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:l?["list-tools"]:r.map((e,t)=>"mcp-call-".concat(t)),children:[l&&(0,o.jsx)(eh,{header:"List tools",children:(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:null===(s=l.item)||void 0===s?void 0:null===(t=s.tools)||void 0===t?void 0:t.map((e,t)=>(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},t))})},"list-tools"),r.map((e,t)=>{var s,a,n;return(0,o.jsx)(eh,{header:(null===(s=e.item)||void 0===s?void 0:s.name)||"Tool call",children:(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:(null===(a=e.item)||void 0===a?void 0:a.arguments)&&(0,o.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,o.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),(null===(n=e.item)||void 0===n?void 0:n.output)&&(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},"mcp-call-".concat(t))})]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)},ev=s(44625),eb=s(38434);function ey(e){let{searchResults:t}=e,[s,n]=(0,a.useState)(!0),[l,r]=(0,a.useState)({});if(!t||0===t.length)return null;let i=(e,t)=>{let s="".concat(e,"-").concat(t);r(e=>({...e,[s]:!e[s]}))},c=t.reduce((e,t)=>e+t.data.length,0);return(0,o.jsxs)("div",{className:"search-results-content mt-1 mb-2",children:[(0,o.jsxs)(x.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>n(!s),icon:(0,o.jsx)(ev.Z,{}),children:[s?"Hide sources":"Show sources (".concat(c,")"),s?(0,o.jsx)(M.Z,{className:"ml-1"}):(0,o.jsx)(D.Z,{className:"ml-1"})]}),s&&(0,o.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm",children:(0,o.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"text-xs text-gray-600 mb-2 flex items-center gap-2",children:[(0,o.jsx)("span",{className:"font-medium",children:"Query:"}),(0,o.jsxs)("span",{className:"italic",children:['"',e.search_query,'"']}),(0,o.jsx)("span",{className:"text-gray-400",children:"•"}),(0,o.jsxs)("span",{className:"text-gray-500",children:[e.data.length," result",1!==e.data.length?"s":""]})]}),(0,o.jsx)("div",{className:"space-y-2",children:e.data.map((e,s)=>{let a=l["".concat(t,"-").concat(s)]||!1;return(0,o.jsxs)("div",{className:"border border-gray-200 rounded-md overflow-hidden bg-white",children:[(0,o.jsx)("div",{className:"flex items-center justify-between p-2 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>i(t,s),children:(0,o.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,o.jsx)("svg",{className:"w-4 h-4 text-gray-400 transition-transform flex-shrink-0 ".concat(a?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,o.jsx)(eb.Z,{className:"text-gray-400 flex-shrink-0",style:{fontSize:"12px"}}),(0,o.jsx)("span",{className:"text-xs font-medium text-gray-700 truncate",children:e.filename||e.file_id||"Result ".concat(s+1)}),(0,o.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-blue-100 text-blue-700 font-mono flex-shrink-0",children:e.score.toFixed(3)})]})}),a&&(0,o.jsx)("div",{className:"border-t border-gray-200 bg-white",children:(0,o.jsxs)("div",{className:"p-3 space-y-2",children:[e.content.map((e,t)=>(0,o.jsx)("div",{children:(0,o.jsx)("div",{className:"text-xs font-mono bg-gray-50 p-2 rounded text-gray-800 whitespace-pre-wrap break-words",children:e.text})},t)),e.attributes&&Object.keys(e.attributes).length>0&&(0,o.jsxs)("div",{className:"mt-2 pt-2 border-t border-gray-100",children:[(0,o.jsx)("div",{className:"text-xs text-gray-500 mb-1 font-medium",children:"Metadata:"}),(0,o.jsx)("div",{className:"space-y-1",children:Object.entries(e.attributes).map(e=>{let[t,s]=e;return(0,o.jsxs)("div",{className:"text-xs flex gap-2",children:[(0,o.jsxs)("span",{className:"text-gray-500 font-medium",children:[t,":"]}),(0,o.jsx)("span",{className:"text-gray-700 font-mono break-all",children:String(s)})]},t)})})]})]})})]},s)})})]},t))})})]})}var ej=s(61935),ew=s(92403),eN=s(69993),eS=s(12660),ek=s(71891),eP=s(57400),eC=s(26430),e_=s(11894),eI=s(15883),eZ=s(99890),eT=s(26349),eE=s(79276);let{TextArea:eA}=i.default,{Dragger:eR}=c.default;var eU=e=>{let{accessToken:t,token:s,userRole:i,userID:c,disabledPersonalKeyCreation:h}=e,[f,N]=(0,a.useState)(!1),[Z,L]=(0,a.useState)([]),[M,D]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedMCPTools");try{let t=e?JSON.parse(e):[];return Array.isArray(t)?t:t?[t]:[]}catch(e){return console.error("Error parsing selectedMCPTools from sessionStorage",e),[]}}),[O,z]=(0,a.useState)(!1),[F,H]=(0,a.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return h?"custom":"session"}),[q,J]=(0,a.useState)(()=>sessionStorage.getItem("apiKey")||""),[V,$]=(0,a.useState)(""),[et,eo]=(0,a.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[el,ei]=(0,a.useState)(()=>sessionStorage.getItem("selectedModel")||void 0),[ed,eg]=(0,a.useState)(!1),[eu,ep]=(0,a.useState)([]),ex=(0,a.useRef)(null),[eh,eb]=(0,a.useState)(()=>sessionStorage.getItem("endpointType")||C.KP.CHAT),[eU,eL]=(0,a.useState)(!1),eM=(0,a.useRef)(null),[eD,eK]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[eO,ez]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[eF,eH]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[eB,eG]=(0,a.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[eq,eJ]=(0,a.useState)(()=>sessionStorage.getItem("responsesSessionId")||null),[eW,eV]=(0,a.useState)(()=>{let e=sessionStorage.getItem("useApiSessionManagement");return!e||JSON.parse(e)}),[eY,eX]=(0,a.useState)([]),[e$,eQ]=(0,a.useState)([]),[e0,e1]=(0,a.useState)(null),[e4,e2]=(0,a.useState)(null),[e3,e6]=(0,a.useState)(null),[e5,e8]=(0,a.useState)(null),[e7,e9]=(0,a.useState)(!1),[te,tt]=(0,a.useState)(""),[ts,to]=(0,a.useState)("openai"),[ta,tn]=(0,a.useState)([]),tl=(0,a.useRef)(null),tr=async()=>{let e="session"===F?t:q;if(e){z(!0);try{let t=await P(e);L(t)}catch(e){console.error("Error fetching MCP tools:",e)}finally{z(!1)}}};(0,a.useEffect)(()=>{f&&tr()},[f,t,q,F]),(0,a.useEffect)(()=>{e7&&tt((0,U.L)({apiKeySource:F,accessToken:t,apiKey:q,inputMessage:V,chatHistory:et,selectedTags:eD,selectedVectorStores:eO,selectedGuardrails:eF,selectedMCPTools:M,endpointType:eh,selectedModel:el,selectedSdk:ts}))},[e7,ts,F,t,q,V,et,eD,eO,eF,M,eh,el]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(et))},500);return()=>{clearTimeout(e)}},[et]),(0,a.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(F)),sessionStorage.setItem("apiKey",q),sessionStorage.setItem("endpointType",eh),sessionStorage.setItem("selectedTags",JSON.stringify(eD)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(eO)),sessionStorage.setItem("selectedGuardrails",JSON.stringify(eF)),sessionStorage.setItem("selectedMCPTools",JSON.stringify(M)),el?sessionStorage.setItem("selectedModel",el):sessionStorage.removeItem("selectedModel"),eB?sessionStorage.setItem("messageTraceId",eB):sessionStorage.removeItem("messageTraceId"),eq?sessionStorage.setItem("responsesSessionId",eq):sessionStorage.removeItem("responsesSessionId"),sessionStorage.setItem("useApiSessionManagement",JSON.stringify(eW))},[F,q,el,eh,eD,eO,eF,eB,eq,eW,M]),(0,a.useEffect)(()=>{let e="session"===F?t:q;if(!e||!s||!i||!c){console.log("userApiKey or token or userRole or userID is missing = ",e,s,i,c);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let t=await (0,k.p)(e);console.log("Fetched models:",t),ep(t);let s=t.some(e=>e.model_group===el);t.length?s||ei(t[0].model_group):ei(void 0)}catch(e){console.error("Error fetching model info:",e)}})(),tr()},[t,c,i,F,q,s]),(0,a.useEffect)(()=>{tl.current&&setTimeout(()=>{var e;null===(e=tl.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[et]);let ti=(e,t,s)=>{console.log("updateTextUI called with:",e,t,s),eo(o=>{let a=o[o.length-1];if(!a||a.role!==e||a.isImage)return[...o,{role:e,content:t,model:s}];{var n;let e={...a,content:a.content+t,model:null!==(n=a.model)&&void 0!==n?n:s};return[...o.slice(0,-1),e]}})},tc=e=>{eo(t=>{let s=t[t.length-1];return s&&"assistant"===s.role&&!s.isImage?[...t.slice(0,t.length-1),{...s,reasoningContent:(s.reasoningContent||"")+e}]:t.length>0&&"user"===t[t.length-1].role?[...t,{role:"assistant",content:"",reasoningContent:e}]:t})},td=e=>{console.log("updateTimingData called with:",e),eo(t=>{let s=t[t.length-1];if(console.log("Current last message:",s),s&&"assistant"===s.role){console.log("Updating assistant message with timeToFirstToken:",e);let o=[...t.slice(0,t.length-1),{...s,timeToFirstToken:e}];return console.log("Updated chat history:",o),o}return s&&"user"===s.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...t,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),t)})},tm=(e,t)=>{console.log("Received usage data:",e),eo(s=>{let o=s[s.length-1];if(o&&"assistant"===o.role){console.log("Updating message with usage data:",e);let a={...o,usage:e,toolName:t};return console.log("Updated message:",a),[...s.slice(0,s.length-1),a]}return s})},tg=e=>{console.log("Received search results:",e),eo(t=>{let s=t[t.length-1];if(s&&"assistant"===s.role){console.log("Updating message with search results");let o={...s,searchResults:e};return[...t.slice(0,t.length-1),o]}return t})},tu=e=>{console.log("Received response ID for session management:",e),eW&&eJ(e)},tp=e=>{console.log("ChatUI: Received MCP event:",e),tn(t=>{if(t.some(t=>t.item_id===e.item_id&&t.type===e.type&&t.sequence_number===e.sequence_number))return console.log("ChatUI: Duplicate MCP event, skipping"),t;let s=[...t,e];return console.log("ChatUI: Updated MCP events:",s),s})},tx=(e,t)=>{eo(s=>[...s,{role:"assistant",content:e,model:t,isImage:!0}])},th=(e,t)=>{eo(s=>{let o=s[s.length-1];if(!o||"assistant"!==o.role||o.isImage)return[...s,{role:"assistant",content:"",model:t,image:{url:e,detail:"auto"}}];{var a;let n={...o,image:{url:e,detail:"auto"},model:null!==(a=o.model)&&void 0!==a?a:t};return[...s.slice(0,-1),n]}})},tf=e=>{eX(t=>[...t,e]);let t=URL.createObjectURL(e);return eQ(e=>[...e,t]),!1},tv=e=>{e$[e]&&URL.revokeObjectURL(e$[e]),eX(t=>t.filter((t,s)=>s!==e)),eQ(t=>t.filter((t,s)=>s!==e))},tb=()=>{e$.forEach(e=>{URL.revokeObjectURL(e)}),eX([]),eQ([])},ty=()=>{e4&&URL.revokeObjectURL(e4),e1(null),e2(null)},tj=()=>{e5&&URL.revokeObjectURL(e5),e6(null),e8(null)},tw=async()=>{let e;if(""===V.trim())return;if(eh===C.KP.IMAGE_EDITS&&0===eY.length){b.Z.fromBackend("Please upload at least one image for editing");return}if(!s||!i||!c)return;let o="session"===F?t:q;if(!o){b.Z.fromBackend("Please provide an API key or select Current UI Session");return}eM.current=new AbortController;let a=eM.current.signal;if(eh===C.KP.RESPONSES&&e0)try{e=await Y(V,e0)}catch(e){b.Z.fromBackend("Failed to process image. Please try again.");return}else if(eh===C.KP.CHAT&&e3)try{e=await ea(V,e3)}catch(e){b.Z.fromBackend("Failed to process image. Please try again.");return}else e={role:"user",content:V};let n=eB||(0,r.Z)();eB||eG(n),eo([...et,eh===C.KP.RESPONSES&&e0?X(V,!0,e4||void 0,e0.name):eh===C.KP.CHAT&&e3?en(V,!0,e5||void 0,e3.name):X(V,!1)]),tn([]),eL(!0);try{if(el){if(eh===C.KP.CHAT){let t=[...et.filter(e=>!e.isImage).map(e=>{let{role:t,content:s}=e;return{role:t,content:"string"==typeof s?s:""}}),e];await v(t,(e,t)=>ti("assistant",e,t),el,o,eD,a,tc,td,tm,n,eO.length>0?eO:void 0,eF.length>0?eF:void 0,M,th,tg)}else if(eh===C.KP.IMAGE)await y(V,(e,t)=>tx(e,t),el,o,eD,a);else if(eh===C.KP.IMAGE_EDITS)eY.length>0&&await j(1===eY.length?eY[0]:eY,V,(e,t)=>tx(e,t),el,o,eD,a);else if(eh===C.KP.RESPONSES){let t;t=eW&&eq?[e]:[...et.filter(e=>!e.isImage).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e],await w(t,(e,t,s)=>ti(e,t,s),el,o,eD,a,tc,td,tm,n,eO.length>0?eO:void 0,eF.length>0?eF:void 0,M,eW?eq:null,tu,tp)}else if(eh===C.KP.ANTHROPIC_MESSAGES){let t=[...et.filter(e=>!e.isImage).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e];await S(t,(e,t,s)=>ti(e,t,s),el,o,eD,a,tc,td,tm,n,eO.length>0?eO:void 0,eF.length>0?eF:void 0,M)}}}catch(e){a.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),ti("assistant","Error fetching response:"+e))}finally{eL(!1),eM.current=null,eh===C.KP.IMAGE_EDITS&&tb(),eh===C.KP.RESPONSES&&e0&&ty(),eh===C.KP.CHAT&&e3&&tj()}$("")};if(i&&"Admin Viewer"===i){let{Title:e,Paragraph:t}=d.default;return(0,o.jsxs)("div",{children:[(0,o.jsx)(e,{level:1,children:"Access Denied"}),(0,o.jsx)(t,{children:"Ask your proxy admin for access to test models"})]})}let tN=(0,o.jsx)(ej.Z,{style:{fontSize:24},spin:!0});return(0,o.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,o.jsx)(l.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,o.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,o.jsx)(l.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ew.Z,{className:"mr-2"})," API Key Source"]}),(0,o.jsx)(m.default,{disabled:h,value:F,style:{width:"100%"},onChange:e=>{H(e)},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===F&&(0,o.jsx)(l.oi,{className:"mt-2",placeholder:"Enter custom API key",type:"password",onValueChange:J,value:q,icon:ew.Z})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(eN.Z,{className:"mr-2"})," Select Model"]}),(0,o.jsx)(m.default,{value:el,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),ei(e),eg("custom"===e)},options:[...Array.from(new Set(eu.map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%"},showSearch:!0,className:"rounded-md"}),ed&&(0,o.jsx)(l.oi,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{ex.current&&clearTimeout(ex.current),ex.current=setTimeout(()=>{ei(e)},500)}})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(eS.Z,{className:"mr-2"})," Endpoint Type"]}),(0,o.jsx)(T,{endpointType:eh,onEndpointChange:e=>{eb(e)},className:"mb-4"}),(0,o.jsx)(em,{endpointType:eh,responsesSessionId:eq,useApiSessionManagement:eW,onToggleSessionManagement:e=>{eV(e),e||eJ(null)}})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ek.Z,{className:"mr-2"})," Tags"]}),(0,o.jsx)(E,{value:eD,onChange:eK,className:"mb-4",accessToken:t||""})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(B.Z,{className:"mr-2"})," MCP Tool",(0,o.jsx)(g.Z,{className:"ml-1",title:"Select MCP tools to use in your conversation, only available for /v1/responses endpoint",children:(0,o.jsx)(ec.Z,{})})]}),(0,o.jsx)(m.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:M,onChange:e=>D(e),loading:O,className:"mb-4",allowClear:!0,optionLabelProp:"label",disabled:eh!==C.KP.RESPONSES,maxTagCount:"responsive",children:Array.isArray(Z)&&Z.map(e=>(0,o.jsx)(m.default.Option,{value:e.name,label:(0,o.jsx)("div",{className:"font-medium",children:e.name}),children:(0,o.jsxs)("div",{className:"flex flex-col py-1",children:[(0,o.jsx)("span",{className:"font-medium",children:e.name}),(0,o.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ev.Z,{className:"mr-2"})," Vector Store",(0,o.jsx)(g.Z,{className:"ml-1",title:(0,o.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store"," ",(0,o.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,o.jsx)(ec.Z,{})})]}),(0,o.jsx)(A.Z,{value:eO,onChange:ez,className:"mb-4",accessToken:t||""})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(eP.Z,{className:"mr-2"})," Guardrails",(0,o.jsx)(g.Z,{className:"ml-1",title:(0,o.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails"," ",(0,o.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,o.jsx)(ec.Z,{})})]}),(0,o.jsx)(R.Z,{value:eF,onChange:eH,className:"mb-4",accessToken:t||""})]})]})]}),(0,o.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,o.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,o.jsx)(l.Dx,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsx)(l.zx,{onClick:()=>{eo([]),eG(null),eJ(null),tn([]),tb(),ty(),tj(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),sessionStorage.removeItem("responsesSessionId"),b.Z.success("Chat history cleared.")},className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:eC.Z,children:"Clear Chat"}),(0,o.jsx)(l.zx,{onClick:()=>e9(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:e_.Z,children:"Get Code"})]})]}),(0,o.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===et.length&&(0,o.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,o.jsx)(eN.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,o.jsx)(l.xv,{children:"Start a conversation or generate an image"})]}),et.map((e,t)=>(0,o.jsx)("div",{children:(0,o.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,o.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,o.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,o.jsx)(eI.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,o.jsx)(eN.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,o.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,o.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,o.jsx)(K,{reasoningContent:e.reasoningContent}),"assistant"===e.role&&t===et.length-1&&ta.length>0&&eh===C.KP.RESPONSES&&(0,o.jsx)("div",{className:"mb-3",children:(0,o.jsx)(ef,{events:ta})}),"assistant"===e.role&&e.searchResults&&(0,o.jsx)(ey,{searchResults:e.searchResults}),(0,o.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,o.jsx)("img",{src:"string"==typeof e.content?e.content:"",alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):(0,o.jsxs)(o.Fragment,{children:[eh===C.KP.RESPONSES&&(0,o.jsx)(ee,{message:e}),eh===C.KP.CHAT&&(0,o.jsx)(er,{message:e}),(0,o.jsx)(n.U,{components:{code(e){let{node:t,inline:s,className:a,children:n,...l}=e,r=/language-(\w+)/.exec(a||"");return!s&&r?(0,o.jsx)(_.Z,{style:I.Z,language:r[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...l,children:String(n).replace(/\n$/,"")}):(0,o.jsx)("code",{className:"".concat(a," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...l,children:n})},pre:e=>{let{node:t,...s}=e;return(0,o.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})}},children:"string"==typeof e.content?e.content:""}),e.image&&(0,o.jsx)("div",{className:"mt-3",children:(0,o.jsx)("img",{src:e.image.url,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}})})]}),"assistant"===e.role&&(e.timeToFirstToken||e.usage)&&(0,o.jsx)(G,{timeToFirstToken:e.timeToFirstToken,usage:e.usage,toolName:e.toolName})]})]})})},t)),eU&&ta.length>0&&eh===C.KP.RESPONSES&&et.length>0&&"user"===et[et.length-1].role&&(0,o.jsx)("div",{className:"text-left mb-4",children:(0,o.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"#ffffff",border:"1px solid #f0f0f0",textAlign:"left"},children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,o.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"#f5f5f5"},children:(0,o.jsx)(eN.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,o.jsx)("strong",{className:"text-sm capitalize",children:"Assistant"})]}),(0,o.jsx)(ef,{events:ta})]})}),eU&&(0,o.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,o.jsx)(u.Z,{indicator:tN})}),(0,o.jsx)("div",{ref:tl,style:{height:"1px"}})]}),(0,o.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[eh===C.KP.IMAGE_EDITS&&(0,o.jsx)("div",{className:"mb-4",children:0===eY.length?(0,o.jsxs)(eR,{beforeUpload:tf,accept:"image/*",showUploadList:!1,className:"border-dashed border-2 border-gray-300 rounded-lg p-4",children:[(0,o.jsx)("p",{className:"ant-upload-drag-icon",children:(0,o.jsx)(eZ.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,o.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag images to upload"}),(0,o.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats. Multiple images supported."})]}):(0,o.jsxs)("div",{className:"flex flex-wrap gap-2",children:[eY.map((e,t)=>(0,o.jsxs)("div",{className:"relative inline-block",children:[(0,o.jsx)("img",{src:e$[t]||"",alt:"Upload preview ".concat(t+1),className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,o.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:()=>tv(t),children:(0,o.jsx)(eT.Z,{})})]},t)),(0,o.jsxs)("div",{className:"flex items-center justify-center w-32 h-32 border-2 border-dashed border-gray-300 rounded-md hover:border-gray-400 cursor-pointer",onClick:()=>{var e;return null===(e=document.getElementById("additional-image-upload"))||void 0===e?void 0:e.click()},children:[(0,o.jsxs)("div",{className:"text-center",children:[(0,o.jsx)(eZ.Z,{style:{fontSize:"24px",color:"#666"}}),(0,o.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Add more"})]}),(0,o.jsx)("input",{id:"additional-image-upload",type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:e=>{Array.from(e.target.files||[]).forEach(e=>tf(e))}})]})]})}),eh===C.KP.RESPONSES&&e0&&(0,o.jsx)("div",{className:"mb-2",children:(0,o.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,o.jsx)("div",{className:"relative inline-block",children:e0.name.toLowerCase().endsWith(".pdf")?(0,o.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"16px",color:"white"}})}):(0,o.jsx)("img",{src:e4||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:e0.name}),(0,o.jsx)("div",{className:"text-xs text-gray-500",children:e0.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,o.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:ty,children:(0,o.jsx)(eT.Z,{style:{fontSize:"12px"}})})]})}),eh===C.KP.CHAT&&e3&&(0,o.jsx)("div",{className:"mb-2",children:(0,o.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,o.jsx)("div",{className:"relative inline-block",children:e3.name.toLowerCase().endsWith(".pdf")?(0,o.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"16px",color:"white"}})}):(0,o.jsx)("img",{src:e5||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:e3.name}),(0,o.jsx)("div",{className:"text-xs text-gray-500",children:e3.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,o.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:tj,children:(0,o.jsx)(eT.Z,{style:{fontSize:"12px"}})})]})}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,o.jsxs)("div",{className:"flex-shrink-0 mr-2",children:[eh===C.KP.RESPONSES&&!e0&&(0,o.jsx)(W,{responsesUploadedImage:e0,responsesImagePreviewUrl:e4,onImageUpload:e=>(e1(e),e2(URL.createObjectURL(e)),!1),onRemoveImage:ty}),eh===C.KP.CHAT&&!e3&&(0,o.jsx)(es,{chatUploadedImage:e3,chatImagePreviewUrl:e5,onImageUpload:e=>(e6(e),e8(URL.createObjectURL(e)),!1),onRemoveImage:tj})]}),(0,o.jsx)(eA,{value:V,onChange:e=>$(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),tw())},placeholder:eh===C.KP.CHAT||eh===C.KP.RESPONSES||eh===C.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":eh===C.KP.IMAGE_EDITS?"Describe how you want to edit the image...":"Describe the image you want to generate...",disabled:eU,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,o.jsx)(l.zx,{onClick:tw,disabled:eU||!V.trim(),className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,o.jsx)(eE.Z,{style:{fontSize:"14px"}})})]}),eU&&(0,o.jsx)(l.zx,{onClick:()=>{eM.current&&(eM.current.abort(),eM.current=null,eL(!1),b.Z.info("Request cancelled"))},className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:eT.Z,children:"Cancel"})]})]})]})]})}),(0,o.jsxs)(p.Z,{title:"Generated Code",visible:e7,onCancel:()=>e9(!1),footer:null,width:800,children:[(0,o.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(l.xv,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,o.jsx)(m.default,{value:ts,onChange:e=>to(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,o.jsx)(x.ZP,{onClick:()=>{navigator.clipboard.writeText(te),b.Z.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,o.jsx)(_.Z,{language:"python",style:I.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:te})]}),"custom"===F&&(0,o.jsx)(p.Z,{title:"Select MCP Tool",visible:f,onCancel:()=>N(!1),onOk:()=>{N(!1),b.Z.success("MCP tool selection updated")},width:800,children:O?(0,o.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,o.jsx)(u.Z,{indicator:(0,o.jsx)(ej.Z,{style:{fontSize:24},spin:!0})})}):(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsx)(l.xv,{className:"text-gray-600 block mb-4",children:"Select the MCP tools you want to use in your conversation."}),(0,o.jsx)(m.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:M,onChange:e=>D(e),optionLabelProp:"label",allowClear:!0,maxTagCount:"responsive",children:Z.map(e=>(0,o.jsx)(m.default.Option,{value:e.name,label:(0,o.jsx)("div",{className:"font-medium",children:e.name}),children:(0,o.jsxs)("div",{className:"flex flex-col py-1",children:[(0,o.jsx)("span",{className:"font-medium",children:e.name}),(0,o.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]})})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9883-85b2991f131b4416.js b/litellm/proxy/_experimental/out/_next/static/chunks/9883-85b2991f131b4416.js deleted file mode 100644 index 1dca341cb5..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9883-85b2991f131b4416.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9883],{99883:function(e,s,t){t.d(s,{Z:function(){return ed}});var a=t(57437),r=t(2265),l=t(40278),n=t(12514),i=t(49804),c=t(14042),o=t(67101),d=t(12485),u=t(18135),m=t(35242),x=t(29706),h=t(77991),p=t(21626),j=t(97214),_=t(28241),g=t(58834),f=t(69552),y=t(71876),k=t(84264),Z=t(96761),v=t(19431),b=t(5540),N=t(49634),w=t(77398),q=t.n(w);let S=[{label:"Today",shortLabel:"today",getValue:()=>({from:q()().startOf("day").toDate(),to:q()().endOf("day").toDate()})},{label:"Last 7 days",shortLabel:"7d",getValue:()=>({from:q()().subtract(7,"days").startOf("day").toDate(),to:q()().endOf("day").toDate()})},{label:"Last 30 days",shortLabel:"30d",getValue:()=>({from:q()().subtract(30,"days").startOf("day").toDate(),to:q()().endOf("day").toDate()})},{label:"Month to date",shortLabel:"MTD",getValue:()=>({from:q()().startOf("month").toDate(),to:q()().endOf("day").toDate()})},{label:"Year to date",shortLabel:"YTD",getValue:()=>({from:q()().startOf("year").toDate(),to:q()().endOf("day").toDate()})}];var C=e=>{let{value:s,onValueChange:t,label:l="Select Time Range",showTimeRange:n=!0}=e,[i,c]=(0,r.useState)(!1),[o,d]=(0,r.useState)(s),[u,m]=(0,r.useState)(null),[x,h]=(0,r.useState)(""),[p,j]=(0,r.useState)(""),_=(0,r.useRef)(null),g=(0,r.useCallback)(e=>{if(!e.from||!e.to)return null;for(let s of S){let t=s.getValue(),a=q()(e.from).isSame(q()(t.from),"day"),r=q()(e.to).isSame(q()(t.to),"day");if(a&&r)return s.shortLabel}return null},[]);(0,r.useEffect)(()=>{m(g(s))},[s,g]);let f=(0,r.useCallback)(()=>{if(!x||!p)return{isValid:!0,error:""};let e=q()(x,"YYYY-MM-DD"),s=q()(p,"YYYY-MM-DD");return e.isValid()&&s.isValid()?s.isBefore(e)?{isValid:!1,error:"End date cannot be before start date"}:{isValid:!0,error:""}:{isValid:!1,error:"Invalid date format"}},[x,p])();(0,r.useEffect)(()=>{s.from&&h(q()(s.from).format("YYYY-MM-DD")),s.to&&j(q()(s.to).format("YYYY-MM-DD")),d(s)},[s]),(0,r.useEffect)(()=>{let e=e=>{_.current&&!_.current.contains(e.target)&&c(!1)};return i&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[i]);let y=(0,r.useCallback)((e,s)=>{if(!e||!s)return"Select date range";let t=e=>q()(e).format("D MMM, HH:mm");return"".concat(t(e)," - ").concat(t(s))},[]),k=(0,r.useCallback)(e=>{let s;if(!e.from)return e;let t={...e},a=new Date(e.from);return s=new Date(e.to?e.to:e.from),a.toDateString(),s.toDateString(),a.setHours(0,0,0,0),s.setHours(23,59,59,999),t.from=a,t.to=s,t},[]),Z=e=>{let{from:s,to:t}=e.getValue();d({from:s,to:t}),m(e.shortLabel),h(q()(s).format("YYYY-MM-DD")),j(q()(t).format("YYYY-MM-DD"))},w=(0,r.useCallback)(()=>{try{if(x&&p&&f.isValid){let e=q()(x,"YYYY-MM-DD").startOf("day"),s=q()(p,"YYYY-MM-DD").endOf("day");if(e.isValid()&&s.isValid()){let t={from:e.toDate(),to:s.toDate()};d(t);let a=g(t);m(a)}}}catch(e){console.warn("Invalid date format:",e)}},[x,p,f.isValid,g]);return(0,r.useEffect)(()=>{w()},[w]),(0,a.jsxs)("div",{children:[l&&(0,a.jsx)(v.x,{className:"mb-2",children:l}),(0,a.jsxs)("div",{className:"relative",ref:_,children:[(0,a.jsx)("div",{className:"w-[300px] px-3 py-2 text-sm border border-gray-300 rounded-md bg-white cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500",onClick:()=>c(!i),children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(b.Z,{className:"text-gray-600"}),(0,a.jsx)("span",{className:"text-gray-900",children:y(s.from,s.to)})]}),(0,a.jsx)("svg",{className:"w-4 h-4 text-gray-400 transition-transform ".concat(i?"rotate-180":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),i&&(0,a.jsx)("div",{className:"absolute top-full left-0 z-[9999] min-w-[600px] mt-1 bg-white border border-gray-200 rounded-lg shadow-xl",children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsxs)("div",{className:"w-1/2 border-r border-gray-200",children:[(0,a.jsx)("div",{className:"p-3 border-b border-gray-200",children:(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:"Relative time (today, 7d, 30d, MTD, YTD)"})}),(0,a.jsx)("div",{className:"h-[350px] overflow-y-auto",children:S.map(e=>{let s=u===e.shortLabel;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 cursor-pointer border-b border-gray-100 transition-colors ".concat(s?"bg-blue-50 hover:bg-blue-100 border-blue-200":"hover:bg-gray-50"),onClick:()=>Z(e),children:[(0,a.jsx)("span",{className:"text-sm ".concat(s?"text-blue-700 font-medium":"text-gray-700"),children:e.label}),(0,a.jsx)("span",{className:"text-xs px-2 py-1 rounded ".concat(s?"text-blue-700 bg-blue-100":"text-gray-500 bg-gray-100"),children:e.shortLabel})]},e.label)})})]}),(0,a.jsxs)("div",{className:"w-1/2 relative",children:[(0,a.jsx)("div",{className:"p-3.5 border-b border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(N.Z,{className:"text-gray-600"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:"Start and end dates"})]})}),(0,a.jsxs)("div",{className:"p-6 space-y-6 pb-20",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm text-gray-700 mb-1 block",children:"Start date"}),(0,a.jsx)("input",{type:"date",value:x,onChange:e=>h(e.target.value),className:"w-65 px-3 py-2 text-sm border rounded-md cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 ".concat(f.isValid?"border-gray-300":"border-red-300 focus:border-red-500 focus:ring-red-200")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm text-gray-700 mb-1 block",children:"End date"}),(0,a.jsx)("input",{type:"date",value:p,onChange:e=>j(e.target.value),className:"w-65 px-3 py-2 text-sm border rounded-md cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 ".concat(f.isValid?"border-gray-300":"border-red-300 focus:border-red-500 focus:ring-red-200")})]}),!f.isValid&&f.error&&(0,a.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("svg",{className:"w-4 h-4 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),(0,a.jsx)("span",{className:"text-sm text-red-700 font-medium",children:f.error})]})}),o.from&&o.to&&f.isValid&&(0,a.jsxs)("div",{className:"bg-blue-50 p-3 rounded-md",children:[(0,a.jsx)("div",{className:"text-xs text-blue-700 font-medium",children:"Preview:"}),(0,a.jsx)("div",{className:"text-sm text-blue-800",children:y(o.from,o.to)})]})]}),(0,a.jsx)("div",{className:"absolute bottom-4 right-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(v.z,{variant:"secondary",onClick:()=>{d(s),s.from&&h(q()(s.from).format("YYYY-MM-DD")),s.to&&j(q()(s.to).format("YYYY-MM-DD")),m(g(s)),c(!1)},children:"Cancel"}),(0,a.jsx)(v.z,{onClick:()=>{o.from&&o.to&&f.isValid&&(t(o),requestIdleCallback(()=>{t(k(o))},{timeout:100}),c(!1))},disabled:!o.from||!o.to||!f.isValid,children:"Apply"})]})})]})]})})]}),n&&s.from&&s.to&&(0,a.jsxs)(v.x,{className:"mt-2 text-xs text-gray-500",children:[q()(s.from).format("MMM D, YYYY [at] HH:mm:ss")," -"," ",q()(s.to).format("MMM D, YYYY [at] HH:mm:ss")]})]})},T=t(19250),D=t(47375),L=t(83438),E=t(75105),A=t(44851),M=t(59872);function F(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function O(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}let U={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6"},Y=e=>{let{active:s,payload:t,label:r}=e;if(s&&t&&t.length){let e=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),s=(e,s)=>{let t=s.substring(s.indexOf(".")+1);if(e.metrics&&t in e.metrics)return e.metrics[t]};return(0,a.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,a.jsx)("p",{className:"text-tremor-content-strong",children:r}),t.map(t=>{var r;let l=null===(r=t.dataKey)||void 0===r?void 0:r.toString();if(!l||!t.payload)return null;let n=s(t.payload,l),i=l.includes("spend"),c=void 0!==n?i?"$".concat(n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})):n.toLocaleString():"N/A",o=U[t.color]||t.color;return(0,a.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:o}}),(0,a.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:e(l)})]}),(0,a.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:c})]},l)})]})}return null},V=e=>{let{categories:s,colors:t}=e,r=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return(0,a.jsx)("div",{className:"flex items-center justify-end space-x-4",children:s.map((e,s)=>{let l=U[t[s]]||t[s];return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:l}}),(0,a.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:r(e)})]},e)})})},I=e=>{var s,t;let{modelName:r,metrics:i}=e;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(o.Z,{numItems:4,className:"gap-4",children:[(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(k.Z,{children:"Total Requests"}),(0,a.jsx)(Z.Z,{children:i.total_requests.toLocaleString()})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(k.Z,{children:"Total Successful Requests"}),(0,a.jsx)(Z.Z,{children:i.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(k.Z,{children:"Total Tokens"}),(0,a.jsx)(Z.Z,{children:i.total_tokens.toLocaleString()}),(0,a.jsxs)(k.Z,{children:[Math.round(i.total_tokens/i.total_successful_requests)," avg per successful request"]})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(k.Z,{children:"Total Spend"}),(0,a.jsxs)(Z.Z,{children:["$",(0,M.pw)(i.total_spend,2)]}),(0,a.jsxs)(k.Z,{children:["$",(0,M.pw)(i.total_spend/i.total_successful_requests,3)," per successful request"]})]})]}),i.top_api_keys&&i.top_api_keys.length>0&&(0,a.jsxs)(n.Z,{className:"mt-4",children:[(0,a.jsx)(Z.Z,{children:"Top API Keys by Spend"}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-2",children:i.top_api_keys.map((e,s)=>(0,a.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(k.Z,{className:"font-medium",children:e.key_alias||"".concat(e.api_key.substring(0,10),"...")}),e.team_id&&(0,a.jsxs)(k.Z,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsxs)(k.Z,{className:"font-medium",children:["$",(0,M.pw)(e.spend,2)]}),(0,a.jsxs)(k.Z,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),(0,a.jsxs)(o.Z,{numItems:2,className:"gap-4",children:[(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(Z.Z,{children:"Total Tokens"}),(0,a.jsx)(V,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,a.jsx)(E.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:F,customTooltip:Y,showLegend:!1})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(Z.Z,{children:"Requests per day"}),(0,a.jsx)(V,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,a.jsx)(l.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:F,customTooltip:Y,showLegend:!1})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(Z.Z,{children:"Spend per day"}),(0,a.jsx)(V,{categories:["metrics.spend"],colors:["green"]})]}),(0,a.jsx)(l.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:e=>"$".concat((0,M.pw)(e,2,!0)),yAxisWidth:72})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(Z.Z,{children:"Success vs Failed Requests"}),(0,a.jsx)(V,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,a.jsx)(E.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:F,stack:!0,customTooltip:Y,showLegend:!1})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(Z.Z,{children:"Prompt Caching Metrics"}),(0,a.jsx)(V,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsxs)(k.Z,{children:["Cache Read: ",(null===(s=i.total_cache_read_input_tokens)||void 0===s?void 0:s.toLocaleString())||0," tokens"]}),(0,a.jsxs)(k.Z,{children:["Cache Creation: ",(null===(t=i.total_cache_creation_input_tokens)||void 0===t?void 0:t.toLocaleString())||0," tokens"]})]}),(0,a.jsx)(E.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:F,customTooltip:Y,showLegend:!1})]})]})]})},z=e=>{let{modelMetrics:s}=e,t=Object.keys(s).sort((e,t)=>""===e?1:""===t?-1:s[t].total_spend-s[e].total_spend),r={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(s).forEach(e=>{r.total_requests+=e.total_requests,r.total_successful_requests+=e.total_successful_requests,r.total_tokens+=e.total_tokens,r.total_spend+=e.total_spend,r.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,r.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{r.daily_data[e.date]||(r.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),r.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,r.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,r.daily_data[e.date].total_tokens+=e.metrics.total_tokens,r.daily_data[e.date].api_requests+=e.metrics.api_requests,r.daily_data[e.date].spend+=e.metrics.spend,r.daily_data[e.date].successful_requests+=e.metrics.successful_requests,r.daily_data[e.date].failed_requests+=e.metrics.failed_requests,r.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,r.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let l=Object.entries(r.daily_data).map(e=>{let[s,t]=e;return{date:s,metrics:t}}).sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime());return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,a.jsx)(Z.Z,{children:"Overall Usage"}),(0,a.jsxs)(o.Z,{numItems:4,className:"gap-4 mb-4",children:[(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(k.Z,{children:"Total Requests"}),(0,a.jsx)(Z.Z,{children:r.total_requests.toLocaleString()})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(k.Z,{children:"Total Successful Requests"}),(0,a.jsx)(Z.Z,{children:r.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(k.Z,{children:"Total Tokens"}),(0,a.jsx)(Z.Z,{children:r.total_tokens.toLocaleString()})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(k.Z,{children:"Total Spend"}),(0,a.jsxs)(Z.Z,{children:["$",(0,M.pw)(r.total_spend,2)]})]})]}),(0,a.jsxs)(o.Z,{numItems:2,className:"gap-4",children:[(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(Z.Z,{children:"Total Tokens Over Time"}),(0,a.jsx)(V,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,a.jsx)(E.Z,{className:"mt-4",data:l,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:F,customTooltip:Y,showLegend:!1})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Total Requests Over Time"}),(0,a.jsx)(E.Z,{className:"mt-4",data:l,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["emerald","red"],valueFormatter:e=>e.toLocaleString(),stack:!0,customTooltip:Y,showLegend:!1})]})]})]}),(0,a.jsx)(A.default,{defaultActiveKey:t[0],children:t.map(e=>(0,a.jsx)(A.default.Panel,{header:(0,a.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,a.jsx)(Z.Z,{children:s[e].label||"Unknown Item"}),(0,a.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,a.jsxs)("span",{children:["$",(0,M.pw)(s[e].total_spend,2)]}),(0,a.jsxs)("span",{children:[s[e].total_requests.toLocaleString()," requests"]})]})]}),children:(0,a.jsx)(I,{modelName:e||"Unknown Model",metrics:s[e]})},e))})]})},R=(e,s)=>{let t=e.metadata.key_alias||"key-hash-".concat(s),a=e.metadata.team_id;return a?"".concat(t," (team_id: ").concat(a,")"):t},$=(e,s)=>{let t={};return e.results.forEach(e=>{Object.entries(e.breakdown[s]||{}).forEach(a=>{let[r,l]=a;t[r]||(t[r]={label:"api_keys"===s?R(l,r):r,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],daily_data:[]}),t[r].total_requests+=l.metrics.api_requests,t[r].prompt_tokens+=l.metrics.prompt_tokens,t[r].completion_tokens+=l.metrics.completion_tokens,t[r].total_tokens+=l.metrics.total_tokens,t[r].total_spend+=l.metrics.spend,t[r].total_successful_requests+=l.metrics.successful_requests,t[r].total_failed_requests+=l.metrics.failed_requests,t[r].total_cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,t[r].total_cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0,t[r].daily_data.push({date:e.date,metrics:{prompt_tokens:l.metrics.prompt_tokens,completion_tokens:l.metrics.completion_tokens,total_tokens:l.metrics.total_tokens,api_requests:l.metrics.api_requests,spend:l.metrics.spend,successful_requests:l.metrics.successful_requests,failed_requests:l.metrics.failed_requests,cache_read_input_tokens:l.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:l.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==s&&Object.entries(t).forEach(a=>{let[r,l]=a,n={};e.results.forEach(e=>{var t;let a=null===(t=e.breakdown[s])||void 0===t?void 0:t[r];a&&"api_key_breakdown"in a&&Object.entries(a.api_key_breakdown||{}).forEach(e=>{let[s,t]=e;n[s]||(n[s]={api_key:s,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),n[s].spend+=t.metrics.spend,n[s].requests+=t.metrics.api_requests,n[s].tokens+=t.metrics.total_tokens})}),t[r].top_api_keys=Object.values(n).sort((e,s)=>s.spend-e.spend).slice(0,5)}),Object.values(t).forEach(e=>{e.daily_data.sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime())}),t};var P=t(35829),W=t(97765),K=t(52787),B=t(89970),H=t(20831),G=e=>{let{accessToken:s,selectedTags:t,formatAbbreviatedNumber:n}=e,[i,c]=(0,r.useState)({results:[],total_count:0,page:1,page_size:50,total_pages:0}),[o,v]=(0,r.useState)(!1),[b,N]=(0,r.useState)(1),w=async()=>{if(s){v(!0);try{let e=await (0,T.perUserAnalyticsCall)(s,b,50,t.length>0?t:void 0);c(e)}catch(e){console.error("Failed to fetch per-user data:",e)}finally{v(!1)}}};return(0,r.useEffect)(()=>{w()},[s,t,b]),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(Z.Z,{children:"Per User Usage"}),(0,a.jsx)(W.Z,{children:"Individual developer usage metrics"}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(m.Z,{className:"mb-6",children:[(0,a.jsx)(d.Z,{children:"User Details"}),(0,a.jsx)(d.Z,{children:"Usage Distribution"})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(f.Z,{children:"User ID"}),(0,a.jsx)(f.Z,{children:"User Email"}),(0,a.jsx)(f.Z,{children:"User Agent"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Success Generations"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Total Tokens"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Failed Requests"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Total Cost"})]})}),(0,a.jsx)(j.Z,{children:i.results.slice(0,10).map((e,s)=>(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(_.Z,{children:(0,a.jsx)(k.Z,{className:"font-medium",children:e.user_id})}),(0,a.jsx)(_.Z,{children:(0,a.jsx)(k.Z,{children:e.user_email||"N/A"})}),(0,a.jsx)(_.Z,{children:(0,a.jsx)(k.Z,{children:e.user_agent||"Unknown"})}),(0,a.jsx)(_.Z,{className:"text-right",children:(0,a.jsx)(k.Z,{children:n(e.successful_requests)})}),(0,a.jsx)(_.Z,{className:"text-right",children:(0,a.jsx)(k.Z,{children:n(e.total_tokens)})}),(0,a.jsx)(_.Z,{className:"text-right",children:(0,a.jsx)(k.Z,{children:n(e.failed_requests)})}),(0,a.jsx)(_.Z,{className:"text-right",children:(0,a.jsxs)(k.Z,{children:["$",n(e.spend,4)]})})]},s))})]}),i.results.length>10&&(0,a.jsxs)("div",{className:"mt-4 flex justify-between items-center",children:[(0,a.jsxs)(k.Z,{className:"text-sm text-gray-500",children:["Showing 10 of ",i.total_count," results"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(H.Z,{size:"sm",variant:"secondary",onClick:()=>{b>1&&N(b-1)},disabled:1===b,children:"Previous"}),(0,a.jsx)(H.Z,{size:"sm",variant:"secondary",onClick:()=>{b=i.total_pages,children:"Next"})]})]})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)(Z.Z,{className:"text-lg",children:"User Usage Distribution"}),(0,a.jsx)(W.Z,{children:"Number of users by successful request frequency"})]}),(0,a.jsx)(l.Z,{data:(()=>{let e=new Map;i.results.forEach(s=>{let t=s.user_agent||"Unknown";e.set(t,(e.get(t)||0)+1)});let s=Array.from(e.entries()).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).slice(0,8).map(e=>{let[s]=e;return s}),t={"1-9 requests":{range:[1,9],agents:{}},"10-99 requests":{range:[10,99],agents:{}},"100-999 requests":{range:[100,999],agents:{}},"1K-9.9K requests":{range:[1e3,9999],agents:{}},"10K-99.9K requests":{range:[1e4,99999],agents:{}},"100K+ requests":{range:[1e5,1/0],agents:{}}};return i.results.forEach(e=>{let a=e.successful_requests,r=e.user_agent||"Unknown";s.includes(r)&&Object.entries(t).forEach(e=>{let[s,t]=e;a>=t.range[0]&&a<=t.range[1]&&(t.agents[r]||(t.agents[r]=0),t.agents[r]++)})}),Object.entries(t).map(e=>{let[t,a]=e,r={category:t};return s.forEach(e=>{r[e]=a.agents[e]||0}),r})})(),index:"category",categories:(()=>{let e=new Map;return i.results.forEach(s=>{let t=s.user_agent||"Unknown";e.set(t,(e.get(t)||0)+1)}),Array.from(e.entries()).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).slice(0,8).map(e=>{let[s]=e;return s})})(),colors:["blue","green","orange","red","purple","yellow","pink","indigo"],valueFormatter:e=>"".concat(e," users"),yAxisWidth:80,showLegend:!0,stack:!0})]})]})]})]})},J=t(91323);let X=e=>{let{isDateChanging:s=!1}=e;return(0,a.jsx)("div",{className:"flex items-center justify-center h-40",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,a.jsx)(J.S,{className:"size-5"}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"text-gray-600 text-sm font-medium",children:s?"Processing date selection...":"Loading chart data..."}),(0,a.jsx)("span",{className:"text-gray-400 text-xs mt-1",children:s?"This will only take a moment":"Fetching your data"})]})]})})};var Q=e=>{let{accessToken:s,userRole:t}=e,[i,c]=(0,r.useState)({results:[]}),[p,j]=(0,r.useState)({results:[]}),[_,g]=(0,r.useState)({results:[]}),[f,y]=(0,r.useState)({results:[]}),[v,b]=(0,r.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[N,w]=(0,r.useState)(""),[q,S]=(0,r.useState)([]),[D,L]=(0,r.useState)([]),[E,A]=(0,r.useState)(!1),[M,F]=(0,r.useState)(!1),[O,U]=(0,r.useState)(!1),[Y,V]=(0,r.useState)(!1),[I,z]=(0,r.useState)(!1),[R,$]=(0,r.useState)(!1),H=new Date,J=async()=>{if(s){A(!0);try{let e=await (0,T.tagDistinctCall)(s);S(e.results.map(e=>e.tag))}catch(e){console.error("Failed to fetch available tags:",e)}finally{A(!1)}}},Q=async()=>{if(s){F(!0);try{let e=await (0,T.tagDauCall)(s,H,N||void 0,D.length>0?D:void 0);c(e)}catch(e){console.error("Failed to fetch DAU data:",e)}finally{F(!1)}}},ee=async()=>{if(s){U(!0);try{let e=await (0,T.tagWauCall)(s,H,N||void 0,D.length>0?D:void 0);j(e)}catch(e){console.error("Failed to fetch WAU data:",e)}finally{U(!1)}}},es=async()=>{if(s){V(!0);try{let e=await (0,T.tagMauCall)(s,H,N||void 0,D.length>0?D:void 0);g(e)}catch(e){console.error("Failed to fetch MAU data:",e)}finally{V(!1)}}},et=async()=>{if(s&&v.from&&v.to){z(!0);try{let e=await (0,T.userAgentSummaryCall)(s,v.from,v.to,D.length>0?D:void 0);y(e)}catch(e){console.error("Failed to fetch user agent summary data:",e)}finally{z(!1),$(!1)}}};(0,r.useEffect)(()=>{J()},[s]),(0,r.useEffect)(()=>{if(!s)return;let e=setTimeout(()=>{Q(),ee(),es()},50);return()=>clearTimeout(e)},[s,N,D]),(0,r.useEffect)(()=>{if(!v.from||!v.to)return;let e=setTimeout(()=>{et()},50);return()=>clearTimeout(e)},[s,v,D]);let ea=e=>e.startsWith("User-Agent: ")?e.replace("User-Agent: ",""):e,er=e=>e.length>15?e.substring(0,15)+"...":e,el=e=>Object.entries(e.reduce((e,s)=>(e[s.tag]=(e[s.tag]||0)+s.active_users,e),{})).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).map(e=>{let[s]=e;return s}),en=el(i.results).slice(0,10),ei=el(p.results).slice(0,10),ec=el(_.results).slice(0,10),eo=(()=>{let e=[],s=new Date;for(let t=6;t>=0;t--){let a=new Date(s);a.setDate(a.getDate()-t);let r={date:a.toISOString().split("T")[0]};en.forEach(e=>{r[ea(e)]=0}),e.push(r)}return i.results.forEach(s=>{let t=ea(s.tag),a=e.find(e=>e.date===s.date);a&&(a[t]=s.active_users)}),e})(),ed=(()=>{let e=[];for(let s=1;s<=7;s++){let t={week:"Week ".concat(s)};ei.forEach(e=>{t[ea(e)]=0}),e.push(t)}return p.results.forEach(s=>{let t=ea(s.tag),a=s.date.match(/Week (\d+)/);if(a){let r="Week ".concat(a[1]),l=e.find(e=>e.week===r);l&&(l[t]=s.active_users)}}),e})(),eu=(()=>{let e=[];for(let s=1;s<=7;s++){let t={month:"Month ".concat(s)};ec.forEach(e=>{t[ea(e)]=0}),e.push(t)}return _.results.forEach(s=>{let t=ea(s.tag),a=s.date.match(/Month (\d+)/);if(a){let r="Month ".concat(a[1]),l=e.find(e=>e.month===r);l&&(l[t]=s.active_users)}}),e})(),em=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e>=1e8||e>=1e7||e>=1e6?(e/1e6).toFixed(s)+"M":e>=1e4?(e/1e3).toFixed(s)+"K":e>=1e3?(e/1e3).toFixed(s)+"K":e.toFixed(s)};return(0,a.jsxs)("div",{className:"space-y-6 mt-6",children:[(0,a.jsx)(n.Z,{children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(Z.Z,{children:"Summary by User Agent"}),(0,a.jsx)(W.Z,{children:"Performance metrics for different user agents"})]}),(0,a.jsxs)("div",{className:"w-96",children:[(0,a.jsx)(k.Z,{className:"text-sm font-medium block mb-2",children:"Filter by User Agents"}),(0,a.jsx)(K.default,{mode:"multiple",placeholder:"All User Agents",value:D,onChange:L,style:{width:"100%"},showSearch:!0,allowClear:!0,loading:E,optionFilterProp:"label",className:"rounded-md",maxTagCount:"responsive",children:q.map(e=>{let s=ea(e),t=s.length>50?"".concat(s.substring(0,50),"..."):s;return(0,a.jsx)(K.default.Option,{value:e,label:t,title:s,children:t},e)})})]})]}),(0,a.jsx)(C,{value:v,onValueChange:e=>{$(!0),z(!0),b(e)}}),I?(0,a.jsx)(X,{isDateChanging:R}):(0,a.jsxs)(o.Z,{numItems:4,className:"gap-4",children:[(f.results||[]).slice(0,4).map((e,s)=>{let t=ea(e.tag),r=er(t);return(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(B.Z,{title:t,placement:"top",children:(0,a.jsx)(Z.Z,{className:"truncate",children:r})}),(0,a.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(k.Z,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,a.jsx)(P.Z,{className:"text-lg",children:em(e.successful_requests)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(k.Z,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,a.jsx)(P.Z,{className:"text-lg",children:em(e.total_tokens)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(k.Z,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,a.jsxs)(P.Z,{className:"text-lg",children:["$",em(e.total_spend,4)]})]})]})]},s)}),Array.from({length:Math.max(0,4-(f.results||[]).length)}).map((e,s)=>(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"No Data"}),(0,a.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(k.Z,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,a.jsx)(P.Z,{className:"text-lg",children:"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(k.Z,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,a.jsx)(P.Z,{className:"text-lg",children:"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(k.Z,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,a.jsx)(P.Z,{className:"text-lg",children:"-"})]})]})]},"empty-".concat(s)))]})]})}),(0,a.jsx)(n.Z,{children:(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(m.Z,{className:"mb-6",children:[(0,a.jsx)(d.Z,{children:"DAU/WAU/MAU"}),(0,a.jsx)(d.Z,{children:"Per User Usage (Last 30 Days)"})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(Z.Z,{children:"DAU, WAU & MAU per Agent"}),(0,a.jsx)(W.Z,{children:"Active users across different time periods"})]}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(m.Z,{className:"mb-6",children:[(0,a.jsx)(d.Z,{children:"DAU"}),(0,a.jsx)(d.Z,{children:"WAU"}),(0,a.jsx)(d.Z,{children:"MAU"})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(x.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(Z.Z,{className:"text-lg",children:"Daily Active Users - Last 7 Days"})}),M?(0,a.jsx)(X,{isDateChanging:!1}):(0,a.jsx)(l.Z,{data:eo,index:"date",categories:en.map(ea),valueFormatter:e=>em(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(Z.Z,{className:"text-lg",children:"Weekly Active Users - Last 7 Weeks"})}),O?(0,a.jsx)(X,{isDateChanging:!1}):(0,a.jsx)(l.Z,{data:ed,index:"week",categories:ei.map(ea),valueFormatter:e=>em(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(Z.Z,{className:"text-lg",children:"Monthly Active Users - Last 7 Months"})}),Y?(0,a.jsx)(X,{isDateChanging:!1}):(0,a.jsx)(l.Z,{data:eu,index:"month",categories:ec.map(ea),valueFormatter:e=>em(e),yAxisWidth:60,showLegend:!0,stack:!0})]})]})]})]}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(G,{accessToken:s,selectedTags:D,formatAbbreviatedNumber:em})})]})]})})]})},ee=t(42673),es=e=>{let{accessToken:s,entityType:t,entityId:v,userID:b,userRole:N,entityList:w,premiumUser:q}=e,[S,D]=(0,r.useState)({results:[],metadata:{total_spend:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0}}),E=$(S,"models"),A=$(S,"api_keys"),[F,U]=(0,r.useState)([]),[Y,V]=(0,r.useState)({from:new Date(Date.now()-24192e5),to:new Date}),I=async()=>{if(!s||!Y.from||!Y.to)return;let e=new Date(Y.from),a=new Date(Y.to);if("tag"===t)D(await (0,T.tagDailyActivityCall)(s,e,a,1,F.length>0?F:null));else if("team"===t)D(await (0,T.teamDailyActivityCall)(s,e,a,1,F.length>0?F:null));else throw Error("Invalid entity type")};(0,r.useEffect)(()=>{I()},[s,Y,v,F]);let R=()=>{let e={};return S.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=a.metrics.spend,e[t].requests+=a.metrics.api_requests,e[t].successful_requests+=a.metrics.successful_requests,e[t].failed_requests+=a.metrics.failed_requests,e[t].tokens+=a.metrics.total_tokens}catch(e){console.error("Error processing provider ".concat(t,": ").concat(e))}})}),Object.values(e).filter(e=>e.spend>0).sort((e,s)=>s.spend-e.spend)},P=e=>0===F.length?e:e.filter(e=>F.includes(e.metadata.id)),B=()=>{let e={};return S.results.forEach(s=>{Object.entries(s.breakdown.entities||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:a.metadata.team_alias||t,id:t}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.total_tokens+=a.metrics.total_tokens})}),P(Object.values(e).sort((e,s)=>s.metrics.spend-e.metrics.spend))};return(0,a.jsxs)("div",{style:{width:"100%"},children:[(0,a.jsxs)(o.Z,{numItems:2,className:"gap-2 w-full mb-4",children:[(0,a.jsx)(i.Z,{children:(0,a.jsx)(C,{value:Y,onValueChange:V})}),w&&w.length>0&&(0,a.jsxs)(i.Z,{children:[(0,a.jsxs)(k.Z,{children:["Filter by ","tag"===t?"Tags":"Teams"]}),(0,a.jsx)(K.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select ".concat("tag"===t?"tags":"teams"," to filter..."),value:F,onChange:U,options:(()=>{if(w)return w})(),className:"mt-2",allowClear:!0})]})]}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(m.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(d.Z,{children:"Cost"}),(0,a.jsx)(d.Z,{children:"Model Activity"}),(0,a.jsx)(d.Z,{children:"Key Activity"})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(x.Z,{children:(0,a.jsxs)(o.Z,{numItems:2,className:"gap-2 w-full",children:[(0,a.jsx)(i.Z,{numColSpan:2,children:(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)(Z.Z,{children:["tag"===t?"Tag":"Team"," Spend Overview"]}),(0,a.jsxs)(o.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Total Spend"}),(0,a.jsxs)(k.Z,{className:"text-2xl font-bold mt-2",children:["$",(0,M.pw)(S.metadata.total_spend,2)]})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Total Requests"}),(0,a.jsx)(k.Z,{className:"text-2xl font-bold mt-2",children:S.metadata.total_api_requests.toLocaleString()})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Successful Requests"}),(0,a.jsx)(k.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:S.metadata.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Failed Requests"}),(0,a.jsx)(k.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:S.metadata.total_failed_requests.toLocaleString()})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Total Tokens"}),(0,a.jsx)(k.Z,{className:"text-2xl font-bold mt-2",children:S.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,a.jsx)(i.Z,{numColSpan:2,children:(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Daily Spend"}),(0,a.jsx)(l.Z,{data:[...S.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:O,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:r}=e;if(!r||!(null==s?void 0:s[0]))return null;let l=s[0].payload,n=Object.keys(l.breakdown.entities||{}).length;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:l.date}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",(0,M.pw)(l.metrics.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",l.metrics.api_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Successful: ",l.metrics.successful_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Failed: ",l.metrics.failed_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",l.metrics.total_tokens]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["tag"===t?"Total Tags":"Total Teams",": ",n]}),(0,a.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,a.jsxs)("p",{className:"font-semibold",children:["Spend by ","tag"===t?"Tag":"Team",":"]}),Object.entries(l.breakdown.entities||{}).sort((e,s)=>{let[,t]=e,[,a]=s,r=t.metrics.spend;return a.metrics.spend-r}).slice(0,5).map(e=>{let[s,t]=e;return(0,a.jsxs)("p",{className:"text-sm text-gray-600",children:[t.metadata.team_alias||s,": $",(0,M.pw)(t.metrics.spend,2)]},s)}),n>5&&(0,a.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",n-5," more"]})]})]})}})]})}),(0,a.jsx)(i.Z,{numColSpan:2,children:(0,a.jsx)(n.Z,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,a.jsxs)(Z.Z,{children:["Spend Per ","tag"===t?"Tag":"Team"]}),(0,a.jsx)(W.Z,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,a.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,a.jsxs)("span",{children:["Get Started by Tracking cost per ",t," "]}),(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,a.jsxs)(o.Z,{numItems:2,className:"gap-6",children:[(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsx)(l.Z,{className:"mt-4 h-52",data:B().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?"".concat(e.metadata.alias.slice(0,15),"..."):e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:O,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.metadata.alias}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,M.pw)(r.metrics.spend,4)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.metrics.successful_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.metrics.failed_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens.toLocaleString()]})]})}})}),(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(f.Z,{children:"tag"===t?"Tag":"Team"}),(0,a.jsx)(f.Z,{children:"Spend"}),(0,a.jsx)(f.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(f.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(f.Z,{children:"Tokens"})]})}),(0,a.jsx)(j.Z,{children:B().filter(e=>e.metrics.spend>0).map(e=>(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(_.Z,{children:e.metadata.alias}),(0,a.jsxs)(_.Z,{children:["$",(0,M.pw)(e.metrics.spend,4)]}),(0,a.jsx)(_.Z,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,a.jsx)(_.Z,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,a.jsx)(_.Z,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Top API Keys"}),(0,a.jsx)(L.Z,{topKeys:(()=>{console.log("debugTags",{spendData:S});let e={};return S.results.forEach(s=>{let{breakdown:t}=s,{entities:a}=t;console.log("debugTags",{entities:a});let r=Object.keys(a).reduce((e,s)=>{let{api_key_breakdown:t}=a[s];return Object.keys(t).forEach(a=>{let r={tag:s,usage:t[a].metrics.spend};e[a]?e[a].push(r):e[a]=[r]}),e},{});console.log("debugTags",{tagDictionary:r}),Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:a.metadata.key_alias,team_id:a.metadata.team_id||null,tags:r[t]||[]}},console.log("debugTags",{keySpend:e})),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:s,userID:b,userRole:N,teams:null,premiumUser:q,showTags:"tag"===t})]})}),(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Top Models"}),(0,a.jsx)(l.Z,{className:"mt-4 h-40",data:(()=>{let e={};return S.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=a.metrics.spend}catch(e){console.error("Error adding spend for ".concat(t,": ").concat(e,", got metrics: ").concat(JSON.stringify(a)))}e[t].requests+=a.metrics.api_requests,e[t].successful_requests+=a.metrics.successful_requests,e[t].failed_requests+=a.metrics.failed_requests,e[t].tokens+=a.metrics.total_tokens})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,...t}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"display_key",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$".concat((0,M.pw)(e,2)),layout:"vertical",yAxisWidth:200,showLegend:!1})]})}),(0,a.jsx)(i.Z,{numColSpan:2,children:(0,a.jsx)(n.Z,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsx)(Z.Z,{children:"Provider Usage"}),(0,a.jsxs)(o.Z,{numItems:2,children:[(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsx)(c.Z,{className:"mt-4 h-40",data:R(),index:"provider",category:"spend",valueFormatter:e=>"$".concat((0,M.pw)(e,2)),colors:["cyan","blue","indigo","violet","purple"]})}),(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(f.Z,{children:"Provider"}),(0,a.jsx)(f.Z,{children:"Spend"}),(0,a.jsx)(f.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(f.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(f.Z,{children:"Tokens"})]})}),(0,a.jsx)(j.Z,{children:R().map(e=>(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(_.Z,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,a.jsx)("img",{src:(0,ee.dr)(e.provider).logo,alt:"".concat(e.provider," logo"),className:"w-4 h-4",onError:s=>{let t=s.target,a=t.parentElement;if(a){var r;let s=document.createElement("div");s.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",s.textContent=(null===(r=e.provider)||void 0===r?void 0:r.charAt(0))||"-",a.replaceChild(s,t)}}}),(0,a.jsx)("span",{children:e.provider})]})}),(0,a.jsxs)(_.Z,{children:["$",(0,M.pw)(e.spend,2)]}),(0,a.jsx)(_.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,a.jsx)(_.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,a.jsx)(_.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(z,{modelMetrics:E})}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(z,{modelMetrics:A})})]})]})]})},et=t(20347),ea=t(94789),er=t(49566),el=t(13634),en=t(82680),ei=t(87908),ec=t(9114),eo=e=>{let{isOpen:s,onClose:t,accessToken:l}=e,[n]=el.Z.useForm(),[i,c]=(0,r.useState)(!1),[o,d]=(0,r.useState)(null),[u,m]=(0,r.useState)(!1),[x,h]=(0,r.useState)("cloudzero"),[p,j]=(0,r.useState)(!1);(0,r.useEffect)(()=>{s&&l&&_()},[s,l]);let _=async()=>{m(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"}});if(e.ok){let s=await e.json();d(s),n.setFieldsValue({connection_id:s.connection_id})}else if(404!==e.status){let s=await e.json();ec.Z.fromBackend("Failed to load existing settings: ".concat(s.error||"Unknown error"))}}catch(e){console.error("Error loading CloudZero settings:",e),ec.Z.fromBackend("Failed to load existing settings")}finally{m(!1)}},g=async e=>{if(!l){ec.Z.fromBackend("No access token available");return}c(!0);try{let s={...e,timezone:"UTC"},t=await fetch(o?"/cloudzero/settings":"/cloudzero/init",{method:o?"PUT":"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify(s)}),a=await t.json();if(t.ok)return ec.Z.success(a.message||"CloudZero settings saved successfully"),d({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return ec.Z.fromBackend(a.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),ec.Z.fromBackend("Failed to save CloudZero settings"),!1}finally{c(!1)}},f=async()=>{if(!l){ec.Z.fromBackend("No access token available");return}j(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),s=await e.json();e.ok?(ec.Z.success(s.message||"Export to CloudZero completed successfully"),t()):ec.Z.fromBackend(s.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),ec.Z.fromBackend("Failed to export to CloudZero")}finally{j(!1)}},y=async()=>{j(!0);try{ec.Z.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),ec.Z.fromBackend("Failed to export CSV")}finally{j(!1)}},Z=async()=>{if("cloudzero"===x){if(!o){let e=await n.validateFields();if(!await g(e))return}await f()}else await y()},v=()=>{n.resetFields(),h("cloudzero"),d(null),t()},b=[{value:"cloudzero",label:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,a.jsx)("span",{children:"Export to CSV"})]})}];return(0,a.jsx)(en.Z,{title:"Export Data",open:s,onCancel:v,footer:null,width:600,destroyOnClose:!0,children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(k.Z,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,a.jsx)(K.default,{value:x,onChange:h,options:b,className:"w-full",size:"large"})]}),"cloudzero"===x&&(0,a.jsx)("div",{children:u?(0,a.jsx)("div",{className:"flex justify-center py-8",children:(0,a.jsx)(ei.Z,{size:"large"})}):(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsx)(ea.Z,{title:"Existing CloudZero Configuration",icon:()=>(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,a.jsxs)(k.Z,{children:["API Key: ",o.api_key_masked,(0,a.jsx)("br",{}),"Connection ID: ",o.connection_id]})}),!o&&(0,a.jsxs)(el.Z,{form:n,layout:"vertical",children:[(0,a.jsx)(el.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,a.jsx)(er.Z,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,a.jsx)(el.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,a.jsx)(er.Z,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===x&&(0,a.jsx)(ea.Z,{title:"CSV Export",icon:()=>(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,a.jsx)(k.Z,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,a.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,a.jsx)(H.Z,{variant:"secondary",onClick:v,children:"Cancel"}),(0,a.jsx)(H.Z,{onClick:Z,loading:i||p,disabled:i||p,children:"cloudzero"===x?"Export to CloudZero":"Export CSV"})]})]})})},ed=e=>{var s,t,v,b,N,w,q,S,E,A;let{accessToken:F,userRole:U,userID:Y,teams:V,premiumUser:I}=e,[R,P]=(0,r.useState)({results:[],metadata:{}}),[W,K]=(0,r.useState)(!1),[B,H]=(0,r.useState)(!1),G=(0,r.useMemo)(()=>new Date(Date.now()-6048e5),[]),J=(0,r.useMemo)(()=>new Date,[]),[ea,er]=(0,r.useState)({from:G,to:J}),[el,en]=(0,r.useState)([]),[ei,ec]=(0,r.useState)("groups"),[ed,eu]=(0,r.useState)(!1),em=async()=>{F&&en(Object.values(await (0,T.tagListCall)(F)).map(e=>({label:e.name,value:e.name})))};(0,r.useEffect)(()=>{em()},[F]);let ex=(null===(s=R.metadata)||void 0===s?void 0:s.total_spend)||0,eh=()=>{let e={};return R.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{provider:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}})},ep=(0,r.useCallback)(async()=>{if(!F||!ea.from||!ea.to)return;K(!0);let e=new Date(ea.from),s=new Date(ea.to);try{try{let t=await (0,T.userDailyActivityAggregatedCall)(F,e,s);P(t);return}catch(e){}let t=await (0,T.userDailyActivityCall)(F,e,s);if(t.metadata.total_pages<=1){P(t);return}let a=[...t.results],r={...t.metadata};for(let l=2;l<=t.metadata.total_pages;l++){let t=await (0,T.userDailyActivityCall)(F,e,s,l);a.push(...t.results),t.metadata&&(r.total_spend+=t.metadata.total_spend||0,r.total_api_requests+=t.metadata.total_api_requests||0,r.total_successful_requests+=t.metadata.total_successful_requests||0,r.total_failed_requests+=t.metadata.total_failed_requests||0,r.total_tokens+=t.metadata.total_tokens||0)}P({results:a,metadata:r})}catch(e){console.error("Error fetching user spend data:",e)}finally{K(!1),H(!1)}},[F,ea.from,ea.to]),ej=(0,r.useCallback)(e=>{H(!0),K(!0),er(e)},[]);(0,r.useEffect)(()=>{if(!ea.from||!ea.to)return;let e=setTimeout(()=>{ep()},50);return()=>clearTimeout(e)},[ep]);let e_=$(R,"models"),eg=$(R,"api_keys"),ef=$(R,"mcp_servers");return(0,a.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(m.Z,{variant:"solid",className:"mt-1",children:[et.ZL.includes(U||"")?(0,a.jsx)(d.Z,{children:"Global Usage"}):(0,a.jsx)(d.Z,{children:"Your Usage"}),(0,a.jsx)(d.Z,{children:"Team Usage"}),et.ZL.includes(U||"")?(0,a.jsx)(d.Z,{children:"Tag Usage"}):(0,a.jsx)(a.Fragment,{}),et.ZL.includes(U||"")?(0,a.jsx)(d.Z,{children:"User Agent Activity"}):(0,a.jsx)(a.Fragment,{})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(o.Z,{numItems:2,className:"gap-10 w-1/2 mb-4",children:(0,a.jsx)(i.Z,{children:(0,a.jsx)(C,{value:ea,onValueChange:ej})})}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(m.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(d.Z,{children:"Cost"}),(0,a.jsx)(d.Z,{children:"Model Activity"}),(0,a.jsx)(d.Z,{children:"Key Activity"}),(0,a.jsx)(d.Z,{children:"MCP Server Activity"})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(x.Z,{children:(0,a.jsxs)(o.Z,{numItems:2,className:"gap-2 w-full",children:[(0,a.jsxs)(i.Z,{numColSpan:2,children:[(0,a.jsxs)(k.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend"," ",new Date().toLocaleString("default",{month:"long"})," ","1 - ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,a.jsx)(D.Z,{userID:Y,userRole:U,accessToken:F,userSpend:ex,selectedTeam:null,userMaxBudget:null})]}),(0,a.jsx)(i.Z,{numColSpan:2,children:(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Usage Metrics"}),(0,a.jsxs)(o.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Total Requests"}),(0,a.jsx)(k.Z,{className:"text-2xl font-bold mt-2",children:(null===(v=R.metadata)||void 0===v?void 0:null===(t=v.total_api_requests)||void 0===t?void 0:t.toLocaleString())||0})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Successful Requests"}),(0,a.jsx)(k.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:(null===(N=R.metadata)||void 0===N?void 0:null===(b=N.total_successful_requests)||void 0===b?void 0:b.toLocaleString())||0})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Failed Requests"}),(0,a.jsx)(k.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:(null===(q=R.metadata)||void 0===q?void 0:null===(w=q.total_failed_requests)||void 0===w?void 0:w.toLocaleString())||0})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Total Tokens"}),(0,a.jsx)(k.Z,{className:"text-2xl font-bold mt-2",children:(null===(E=R.metadata)||void 0===E?void 0:null===(S=E.total_tokens)||void 0===S?void 0:S.toLocaleString())||0})]}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Average Cost per Request"}),(0,a.jsxs)(k.Z,{className:"text-2xl font-bold mt-2",children:["$",(0,M.pw)((ex||0)/((null===(A=R.metadata)||void 0===A?void 0:A.total_api_requests)||1),4)]})]})]})]})}),(0,a.jsx)(i.Z,{numColSpan:2,children:(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(Z.Z,{children:"Daily Spend"}),W?(0,a.jsx)(X,{isDateChanging:B}):(0,a.jsx)(l.Z,{data:[...R.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:O,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.date}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,M.pw)(r.metrics.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens]})]})}})]})}),(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsxs)(n.Z,{className:"h-full",children:[(0,a.jsx)(Z.Z,{children:"Top API Keys"}),(0,a.jsx)(L.Z,{topKeys:(()=>{let e={};return R.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:a.metadata.key_alias,team_id:null,tags:a.metadata.tags||[]}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),console.log("debugTags",{keySpend:e,userSpendData:R}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||[],spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:F,userID:Y,userRole:U,teams:null,premiumUser:I})]})}),(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsxs)(n.Z,{className:"h-full",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(Z.Z,{children:"groups"===ei?"Top Public Model Names":"Top Litellm Models"}),(0,a.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,a.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("groups"===ei?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>ec("groups"),children:"Public Model Name"}),(0,a.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("individual"===ei?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>ec("individual"),children:"Litellm Model Name"})]})]}),W?(0,a.jsx)(X,{isDateChanging:B}):(0,a.jsx)(l.Z,{className:"mt-4 h-40",data:"groups"===ei?(()=>{let e={};return R.results.forEach(s=>{Object.entries(s.breakdown.model_groups||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})():(()=>{let e={};return R.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:O,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.key}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,M.pw)(r.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.successful_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.failed_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.tokens.toLocaleString()]})]})}})]})}),(0,a.jsx)(i.Z,{numColSpan:2,children:(0,a.jsxs)(n.Z,{className:"h-full",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,a.jsx)(Z.Z,{children:"Spend by Provider"})}),W?(0,a.jsx)(X,{isDateChanging:B}):(0,a.jsxs)(o.Z,{numItems:2,children:[(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsx)(c.Z,{className:"mt-4 h-40",data:eh(),index:"provider",category:"spend",valueFormatter:e=>"$".concat((0,M.pw)(e,2)),colors:["cyan"]})}),(0,a.jsx)(i.Z,{numColSpan:1,children:(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(f.Z,{children:"Provider"}),(0,a.jsx)(f.Z,{children:"Spend"}),(0,a.jsx)(f.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(f.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(f.Z,{children:"Tokens"})]})}),(0,a.jsx)(j.Z,{children:eh().filter(e=>e.spend>0).map(e=>(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(_.Z,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,a.jsx)("img",{src:(0,ee.dr)(e.provider).logo,alt:"".concat(e.provider," logo"),className:"w-4 h-4",onError:s=>{let t=s.target,a=t.parentElement;if(a){var r;let s=document.createElement("div");s.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",s.textContent=(null===(r=e.provider)||void 0===r?void 0:r.charAt(0))||"-",a.replaceChild(s,t)}}}),(0,a.jsx)("span",{children:e.provider})]})}),(0,a.jsxs)(_.Z,{children:["$",(0,M.pw)(e.spend,2)]}),(0,a.jsx)(_.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,a.jsx)(_.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,a.jsx)(_.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})]})}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(z,{modelMetrics:e_})}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(z,{modelMetrics:eg})}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(z,{modelMetrics:ef})})]})]})]}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(es,{accessToken:F,entityType:"team",userID:Y,userRole:U,entityList:(null==V?void 0:V.map(e=>({label:e.team_alias,value:e.team_id})))||null,premiumUser:I})}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(es,{accessToken:F,entityType:"tag",userID:Y,userRole:U,entityList:el,premiumUser:I})}),(0,a.jsx)(x.Z,{children:(0,a.jsx)(Q,{accessToken:F,userRole:U})})]})]}),(0,a.jsx)(eo,{isOpen:ed,onClose:()=>eu(!1),accessToken:F})]})}},83438:function(e,s,t){t.d(s,{Z:function(){return p}});var a=t(57437),r=t(2265),l=t(40278),n=t(94292),i=t(19250);let c=e=>{let{key:s,info:t}=e;return{token:s,...t}};var o=t(12322),d=t(89970),u=t(16312),m=t(59872),x=t(44633),h=t(86462),p=e=>{let{topKeys:s,accessToken:t,userID:p,userRole:j,teams:_,premiumUser:g,showTags:f=!1}=e,[y,k]=(0,r.useState)(!1),[Z,v]=(0,r.useState)(null),[b,N]=(0,r.useState)(void 0),[w,q]=(0,r.useState)("table"),[S,C]=(0,r.useState)(new Set),T=e=>{C(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},D=async e=>{if(t)try{let s=await (0,i.keyInfoV1Call)(t,e.api_key),a=c(s);N(a),v(e.api_key),k(!0)}catch(e){console.error("Error fetching key info:",e)}},L=()=>{k(!1),v(null),N(void 0)};r.useEffect(()=>{let e=e=>{"Escape"===e.key&&y&&L()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[y]);let E=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(d.Z,{title:e.getValue(),children:(0,a.jsx)(u.z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>D(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],A={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let s=e.getValue();return s>0&&s<.01?"<$0.01":"$".concat((0,m.pw)(s,2))}},M=f?[...E,{header:"Tags",accessorKey:"tags",cell:e=>{let s=e.getValue(),t=e.row.original.api_key,r=S.has(t);if(!s||0===s.length)return"-";let l=s.sort((e,s)=>s.usage-e.usage),n=r?l:l.slice(0,2),i=s.length>2;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[n.map((e,s)=>(0,a.jsx)(d.Z,{title:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":"$".concat((0,m.pw)(e.usage,2))]})]}),children:(0,a.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},s)),i&&(0,a.jsx)("button",{onClick:()=>T(t),className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:r?"Show fewer tags":"Show all tags",children:r?(0,a.jsx)(x.Z,{className:"h-3 w-3 text-gray-500"}):(0,a.jsx)(h.Z,{className:"h-3 w-3 text-gray-500"})})]})})}},A]:[...E,A],F=s.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>q("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===w?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>q("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===w?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===w?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(l.Z,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:F,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>e?"$".concat((0,m.pw)(e,2)):"No Key Alias",onValueChange:e=>D(e),showTooltip:!0,customTooltip:e=>{var s,t;let r=null===(t=e.payload)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.payload;return(0,a.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==r?void 0:r.key_alias})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==r?void 0:r.api_key})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,a.jsxs)("span",{className:"text-white font-medium",children:["$",(0,m.pw)(null==r?void 0:r.spend,2)]})]})]})})}})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,a.jsx)(o.w,{columns:M,data:s,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),y&&Z&&b&&(console.log("Rendering modal with:",{isModalOpen:y,selectedKey:Z,keyData:b}),(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&L()},children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,a.jsx)("button",{onClick:L,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("div",{className:"p-6 h-full",children:(0,a.jsx)(n.Z,{keyId:Z,onClose:L,keyData:b,accessToken:t,userID:p,userRole:j,teams:_,premiumUser:g})})]})}))]})}},91323:function(e,s,t){t.d(s,{S:function(){return n}});var a=t(57437),r=t(2265),l=t(10012);function n(e){var s,t;let{className:n="",...i}=e,c=(0,r.useId)();return s=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),s=e.find(e=>{var s;return(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))===c}),t=e.find(e=>{var s;return e.effect instanceof KeyframeEffect&&(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))!==c});s&&t&&(s.currentTime=t.currentTime)},t=[c],(0,r.useLayoutEffect)(s,t),(0,a.jsxs)("svg",{"data-spinner-id":c,className:(0,l.cx)("pointer-events-none size-12 animate-spin text-current",n),fill:"none",viewBox:"0 0 24 24",...i,children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},47375:function(e,s,t){var a=t(57437),r=t(2265),l=t(19250),n=t(59872);s.Z=e=>{let{userID:s,userRole:t,accessToken:i,userSpend:c,userMaxBudget:o,selectedTeam:d}=e;console.log("userSpend: ".concat(c));let[u,m]=(0,r.useState)(null!==c?c:0),[x,h]=(0,r.useState)(d?Number((0,n.pw)(d.max_budget,4)):null);(0,r.useEffect)(()=>{if(d){if("Default Team"===d.team_alias)h(o);else{let e=!1;if(d.team_memberships)for(let t of d.team_memberships)t.user_id===s&&"max_budget"in t.litellm_budget_table&&null!==t.litellm_budget_table.max_budget&&(h(t.litellm_budget_table.max_budget),e=!0);e||h(d.max_budget)}}},[d,o]);let[p,j]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=async()=>{if(!i||!s||!t)return};(async()=>{try{if(null===s||null===t)return;if(null!==i){let e=(await (0,l.modelAvailableCall)(i,s,t)).data.map(e=>e.id);console.log("available_model_names:",e),j(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[t,i,s]),(0,r.useEffect)(()=>{null!==c&&m(c)},[c]);let _=[];d&&d.models&&(_=d.models),_&&_.includes("all-proxy-models")?(console.log("user models:",p),_=p):_&&_.includes("all-team-models")?_=d.models:_&&0===_.length&&(_=p);let g=null!==x?"$".concat((0,n.pw)(Number(x),4)," limit"):"No limit",f=void 0!==u?(0,n.pw)(u,4):null;return console.log("spend in view user spend: ".concat(u)),(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,a.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",f]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:g})]})]})})}},10012:function(e,s,t){t.d(s,{cx:function(){return n}});var a=t(49096),r=t(53335);let{cva:l,cx:n,compose:i}=(0,a.ZD)({hooks:{onComplete:e=>(0,r.m6)(e)}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-c04f26edd6161f83.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-c04f26edd6161f83.js deleted file mode 100644 index 10a16c814f..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-c04f26edd6161f83.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/api-reference/page-e1b30f2f59900b67.js -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4303],{25088:function(e,o,r){Promise.resolve().then(r.bind(r,81300))},67101:function(e,o,r){"use strict";r.d(o,{Z:function(){return d}});var n=r(5853),l=r(97324),t=r(1153),s=r(2265),a=r(9496);let i=(0,t.fn)("Grid"),c=(e,o)=>e&&Object.keys(o).includes(String(e))?o[e]:"",d=s.forwardRef((e,o)=>{let{numItems:r=1,numItemsSm:t,numItemsMd:d,numItemsLg:p,children:g,className:h}=e,m=(0,n._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),u=c(r,a._m),b=c(t,a.LH),k=c(d,a.l5),f=c(p,a.N4),v=(0,l.q)(u,b,k,f);return s.createElement("div",Object.assign({ref:o,className:(0,l.q)(i("root"),"grid",v,h)},m),g)});d.displayName="Grid"},9496:function(e,o,r){"use strict";r.d(o,{LH:function(){return l},N4:function(){return s},PT:function(){return a},SP:function(){return i},VS:function(){return c},_m:function(){return n},_w:function(){return d},l5:function(){return t}});let n={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},l={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},t={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},s={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},a={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},i={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},c={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},d={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},84264:function(e,o,r){"use strict";r.d(o,{Z:function(){return a}});var n=r(26898),l=r(97324),t=r(1153),s=r(2265);let a=s.forwardRef((e,o)=>{let{color:r,className:a,children:i}=e;return s.createElement("p",{ref:o,className:(0,l.q)("text-tremor-default",r?(0,t.bM)(r,n.K.text).textColor:(0,l.q)("text-tremor-content","dark:text-dark-tremor-content"),a)},i)});a.displayName="Text"},79205:function(e,o,r){"use strict";r.d(o,{Z:function(){return p}});var n=r(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),t=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),s=e=>{let o=t(e);return o.charAt(0).toUpperCase()+o.slice(1)},a=function(){for(var e=arguments.length,o=Array(e),r=0;r!!e&&""!==e.trim()&&r.indexOf(e)===o).join(" ").trim()},i=e=>{for(let o in e)if(o.startsWith("aria-")||"role"===o||"title"===o)return!0};var c={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"};let d=(0,n.forwardRef)((e,o)=>{let{color:r="currentColor",size:l=24,strokeWidth:t=2,absoluteStrokeWidth:s,className:d="",children:p,iconNode:g,...h}=e;return(0,n.createElement)("svg",{ref:o,...c,width:l,height:l,stroke:r,strokeWidth:s?24*Number(t)/Number(l):t,className:a("lucide",d),...!p&&!i(h)&&{"aria-hidden":"true"},...h},[...g.map(e=>{let[o,r]=e;return(0,n.createElement)(o,r)}),...Array.isArray(p)?p:[p]])}),p=(e,o)=>{let r=(0,n.forwardRef)((r,t)=>{let{className:i,...c}=r;return(0,n.createElement)(d,{ref:t,iconNode:o,className:a("lucide-".concat(l(s(e))),"lucide-".concat(e),i),...c})});return r.displayName=s(e),r}},30401:function(e,o,r){"use strict";r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},5136:function(e,o,r){"use strict";r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]])},96362:function(e,o,r){"use strict";r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},1479:function(e,o){"use strict";o.Z={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}}},23192:function(e,o,r){"use strict";r.d(o,{Z:function(){return m}});var n=r(57437);r(2265);var l=r(67101),t=r(12485),s=r(18135),a=r(35242),i=r(29706),c=r(77991),d=r(84264),p=r(25653),g=r(96362),h=e=>{let{href:o,className:r}=e;return(0,n.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(){for(var e=arguments.length,o=Array(e),r=0;r{let{proxySettings:o}=e,r="";return(null==o?void 0:o.PROXY_BASE_URL)!==void 0&&(null==o?void 0:o.PROXY_BASE_URL)&&(r=o.PROXY_BASE_URL),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(l.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,n.jsxs)("div",{className:"mb-5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,n.jsx)(h,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,n.jsxs)(d.Z,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,n.jsxs)(s.Z,{children:[(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(t.Z,{children:"OpenAI Python SDK"}),(0,n.jsx)(t.Z,{children:"LlamaIndex"}),(0,n.jsx)(t.Z,{children:"Langchain Py"})]}),(0,n.jsxs)(c.Z,{children:[(0,n.jsx)(i.Z,{children:(0,n.jsx)(p.Z,{language:"python",code:'import openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(r,'" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)')})}),(0,n.jsx)(i.Z,{children:(0,n.jsx)(p.Z,{language:"python",code:'import os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="'.concat(r,'", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="').concat(r,'",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)')})}),(0,n.jsx)(i.Z,{children:(0,n.jsx)(p.Z,{language:"python",code:'from langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="'.concat(r,'",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)')})})]})]})]})})})}},25653:function(e,o,r){"use strict";var n=r(57437),l=r(2265),t=r(30401),s=r(5136),a=r(17906),i=r(1479);o.Z=e=>{let{code:o,language:r}=e,[c,d]=(0,l.useState)(!1);return(0,n.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,n.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(o),d(!0),setTimeout(()=>d(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:c?(0,n.jsx)(t.Z,{size:16}):(0,n.jsx)(s.Z,{size:16})}),(0,n.jsx)(a.Z,{language:r,style:i.Z,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:o})]})}},81300:function(e,o,r){"use strict";r.r(o);var n=r(57437),l=r(23192),t=r(2265);o.default=()=>{let[e,o]=(0,t.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""});return(0,n.jsx)(l.Z,{proxySettings:e})}}},function(e){e.O(0,[9820,2926,7906,2971,2117,1744],function(){return e(e.s=25088)}),_N_E=e.O()}]); -======== -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4303],{25088:function(e,o,r){Promise.resolve().then(r.bind(r,81300))},67101:function(e,o,r){"use strict";r.d(o,{Z:function(){return d}});var n=r(5853),l=r(97324),t=r(1153),s=r(2265),a=r(9496);let i=(0,t.fn)("Grid"),c=(e,o)=>e&&Object.keys(o).includes(String(e))?o[e]:"",d=s.forwardRef((e,o)=>{let{numItems:r=1,numItemsSm:t,numItemsMd:d,numItemsLg:p,children:g,className:h}=e,m=(0,n._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),u=c(r,a._m),b=c(t,a.LH),k=c(d,a.l5),f=c(p,a.N4),w=(0,l.q)(u,b,k,f);return s.createElement("div",Object.assign({ref:o,className:(0,l.q)(i("root"),"grid",w,h)},m),g)});d.displayName="Grid"},9496:function(e,o,r){"use strict";r.d(o,{LH:function(){return l},N4:function(){return s},PT:function(){return a},SP:function(){return i},VS:function(){return c},_m:function(){return n},_w:function(){return d},l5:function(){return t}});let n={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},l={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},t={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},s={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},a={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},i={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},c={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},d={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},84264:function(e,o,r){"use strict";r.d(o,{Z:function(){return a}});var n=r(26898),l=r(97324),t=r(1153),s=r(2265);let a=s.forwardRef((e,o)=>{let{color:r,className:a,children:i}=e;return s.createElement("p",{ref:o,className:(0,l.q)("text-tremor-default",r?(0,t.bM)(r,n.K.text).textColor:(0,l.q)("text-tremor-content","dark:text-dark-tremor-content"),a)},i)});a.displayName="Text"},79205:function(e,o,r){"use strict";r.d(o,{Z:function(){return p}});var n=r(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),t=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),s=e=>{let o=t(e);return o.charAt(0).toUpperCase()+o.slice(1)},a=function(){for(var e=arguments.length,o=Array(e),r=0;r!!e&&""!==e.trim()&&r.indexOf(e)===o).join(" ").trim()},i=e=>{for(let o in e)if(o.startsWith("aria-")||"role"===o||"title"===o)return!0};var c={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"};let d=(0,n.forwardRef)((e,o)=>{let{color:r="currentColor",size:l=24,strokeWidth:t=2,absoluteStrokeWidth:s,className:d="",children:p,iconNode:g,...h}=e;return(0,n.createElement)("svg",{ref:o,...c,width:l,height:l,stroke:r,strokeWidth:s?24*Number(t)/Number(l):t,className:a("lucide",d),...!p&&!i(h)&&{"aria-hidden":"true"},...h},[...g.map(e=>{let[o,r]=e;return(0,n.createElement)(o,r)}),...Array.isArray(p)?p:[p]])}),p=(e,o)=>{let r=(0,n.forwardRef)((r,t)=>{let{className:i,...c}=r;return(0,n.createElement)(d,{ref:t,iconNode:o,className:a("lucide-".concat(l(s(e))),"lucide-".concat(e),i),...c})});return r.displayName=s(e),r}},30401:function(e,o,r){"use strict";r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},5136:function(e,o,r){"use strict";r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]])},96362:function(e,o,r){"use strict";r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},1479:function(e,o){"use strict";o.Z={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}}},80619:function(e,o,r){"use strict";r.d(o,{Z:function(){return w}});var n=r(57437),l=r(2265),t=r(67101),s=r(12485),a=r(18135),i=r(35242),c=r(29706),d=r(77991),p=r(84264),g=r(30401),h=r(5136),m=r(17906),u=r(1479),b=e=>{let{code:o,language:r}=e,[t,s]=(0,l.useState)(!1);return(0,n.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,n.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(o),s(!0),setTimeout(()=>s(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:t?(0,n.jsx)(g.Z,{size:16}):(0,n.jsx)(h.Z,{size:16})}),(0,n.jsx)(m.Z,{language:r,style:u.Z,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:o})]})},k=r(96362),f=e=>{let{href:o,className:r}=e;return(0,n.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(){for(var e=arguments.length,o=Array(e),r=0;r{let{proxySettings:o}=e,r="";return(null==o?void 0:o.PROXY_BASE_URL)!==void 0&&(null==o?void 0:o.PROXY_BASE_URL)&&(r=o.PROXY_BASE_URL),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(t.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,n.jsxs)("div",{className:"mb-5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,n.jsx)(f,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,n.jsxs)(p.Z,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,n.jsxs)(a.Z,{children:[(0,n.jsxs)(i.Z,{children:[(0,n.jsx)(s.Z,{children:"OpenAI Python SDK"}),(0,n.jsx)(s.Z,{children:"LlamaIndex"}),(0,n.jsx)(s.Z,{children:"Langchain Py"})]}),(0,n.jsxs)(d.Z,{children:[(0,n.jsx)(c.Z,{children:(0,n.jsx)(b,{language:"python",code:'import openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(r,'" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)')})}),(0,n.jsx)(c.Z,{children:(0,n.jsx)(b,{language:"python",code:'import os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="'.concat(r,'", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="').concat(r,'",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)')})}),(0,n.jsx)(c.Z,{children:(0,n.jsx)(b,{language:"python",code:'from langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="'.concat(r,'",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)')})})]})]})]})})})}},81300:function(e,o,r){"use strict";r.r(o);var n=r(57437),l=r(80619),t=r(2265);o.default=()=>{let[e,o]=(0,t.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""});return(0,n.jsx)(l.Z,{proxySettings:e})}}},function(e){e.O(0,[9820,2926,7906,2971,2117,1744],function(){return e(e.s=25088)}),_N_E=e.O()}]); ->>>>>>>> ef0d6f0207 (Resolve conflicts in generated HTML files):litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-c04f26edd6161f83.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-e1b30f2f59900b67.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-e1b30f2f59900b67.js new file mode 100644 index 0000000000..1f6ab3d46c --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-e1b30f2f59900b67.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4303],{25088:function(e,o,r){Promise.resolve().then(r.bind(r,81300))},67101:function(e,o,r){"use strict";r.d(o,{Z:function(){return d}});var n=r(5853),l=r(97324),t=r(1153),s=r(2265),a=r(9496);let i=(0,t.fn)("Grid"),c=(e,o)=>e&&Object.keys(o).includes(String(e))?o[e]:"",d=s.forwardRef((e,o)=>{let{numItems:r=1,numItemsSm:t,numItemsMd:d,numItemsLg:p,children:g,className:h}=e,m=(0,n._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),u=c(r,a._m),b=c(t,a.LH),k=c(d,a.l5),f=c(p,a.N4),v=(0,l.q)(u,b,k,f);return s.createElement("div",Object.assign({ref:o,className:(0,l.q)(i("root"),"grid",v,h)},m),g)});d.displayName="Grid"},9496:function(e,o,r){"use strict";r.d(o,{LH:function(){return l},N4:function(){return s},PT:function(){return a},SP:function(){return i},VS:function(){return c},_m:function(){return n},_w:function(){return d},l5:function(){return t}});let n={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},l={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},t={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},s={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},a={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},i={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},c={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},d={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},84264:function(e,o,r){"use strict";r.d(o,{Z:function(){return a}});var n=r(26898),l=r(97324),t=r(1153),s=r(2265);let a=s.forwardRef((e,o)=>{let{color:r,className:a,children:i}=e;return s.createElement("p",{ref:o,className:(0,l.q)("text-tremor-default",r?(0,t.bM)(r,n.K.text).textColor:(0,l.q)("text-tremor-content","dark:text-dark-tremor-content"),a)},i)});a.displayName="Text"},79205:function(e,o,r){"use strict";r.d(o,{Z:function(){return p}});var n=r(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),t=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),s=e=>{let o=t(e);return o.charAt(0).toUpperCase()+o.slice(1)},a=function(){for(var e=arguments.length,o=Array(e),r=0;r!!e&&""!==e.trim()&&r.indexOf(e)===o).join(" ").trim()},i=e=>{for(let o in e)if(o.startsWith("aria-")||"role"===o||"title"===o)return!0};var c={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"};let d=(0,n.forwardRef)((e,o)=>{let{color:r="currentColor",size:l=24,strokeWidth:t=2,absoluteStrokeWidth:s,className:d="",children:p,iconNode:g,...h}=e;return(0,n.createElement)("svg",{ref:o,...c,width:l,height:l,stroke:r,strokeWidth:s?24*Number(t)/Number(l):t,className:a("lucide",d),...!p&&!i(h)&&{"aria-hidden":"true"},...h},[...g.map(e=>{let[o,r]=e;return(0,n.createElement)(o,r)}),...Array.isArray(p)?p:[p]])}),p=(e,o)=>{let r=(0,n.forwardRef)((r,t)=>{let{className:i,...c}=r;return(0,n.createElement)(d,{ref:t,iconNode:o,className:a("lucide-".concat(l(s(e))),"lucide-".concat(e),i),...c})});return r.displayName=s(e),r}},30401:function(e,o,r){"use strict";r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},5136:function(e,o,r){"use strict";r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]])},96362:function(e,o,r){"use strict";r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},1479:function(e,o){"use strict";o.Z={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}}},23192:function(e,o,r){"use strict";r.d(o,{Z:function(){return m}});var n=r(57437);r(2265);var l=r(67101),t=r(12485),s=r(18135),a=r(35242),i=r(29706),c=r(77991),d=r(84264),p=r(25653),g=r(96362),h=e=>{let{href:o,className:r}=e;return(0,n.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(){for(var e=arguments.length,o=Array(e),r=0;r{let{proxySettings:o}=e,r="";return(null==o?void 0:o.PROXY_BASE_URL)!==void 0&&(null==o?void 0:o.PROXY_BASE_URL)&&(r=o.PROXY_BASE_URL),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(l.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,n.jsxs)("div",{className:"mb-5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,n.jsx)(h,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,n.jsxs)(d.Z,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,n.jsxs)(s.Z,{children:[(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(t.Z,{children:"OpenAI Python SDK"}),(0,n.jsx)(t.Z,{children:"LlamaIndex"}),(0,n.jsx)(t.Z,{children:"Langchain Py"})]}),(0,n.jsxs)(c.Z,{children:[(0,n.jsx)(i.Z,{children:(0,n.jsx)(p.Z,{language:"python",code:'import openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(r,'" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)')})}),(0,n.jsx)(i.Z,{children:(0,n.jsx)(p.Z,{language:"python",code:'import os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="'.concat(r,'", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="').concat(r,'",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)')})}),(0,n.jsx)(i.Z,{children:(0,n.jsx)(p.Z,{language:"python",code:'from langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="'.concat(r,'",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)')})})]})]})]})})})}},25653:function(e,o,r){"use strict";var n=r(57437),l=r(2265),t=r(30401),s=r(5136),a=r(17906),i=r(1479);o.Z=e=>{let{code:o,language:r}=e,[c,d]=(0,l.useState)(!1);return(0,n.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,n.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(o),d(!0),setTimeout(()=>d(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:c?(0,n.jsx)(t.Z,{size:16}):(0,n.jsx)(s.Z,{size:16})}),(0,n.jsx)(a.Z,{language:r,style:i.Z,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:o})]})}},81300:function(e,o,r){"use strict";r.r(o);var n=r(57437),l=r(23192),t=r(2265);o.default=()=>{let[e,o]=(0,t.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""});return(0,n.jsx)(l.Z,{proxySettings:e})}}},function(e){e.O(0,[9820,2926,7906,2971,2117,1744],function(){return e(e.s=25088)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-2e10f494907c6a63.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-2e10f494907c6a63.js deleted file mode 100644 index e6f66ecb8b..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-2e10f494907c6a63.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3425],{52235:function(e,n,t){Promise.resolve().then(t.bind(t,16643))},23639:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var r=t(1119),s=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},i=t(55015),a=s.forwardRef(function(e,n){return s.createElement(i.Z,(0,r.Z)({},e,{ref:n,icon:o}))})},96761:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(5853),s=t(26898),o=t(97324),i=t(1153),a=t(2265);let l=a.forwardRef((e,n)=>{let{color:t,children:l,className:c}=e,d=(0,r._T)(e,["color","children","className"]);return a.createElement("p",Object.assign({ref:n,className:(0,o.q)("font-medium text-tremor-title",t?(0,i.bM)(t,s.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},d),l)});l.displayName="Title"},16643:function(e,n,t){"use strict";t.r(n);var r=t(57437),s=t(6674),o=t(39760);n.default=()=>{let{accessToken:e}=(0,o.Z)();return(0,r.jsx)(s.Z,{accessToken:e})}},39760:function(e,n,t){"use strict";var r=t(2265),s=t(99376),o=t(14474),i=t(3914);n.Z=()=>{var e,n,t,a,l,c,d;let u=(0,s.useRouter)(),p="undefined"!=typeof document?(0,i.e)("token"):null;(0,r.useEffect)(()=>{p||u.replace("/sso/key/generate")},[p,u]);let m=(0,r.useMemo)(()=>{if(!p)return null;try{return(0,o.o)(p)}catch(e){return(0,i.b)(),u.replace("/sso/key/generate"),null}},[p,u]);return{token:p,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(n=null==m?void 0:m.user_id)&&void 0!==n?n:null,userEmail:null!==(t=null==m?void 0:m.user_email)&&void 0!==t?t:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(a=null==m?void 0:m.user_role)&&void 0!==a?a:null),premiumUser:null!==(l=null==m?void 0:m.premium_user)&&void 0!==l?l:null,disabledPersonalKeyCreation:null!==(c=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},6674:function(e,n,t){"use strict";t.d(n,{Z:function(){return d}});var r=t(57437),s=t(2265),o=t(73002),i=t(23639),a=t(96761),l=t(19250),c=t(9114),d=e=>{let{accessToken:n}=e,[t,d]=(0,s.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[u,p]=(0,s.useState)(""),[m,f]=(0,s.useState)(!1),h=(e,n,t)=>{let r=JSON.stringify(n,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),s=Object.entries(t).map(e=>{let[n,t]=e;return"-H '".concat(n,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(s?"".concat(s," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(r,"\n }'")},x=async()=>{f(!0);try{let e;try{e=JSON.parse(t)}catch(e){c.Z.fromBackend("Invalid JSON in request body"),f(!1);return}let r={call_type:"completion",request_body:e};if(!n){c.Z.fromBackend("No access token found"),f(!1);return}let s=await (0,l.transformRequestCall)(n,r);if(s.raw_request_api_base&&s.raw_request_body){let e=h(s.raw_request_api_base,s.raw_request_body,s.raw_request_headers||{});p(e),c.Z.success("Request transformed successfully")}else{let e="string"==typeof s?s:JSON.stringify(s);p(e),c.Z.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),c.Z.fromBackend("Failed to transform request")}finally{f(!1)}};return(0,r.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,r.jsx)(a.Z,{children:"Playground"}),(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,r.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,r.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,r.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,r.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,r.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,r.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),x())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,r.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,r.jsxs)(o.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:x,loading:m,children:[(0,r.jsx)("span",{children:"Transform"}),(0,r.jsx)("span",{children:"→"})]})})]}),(0,r.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,r.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,r.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,r.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,r.jsx)("br",{}),(0,r.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,r.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,r.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:u||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,r.jsx)(o.ZP,{type:"text",icon:(0,r.jsx)(i.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(u||""),c.Z.success("Copied to clipboard")}})]})]})]}),(0,r.jsx)("div",{className:"mt-4 text-right w-full",children:(0,r.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue"," ",(0,r.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})}},14474:function(e,n,t){"use strict";t.d(n,{o:function(){return s}});class r extends Error{}function s(e,n){let t;if("string"!=typeof e)throw new r("Invalid token specified: must be a string");n||(n={});let s=!0===n.header?0:1,o=e.split(".")[s];if("string"!=typeof o)throw new r(`Invalid token specified: missing part #${s+1}`);try{t=function(e){let n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw Error("base64 string is not of the correct length")}try{var t;return t=n,decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let t=n.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return atob(n)}}(o)}catch(e){throw new r(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(t)}catch(e){throw new r(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}r.prototype.name="InvalidTokenError"}},function(e){e.O(0,[9820,1491,8049,2971,2117,1744],function(){return e(e.s=52235)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-2e10f494907c6a63.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-9890fc550d55b49b.js similarity index 98% rename from ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-2e10f494907c6a63.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-9890fc550d55b49b.js index e6f66ecb8b..314d5d68b9 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-2e10f494907c6a63.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-9890fc550d55b49b.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3425],{52235:function(e,n,t){Promise.resolve().then(t.bind(t,16643))},23639:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var r=t(1119),s=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},i=t(55015),a=s.forwardRef(function(e,n){return s.createElement(i.Z,(0,r.Z)({},e,{ref:n,icon:o}))})},96761:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(5853),s=t(26898),o=t(97324),i=t(1153),a=t(2265);let l=a.forwardRef((e,n)=>{let{color:t,children:l,className:c}=e,d=(0,r._T)(e,["color","children","className"]);return a.createElement("p",Object.assign({ref:n,className:(0,o.q)("font-medium text-tremor-title",t?(0,i.bM)(t,s.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},d),l)});l.displayName="Title"},16643:function(e,n,t){"use strict";t.r(n);var r=t(57437),s=t(6674),o=t(39760);n.default=()=>{let{accessToken:e}=(0,o.Z)();return(0,r.jsx)(s.Z,{accessToken:e})}},39760:function(e,n,t){"use strict";var r=t(2265),s=t(99376),o=t(14474),i=t(3914);n.Z=()=>{var e,n,t,a,l,c,d;let u=(0,s.useRouter)(),p="undefined"!=typeof document?(0,i.e)("token"):null;(0,r.useEffect)(()=>{p||u.replace("/sso/key/generate")},[p,u]);let m=(0,r.useMemo)(()=>{if(!p)return null;try{return(0,o.o)(p)}catch(e){return(0,i.b)(),u.replace("/sso/key/generate"),null}},[p,u]);return{token:p,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(n=null==m?void 0:m.user_id)&&void 0!==n?n:null,userEmail:null!==(t=null==m?void 0:m.user_email)&&void 0!==t?t:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(a=null==m?void 0:m.user_role)&&void 0!==a?a:null),premiumUser:null!==(l=null==m?void 0:m.premium_user)&&void 0!==l?l:null,disabledPersonalKeyCreation:null!==(c=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},6674:function(e,n,t){"use strict";t.d(n,{Z:function(){return d}});var r=t(57437),s=t(2265),o=t(73002),i=t(23639),a=t(96761),l=t(19250),c=t(9114),d=e=>{let{accessToken:n}=e,[t,d]=(0,s.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[u,p]=(0,s.useState)(""),[m,f]=(0,s.useState)(!1),h=(e,n,t)=>{let r=JSON.stringify(n,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),s=Object.entries(t).map(e=>{let[n,t]=e;return"-H '".concat(n,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(s?"".concat(s," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(r,"\n }'")},x=async()=>{f(!0);try{let e;try{e=JSON.parse(t)}catch(e){c.Z.fromBackend("Invalid JSON in request body"),f(!1);return}let r={call_type:"completion",request_body:e};if(!n){c.Z.fromBackend("No access token found"),f(!1);return}let s=await (0,l.transformRequestCall)(n,r);if(s.raw_request_api_base&&s.raw_request_body){let e=h(s.raw_request_api_base,s.raw_request_body,s.raw_request_headers||{});p(e),c.Z.success("Request transformed successfully")}else{let e="string"==typeof s?s:JSON.stringify(s);p(e),c.Z.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),c.Z.fromBackend("Failed to transform request")}finally{f(!1)}};return(0,r.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,r.jsx)(a.Z,{children:"Playground"}),(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,r.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,r.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,r.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,r.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,r.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,r.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),x())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,r.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,r.jsxs)(o.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:x,loading:m,children:[(0,r.jsx)("span",{children:"Transform"}),(0,r.jsx)("span",{children:"→"})]})})]}),(0,r.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,r.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,r.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,r.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,r.jsx)("br",{}),(0,r.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,r.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,r.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:u||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,r.jsx)(o.ZP,{type:"text",icon:(0,r.jsx)(i.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(u||""),c.Z.success("Copied to clipboard")}})]})]})]}),(0,r.jsx)("div",{className:"mt-4 text-right w-full",children:(0,r.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue"," ",(0,r.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})}},14474:function(e,n,t){"use strict";t.d(n,{o:function(){return s}});class r extends Error{}function s(e,n){let t;if("string"!=typeof e)throw new r("Invalid token specified: must be a string");n||(n={});let s=!0===n.header?0:1,o=e.split(".")[s];if("string"!=typeof o)throw new r(`Invalid token specified: missing part #${s+1}`);try{t=function(e){let n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw Error("base64 string is not of the correct length")}try{var t;return t=n,decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let t=n.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return atob(n)}}(o)}catch(e){throw new r(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(t)}catch(e){throw new r(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}r.prototype.name="InvalidTokenError"}},function(e){e.O(0,[9820,1491,8049,2971,2117,1744],function(){return e(e.s=52235)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3425],{52235:function(e,n,t){Promise.resolve().then(t.bind(t,16643))},23639:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var r=t(1119),s=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},i=t(55015),a=s.forwardRef(function(e,n){return s.createElement(i.Z,(0,r.Z)({},e,{ref:n,icon:o}))})},96761:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(5853),s=t(26898),o=t(97324),i=t(1153),a=t(2265);let l=a.forwardRef((e,n)=>{let{color:t,children:l,className:c}=e,d=(0,r._T)(e,["color","children","className"]);return a.createElement("p",Object.assign({ref:n,className:(0,o.q)("font-medium text-tremor-title",t?(0,i.bM)(t,s.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},d),l)});l.displayName="Title"},16643:function(e,n,t){"use strict";t.r(n);var r=t(57437),s=t(6674),o=t(80443);n.default=()=>{let{accessToken:e}=(0,o.Z)();return(0,r.jsx)(s.Z,{accessToken:e})}},80443:function(e,n,t){"use strict";var r=t(2265),s=t(99376),o=t(14474),i=t(3914);n.Z=()=>{var e,n,t,a,l,c,d;let u=(0,s.useRouter)(),p="undefined"!=typeof document?(0,i.e)("token"):null;(0,r.useEffect)(()=>{p||u.replace("/sso/key/generate")},[p,u]);let m=(0,r.useMemo)(()=>{if(!p)return null;try{return(0,o.o)(p)}catch(e){return(0,i.b)(),u.replace("/sso/key/generate"),null}},[p,u]);return{token:p,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(n=null==m?void 0:m.user_id)&&void 0!==n?n:null,userEmail:null!==(t=null==m?void 0:m.user_email)&&void 0!==t?t:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(a=null==m?void 0:m.user_role)&&void 0!==a?a:null),premiumUser:null!==(l=null==m?void 0:m.premium_user)&&void 0!==l?l:null,disabledPersonalKeyCreation:null!==(c=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},6674:function(e,n,t){"use strict";t.d(n,{Z:function(){return d}});var r=t(57437),s=t(2265),o=t(73002),i=t(23639),a=t(96761),l=t(19250),c=t(9114),d=e=>{let{accessToken:n}=e,[t,d]=(0,s.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[u,p]=(0,s.useState)(""),[m,f]=(0,s.useState)(!1),h=(e,n,t)=>{let r=JSON.stringify(n,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),s=Object.entries(t).map(e=>{let[n,t]=e;return"-H '".concat(n,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(s?"".concat(s," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(r,"\n }'")},x=async()=>{f(!0);try{let e;try{e=JSON.parse(t)}catch(e){c.Z.fromBackend("Invalid JSON in request body"),f(!1);return}let r={call_type:"completion",request_body:e};if(!n){c.Z.fromBackend("No access token found"),f(!1);return}let s=await (0,l.transformRequestCall)(n,r);if(s.raw_request_api_base&&s.raw_request_body){let e=h(s.raw_request_api_base,s.raw_request_body,s.raw_request_headers||{});p(e),c.Z.success("Request transformed successfully")}else{let e="string"==typeof s?s:JSON.stringify(s);p(e),c.Z.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),c.Z.fromBackend("Failed to transform request")}finally{f(!1)}};return(0,r.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,r.jsx)(a.Z,{children:"Playground"}),(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,r.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,r.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,r.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,r.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,r.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,r.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),x())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,r.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,r.jsxs)(o.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:x,loading:m,children:[(0,r.jsx)("span",{children:"Transform"}),(0,r.jsx)("span",{children:"→"})]})})]}),(0,r.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,r.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,r.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,r.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,r.jsx)("br",{}),(0,r.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,r.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,r.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:u||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,r.jsx)(o.ZP,{type:"text",icon:(0,r.jsx)(i.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(u||""),c.Z.success("Copied to clipboard")}})]})]})]}),(0,r.jsx)("div",{className:"mt-4 text-right w-full",children:(0,r.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue"," ",(0,r.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})}},14474:function(e,n,t){"use strict";t.d(n,{o:function(){return s}});class r extends Error{}function s(e,n){let t;if("string"!=typeof e)throw new r("Invalid token specified: must be a string");n||(n={});let s=!0===n.header?0:1,o=e.split(".")[s];if("string"!=typeof o)throw new r(`Invalid token specified: missing part #${s+1}`);try{t=function(e){let n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw Error("base64 string is not of the correct length")}try{var t;return t=n,decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let t=n.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return atob(n)}}(o)}catch(e){throw new r(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(t)}catch(e){throw new r(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}r.prototype.name="InvalidTokenError"}},function(e){e.O(0,[9820,1491,8049,2971,2117,1744],function(){return e(e.s=52235)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/page-b913787fbd844fd3.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/page-712ccbc9bd44a5ae.js similarity index 98% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/page-b913787fbd844fd3.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/page-712ccbc9bd44a5ae.js index f5d6e6762a..8a87eec644 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/page-b913787fbd844fd3.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/page-712ccbc9bd44a5ae.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5649],{54501:function(e,n,l){Promise.resolve().then(l.bind(l,78858))},78858:function(e,n,l){"use strict";l.r(n);var t=l(57437),s=l(49104),i=l(39760);n.default=()=>{let{accessToken:e}=(0,i.Z)();return(0,t.jsx)(s.Z,{accessToken:e})}},39760:function(e,n,l){"use strict";var t=l(2265),s=l(99376),i=l(14474),r=l(3914);n.Z=()=>{var e,n,l,a,d,u,o;let c=(0,s.useRouter)(),m="undefined"!=typeof document?(0,r.e)("token"):null;(0,t.useEffect)(()=>{m||c.replace("/sso/key/generate")},[m,c]);let h=(0,t.useMemo)(()=>{if(!m)return null;try{return(0,i.o)(m)}catch(e){return(0,r.b)(),c.replace("/sso/key/generate"),null}},[m,c]);return{token:m,accessToken:null!==(e=null==h?void 0:h.key)&&void 0!==e?e:null,userId:null!==(n=null==h?void 0:h.user_id)&&void 0!==n?n:null,userEmail:null!==(l=null==h?void 0:h.user_email)&&void 0!==l?l:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(a=null==h?void 0:h.user_role)&&void 0!==a?a:null),premiumUser:null!==(d=null==h?void 0:h.premium_user)&&void 0!==d?d:null,disabledPersonalKeyCreation:null!==(u=null==h?void 0:h.disabled_non_admin_personal_key_creation)&&void 0!==u?u:null,showSSOBanner:(null==h?void 0:h.login_method)==="username_password"}}},49104:function(e,n,l){"use strict";l.d(n,{Z:function(){return F}});var t=l(57437),s=l(2265),i=l(87452),r=l(88829),a=l(72208),d=l(49566),u=l(13634),o=l(82680),c=l(20577),m=l(52787),h=l(73002),p=l(19250),x=l(9114),g=e=>{let{isModalVisible:n,accessToken:l,setIsModalVisible:s,setBudgetList:g}=e,[j]=u.Z.useForm(),Z=async e=>{if(null!=l&&void 0!=l)try{x.Z.info("Making API Call");let n=await (0,p.budgetCreateCall)(l,e);console.log("key create Response:",n),g(e=>e?[...e,n]:[n]),x.Z.success("Budget Created"),j.resetFields()}catch(e){console.error("Error creating the key:",e),x.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,t.jsx)(o.Z,{title:"Create Budget",visible:n,width:800,footer:null,onOk:()=>{s(!1),j.resetFields()},onCancel:()=>{s(!1),j.resetFields()},children:(0,t.jsxs)(u.Z,{form:j,onFinish:Z,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,t.jsx)(d.Z,{placeholder:""})}),(0,t.jsx)(u.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,t.jsx)(c.Z,{step:1,precision:2,width:200})}),(0,t.jsx)(u.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,t.jsx)(c.Z,{step:1,precision:2,width:200})}),(0,t.jsxs)(i.Z,{className:"mt-20 mb-8",children:[(0,t.jsx)(a.Z,{children:(0,t.jsx)("b",{children:"Optional Settings"})}),(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(u.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(c.Z,{step:.01,precision:2,width:200})}),(0,t.jsx)(u.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(m.default,{defaultValue:null,placeholder:"n/a",children:[(0,t.jsx)(m.default.Option,{value:"24h",children:"daily"}),(0,t.jsx)(m.default.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(m.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(h.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},j=e=>{let{isModalVisible:n,accessToken:l,setIsModalVisible:g,setBudgetList:j,existingBudget:Z,handleUpdateCall:_}=e;console.log("existingBudget",Z);let[b]=u.Z.useForm();(0,s.useEffect)(()=>{b.setFieldsValue(Z)},[Z,b]);let f=async e=>{if(null!=l&&void 0!=l)try{x.Z.info("Making API Call"),g(!0);let n=await (0,p.budgetUpdateCall)(l,e);j(e=>e?[...e,n]:[n]),x.Z.success("Budget Updated"),b.resetFields(),_()}catch(e){console.error("Error creating the key:",e),x.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,t.jsx)(o.Z,{title:"Edit Budget",visible:n,width:800,footer:null,onOk:()=>{g(!1),b.resetFields()},onCancel:()=>{g(!1),b.resetFields()},children:(0,t.jsxs)(u.Z,{form:b,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:Z,children:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,t.jsx)(d.Z,{placeholder:""})}),(0,t.jsx)(u.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,t.jsx)(c.Z,{step:1,precision:2,width:200})}),(0,t.jsx)(u.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,t.jsx)(c.Z,{step:1,precision:2,width:200})}),(0,t.jsxs)(i.Z,{className:"mt-20 mb-8",children:[(0,t.jsx)(a.Z,{children:(0,t.jsx)("b",{children:"Optional Settings"})}),(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(u.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(c.Z,{step:.01,precision:2,width:200})}),(0,t.jsx)(u.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(m.default,{defaultValue:null,placeholder:"n/a",children:[(0,t.jsx)(m.default.Option,{value:"24h",children:"daily"}),(0,t.jsx)(m.default.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(m.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(h.ZP,{htmlType:"submit",children:"Save"})})]})})},Z=l(20831),_=l(12514),b=l(47323),f=l(12485),y=l(18135),v=l(35242),k=l(29706),w=l(77991),C=l(21626),B=l(97214),I=l(28241),D=l(58834),A=l(69552),O=l(71876),T=l(84264),E=l(53410),M=l(74998),S=l(17906),F=e=>{let{accessToken:n}=e,[l,i]=(0,s.useState)(!1),[r,a]=(0,s.useState)(!1),[d,u]=(0,s.useState)(null),[o,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{n&&(0,p.getBudgetList)(n).then(e=>{c(e)})},[n]);let m=async(e,l)=>{console.log("budget_id",e),null!=n&&(u(o.find(n=>n.budget_id===e)||null),a(!0))},h=async(e,l)=>{if(null==n)return;x.Z.info("Request made"),await (0,p.budgetDeleteCall)(n,e);let t=[...o];t.splice(l,1),c(t),x.Z.success("Budget Deleted.")},F=async()=>{null!=n&&(0,p.getBudgetList)(n).then(e=>{c(e)})};return(0,t.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,t.jsx)(Z.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>i(!0),children:"+ Create Budget"}),(0,t.jsx)(g,{accessToken:n,isModalVisible:l,setIsModalVisible:i,setBudgetList:c}),d&&(0,t.jsx)(j,{accessToken:n,isModalVisible:r,setIsModalVisible:a,setBudgetList:c,existingBudget:d,handleUpdateCall:F}),(0,t.jsxs)(_.Z,{children:[(0,t.jsx)(T.Z,{children:"Create a budget to assign to customers."}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(D.Z,{children:(0,t.jsxs)(O.Z,{children:[(0,t.jsx)(A.Z,{children:"Budget ID"}),(0,t.jsx)(A.Z,{children:"Max Budget"}),(0,t.jsx)(A.Z,{children:"TPM"}),(0,t.jsx)(A.Z,{children:"RPM"})]})}),(0,t.jsx)(B.Z,{children:o.slice().sort((e,n)=>new Date(n.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,n)=>(0,t.jsxs)(O.Z,{children:[(0,t.jsx)(I.Z,{children:e.budget_id}),(0,t.jsx)(I.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,t.jsx)(I.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,t.jsx)(I.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,t.jsx)(b.Z,{icon:E.Z,size:"sm",onClick:()=>m(e.budget_id,n)}),(0,t.jsx)(b.Z,{icon:M.Z,size:"sm",onClick:()=>h(e.budget_id,n)})]},n))})]})]}),(0,t.jsxs)("div",{className:"mt-5",children:[(0,t.jsx)(T.Z,{className:"text-base",children:"How to use budget id"}),(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(v.Z,{children:[(0,t.jsx)(f.Z,{children:"Assign Budget to Customer"}),(0,t.jsx)(f.Z,{children:"Test it (Curl)"}),(0,t.jsx)(f.Z,{children:"Test it (OpenAI SDK)"})]}),(0,t.jsxs)(w.Z,{children:[(0,t.jsx)(k.Z,{children:(0,t.jsx)(S.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,t.jsx)(k.Z,{children:(0,t.jsx)(S.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,t.jsx)(k.Z,{children:(0,t.jsx)(S.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="",\n api_key=""\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})}}},function(e){e.O(0,[9820,1491,1526,2417,2926,7906,527,8049,2971,2117,1744],function(){return e(e.s=54501)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5649],{54501:function(e,n,l){Promise.resolve().then(l.bind(l,78858))},78858:function(e,n,l){"use strict";l.r(n);var t=l(57437),s=l(49104),i=l(80443);n.default=()=>{let{accessToken:e}=(0,i.Z)();return(0,t.jsx)(s.Z,{accessToken:e})}},80443:function(e,n,l){"use strict";var t=l(2265),s=l(99376),i=l(14474),r=l(3914);n.Z=()=>{var e,n,l,a,d,u,o;let c=(0,s.useRouter)(),m="undefined"!=typeof document?(0,r.e)("token"):null;(0,t.useEffect)(()=>{m||c.replace("/sso/key/generate")},[m,c]);let h=(0,t.useMemo)(()=>{if(!m)return null;try{return(0,i.o)(m)}catch(e){return(0,r.b)(),c.replace("/sso/key/generate"),null}},[m,c]);return{token:m,accessToken:null!==(e=null==h?void 0:h.key)&&void 0!==e?e:null,userId:null!==(n=null==h?void 0:h.user_id)&&void 0!==n?n:null,userEmail:null!==(l=null==h?void 0:h.user_email)&&void 0!==l?l:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(a=null==h?void 0:h.user_role)&&void 0!==a?a:null),premiumUser:null!==(d=null==h?void 0:h.premium_user)&&void 0!==d?d:null,disabledPersonalKeyCreation:null!==(u=null==h?void 0:h.disabled_non_admin_personal_key_creation)&&void 0!==u?u:null,showSSOBanner:(null==h?void 0:h.login_method)==="username_password"}}},49104:function(e,n,l){"use strict";l.d(n,{Z:function(){return F}});var t=l(57437),s=l(2265),i=l(87452),r=l(88829),a=l(72208),d=l(49566),u=l(13634),o=l(82680),c=l(20577),m=l(52787),h=l(73002),p=l(19250),x=l(9114),g=e=>{let{isModalVisible:n,accessToken:l,setIsModalVisible:s,setBudgetList:g}=e,[j]=u.Z.useForm(),Z=async e=>{if(null!=l&&void 0!=l)try{x.Z.info("Making API Call");let n=await (0,p.budgetCreateCall)(l,e);console.log("key create Response:",n),g(e=>e?[...e,n]:[n]),x.Z.success("Budget Created"),j.resetFields()}catch(e){console.error("Error creating the key:",e),x.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,t.jsx)(o.Z,{title:"Create Budget",visible:n,width:800,footer:null,onOk:()=>{s(!1),j.resetFields()},onCancel:()=>{s(!1),j.resetFields()},children:(0,t.jsxs)(u.Z,{form:j,onFinish:Z,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,t.jsx)(d.Z,{placeholder:""})}),(0,t.jsx)(u.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,t.jsx)(c.Z,{step:1,precision:2,width:200})}),(0,t.jsx)(u.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,t.jsx)(c.Z,{step:1,precision:2,width:200})}),(0,t.jsxs)(i.Z,{className:"mt-20 mb-8",children:[(0,t.jsx)(a.Z,{children:(0,t.jsx)("b",{children:"Optional Settings"})}),(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(u.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(c.Z,{step:.01,precision:2,width:200})}),(0,t.jsx)(u.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(m.default,{defaultValue:null,placeholder:"n/a",children:[(0,t.jsx)(m.default.Option,{value:"24h",children:"daily"}),(0,t.jsx)(m.default.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(m.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(h.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},j=e=>{let{isModalVisible:n,accessToken:l,setIsModalVisible:g,setBudgetList:j,existingBudget:Z,handleUpdateCall:_}=e;console.log("existingBudget",Z);let[b]=u.Z.useForm();(0,s.useEffect)(()=>{b.setFieldsValue(Z)},[Z,b]);let f=async e=>{if(null!=l&&void 0!=l)try{x.Z.info("Making API Call"),g(!0);let n=await (0,p.budgetUpdateCall)(l,e);j(e=>e?[...e,n]:[n]),x.Z.success("Budget Updated"),b.resetFields(),_()}catch(e){console.error("Error creating the key:",e),x.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,t.jsx)(o.Z,{title:"Edit Budget",visible:n,width:800,footer:null,onOk:()=>{g(!1),b.resetFields()},onCancel:()=>{g(!1),b.resetFields()},children:(0,t.jsxs)(u.Z,{form:b,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:Z,children:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,t.jsx)(d.Z,{placeholder:""})}),(0,t.jsx)(u.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,t.jsx)(c.Z,{step:1,precision:2,width:200})}),(0,t.jsx)(u.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,t.jsx)(c.Z,{step:1,precision:2,width:200})}),(0,t.jsxs)(i.Z,{className:"mt-20 mb-8",children:[(0,t.jsx)(a.Z,{children:(0,t.jsx)("b",{children:"Optional Settings"})}),(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(u.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(c.Z,{step:.01,precision:2,width:200})}),(0,t.jsx)(u.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(m.default,{defaultValue:null,placeholder:"n/a",children:[(0,t.jsx)(m.default.Option,{value:"24h",children:"daily"}),(0,t.jsx)(m.default.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(m.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(h.ZP,{htmlType:"submit",children:"Save"})})]})})},Z=l(20831),_=l(12514),b=l(47323),f=l(12485),y=l(18135),v=l(35242),k=l(29706),w=l(77991),C=l(21626),B=l(97214),I=l(28241),D=l(58834),A=l(69552),O=l(71876),T=l(84264),E=l(53410),M=l(74998),S=l(17906),F=e=>{let{accessToken:n}=e,[l,i]=(0,s.useState)(!1),[r,a]=(0,s.useState)(!1),[d,u]=(0,s.useState)(null),[o,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{n&&(0,p.getBudgetList)(n).then(e=>{c(e)})},[n]);let m=async(e,l)=>{console.log("budget_id",e),null!=n&&(u(o.find(n=>n.budget_id===e)||null),a(!0))},h=async(e,l)=>{if(null==n)return;x.Z.info("Request made"),await (0,p.budgetDeleteCall)(n,e);let t=[...o];t.splice(l,1),c(t),x.Z.success("Budget Deleted.")},F=async()=>{null!=n&&(0,p.getBudgetList)(n).then(e=>{c(e)})};return(0,t.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,t.jsx)(Z.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>i(!0),children:"+ Create Budget"}),(0,t.jsx)(g,{accessToken:n,isModalVisible:l,setIsModalVisible:i,setBudgetList:c}),d&&(0,t.jsx)(j,{accessToken:n,isModalVisible:r,setIsModalVisible:a,setBudgetList:c,existingBudget:d,handleUpdateCall:F}),(0,t.jsxs)(_.Z,{children:[(0,t.jsx)(T.Z,{children:"Create a budget to assign to customers."}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(D.Z,{children:(0,t.jsxs)(O.Z,{children:[(0,t.jsx)(A.Z,{children:"Budget ID"}),(0,t.jsx)(A.Z,{children:"Max Budget"}),(0,t.jsx)(A.Z,{children:"TPM"}),(0,t.jsx)(A.Z,{children:"RPM"})]})}),(0,t.jsx)(B.Z,{children:o.slice().sort((e,n)=>new Date(n.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,n)=>(0,t.jsxs)(O.Z,{children:[(0,t.jsx)(I.Z,{children:e.budget_id}),(0,t.jsx)(I.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,t.jsx)(I.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,t.jsx)(I.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,t.jsx)(b.Z,{icon:E.Z,size:"sm",onClick:()=>m(e.budget_id,n)}),(0,t.jsx)(b.Z,{icon:M.Z,size:"sm",onClick:()=>h(e.budget_id,n)})]},n))})]})]}),(0,t.jsxs)("div",{className:"mt-5",children:[(0,t.jsx)(T.Z,{className:"text-base",children:"How to use budget id"}),(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(v.Z,{children:[(0,t.jsx)(f.Z,{children:"Assign Budget to Customer"}),(0,t.jsx)(f.Z,{children:"Test it (Curl)"}),(0,t.jsx)(f.Z,{children:"Test it (OpenAI SDK)"})]}),(0,t.jsxs)(w.Z,{children:[(0,t.jsx)(k.Z,{children:(0,t.jsx)(S.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,t.jsx)(k.Z,{children:(0,t.jsx)(S.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,t.jsx)(k.Z,{children:(0,t.jsx)(S.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="",\n api_key=""\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})}}},function(e){e.O(0,[9820,1491,1526,2417,2926,7906,527,8049,2971,2117,1744],function(){return e(e.s=54501)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/page-c24bfd9a9fd51fe8.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/page-34cb1817eb6914a2.js similarity index 96% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/page-c24bfd9a9fd51fe8.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/page-34cb1817eb6914a2.js index 1ebaa23ece..c29c70e016 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/page-c24bfd9a9fd51fe8.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/page-34cb1817eb6914a2.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1979],{90286:function(e,n,t){Promise.resolve().then(t.bind(t,37492))},37492:function(e,n,t){"use strict";t.r(n);var r=t(57437),l=t(44696),s=t(39760);n.default=()=>{let{token:e,accessToken:n,userRole:t,userId:a,premiumUser:i}=(0,s.Z)();return(0,r.jsx)(l.Z,{accessToken:n,token:e,userRole:t,userID:a,premiumUser:i})}},39760:function(e,n,t){"use strict";var r=t(2265),l=t(99376),s=t(14474),a=t(3914);n.Z=()=>{var e,n,t,i,o,u,c;let d=(0,l.useRouter)(),m="undefined"!=typeof document?(0,a.e)("token"):null;(0,r.useEffect)(()=>{m||d.replace("/sso/key/generate")},[m,d]);let f=(0,r.useMemo)(()=>{if(!m)return null;try{return(0,s.o)(m)}catch(e){return(0,a.b)(),d.replace("/sso/key/generate"),null}},[m,d]);return{token:m,accessToken:null!==(e=null==f?void 0:f.key)&&void 0!==e?e:null,userId:null!==(n=null==f?void 0:f.user_id)&&void 0!==n?n:null,userEmail:null!==(t=null==f?void 0:f.user_email)&&void 0!==t?t:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(i=null==f?void 0:f.user_role)&&void 0!==i?i:null),premiumUser:null!==(o=null==f?void 0:f.premium_user)&&void 0!==o?o:null,disabledPersonalKeyCreation:null!==(u=null==f?void 0:f.disabled_non_admin_personal_key_creation)&&void 0!==u?u:null,showSSOBanner:(null==f?void 0:f.login_method)==="username_password"}}},39789:function(e,n,t){"use strict";t.d(n,{Z:function(){return i}});var r=t(57437),l=t(2265),s=t(21487),a=t(84264),i=e=>{let{value:n,onValueChange:t,label:i="Select Time Range",className:o="",showTimeRange:u=!0}=e,[c,d]=(0,l.useState)(!1),m=(0,l.useRef)(null),f=(0,l.useCallback)(e=>{d(!0),setTimeout(()=>d(!1),1500),t(e),requestIdleCallback(()=>{if(e.from){let n;let r={...e},l=new Date(e.from);n=new Date(e.to?e.to:e.from),l.toDateString(),n.toDateString(),l.setHours(0,0,0,0),n.setHours(23,59,59,999),r.from=l,r.to=n,t(r)}},{timeout:100})},[t]),h=(0,l.useCallback)((e,n)=>{if(!e||!n)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==n.toDateString())return"".concat(t(e)," - ").concat(t(n));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),r=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),l=n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(r," - ").concat(l)}},[]);return(0,r.jsxs)("div",{className:o,children:[i&&(0,r.jsx)(a.Z,{className:"mb-2",children:i}),(0,r.jsxs)("div",{className:"relative w-fit",children:[(0,r.jsx)("div",{ref:m,children:(0,r.jsx)(s.Z,{enableSelect:!0,value:n,onValueChange:f,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,r.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,r.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,r.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,r.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),u&&n.from&&n.to&&(0,r.jsx)(a.Z,{className:"mt-2 text-xs text-gray-500",children:h(n.from,n.to)})]})}}},function(e){e.O(0,[9820,1491,1526,2926,9678,7281,2344,1487,2662,8049,4696,2971,2117,1744],function(){return e(e.s=90286)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1979],{90286:function(e,n,t){Promise.resolve().then(t.bind(t,37492))},37492:function(e,n,t){"use strict";t.r(n);var r=t(57437),l=t(44696),s=t(80443);n.default=()=>{let{token:e,accessToken:n,userRole:t,userId:a,premiumUser:i}=(0,s.Z)();return(0,r.jsx)(l.Z,{accessToken:n,token:e,userRole:t,userID:a,premiumUser:i})}},80443:function(e,n,t){"use strict";var r=t(2265),l=t(99376),s=t(14474),a=t(3914);n.Z=()=>{var e,n,t,i,o,u,c;let d=(0,l.useRouter)(),m="undefined"!=typeof document?(0,a.e)("token"):null;(0,r.useEffect)(()=>{m||d.replace("/sso/key/generate")},[m,d]);let f=(0,r.useMemo)(()=>{if(!m)return null;try{return(0,s.o)(m)}catch(e){return(0,a.b)(),d.replace("/sso/key/generate"),null}},[m,d]);return{token:m,accessToken:null!==(e=null==f?void 0:f.key)&&void 0!==e?e:null,userId:null!==(n=null==f?void 0:f.user_id)&&void 0!==n?n:null,userEmail:null!==(t=null==f?void 0:f.user_email)&&void 0!==t?t:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(i=null==f?void 0:f.user_role)&&void 0!==i?i:null),premiumUser:null!==(o=null==f?void 0:f.premium_user)&&void 0!==o?o:null,disabledPersonalKeyCreation:null!==(u=null==f?void 0:f.disabled_non_admin_personal_key_creation)&&void 0!==u?u:null,showSSOBanner:(null==f?void 0:f.login_method)==="username_password"}}},39789:function(e,n,t){"use strict";t.d(n,{Z:function(){return i}});var r=t(57437),l=t(2265),s=t(21487),a=t(84264),i=e=>{let{value:n,onValueChange:t,label:i="Select Time Range",className:o="",showTimeRange:u=!0}=e,[c,d]=(0,l.useState)(!1),m=(0,l.useRef)(null),f=(0,l.useCallback)(e=>{d(!0),setTimeout(()=>d(!1),1500),t(e),requestIdleCallback(()=>{if(e.from){let n;let r={...e},l=new Date(e.from);n=new Date(e.to?e.to:e.from),l.toDateString(),n.toDateString(),l.setHours(0,0,0,0),n.setHours(23,59,59,999),r.from=l,r.to=n,t(r)}},{timeout:100})},[t]),h=(0,l.useCallback)((e,n)=>{if(!e||!n)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==n.toDateString())return"".concat(t(e)," - ").concat(t(n));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),r=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),l=n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(r," - ").concat(l)}},[]);return(0,r.jsxs)("div",{className:o,children:[i&&(0,r.jsx)(a.Z,{className:"mb-2",children:i}),(0,r.jsxs)("div",{className:"relative w-fit",children:[(0,r.jsx)("div",{ref:m,children:(0,r.jsx)(s.Z,{enableSelect:!0,value:n,onValueChange:f,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,r.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,r.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,r.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,r.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),u&&n.from&&n.to&&(0,r.jsx)(a.Z,{className:"mt-2 text-xs text-gray-500",children:h(n.from,n.to)})]})}}},function(e){e.O(0,[9820,1491,1526,2926,9678,7281,2344,1487,2662,8049,4696,2971,2117,1744],function(){return e(e.s=90286)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-755c4cefc4b9c65c.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-755c4cefc4b9c65c.js deleted file mode 100644 index 39ccd23019..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-755c4cefc4b9c65c.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[813],{59898:function(e,t,r){Promise.resolve().then(r.bind(r,42954))},47323:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var a=r(5853),n=r(2265),l=r(1526),o=r(7084),s=r(97324),d=r(1153),i=r(26898);let c={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},m={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},u={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},x=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,d.bM)(t,i.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,s.q)((0,d.bM)(t,i.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,d.fn)("Icon"),g=n.forwardRef((e,t)=>{let{icon:r,variant:i="simple",tooltip:g,size:b=o.u8.SM,color:p,className:f}=e,k=(0,a._T)(e,["icon","variant","tooltip","size","color","className"]),v=x(i,p),{tooltipProps:w,getReferenceProps:y}=(0,l.l)();return n.createElement("span",Object.assign({ref:(0,d.lq)([t,w.refs.setReference]),className:(0,s.q)(h("root"),"inline-flex flex-shrink-0 items-center",v.bgColor,v.textColor,v.borderColor,v.ringColor,u[i].rounded,u[i].border,u[i].shadow,u[i].ring,c[b].paddingX,c[b].paddingY,f)},y,k),n.createElement(l.Z,Object.assign({text:g},w)),n.createElement(r,{className:(0,s.q)(h("icon"),"shrink-0",m[b].height,m[b].width)}))});g.displayName="Icon"},92414:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var a=r(5853),n=r(2265);r(42698),r(64016),r(8710);var l=r(33232),o=r(44140),s=r(58747);let d=e=>{var t=(0,a._T)(e,[]);return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),n.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var i=r(4537),c=r(9528),m=r(33044);let u=e=>{var t=(0,a._T)(e,[]);return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var x=r(97324),h=r(1153),g=r(96398);let b=(0,h.fn)("MultiSelect"),p=n.forwardRef((e,t)=>{let{defaultValue:r,value:h,onValueChange:p,placeholder:f="Select...",placeholderSearch:k="Search",disabled:v=!1,icon:w,children:y,className:N}=e,j=(0,a._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className"]),[C,E]=(0,o.Z)(r,h),{reactElementChildren:S,optionsAvailable:_}=(0,n.useMemo)(()=>{let e=n.Children.toArray(y).filter(n.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,g.n0)("",e)}},[y]),[Z,q]=(0,n.useState)(""),M=(null!=C?C:[]).length>0,R=(0,n.useMemo)(()=>Z?(0,g.n0)(Z,S):_,[Z,S,_]),T=()=>{q("")};return n.createElement(c.R,Object.assign({as:"div",ref:t,defaultValue:C,value:C,onChange:e=>{null==p||p(e),E(e)},disabled:v,className:(0,x.q)("w-full min-w-[10rem] relative text-tremor-default",N)},j,{multiple:!0}),e=>{let{value:t}=e;return n.createElement(n.Fragment,null,n.createElement(c.R.Button,{className:(0,x.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",w?"pl-11 -ml-0.5":"pl-3",(0,g.um)(t.length>0,v))},w&&n.createElement("span",{className:(0,x.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},n.createElement(w,{className:(0,x.q)(b("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.createElement("div",{className:"h-6 flex items-center"},t.length>0?n.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},_.filter(e=>t.includes(e.props.value)).map((e,r)=>{var a;return n.createElement("div",{key:r,className:(0,x.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},n.createElement("div",{className:"text-xs truncate "},null!==(a=e.props.children)&&void 0!==a?a:e.props.value),n.createElement("div",{onClick:r=>{r.preventDefault();let a=t.filter(t=>t!==e.props.value);null==p||p(a),E(a)}},n.createElement(u,{className:(0,x.q)(b("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):n.createElement("span",null,f)),n.createElement("span",{className:(0,x.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},n.createElement(s.Z,{className:(0,x.q)(b("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),M&&!v?n.createElement("button",{type:"button",className:(0,x.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),E([]),null==p||p([])}},n.createElement(i.Z,{className:(0,x.q)(b("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,n.createElement(m.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},n.createElement(c.R.Options,{className:(0,x.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},n.createElement("div",{className:(0,x.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},n.createElement("span",null,n.createElement(d,{className:(0,x.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:k,className:(0,x.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>q(e.target.value),value:Z})),n.createElement(l.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:T}},{value:{selectedValue:t}}),R))))})});p.displayName="MultiSelect"},46030:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var a=r(5853);r(42698),r(64016),r(8710);var n=r(33232),l=r(2265),o=r(97324),s=r(1153),d=r(9528);let i=(0,s.fn)("MultiSelectItem"),c=l.forwardRef((e,t)=>{let{value:r,className:c,children:m}=e,u=(0,a._T)(e,["value","className","children"]),{selectedValue:x}=(0,l.useContext)(n.Z),h=(0,s.NZ)(r,x);return l.createElement(d.R.Option,Object.assign({className:(0,o.q)(i("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",c),ref:t,key:r,value:r},u),l.createElement("input",{type:"checkbox",className:(0,o.q)(i("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),l.createElement("span",{className:"whitespace-nowrap truncate"},null!=m?m:r))});c.displayName="MultiSelectItem"},96889:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a=r(5853),n=r(2265),l=r(26898),o=r(97324),s=r(1153);let d=(0,s.fn)("BarList"),i=n.forwardRef((e,t)=>{var r;let i;let{data:c=[],color:m,valueFormatter:u=s.Cj,showAnimation:x=!1,className:h}=e,g=(0,a._T)(e,["data","color","valueFormatter","showAnimation","className"]),b=(r=c.map(e=>e.value),i=-1/0,r.forEach(e=>{i=Math.max(i,e)}),r.map(e=>0===e?0:Math.max(e/i*100,1)));return n.createElement("div",Object.assign({ref:t,className:(0,o.q)(d("root"),"flex justify-between space-x-6",h)},g),n.createElement("div",{className:(0,o.q)(d("bars"),"relative w-full")},c.map((e,t)=>{var r,a,i;let u=e.icon;return n.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:(0,o.q)(d("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||m?(0,s.bM)(null!==(a=e.color)&&void 0!==a?a:m,l.K.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===c.length-1?"mb-0":"mb-2"),style:{width:"".concat(b[t],"%"),transition:x?"all 1s":""}},n.createElement("div",{className:(0,o.q)("absolute max-w-full flex left-2")},u?n.createElement(u,{className:(0,o.q)(d("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?n.createElement("a",{href:e.href,target:null!==(i=e.target)&&void 0!==i?i:"_blank",rel:"noreferrer",className:(0,o.q)(d("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name):n.createElement("p",{className:(0,o.q)(d("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name)))})),n.createElement("div",{className:"text-right min-w-min"},c.map((e,t)=>{var r;return n.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:(0,o.q)(d("labelWrapper"),"flex justify-end items-center","h-9",t===c.length-1?"mb-0":"mb-2")},n.createElement("p",{className:(0,o.q)(d("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},u(e.value)))})))});i.displayName="BarList"},16312:function(e,t,r){"use strict";r.d(t,{z:function(){return a.Z}});var a=r(20831)},19130:function(e,t,r){"use strict";r.d(t,{RM:function(){return n.Z},SC:function(){return d.Z},iA:function(){return a.Z},pj:function(){return l.Z},ss:function(){return o.Z},xs:function(){return s.Z}});var a=r(21626),n=r(97214),l=r(28241),o=r(58834),s=r(69552),d=r(71876)},42954:function(e,t,r){"use strict";r.r(t);var a=r(57437),n=r(18143),l=r(39760),o=r(2265);t.default=()=>{let{accessToken:e,token:t,userRole:r,userId:s,premiumUser:d}=(0,l.Z)(),[i,c]=(0,o.useState)([]);return(0,a.jsx)(n.Z,{accessToken:e,token:t,userRole:r,userID:s,keys:i,premiumUser:d})}},39789:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(57437),n=r(2265),l=r(21487),o=r(84264),s=e=>{let{value:t,onValueChange:r,label:s="Select Time Range",className:d="",showTimeRange:i=!0}=e,[c,m]=(0,n.useState)(!1),u=(0,n.useRef)(null),x=(0,n.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),r(e),requestIdleCallback(()=>{if(e.from){let t;let a={...e},n=new Date(e.from);t=new Date(e.to?e.to:e.from),n.toDateString(),t.toDateString(),n.setHours(0,0,0,0),t.setHours(23,59,59,999),a.from=n,a.to=t,r(a)}},{timeout:100})},[r]),h=(0,n.useCallback)((e,t)=>{if(!e||!t)return"";let r=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==t.toDateString())return"".concat(r(e)," - ").concat(r(t));{let r=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),a=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(r,": ").concat(a," - ").concat(n)}},[]);return(0,a.jsxs)("div",{className:d,children:[s&&(0,a.jsx)(o.Z,{className:"mb-2",children:s}),(0,a.jsxs)("div",{className:"relative w-fit",children:[(0,a.jsx)("div",{ref:u,children:(0,a.jsx)(l.Z,{enableSelect:!0,value:t,onValueChange:x,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,a.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,a.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,a.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,a.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),i&&t.from&&t.to&&(0,a.jsx)(o.Z,{className:"mt-2 text-xs text-gray-500",children:h(t.from,t.to)})]})}},83438:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var a=r(57437),n=r(2265),l=r(40278),o=r(94292),s=r(19250);let d=e=>{let{key:t,info:r}=e;return{token:t,...r}};var i=r(12322),c=r(89970),m=r(16312),u=r(59872),x=r(44633),h=r(86462),g=e=>{let{topKeys:t,accessToken:r,userID:g,userRole:b,teams:p,premiumUser:f,showTags:k=!1}=e,[v,w]=(0,n.useState)(!1),[y,N]=(0,n.useState)(null),[j,C]=(0,n.useState)(void 0),[E,S]=(0,n.useState)("table"),[_,Z]=(0,n.useState)(new Set),q=e=>{Z(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},M=async e=>{if(r)try{let t=await (0,s.keyInfoV1Call)(r,e.api_key),a=d(t);C(a),N(e.api_key),w(!0)}catch(e){console.error("Error fetching key info:",e)}},R=()=>{w(!1),N(null),C(void 0)};n.useEffect(()=>{let e=e=>{"Escape"===e.key&&v&&R()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v]);let T=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(c.Z,{title:e.getValue(),children:(0,a.jsx)(m.z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>M(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],D={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let t=e.getValue();return t>0&&t<.01?"<$0.01":"$".concat((0,u.pw)(t,2))}},L=k?[...T,{header:"Tags",accessorKey:"tags",cell:e=>{let t=e.getValue(),r=e.row.original.api_key,n=_.has(r);if(!t||0===t.length)return"-";let l=t.sort((e,t)=>t.usage-e.usage),o=n?l:l.slice(0,2),s=t.length>2;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[o.map((e,t)=>(0,a.jsx)(c.Z,{title:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":"$".concat((0,u.pw)(e.usage,2))]})]}),children:(0,a.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},t)),s&&(0,a.jsx)("button",{onClick:()=>q(r),className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:n?"Show fewer tags":"Show all tags",children:n?(0,a.jsx)(x.Z,{className:"h-3 w-3 text-gray-500"}):(0,a.jsx)(h.Z,{className:"h-3 w-3 text-gray-500"})})]})})}},D]:[...T,D],I=t.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>S("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===E?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>S("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===E?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===E?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(l.Z,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:I,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>e?"$".concat((0,u.pw)(e,2)):"No Key Alias",onValueChange:e=>M(e),showTooltip:!0,customTooltip:e=>{var t,r;let n=null===(r=e.payload)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.payload;return(0,a.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==n?void 0:n.key_alias})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==n?void 0:n.api_key})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,a.jsxs)("span",{className:"text-white font-medium",children:["$",(0,u.pw)(null==n?void 0:n.spend,2)]})]})]})})}})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,a.jsx)(i.w,{columns:L,data:t,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),v&&y&&j&&(console.log("Rendering modal with:",{isModalOpen:v,selectedKey:y,keyData:j}),(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&R()},children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,a.jsx)("button",{onClick:R,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("div",{className:"p-6 h-full",children:(0,a.jsx)(o.Z,{keyId:y,onClose:R,keyData:j,accessToken:r,userID:g,userRole:b,teams:p,premiumUser:f})})]})}))]})}},12322:function(e,t,r){"use strict";r.d(t,{w:function(){return d}});var a=r(57437),n=r(2265),l=r(71594),o=r(24525),s=r(19130);function d(e){let{data:t=[],columns:r,getRowCanExpand:d,renderSubComponent:i,isLoading:c=!1,loadingMessage:m="\uD83D\uDE85 Loading logs...",noDataMessage:u="No logs found"}=e,x=(0,l.b7)({data:t,columns:r,getRowCanExpand:d,getRowId:(e,t)=>{var r;return null!==(r=null==e?void 0:e.request_id)&&void 0!==r?r:String(t)},getCoreRowModel:(0,o.sC)(),getExpandedRowModel:(0,o.rV)()});return(0,a.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,a.jsxs)(s.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,a.jsx)(s.ss,{children:x.getHeaderGroups().map(e=>(0,a.jsx)(s.SC,{children:e.headers.map(e=>(0,a.jsx)(s.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,l.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,a.jsx)(s.RM,{children:c?(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:m})})})}):x.getRowModel().rows.length>0?x.getRowModel().rows.map(e=>(0,a.jsxs)(n.Fragment,{children:[(0,a.jsx)(s.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,a.jsx)(s.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,l.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,a.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:i({row:e})})})})]},e.id)):(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:u})})})})})]})})}},47375:function(e,t,r){"use strict";var a=r(57437),n=r(2265),l=r(19250),o=r(59872);t.Z=e=>{let{userID:t,userRole:r,accessToken:s,userSpend:d,userMaxBudget:i,selectedTeam:c}=e;console.log("userSpend: ".concat(d));let[m,u]=(0,n.useState)(null!==d?d:0),[x,h]=(0,n.useState)(c?Number((0,o.pw)(c.max_budget,4)):null);(0,n.useEffect)(()=>{if(c){if("Default Team"===c.team_alias)h(i);else{let e=!1;if(c.team_memberships)for(let r of c.team_memberships)r.user_id===t&&"max_budget"in r.litellm_budget_table&&null!==r.litellm_budget_table.max_budget&&(h(r.litellm_budget_table.max_budget),e=!0);e||h(c.max_budget)}}},[c,i]);let[g,b]=(0,n.useState)([]);(0,n.useEffect)(()=>{let e=async()=>{if(!s||!t||!r)return};(async()=>{try{if(null===t||null===r)return;if(null!==s){let e=(await (0,l.modelAvailableCall)(s,t,r)).data.map(e=>e.id);console.log("available_model_names:",e),b(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[r,s,t]),(0,n.useEffect)(()=>{null!==d&&u(d)},[d]);let p=[];c&&c.models&&(p=c.models),p&&p.includes("all-proxy-models")?(console.log("user models:",g),p=g):p&&p.includes("all-team-models")?p=c.models:p&&0===p.length&&(p=g);let f=null!==x?"$".concat((0,o.pw)(Number(x),4)," limit"):"No limit",k=void 0!==m?(0,o.pw)(m,4):null;return console.log("spend in view user spend: ".concat(m)),(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,a.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",k]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:f})]})]})})}},44633:function(e,t,r){"use strict";var a=r(2265);let n=a.forwardRef(function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=n}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,2344,1487,5105,1160,8049,131,2202,874,4292,8143,2971,2117,1744],function(){return e(e.s=59898)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-755c4cefc4b9c65c.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-dc75946e58de809e.js similarity index 99% rename from ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-755c4cefc4b9c65c.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-dc75946e58de809e.js index 39ccd23019..c9e1144681 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-755c4cefc4b9c65c.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-dc75946e58de809e.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[813],{59898:function(e,t,r){Promise.resolve().then(r.bind(r,42954))},47323:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var a=r(5853),n=r(2265),l=r(1526),o=r(7084),s=r(97324),d=r(1153),i=r(26898);let c={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},m={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},u={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},x=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,d.bM)(t,i.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,s.q)((0,d.bM)(t,i.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,d.fn)("Icon"),g=n.forwardRef((e,t)=>{let{icon:r,variant:i="simple",tooltip:g,size:b=o.u8.SM,color:p,className:f}=e,k=(0,a._T)(e,["icon","variant","tooltip","size","color","className"]),v=x(i,p),{tooltipProps:w,getReferenceProps:y}=(0,l.l)();return n.createElement("span",Object.assign({ref:(0,d.lq)([t,w.refs.setReference]),className:(0,s.q)(h("root"),"inline-flex flex-shrink-0 items-center",v.bgColor,v.textColor,v.borderColor,v.ringColor,u[i].rounded,u[i].border,u[i].shadow,u[i].ring,c[b].paddingX,c[b].paddingY,f)},y,k),n.createElement(l.Z,Object.assign({text:g},w)),n.createElement(r,{className:(0,s.q)(h("icon"),"shrink-0",m[b].height,m[b].width)}))});g.displayName="Icon"},92414:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var a=r(5853),n=r(2265);r(42698),r(64016),r(8710);var l=r(33232),o=r(44140),s=r(58747);let d=e=>{var t=(0,a._T)(e,[]);return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),n.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var i=r(4537),c=r(9528),m=r(33044);let u=e=>{var t=(0,a._T)(e,[]);return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var x=r(97324),h=r(1153),g=r(96398);let b=(0,h.fn)("MultiSelect"),p=n.forwardRef((e,t)=>{let{defaultValue:r,value:h,onValueChange:p,placeholder:f="Select...",placeholderSearch:k="Search",disabled:v=!1,icon:w,children:y,className:N}=e,j=(0,a._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className"]),[C,E]=(0,o.Z)(r,h),{reactElementChildren:S,optionsAvailable:_}=(0,n.useMemo)(()=>{let e=n.Children.toArray(y).filter(n.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,g.n0)("",e)}},[y]),[Z,q]=(0,n.useState)(""),M=(null!=C?C:[]).length>0,R=(0,n.useMemo)(()=>Z?(0,g.n0)(Z,S):_,[Z,S,_]),T=()=>{q("")};return n.createElement(c.R,Object.assign({as:"div",ref:t,defaultValue:C,value:C,onChange:e=>{null==p||p(e),E(e)},disabled:v,className:(0,x.q)("w-full min-w-[10rem] relative text-tremor-default",N)},j,{multiple:!0}),e=>{let{value:t}=e;return n.createElement(n.Fragment,null,n.createElement(c.R.Button,{className:(0,x.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",w?"pl-11 -ml-0.5":"pl-3",(0,g.um)(t.length>0,v))},w&&n.createElement("span",{className:(0,x.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},n.createElement(w,{className:(0,x.q)(b("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.createElement("div",{className:"h-6 flex items-center"},t.length>0?n.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},_.filter(e=>t.includes(e.props.value)).map((e,r)=>{var a;return n.createElement("div",{key:r,className:(0,x.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},n.createElement("div",{className:"text-xs truncate "},null!==(a=e.props.children)&&void 0!==a?a:e.props.value),n.createElement("div",{onClick:r=>{r.preventDefault();let a=t.filter(t=>t!==e.props.value);null==p||p(a),E(a)}},n.createElement(u,{className:(0,x.q)(b("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):n.createElement("span",null,f)),n.createElement("span",{className:(0,x.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},n.createElement(s.Z,{className:(0,x.q)(b("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),M&&!v?n.createElement("button",{type:"button",className:(0,x.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),E([]),null==p||p([])}},n.createElement(i.Z,{className:(0,x.q)(b("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,n.createElement(m.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},n.createElement(c.R.Options,{className:(0,x.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},n.createElement("div",{className:(0,x.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},n.createElement("span",null,n.createElement(d,{className:(0,x.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:k,className:(0,x.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>q(e.target.value),value:Z})),n.createElement(l.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:T}},{value:{selectedValue:t}}),R))))})});p.displayName="MultiSelect"},46030:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var a=r(5853);r(42698),r(64016),r(8710);var n=r(33232),l=r(2265),o=r(97324),s=r(1153),d=r(9528);let i=(0,s.fn)("MultiSelectItem"),c=l.forwardRef((e,t)=>{let{value:r,className:c,children:m}=e,u=(0,a._T)(e,["value","className","children"]),{selectedValue:x}=(0,l.useContext)(n.Z),h=(0,s.NZ)(r,x);return l.createElement(d.R.Option,Object.assign({className:(0,o.q)(i("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",c),ref:t,key:r,value:r},u),l.createElement("input",{type:"checkbox",className:(0,o.q)(i("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),l.createElement("span",{className:"whitespace-nowrap truncate"},null!=m?m:r))});c.displayName="MultiSelectItem"},96889:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a=r(5853),n=r(2265),l=r(26898),o=r(97324),s=r(1153);let d=(0,s.fn)("BarList"),i=n.forwardRef((e,t)=>{var r;let i;let{data:c=[],color:m,valueFormatter:u=s.Cj,showAnimation:x=!1,className:h}=e,g=(0,a._T)(e,["data","color","valueFormatter","showAnimation","className"]),b=(r=c.map(e=>e.value),i=-1/0,r.forEach(e=>{i=Math.max(i,e)}),r.map(e=>0===e?0:Math.max(e/i*100,1)));return n.createElement("div",Object.assign({ref:t,className:(0,o.q)(d("root"),"flex justify-between space-x-6",h)},g),n.createElement("div",{className:(0,o.q)(d("bars"),"relative w-full")},c.map((e,t)=>{var r,a,i;let u=e.icon;return n.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:(0,o.q)(d("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||m?(0,s.bM)(null!==(a=e.color)&&void 0!==a?a:m,l.K.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===c.length-1?"mb-0":"mb-2"),style:{width:"".concat(b[t],"%"),transition:x?"all 1s":""}},n.createElement("div",{className:(0,o.q)("absolute max-w-full flex left-2")},u?n.createElement(u,{className:(0,o.q)(d("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?n.createElement("a",{href:e.href,target:null!==(i=e.target)&&void 0!==i?i:"_blank",rel:"noreferrer",className:(0,o.q)(d("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name):n.createElement("p",{className:(0,o.q)(d("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name)))})),n.createElement("div",{className:"text-right min-w-min"},c.map((e,t)=>{var r;return n.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:(0,o.q)(d("labelWrapper"),"flex justify-end items-center","h-9",t===c.length-1?"mb-0":"mb-2")},n.createElement("p",{className:(0,o.q)(d("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},u(e.value)))})))});i.displayName="BarList"},16312:function(e,t,r){"use strict";r.d(t,{z:function(){return a.Z}});var a=r(20831)},19130:function(e,t,r){"use strict";r.d(t,{RM:function(){return n.Z},SC:function(){return d.Z},iA:function(){return a.Z},pj:function(){return l.Z},ss:function(){return o.Z},xs:function(){return s.Z}});var a=r(21626),n=r(97214),l=r(28241),o=r(58834),s=r(69552),d=r(71876)},42954:function(e,t,r){"use strict";r.r(t);var a=r(57437),n=r(18143),l=r(39760),o=r(2265);t.default=()=>{let{accessToken:e,token:t,userRole:r,userId:s,premiumUser:d}=(0,l.Z)(),[i,c]=(0,o.useState)([]);return(0,a.jsx)(n.Z,{accessToken:e,token:t,userRole:r,userID:s,keys:i,premiumUser:d})}},39789:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(57437),n=r(2265),l=r(21487),o=r(84264),s=e=>{let{value:t,onValueChange:r,label:s="Select Time Range",className:d="",showTimeRange:i=!0}=e,[c,m]=(0,n.useState)(!1),u=(0,n.useRef)(null),x=(0,n.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),r(e),requestIdleCallback(()=>{if(e.from){let t;let a={...e},n=new Date(e.from);t=new Date(e.to?e.to:e.from),n.toDateString(),t.toDateString(),n.setHours(0,0,0,0),t.setHours(23,59,59,999),a.from=n,a.to=t,r(a)}},{timeout:100})},[r]),h=(0,n.useCallback)((e,t)=>{if(!e||!t)return"";let r=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==t.toDateString())return"".concat(r(e)," - ").concat(r(t));{let r=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),a=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(r,": ").concat(a," - ").concat(n)}},[]);return(0,a.jsxs)("div",{className:d,children:[s&&(0,a.jsx)(o.Z,{className:"mb-2",children:s}),(0,a.jsxs)("div",{className:"relative w-fit",children:[(0,a.jsx)("div",{ref:u,children:(0,a.jsx)(l.Z,{enableSelect:!0,value:t,onValueChange:x,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,a.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,a.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,a.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,a.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),i&&t.from&&t.to&&(0,a.jsx)(o.Z,{className:"mt-2 text-xs text-gray-500",children:h(t.from,t.to)})]})}},83438:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var a=r(57437),n=r(2265),l=r(40278),o=r(94292),s=r(19250);let d=e=>{let{key:t,info:r}=e;return{token:t,...r}};var i=r(12322),c=r(89970),m=r(16312),u=r(59872),x=r(44633),h=r(86462),g=e=>{let{topKeys:t,accessToken:r,userID:g,userRole:b,teams:p,premiumUser:f,showTags:k=!1}=e,[v,w]=(0,n.useState)(!1),[y,N]=(0,n.useState)(null),[j,C]=(0,n.useState)(void 0),[E,S]=(0,n.useState)("table"),[_,Z]=(0,n.useState)(new Set),q=e=>{Z(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},M=async e=>{if(r)try{let t=await (0,s.keyInfoV1Call)(r,e.api_key),a=d(t);C(a),N(e.api_key),w(!0)}catch(e){console.error("Error fetching key info:",e)}},R=()=>{w(!1),N(null),C(void 0)};n.useEffect(()=>{let e=e=>{"Escape"===e.key&&v&&R()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v]);let T=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(c.Z,{title:e.getValue(),children:(0,a.jsx)(m.z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>M(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],D={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let t=e.getValue();return t>0&&t<.01?"<$0.01":"$".concat((0,u.pw)(t,2))}},L=k?[...T,{header:"Tags",accessorKey:"tags",cell:e=>{let t=e.getValue(),r=e.row.original.api_key,n=_.has(r);if(!t||0===t.length)return"-";let l=t.sort((e,t)=>t.usage-e.usage),o=n?l:l.slice(0,2),s=t.length>2;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[o.map((e,t)=>(0,a.jsx)(c.Z,{title:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":"$".concat((0,u.pw)(e.usage,2))]})]}),children:(0,a.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},t)),s&&(0,a.jsx)("button",{onClick:()=>q(r),className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:n?"Show fewer tags":"Show all tags",children:n?(0,a.jsx)(x.Z,{className:"h-3 w-3 text-gray-500"}):(0,a.jsx)(h.Z,{className:"h-3 w-3 text-gray-500"})})]})})}},D]:[...T,D],I=t.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>S("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===E?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>S("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===E?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===E?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(l.Z,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:I,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>e?"$".concat((0,u.pw)(e,2)):"No Key Alias",onValueChange:e=>M(e),showTooltip:!0,customTooltip:e=>{var t,r;let n=null===(r=e.payload)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.payload;return(0,a.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==n?void 0:n.key_alias})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==n?void 0:n.api_key})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,a.jsxs)("span",{className:"text-white font-medium",children:["$",(0,u.pw)(null==n?void 0:n.spend,2)]})]})]})})}})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,a.jsx)(i.w,{columns:L,data:t,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),v&&y&&j&&(console.log("Rendering modal with:",{isModalOpen:v,selectedKey:y,keyData:j}),(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&R()},children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,a.jsx)("button",{onClick:R,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("div",{className:"p-6 h-full",children:(0,a.jsx)(o.Z,{keyId:y,onClose:R,keyData:j,accessToken:r,userID:g,userRole:b,teams:p,premiumUser:f})})]})}))]})}},12322:function(e,t,r){"use strict";r.d(t,{w:function(){return d}});var a=r(57437),n=r(2265),l=r(71594),o=r(24525),s=r(19130);function d(e){let{data:t=[],columns:r,getRowCanExpand:d,renderSubComponent:i,isLoading:c=!1,loadingMessage:m="\uD83D\uDE85 Loading logs...",noDataMessage:u="No logs found"}=e,x=(0,l.b7)({data:t,columns:r,getRowCanExpand:d,getRowId:(e,t)=>{var r;return null!==(r=null==e?void 0:e.request_id)&&void 0!==r?r:String(t)},getCoreRowModel:(0,o.sC)(),getExpandedRowModel:(0,o.rV)()});return(0,a.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,a.jsxs)(s.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,a.jsx)(s.ss,{children:x.getHeaderGroups().map(e=>(0,a.jsx)(s.SC,{children:e.headers.map(e=>(0,a.jsx)(s.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,l.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,a.jsx)(s.RM,{children:c?(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:m})})})}):x.getRowModel().rows.length>0?x.getRowModel().rows.map(e=>(0,a.jsxs)(n.Fragment,{children:[(0,a.jsx)(s.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,a.jsx)(s.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,l.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,a.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:i({row:e})})})})]},e.id)):(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:u})})})})})]})})}},47375:function(e,t,r){"use strict";var a=r(57437),n=r(2265),l=r(19250),o=r(59872);t.Z=e=>{let{userID:t,userRole:r,accessToken:s,userSpend:d,userMaxBudget:i,selectedTeam:c}=e;console.log("userSpend: ".concat(d));let[m,u]=(0,n.useState)(null!==d?d:0),[x,h]=(0,n.useState)(c?Number((0,o.pw)(c.max_budget,4)):null);(0,n.useEffect)(()=>{if(c){if("Default Team"===c.team_alias)h(i);else{let e=!1;if(c.team_memberships)for(let r of c.team_memberships)r.user_id===t&&"max_budget"in r.litellm_budget_table&&null!==r.litellm_budget_table.max_budget&&(h(r.litellm_budget_table.max_budget),e=!0);e||h(c.max_budget)}}},[c,i]);let[g,b]=(0,n.useState)([]);(0,n.useEffect)(()=>{let e=async()=>{if(!s||!t||!r)return};(async()=>{try{if(null===t||null===r)return;if(null!==s){let e=(await (0,l.modelAvailableCall)(s,t,r)).data.map(e=>e.id);console.log("available_model_names:",e),b(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[r,s,t]),(0,n.useEffect)(()=>{null!==d&&u(d)},[d]);let p=[];c&&c.models&&(p=c.models),p&&p.includes("all-proxy-models")?(console.log("user models:",g),p=g):p&&p.includes("all-team-models")?p=c.models:p&&0===p.length&&(p=g);let f=null!==x?"$".concat((0,o.pw)(Number(x),4)," limit"):"No limit",k=void 0!==m?(0,o.pw)(m,4):null;return console.log("spend in view user spend: ".concat(m)),(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,a.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",k]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:f})]})]})})}},44633:function(e,t,r){"use strict";var a=r(2265);let n=a.forwardRef(function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=n}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,2344,1487,5105,1160,8049,131,2202,874,4292,8143,2971,2117,1744],function(){return e(e.s=59898)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[813],{59898:function(e,t,r){Promise.resolve().then(r.bind(r,42954))},47323:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var a=r(5853),n=r(2265),l=r(1526),o=r(7084),s=r(97324),d=r(1153),i=r(26898);let c={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},m={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},u={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},x=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,d.bM)(t,i.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,s.q)((0,d.bM)(t,i.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,d.fn)("Icon"),g=n.forwardRef((e,t)=>{let{icon:r,variant:i="simple",tooltip:g,size:b=o.u8.SM,color:p,className:f}=e,k=(0,a._T)(e,["icon","variant","tooltip","size","color","className"]),v=x(i,p),{tooltipProps:w,getReferenceProps:y}=(0,l.l)();return n.createElement("span",Object.assign({ref:(0,d.lq)([t,w.refs.setReference]),className:(0,s.q)(h("root"),"inline-flex flex-shrink-0 items-center",v.bgColor,v.textColor,v.borderColor,v.ringColor,u[i].rounded,u[i].border,u[i].shadow,u[i].ring,c[b].paddingX,c[b].paddingY,f)},y,k),n.createElement(l.Z,Object.assign({text:g},w)),n.createElement(r,{className:(0,s.q)(h("icon"),"shrink-0",m[b].height,m[b].width)}))});g.displayName="Icon"},92414:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var a=r(5853),n=r(2265);r(42698),r(64016),r(8710);var l=r(33232),o=r(44140),s=r(58747);let d=e=>{var t=(0,a._T)(e,[]);return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),n.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var i=r(4537),c=r(9528),m=r(33044);let u=e=>{var t=(0,a._T)(e,[]);return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var x=r(97324),h=r(1153),g=r(96398);let b=(0,h.fn)("MultiSelect"),p=n.forwardRef((e,t)=>{let{defaultValue:r,value:h,onValueChange:p,placeholder:f="Select...",placeholderSearch:k="Search",disabled:v=!1,icon:w,children:y,className:N}=e,j=(0,a._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className"]),[C,E]=(0,o.Z)(r,h),{reactElementChildren:S,optionsAvailable:_}=(0,n.useMemo)(()=>{let e=n.Children.toArray(y).filter(n.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,g.n0)("",e)}},[y]),[Z,q]=(0,n.useState)(""),M=(null!=C?C:[]).length>0,R=(0,n.useMemo)(()=>Z?(0,g.n0)(Z,S):_,[Z,S,_]),T=()=>{q("")};return n.createElement(c.R,Object.assign({as:"div",ref:t,defaultValue:C,value:C,onChange:e=>{null==p||p(e),E(e)},disabled:v,className:(0,x.q)("w-full min-w-[10rem] relative text-tremor-default",N)},j,{multiple:!0}),e=>{let{value:t}=e;return n.createElement(n.Fragment,null,n.createElement(c.R.Button,{className:(0,x.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",w?"pl-11 -ml-0.5":"pl-3",(0,g.um)(t.length>0,v))},w&&n.createElement("span",{className:(0,x.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},n.createElement(w,{className:(0,x.q)(b("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.createElement("div",{className:"h-6 flex items-center"},t.length>0?n.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},_.filter(e=>t.includes(e.props.value)).map((e,r)=>{var a;return n.createElement("div",{key:r,className:(0,x.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},n.createElement("div",{className:"text-xs truncate "},null!==(a=e.props.children)&&void 0!==a?a:e.props.value),n.createElement("div",{onClick:r=>{r.preventDefault();let a=t.filter(t=>t!==e.props.value);null==p||p(a),E(a)}},n.createElement(u,{className:(0,x.q)(b("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):n.createElement("span",null,f)),n.createElement("span",{className:(0,x.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},n.createElement(s.Z,{className:(0,x.q)(b("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),M&&!v?n.createElement("button",{type:"button",className:(0,x.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),E([]),null==p||p([])}},n.createElement(i.Z,{className:(0,x.q)(b("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,n.createElement(m.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},n.createElement(c.R.Options,{className:(0,x.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},n.createElement("div",{className:(0,x.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},n.createElement("span",null,n.createElement(d,{className:(0,x.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:k,className:(0,x.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>q(e.target.value),value:Z})),n.createElement(l.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:T}},{value:{selectedValue:t}}),R))))})});p.displayName="MultiSelect"},46030:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var a=r(5853);r(42698),r(64016),r(8710);var n=r(33232),l=r(2265),o=r(97324),s=r(1153),d=r(9528);let i=(0,s.fn)("MultiSelectItem"),c=l.forwardRef((e,t)=>{let{value:r,className:c,children:m}=e,u=(0,a._T)(e,["value","className","children"]),{selectedValue:x}=(0,l.useContext)(n.Z),h=(0,s.NZ)(r,x);return l.createElement(d.R.Option,Object.assign({className:(0,o.q)(i("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",c),ref:t,key:r,value:r},u),l.createElement("input",{type:"checkbox",className:(0,o.q)(i("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),l.createElement("span",{className:"whitespace-nowrap truncate"},null!=m?m:r))});c.displayName="MultiSelectItem"},96889:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a=r(5853),n=r(2265),l=r(26898),o=r(97324),s=r(1153);let d=(0,s.fn)("BarList"),i=n.forwardRef((e,t)=>{var r;let i;let{data:c=[],color:m,valueFormatter:u=s.Cj,showAnimation:x=!1,className:h}=e,g=(0,a._T)(e,["data","color","valueFormatter","showAnimation","className"]),b=(r=c.map(e=>e.value),i=-1/0,r.forEach(e=>{i=Math.max(i,e)}),r.map(e=>0===e?0:Math.max(e/i*100,1)));return n.createElement("div",Object.assign({ref:t,className:(0,o.q)(d("root"),"flex justify-between space-x-6",h)},g),n.createElement("div",{className:(0,o.q)(d("bars"),"relative w-full")},c.map((e,t)=>{var r,a,i;let u=e.icon;return n.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:(0,o.q)(d("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||m?(0,s.bM)(null!==(a=e.color)&&void 0!==a?a:m,l.K.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===c.length-1?"mb-0":"mb-2"),style:{width:"".concat(b[t],"%"),transition:x?"all 1s":""}},n.createElement("div",{className:(0,o.q)("absolute max-w-full flex left-2")},u?n.createElement(u,{className:(0,o.q)(d("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?n.createElement("a",{href:e.href,target:null!==(i=e.target)&&void 0!==i?i:"_blank",rel:"noreferrer",className:(0,o.q)(d("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name):n.createElement("p",{className:(0,o.q)(d("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name)))})),n.createElement("div",{className:"text-right min-w-min"},c.map((e,t)=>{var r;return n.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:(0,o.q)(d("labelWrapper"),"flex justify-end items-center","h-9",t===c.length-1?"mb-0":"mb-2")},n.createElement("p",{className:(0,o.q)(d("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},u(e.value)))})))});i.displayName="BarList"},16312:function(e,t,r){"use strict";r.d(t,{z:function(){return a.Z}});var a=r(20831)},19130:function(e,t,r){"use strict";r.d(t,{RM:function(){return n.Z},SC:function(){return d.Z},iA:function(){return a.Z},pj:function(){return l.Z},ss:function(){return o.Z},xs:function(){return s.Z}});var a=r(21626),n=r(97214),l=r(28241),o=r(58834),s=r(69552),d=r(71876)},42954:function(e,t,r){"use strict";r.r(t);var a=r(57437),n=r(18143),l=r(80443),o=r(2265);t.default=()=>{let{accessToken:e,token:t,userRole:r,userId:s,premiumUser:d}=(0,l.Z)(),[i,c]=(0,o.useState)([]);return(0,a.jsx)(n.Z,{accessToken:e,token:t,userRole:r,userID:s,keys:i,premiumUser:d})}},39789:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(57437),n=r(2265),l=r(21487),o=r(84264),s=e=>{let{value:t,onValueChange:r,label:s="Select Time Range",className:d="",showTimeRange:i=!0}=e,[c,m]=(0,n.useState)(!1),u=(0,n.useRef)(null),x=(0,n.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),r(e),requestIdleCallback(()=>{if(e.from){let t;let a={...e},n=new Date(e.from);t=new Date(e.to?e.to:e.from),n.toDateString(),t.toDateString(),n.setHours(0,0,0,0),t.setHours(23,59,59,999),a.from=n,a.to=t,r(a)}},{timeout:100})},[r]),h=(0,n.useCallback)((e,t)=>{if(!e||!t)return"";let r=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==t.toDateString())return"".concat(r(e)," - ").concat(r(t));{let r=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),a=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(r,": ").concat(a," - ").concat(n)}},[]);return(0,a.jsxs)("div",{className:d,children:[s&&(0,a.jsx)(o.Z,{className:"mb-2",children:s}),(0,a.jsxs)("div",{className:"relative w-fit",children:[(0,a.jsx)("div",{ref:u,children:(0,a.jsx)(l.Z,{enableSelect:!0,value:t,onValueChange:x,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,a.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,a.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,a.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,a.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),i&&t.from&&t.to&&(0,a.jsx)(o.Z,{className:"mt-2 text-xs text-gray-500",children:h(t.from,t.to)})]})}},83438:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var a=r(57437),n=r(2265),l=r(40278),o=r(94292),s=r(19250);let d=e=>{let{key:t,info:r}=e;return{token:t,...r}};var i=r(12322),c=r(89970),m=r(16312),u=r(59872),x=r(44633),h=r(86462),g=e=>{let{topKeys:t,accessToken:r,userID:g,userRole:b,teams:p,premiumUser:f,showTags:k=!1}=e,[v,w]=(0,n.useState)(!1),[y,N]=(0,n.useState)(null),[j,C]=(0,n.useState)(void 0),[E,S]=(0,n.useState)("table"),[_,Z]=(0,n.useState)(new Set),q=e=>{Z(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},M=async e=>{if(r)try{let t=await (0,s.keyInfoV1Call)(r,e.api_key),a=d(t);C(a),N(e.api_key),w(!0)}catch(e){console.error("Error fetching key info:",e)}},R=()=>{w(!1),N(null),C(void 0)};n.useEffect(()=>{let e=e=>{"Escape"===e.key&&v&&R()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v]);let T=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(c.Z,{title:e.getValue(),children:(0,a.jsx)(m.z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>M(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],D={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let t=e.getValue();return t>0&&t<.01?"<$0.01":"$".concat((0,u.pw)(t,2))}},L=k?[...T,{header:"Tags",accessorKey:"tags",cell:e=>{let t=e.getValue(),r=e.row.original.api_key,n=_.has(r);if(!t||0===t.length)return"-";let l=t.sort((e,t)=>t.usage-e.usage),o=n?l:l.slice(0,2),s=t.length>2;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[o.map((e,t)=>(0,a.jsx)(c.Z,{title:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":"$".concat((0,u.pw)(e.usage,2))]})]}),children:(0,a.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},t)),s&&(0,a.jsx)("button",{onClick:()=>q(r),className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:n?"Show fewer tags":"Show all tags",children:n?(0,a.jsx)(x.Z,{className:"h-3 w-3 text-gray-500"}):(0,a.jsx)(h.Z,{className:"h-3 w-3 text-gray-500"})})]})})}},D]:[...T,D],I=t.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>S("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===E?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>S("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===E?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===E?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(l.Z,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:I,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>e?"$".concat((0,u.pw)(e,2)):"No Key Alias",onValueChange:e=>M(e),showTooltip:!0,customTooltip:e=>{var t,r;let n=null===(r=e.payload)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.payload;return(0,a.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==n?void 0:n.key_alias})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==n?void 0:n.api_key})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,a.jsxs)("span",{className:"text-white font-medium",children:["$",(0,u.pw)(null==n?void 0:n.spend,2)]})]})]})})}})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,a.jsx)(i.w,{columns:L,data:t,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),v&&y&&j&&(console.log("Rendering modal with:",{isModalOpen:v,selectedKey:y,keyData:j}),(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&R()},children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,a.jsx)("button",{onClick:R,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("div",{className:"p-6 h-full",children:(0,a.jsx)(o.Z,{keyId:y,onClose:R,keyData:j,accessToken:r,userID:g,userRole:b,teams:p,premiumUser:f})})]})}))]})}},12322:function(e,t,r){"use strict";r.d(t,{w:function(){return d}});var a=r(57437),n=r(2265),l=r(71594),o=r(24525),s=r(19130);function d(e){let{data:t=[],columns:r,getRowCanExpand:d,renderSubComponent:i,isLoading:c=!1,loadingMessage:m="\uD83D\uDE85 Loading logs...",noDataMessage:u="No logs found"}=e,x=(0,l.b7)({data:t,columns:r,getRowCanExpand:d,getRowId:(e,t)=>{var r;return null!==(r=null==e?void 0:e.request_id)&&void 0!==r?r:String(t)},getCoreRowModel:(0,o.sC)(),getExpandedRowModel:(0,o.rV)()});return(0,a.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,a.jsxs)(s.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,a.jsx)(s.ss,{children:x.getHeaderGroups().map(e=>(0,a.jsx)(s.SC,{children:e.headers.map(e=>(0,a.jsx)(s.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,l.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,a.jsx)(s.RM,{children:c?(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:m})})})}):x.getRowModel().rows.length>0?x.getRowModel().rows.map(e=>(0,a.jsxs)(n.Fragment,{children:[(0,a.jsx)(s.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,a.jsx)(s.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,l.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,a.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:i({row:e})})})})]},e.id)):(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:u})})})})})]})})}},47375:function(e,t,r){"use strict";var a=r(57437),n=r(2265),l=r(19250),o=r(59872);t.Z=e=>{let{userID:t,userRole:r,accessToken:s,userSpend:d,userMaxBudget:i,selectedTeam:c}=e;console.log("userSpend: ".concat(d));let[m,u]=(0,n.useState)(null!==d?d:0),[x,h]=(0,n.useState)(c?Number((0,o.pw)(c.max_budget,4)):null);(0,n.useEffect)(()=>{if(c){if("Default Team"===c.team_alias)h(i);else{let e=!1;if(c.team_memberships)for(let r of c.team_memberships)r.user_id===t&&"max_budget"in r.litellm_budget_table&&null!==r.litellm_budget_table.max_budget&&(h(r.litellm_budget_table.max_budget),e=!0);e||h(c.max_budget)}}},[c,i]);let[g,b]=(0,n.useState)([]);(0,n.useEffect)(()=>{let e=async()=>{if(!s||!t||!r)return};(async()=>{try{if(null===t||null===r)return;if(null!==s){let e=(await (0,l.modelAvailableCall)(s,t,r)).data.map(e=>e.id);console.log("available_model_names:",e),b(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[r,s,t]),(0,n.useEffect)(()=>{null!==d&&u(d)},[d]);let p=[];c&&c.models&&(p=c.models),p&&p.includes("all-proxy-models")?(console.log("user models:",g),p=g):p&&p.includes("all-team-models")?p=c.models:p&&0===p.length&&(p=g);let f=null!==x?"$".concat((0,o.pw)(Number(x),4)," limit"):"No limit",k=void 0!==m?(0,o.pw)(m,4):null;return console.log("spend in view user spend: ".concat(m)),(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,a.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",k]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:f})]})]})})}},44633:function(e,t,r){"use strict";var a=r(2265);let n=a.forwardRef(function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=n}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,2344,1487,5105,1160,8049,131,2202,874,4292,8143,2971,2117,1744],function(){return e(e.s=59898)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-f16a8ef298a13ef7.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-f16a8ef298a13ef7.js deleted file mode 100644 index 9ffe2824f8..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-f16a8ef298a13ef7.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[813],{59898:function(e,t,r){Promise.resolve().then(r.bind(r,42954))},47323:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var a=r(5853),n=r(2265),l=r(1526),o=r(7084),s=r(97324),d=r(1153),i=r(26898);let c={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},m={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},u={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},x=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,d.bM)(t,i.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,d.bM)(t,i.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,d.bM)(t,i.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,s.q)((0,d.bM)(t,i.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,d.fn)("Icon"),g=n.forwardRef((e,t)=>{let{icon:r,variant:i="simple",tooltip:g,size:b=o.u8.SM,color:p,className:f}=e,k=(0,a._T)(e,["icon","variant","tooltip","size","color","className"]),v=x(i,p),{tooltipProps:w,getReferenceProps:y}=(0,l.l)();return n.createElement("span",Object.assign({ref:(0,d.lq)([t,w.refs.setReference]),className:(0,s.q)(h("root"),"inline-flex flex-shrink-0 items-center",v.bgColor,v.textColor,v.borderColor,v.ringColor,u[i].rounded,u[i].border,u[i].shadow,u[i].ring,c[b].paddingX,c[b].paddingY,f)},y,k),n.createElement(l.Z,Object.assign({text:g},w)),n.createElement(r,{className:(0,s.q)(h("icon"),"shrink-0",m[b].height,m[b].width)}))});g.displayName="Icon"},92414:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var a=r(5853),n=r(2265);r(42698),r(64016),r(8710);var l=r(33232),o=r(44140),s=r(58747);let d=e=>{var t=(0,a._T)(e,[]);return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),n.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var i=r(4537),c=r(9528),m=r(33044);let u=e=>{var t=(0,a._T)(e,[]);return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var x=r(97324),h=r(1153),g=r(96398);let b=(0,h.fn)("MultiSelect"),p=n.forwardRef((e,t)=>{let{defaultValue:r,value:h,onValueChange:p,placeholder:f="Select...",placeholderSearch:k="Search",disabled:v=!1,icon:w,children:y,className:N}=e,j=(0,a._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className"]),[C,E]=(0,o.Z)(r,h),{reactElementChildren:S,optionsAvailable:_}=(0,n.useMemo)(()=>{let e=n.Children.toArray(y).filter(n.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,g.n0)("",e)}},[y]),[Z,q]=(0,n.useState)(""),M=(null!=C?C:[]).length>0,R=(0,n.useMemo)(()=>Z?(0,g.n0)(Z,S):_,[Z,S,_]),T=()=>{q("")};return n.createElement(c.R,Object.assign({as:"div",ref:t,defaultValue:C,value:C,onChange:e=>{null==p||p(e),E(e)},disabled:v,className:(0,x.q)("w-full min-w-[10rem] relative text-tremor-default",N)},j,{multiple:!0}),e=>{let{value:t}=e;return n.createElement(n.Fragment,null,n.createElement(c.R.Button,{className:(0,x.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",w?"pl-11 -ml-0.5":"pl-3",(0,g.um)(t.length>0,v))},w&&n.createElement("span",{className:(0,x.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},n.createElement(w,{className:(0,x.q)(b("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.createElement("div",{className:"h-6 flex items-center"},t.length>0?n.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},_.filter(e=>t.includes(e.props.value)).map((e,r)=>{var a;return n.createElement("div",{key:r,className:(0,x.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},n.createElement("div",{className:"text-xs truncate "},null!==(a=e.props.children)&&void 0!==a?a:e.props.value),n.createElement("div",{onClick:r=>{r.preventDefault();let a=t.filter(t=>t!==e.props.value);null==p||p(a),E(a)}},n.createElement(u,{className:(0,x.q)(b("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):n.createElement("span",null,f)),n.createElement("span",{className:(0,x.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},n.createElement(s.Z,{className:(0,x.q)(b("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),M&&!v?n.createElement("button",{type:"button",className:(0,x.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),E([]),null==p||p([])}},n.createElement(i.Z,{className:(0,x.q)(b("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,n.createElement(m.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},n.createElement(c.R.Options,{className:(0,x.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},n.createElement("div",{className:(0,x.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},n.createElement("span",null,n.createElement(d,{className:(0,x.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:k,className:(0,x.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>q(e.target.value),value:Z})),n.createElement(l.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:T}},{value:{selectedValue:t}}),R))))})});p.displayName="MultiSelect"},46030:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var a=r(5853);r(42698),r(64016),r(8710);var n=r(33232),l=r(2265),o=r(97324),s=r(1153),d=r(9528);let i=(0,s.fn)("MultiSelectItem"),c=l.forwardRef((e,t)=>{let{value:r,className:c,children:m}=e,u=(0,a._T)(e,["value","className","children"]),{selectedValue:x}=(0,l.useContext)(n.Z),h=(0,s.NZ)(r,x);return l.createElement(d.R.Option,Object.assign({className:(0,o.q)(i("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",c),ref:t,key:r,value:r},u),l.createElement("input",{type:"checkbox",className:(0,o.q)(i("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),l.createElement("span",{className:"whitespace-nowrap truncate"},null!=m?m:r))});c.displayName="MultiSelectItem"},96889:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a=r(5853),n=r(2265),l=r(26898),o=r(97324),s=r(1153);let d=(0,s.fn)("BarList"),i=n.forwardRef((e,t)=>{var r;let i;let{data:c=[],color:m,valueFormatter:u=s.Cj,showAnimation:x=!1,className:h}=e,g=(0,a._T)(e,["data","color","valueFormatter","showAnimation","className"]),b=(r=c.map(e=>e.value),i=-1/0,r.forEach(e=>{i=Math.max(i,e)}),r.map(e=>0===e?0:Math.max(e/i*100,1)));return n.createElement("div",Object.assign({ref:t,className:(0,o.q)(d("root"),"flex justify-between space-x-6",h)},g),n.createElement("div",{className:(0,o.q)(d("bars"),"relative w-full")},c.map((e,t)=>{var r,a,i;let u=e.icon;return n.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:(0,o.q)(d("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||m?(0,s.bM)(null!==(a=e.color)&&void 0!==a?a:m,l.K.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===c.length-1?"mb-0":"mb-2"),style:{width:"".concat(b[t],"%"),transition:x?"all 1s":""}},n.createElement("div",{className:(0,o.q)("absolute max-w-full flex left-2")},u?n.createElement(u,{className:(0,o.q)(d("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?n.createElement("a",{href:e.href,target:null!==(i=e.target)&&void 0!==i?i:"_blank",rel:"noreferrer",className:(0,o.q)(d("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name):n.createElement("p",{className:(0,o.q)(d("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name)))})),n.createElement("div",{className:"text-right min-w-min"},c.map((e,t)=>{var r;return n.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:(0,o.q)(d("labelWrapper"),"flex justify-end items-center","h-9",t===c.length-1?"mb-0":"mb-2")},n.createElement("p",{className:(0,o.q)(d("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},u(e.value)))})))});i.displayName="BarList"},16312:function(e,t,r){"use strict";r.d(t,{z:function(){return a.Z}});var a=r(20831)},19130:function(e,t,r){"use strict";r.d(t,{RM:function(){return n.Z},SC:function(){return d.Z},iA:function(){return a.Z},pj:function(){return l.Z},ss:function(){return o.Z},xs:function(){return s.Z}});var a=r(21626),n=r(97214),l=r(28241),o=r(58834),s=r(69552),d=r(71876)},42954:function(e,t,r){"use strict";r.r(t);var a=r(57437),n=r(18143),l=r(39760),o=r(2265);t.default=()=>{let{accessToken:e,token:t,userRole:r,userId:s,premiumUser:d}=(0,l.Z)(),[i,c]=(0,o.useState)([]);return(0,a.jsx)(n.Z,{accessToken:e,token:t,userRole:r,userID:s,keys:i,premiumUser:d})}},39789:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(57437),n=r(2265),l=r(21487),o=r(84264),s=e=>{let{value:t,onValueChange:r,label:s="Select Time Range",className:d="",showTimeRange:i=!0}=e,[c,m]=(0,n.useState)(!1),u=(0,n.useRef)(null),x=(0,n.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),r(e),requestIdleCallback(()=>{if(e.from){let t;let a={...e},n=new Date(e.from);t=new Date(e.to?e.to:e.from),n.toDateString(),t.toDateString(),n.setHours(0,0,0,0),t.setHours(23,59,59,999),a.from=n,a.to=t,r(a)}},{timeout:100})},[r]),h=(0,n.useCallback)((e,t)=>{if(!e||!t)return"";let r=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==t.toDateString())return"".concat(r(e)," - ").concat(r(t));{let r=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),a=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(r,": ").concat(a," - ").concat(n)}},[]);return(0,a.jsxs)("div",{className:d,children:[s&&(0,a.jsx)(o.Z,{className:"mb-2",children:s}),(0,a.jsxs)("div",{className:"relative w-fit",children:[(0,a.jsx)("div",{ref:u,children:(0,a.jsx)(l.Z,{enableSelect:!0,value:t,onValueChange:x,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,a.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,a.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,a.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,a.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),i&&t.from&&t.to&&(0,a.jsx)(o.Z,{className:"mt-2 text-xs text-gray-500",children:h(t.from,t.to)})]})}},83438:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var a=r(57437),n=r(2265),l=r(40278),o=r(94292),s=r(19250);let d=e=>{let{key:t,info:r}=e;return{token:t,...r}};var i=r(12322),c=r(89970),m=r(16312),u=r(59872),x=r(44633),h=r(86462),g=e=>{let{topKeys:t,accessToken:r,userID:g,userRole:b,teams:p,premiumUser:f,showTags:k=!1}=e,[v,w]=(0,n.useState)(!1),[y,N]=(0,n.useState)(null),[j,C]=(0,n.useState)(void 0),[E,S]=(0,n.useState)("table"),[_,Z]=(0,n.useState)(new Set),q=e=>{Z(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},M=async e=>{if(r)try{let t=await (0,s.keyInfoV1Call)(r,e.api_key),a=d(t);C(a),N(e.api_key),w(!0)}catch(e){console.error("Error fetching key info:",e)}},R=()=>{w(!1),N(null),C(void 0)};n.useEffect(()=>{let e=e=>{"Escape"===e.key&&v&&R()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v]);let T=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(c.Z,{title:e.getValue(),children:(0,a.jsx)(m.z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>M(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],D={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let t=e.getValue();return t>0&&t<.01?"<$0.01":"$".concat((0,u.pw)(t,2))}},L=k?[...T,{header:"Tags",accessorKey:"tags",cell:e=>{let t=e.getValue(),r=e.row.original.api_key,n=_.has(r);if(!t||0===t.length)return"-";let l=t.sort((e,t)=>t.usage-e.usage),o=n?l:l.slice(0,2),s=t.length>2;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[o.map((e,t)=>(0,a.jsx)(c.Z,{title:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":"$".concat((0,u.pw)(e.usage,2))]})]}),children:(0,a.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},t)),s&&(0,a.jsx)("button",{onClick:()=>q(r),className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:n?"Show fewer tags":"Show all tags",children:n?(0,a.jsx)(x.Z,{className:"h-3 w-3 text-gray-500"}):(0,a.jsx)(h.Z,{className:"h-3 w-3 text-gray-500"})})]})})}},D]:[...T,D],I=t.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>S("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===E?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>S("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===E?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===E?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(l.Z,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:I,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>e?"$".concat((0,u.pw)(e,2)):"No Key Alias",onValueChange:e=>M(e),showTooltip:!0,customTooltip:e=>{var t,r;let n=null===(r=e.payload)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.payload;return(0,a.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==n?void 0:n.key_alias})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==n?void 0:n.api_key})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,a.jsxs)("span",{className:"text-white font-medium",children:["$",(0,u.pw)(null==n?void 0:n.spend,2)]})]})]})})}})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,a.jsx)(i.w,{columns:L,data:t,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),v&&y&&j&&(console.log("Rendering modal with:",{isModalOpen:v,selectedKey:y,keyData:j}),(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&R()},children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,a.jsx)("button",{onClick:R,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("div",{className:"p-6 h-full",children:(0,a.jsx)(o.Z,{keyId:y,onClose:R,keyData:j,accessToken:r,userID:g,userRole:b,teams:p,premiumUser:f})})]})}))]})}},12322:function(e,t,r){"use strict";r.d(t,{w:function(){return d}});var a=r(57437),n=r(2265),l=r(71594),o=r(24525),s=r(19130);function d(e){let{data:t=[],columns:r,getRowCanExpand:d,renderSubComponent:i,isLoading:c=!1,loadingMessage:m="\uD83D\uDE85 Loading logs...",noDataMessage:u="No logs found"}=e,x=(0,l.b7)({data:t,columns:r,getRowCanExpand:d,getRowId:(e,t)=>{var r;return null!==(r=null==e?void 0:e.request_id)&&void 0!==r?r:String(t)},getCoreRowModel:(0,o.sC)(),getExpandedRowModel:(0,o.rV)()});return(0,a.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,a.jsxs)(s.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,a.jsx)(s.ss,{children:x.getHeaderGroups().map(e=>(0,a.jsx)(s.SC,{children:e.headers.map(e=>(0,a.jsx)(s.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,l.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,a.jsx)(s.RM,{children:c?(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:m})})})}):x.getRowModel().rows.length>0?x.getRowModel().rows.map(e=>(0,a.jsxs)(n.Fragment,{children:[(0,a.jsx)(s.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,a.jsx)(s.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,l.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,a.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:i({row:e})})})})]},e.id)):(0,a.jsx)(s.SC,{children:(0,a.jsx)(s.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:u})})})})})]})})}},47375:function(e,t,r){"use strict";var a=r(57437),n=r(2265),l=r(19250),o=r(59872);t.Z=e=>{let{userID:t,userRole:r,accessToken:s,userSpend:d,userMaxBudget:i,selectedTeam:c}=e;console.log("userSpend: ".concat(d));let[m,u]=(0,n.useState)(null!==d?d:0),[x,h]=(0,n.useState)(c?Number((0,o.pw)(c.max_budget,4)):null);(0,n.useEffect)(()=>{if(c){if("Default Team"===c.team_alias)h(i);else{let e=!1;if(c.team_memberships)for(let r of c.team_memberships)r.user_id===t&&"max_budget"in r.litellm_budget_table&&null!==r.litellm_budget_table.max_budget&&(h(r.litellm_budget_table.max_budget),e=!0);e||h(c.max_budget)}}},[c,i]);let[g,b]=(0,n.useState)([]);(0,n.useEffect)(()=>{let e=async()=>{if(!s||!t||!r)return};(async()=>{try{if(null===t||null===r)return;if(null!==s){let e=(await (0,l.modelAvailableCall)(s,t,r)).data.map(e=>e.id);console.log("available_model_names:",e),b(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[r,s,t]),(0,n.useEffect)(()=>{null!==d&&u(d)},[d]);let p=[];c&&c.models&&(p=c.models),p&&p.includes("all-proxy-models")?(console.log("user models:",g),p=g):p&&p.includes("all-team-models")?p=c.models:p&&0===p.length&&(p=g);let f=null!==x?"$".concat((0,o.pw)(Number(x),4)," limit"):"No limit",k=void 0!==m?(0,o.pw)(m,4):null;return console.log("spend in view user spend: ".concat(m)),(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,a.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",k]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:f})]})]})})}},44633:function(e,t,r){"use strict";var a=r(2265);let n=a.forwardRef(function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=n}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,2344,1487,5105,1160,8049,1633,2202,874,4292,8143,2971,2117,1744],function(){return e(e.s=59898)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-61feb7e98f982bcc.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-2608594fa934affa.js similarity index 95% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-61feb7e98f982bcc.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-2608594fa934affa.js index 8577ab64ad..0f8205307b 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-61feb7e98f982bcc.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-2608594fa934affa.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2099],{71620:function(e,n,r){Promise.resolve().then(r.bind(r,51599))},84717:function(e,n,r){"use strict";r.d(n,{Ct:function(){return t.Z},Dx:function(){return m.Z},OK:function(){return l.Z},Zb:function(){return i.Z},nP:function(){return d.Z},rj:function(){return o.Z},td:function(){return a.Z},v0:function(){return c.Z},x4:function(){return s.Z},xv:function(){return f.Z},zx:function(){return u.Z}});var t=r(41649),u=r(20831),i=r(12514),o=r(67101),l=r(12485),c=r(18135),a=r(35242),s=r(29706),d=r(77991),f=r(84264),m=r(96761)},16312:function(e,n,r){"use strict";r.d(n,{z:function(){return t.Z}});var t=r(20831)},51599:function(e,n,r){"use strict";r.r(n);var t=r(57437),u=r(30603),i=r(39760);n.default=()=>{let{accessToken:e}=(0,i.Z)();return(0,t.jsx)(u.Z,{accessToken:e})}},39760:function(e,n,r){"use strict";var t=r(2265),u=r(99376),i=r(14474),o=r(3914);n.Z=()=>{var e,n,r,l,c,a,s;let d=(0,u.useRouter)(),f="undefined"!=typeof document?(0,o.e)("token"):null;(0,t.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let m=(0,t.useMemo)(()=>{if(!f)return null;try{return(0,i.o)(f)}catch(e){return(0,o.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(n=null==m?void 0:m.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==m?void 0:m.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(l=null==m?void 0:m.user_role)&&void 0!==l?l:null),premiumUser:null!==(c=null==m?void 0:m.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(a=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==a?a:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},59872:function(e,n,r){"use strict";r.d(n,{nl:function(){return u},pw:function(){return i},vQ:function(){return o}});var t=r(9114);function u(e,n){let r=structuredClone(e);for(let[e,t]of Object.entries(n))e in r&&(r[e]=t);return r}let i=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let t={minimumFractionDigits:n,maximumFractionDigits:n};if(!r)return e.toLocaleString("en-US",t);let u=Math.abs(e),i=u,o="";return u>=1e6?(i=u/1e6,o="M"):u>=1e3&&(i=u/1e3,o="K"),"".concat(e<0?"-":"").concat(i.toLocaleString("en-US",t)).concat(o)},o=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return l(e,n);try{return await navigator.clipboard.writeText(e),t.Z.success(n),!0}catch(r){return console.error("Clipboard API failed: ",r),l(e,n)}},l=(e,n)=>{try{let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.left="-999999px",r.style.top="-999999px",r.setAttribute("readonly",""),document.body.appendChild(r),r.focus(),r.select();let u=document.execCommand("copy");if(document.body.removeChild(r),u)return t.Z.success(n),!0;throw Error("execCommand failed")}catch(e){return t.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,n,r){"use strict";r.d(n,{LQ:function(){return i},ZL:function(){return t},lo:function(){return u},tY:function(){return o}});let t=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],u=["Internal User","Internal Viewer"],i=["Internal User","Admin","proxy_admin"],o=e=>t.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,2525,9011,5319,8347,8049,603,2971,2117,1744],function(){return e(e.s=71620)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2099],{71620:function(e,n,r){Promise.resolve().then(r.bind(r,51599))},84717:function(e,n,r){"use strict";r.d(n,{Ct:function(){return t.Z},Dx:function(){return m.Z},OK:function(){return l.Z},Zb:function(){return i.Z},nP:function(){return d.Z},rj:function(){return o.Z},td:function(){return a.Z},v0:function(){return c.Z},x4:function(){return s.Z},xv:function(){return f.Z},zx:function(){return u.Z}});var t=r(41649),u=r(20831),i=r(12514),o=r(67101),l=r(12485),c=r(18135),a=r(35242),s=r(29706),d=r(77991),f=r(84264),m=r(96761)},16312:function(e,n,r){"use strict";r.d(n,{z:function(){return t.Z}});var t=r(20831)},51599:function(e,n,r){"use strict";r.r(n);var t=r(57437),u=r(30603),i=r(80443);n.default=()=>{let{accessToken:e}=(0,i.Z)();return(0,t.jsx)(u.Z,{accessToken:e})}},80443:function(e,n,r){"use strict";var t=r(2265),u=r(99376),i=r(14474),o=r(3914);n.Z=()=>{var e,n,r,l,c,a,s;let d=(0,u.useRouter)(),f="undefined"!=typeof document?(0,o.e)("token"):null;(0,t.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let m=(0,t.useMemo)(()=>{if(!f)return null;try{return(0,i.o)(f)}catch(e){return(0,o.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(n=null==m?void 0:m.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==m?void 0:m.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(l=null==m?void 0:m.user_role)&&void 0!==l?l:null),premiumUser:null!==(c=null==m?void 0:m.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(a=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==a?a:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},59872:function(e,n,r){"use strict";r.d(n,{nl:function(){return u},pw:function(){return i},vQ:function(){return o}});var t=r(9114);function u(e,n){let r=structuredClone(e);for(let[e,t]of Object.entries(n))e in r&&(r[e]=t);return r}let i=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let t={minimumFractionDigits:n,maximumFractionDigits:n};if(!r)return e.toLocaleString("en-US",t);let u=Math.abs(e),i=u,o="";return u>=1e6?(i=u/1e6,o="M"):u>=1e3&&(i=u/1e3,o="K"),"".concat(e<0?"-":"").concat(i.toLocaleString("en-US",t)).concat(o)},o=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return l(e,n);try{return await navigator.clipboard.writeText(e),t.Z.success(n),!0}catch(r){return console.error("Clipboard API failed: ",r),l(e,n)}},l=(e,n)=>{try{let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.left="-999999px",r.style.top="-999999px",r.setAttribute("readonly",""),document.body.appendChild(r),r.focus(),r.select();let u=document.execCommand("copy");if(document.body.removeChild(r),u)return t.Z.success(n),!0;throw Error("execCommand failed")}catch(e){return t.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,n,r){"use strict";r.d(n,{LQ:function(){return i},ZL:function(){return t},lo:function(){return u},tY:function(){return o}});let t=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],u=["Internal User","Internal Viewer"],i=["Internal User","Admin","proxy_admin"],o=e=>t.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,2525,9011,5319,8347,8049,603,2971,2117,1744],function(){return e(e.s=71620)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-1da0c9dcc6fabf28.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-1da0c9dcc6fabf28.js deleted file mode 100644 index 58b31f5500..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-1da0c9dcc6fabf28.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-84e24f0f36de61e2.js -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6061],{86947:function(n,u,e){Promise.resolve().then(e.bind(e,21933))},45822:function(n,u,e){"use strict";e.d(u,{JO:function(){return s.Z},JX:function(){return t.Z},rj:function(){return c.Z},xv:function(){return i.Z},zx:function(){return r.Z}});var r=e(20831),t=e(49804),c=e(67101),s=e(47323),i=e(84264)},21933:function(n,u,e){"use strict";e.r(u);var r=e(57437),t=e(42273),c=e(39760);u.default=()=>{let{accessToken:n,userId:u,userRole:e}=(0,c.Z)();return(0,r.jsx)(t.Z,{accessToken:n,userID:u,userRole:e})}}},function(n){n.O(0,[9820,1491,1526,2417,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,6494,5188,4924,8049,131,2202,874,2273,2971,2117,1744],function(){return n(n.s=86947)}),_N_E=n.O()}]); -======== -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6061],{86947:function(n,u,e){Promise.resolve().then(e.bind(e,21933))},45822:function(n,u,e){"use strict";e.d(u,{JO:function(){return s.Z},JX:function(){return t.Z},rj:function(){return c.Z},xv:function(){return i.Z},zx:function(){return r.Z}});var r=e(20831),t=e(49804),c=e(67101),s=e(47323),i=e(84264)},21933:function(n,u,e){"use strict";e.r(u);var r=e(57437),t=e(42273),c=e(39760);u.default=()=>{let{accessToken:n,userId:u,userRole:e}=(0,c.Z)();return(0,r.jsx)(t.Z,{accessToken:n,userID:u,userRole:e})}}},function(n){n.O(0,[9820,1491,1526,2417,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,6494,5188,4924,8049,1633,2202,874,2273,2971,2117,1744],function(){return n(n.s=86947)}),_N_E=n.O()}]); ->>>>>>>> ef0d6f0207 (Resolve conflicts in generated HTML files):litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-1da0c9dcc6fabf28.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-30215d565ccd90ac.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-30215d565ccd90ac.js new file mode 100644 index 0000000000..f6eeeac668 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-30215d565ccd90ac.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6061],{86947:function(n,u,e){Promise.resolve().then(e.bind(e,21933))},45822:function(n,u,e){"use strict";e.d(u,{JO:function(){return s.Z},JX:function(){return t.Z},rj:function(){return c.Z},xv:function(){return i.Z},zx:function(){return r.Z}});var r=e(20831),t=e(49804),c=e(67101),s=e(47323),i=e(84264)},21933:function(n,u,e){"use strict";e.r(u);var r=e(57437),t=e(42273),c=e(80443);u.default=()=>{let{accessToken:n,userId:u,userRole:e}=(0,c.Z)();return(0,r.jsx)(t.Z,{accessToken:n,userID:u,userRole:e})}}},function(n){n.O(0,[9820,1491,1526,2417,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,6494,5188,4924,8049,131,2202,874,2273,2971,2117,1744],function(){return n(n.s=86947)}),_N_E=n.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/page-cba2ae1139d5678e.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/page-229122aa339dc574.js similarity index 97% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/page-cba2ae1139d5678e.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/page-229122aa339dc574.js index 2d7424aaf9..e7dd8cd277 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/page-cba2ae1139d5678e.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/page-229122aa339dc574.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{91229:function(e,n,r){Promise.resolve().then(r.bind(r,49514))},30078:function(e,n,r){"use strict";r.d(n,{Ct:function(){return t.Z},Dx:function(){return p.Z},OK:function(){return l.Z},Zb:function(){return i.Z},nP:function(){return d.Z},oi:function(){return m.Z},rj:function(){return o.Z},td:function(){return a.Z},v0:function(){return c.Z},x4:function(){return s.Z},xv:function(){return f.Z},zx:function(){return u.Z}});var t=r(41649),u=r(20831),i=r(12514),o=r(67101),l=r(12485),c=r(18135),a=r(35242),s=r(29706),d=r(77991),f=r(84264),m=r(49566),p=r(96761)},16312:function(e,n,r){"use strict";r.d(n,{z:function(){return t.Z}});var t=r(20831)},64504:function(e,n,r){"use strict";r.d(n,{o:function(){return u.Z},z:function(){return t.Z}});var t=r(20831),u=r(49566)},49514:function(e,n,r){"use strict";r.r(n);var t=r(57437),u=r(63298),i=r(39760);n.default=()=>{let{accessToken:e}=(0,i.Z)();return(0,t.jsx)(u.Z,{accessToken:e})}},39760:function(e,n,r){"use strict";var t=r(2265),u=r(99376),i=r(14474),o=r(3914);n.Z=()=>{var e,n,r,l,c,a,s;let d=(0,u.useRouter)(),f="undefined"!=typeof document?(0,o.e)("token"):null;(0,t.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let m=(0,t.useMemo)(()=>{if(!f)return null;try{return(0,i.o)(f)}catch(e){return(0,o.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(n=null==m?void 0:m.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==m?void 0:m.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(l=null==m?void 0:m.user_role)&&void 0!==l?l:null),premiumUser:null!==(c=null==m?void 0:m.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(a=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==a?a:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},24199:function(e,n,r){"use strict";r.d(n,{Z:function(){return i}});var t=r(57437);r(2265);var u=r(30150),i=e=>{let{step:n=.01,style:r={width:"100%"},placeholder:i="Enter a numerical value",min:o,max:l,onChange:c,...a}=e;return(0,t.jsx)(u.Z,{onWheel:e=>e.currentTarget.blur(),step:n,style:r,placeholder:i,min:o,max:l,onChange:c,...a})}},59872:function(e,n,r){"use strict";r.d(n,{nl:function(){return u},pw:function(){return i},vQ:function(){return o}});var t=r(9114);function u(e,n){let r=structuredClone(e);for(let[e,t]of Object.entries(n))e in r&&(r[e]=t);return r}let i=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let t={minimumFractionDigits:n,maximumFractionDigits:n};if(!r)return e.toLocaleString("en-US",t);let u=Math.abs(e),i=u,o="";return u>=1e6?(i=u/1e6,o="M"):u>=1e3&&(i=u/1e3,o="K"),"".concat(e<0?"-":"").concat(i.toLocaleString("en-US",t)).concat(o)},o=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return l(e,n);try{return await navigator.clipboard.writeText(e),t.Z.success(n),!0}catch(r){return console.error("Clipboard API failed: ",r),l(e,n)}},l=(e,n)=>{try{let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.left="-999999px",r.style.top="-999999px",r.setAttribute("readonly",""),document.body.appendChild(r),r.focus(),r.select();let u=document.execCommand("copy");if(document.body.removeChild(r),u)return t.Z.success(n),!0;throw Error("execCommand failed")}catch(e){return t.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,n,r){"use strict";r.d(n,{LQ:function(){return i},ZL:function(){return t},lo:function(){return u},tY:function(){return o}});let t=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],u=["Internal User","Internal Viewer"],i=["Internal User","Admin","proxy_admin"],o=e=>t.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,2284,7908,9011,3752,3866,5830,8049,3298,2971,2117,1744],function(){return e(e.s=91229)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{91229:function(e,n,r){Promise.resolve().then(r.bind(r,49514))},30078:function(e,n,r){"use strict";r.d(n,{Ct:function(){return t.Z},Dx:function(){return p.Z},OK:function(){return l.Z},Zb:function(){return i.Z},nP:function(){return d.Z},oi:function(){return m.Z},rj:function(){return o.Z},td:function(){return a.Z},v0:function(){return c.Z},x4:function(){return s.Z},xv:function(){return f.Z},zx:function(){return u.Z}});var t=r(41649),u=r(20831),i=r(12514),o=r(67101),l=r(12485),c=r(18135),a=r(35242),s=r(29706),d=r(77991),f=r(84264),m=r(49566),p=r(96761)},16312:function(e,n,r){"use strict";r.d(n,{z:function(){return t.Z}});var t=r(20831)},64504:function(e,n,r){"use strict";r.d(n,{o:function(){return u.Z},z:function(){return t.Z}});var t=r(20831),u=r(49566)},49514:function(e,n,r){"use strict";r.r(n);var t=r(57437),u=r(63298),i=r(80443);n.default=()=>{let{accessToken:e}=(0,i.Z)();return(0,t.jsx)(u.Z,{accessToken:e})}},80443:function(e,n,r){"use strict";var t=r(2265),u=r(99376),i=r(14474),o=r(3914);n.Z=()=>{var e,n,r,l,c,a,s;let d=(0,u.useRouter)(),f="undefined"!=typeof document?(0,o.e)("token"):null;(0,t.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let m=(0,t.useMemo)(()=>{if(!f)return null;try{return(0,i.o)(f)}catch(e){return(0,o.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(n=null==m?void 0:m.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==m?void 0:m.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(l=null==m?void 0:m.user_role)&&void 0!==l?l:null),premiumUser:null!==(c=null==m?void 0:m.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(a=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==a?a:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},24199:function(e,n,r){"use strict";r.d(n,{Z:function(){return i}});var t=r(57437);r(2265);var u=r(30150),i=e=>{let{step:n=.01,style:r={width:"100%"},placeholder:i="Enter a numerical value",min:o,max:l,onChange:c,...a}=e;return(0,t.jsx)(u.Z,{onWheel:e=>e.currentTarget.blur(),step:n,style:r,placeholder:i,min:o,max:l,onChange:c,...a})}},59872:function(e,n,r){"use strict";r.d(n,{nl:function(){return u},pw:function(){return i},vQ:function(){return o}});var t=r(9114);function u(e,n){let r=structuredClone(e);for(let[e,t]of Object.entries(n))e in r&&(r[e]=t);return r}let i=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let t={minimumFractionDigits:n,maximumFractionDigits:n};if(!r)return e.toLocaleString("en-US",t);let u=Math.abs(e),i=u,o="";return u>=1e6?(i=u/1e6,o="M"):u>=1e3&&(i=u/1e3,o="K"),"".concat(e<0?"-":"").concat(i.toLocaleString("en-US",t)).concat(o)},o=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return l(e,n);try{return await navigator.clipboard.writeText(e),t.Z.success(n),!0}catch(r){return console.error("Clipboard API failed: ",r),l(e,n)}},l=(e,n)=>{try{let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.left="-999999px",r.style.top="-999999px",r.setAttribute("readonly",""),document.body.appendChild(r),r.focus(),r.select();let u=document.execCommand("copy");if(document.body.removeChild(r),u)return t.Z.success(n),!0;throw Error("execCommand failed")}catch(e){return t.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,n,r){"use strict";r.d(n,{LQ:function(){return i},ZL:function(){return t},lo:function(){return u},tY:function(){return o}});let t=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],u=["Internal User","Internal Viewer"],i=["Internal User","Admin","proxy_admin"],o=e=>t.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,2284,7908,9011,3752,3866,5830,8049,3298,2971,2117,1744],function(){return e(e.s=91229)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js deleted file mode 100644 index 6c21f141e7..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5642],{77935:function(e,t,r){Promise.resolve().then(r.bind(r,89219))},1309:function(e,t,r){"use strict";r.d(t,{C:function(){return n.Z}});var n=r(41649)},39760:function(e,t,r){"use strict";var n=r(2265),s=r(99376),l=r(14474),a=r(3914);t.Z=()=>{var e,t,r,o,i,c,u;let d=(0,s.useRouter)(),m="undefined"!=typeof document?(0,a.e)("token"):null;(0,n.useEffect)(()=>{m||d.replace("/sso/key/generate")},[m,d]);let x=(0,n.useMemo)(()=>{if(!m)return null;try{return(0,l.o)(m)}catch(e){return(0,a.b)(),d.replace("/sso/key/generate"),null}},[m,d]);return{token:m,accessToken:null!==(e=null==x?void 0:x.key)&&void 0!==e?e:null,userId:null!==(t=null==x?void 0:x.user_id)&&void 0!==t?t:null,userEmail:null!==(r=null==x?void 0:x.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(o=null==x?void 0:x.user_role)&&void 0!==o?o:null),premiumUser:null!==(i=null==x?void 0:x.premium_user)&&void 0!==i?i:null,disabledPersonalKeyCreation:null!==(c=null==x?void 0:x.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==x?void 0:x.login_method)==="username_password"}}},89219:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return u}});var n=r(57437),s=r(2265),l=r(65373),a=r(69734),o=r(92019),i=r(39760),c=r(99376);function u(e){let{children:t}=e;(0,c.useRouter)();let r=(0,c.useSearchParams)(),{accessToken:u,userRole:d,userId:m,userEmail:x,premiumUser:f}=(0,i.Z)(),[g,h]=s.useState(!1),[p,y]=(0,s.useState)(()=>r.get("page")||"api-keys");return(0,s.useEffect)(()=>{y(r.get("page")||"api-keys")},[r]),(0,n.jsx)(a.f,{accessToken:"",children:(0,n.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,n.jsx)(l.Z,{isPublicPage:!1,sidebarCollapsed:g,onToggleSidebar:()=>h(e=>!e),userID:m,userEmail:x,userRole:d,premiumUser:f,proxySettings:void 0,setProxySettings:()=>{},accessToken:u}),(0,n.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(o.Z,{defaultSelectedKey:p,accessToken:u,userRole:d})}),(0,n.jsx)("main",{className:"flex-1",children:t})]})]})})}!function(e){let t="ui/".trim();if(t)t.replace(/^\/+/,"").replace(/\/+$/,"")}(0)},29488:function(e,t,r){"use strict";r.d(t,{Hc:function(){return a},Ui:function(){return l},e4:function(){return o},xd:function(){return i}});let n="litellm_mcp_auth_tokens",s=()=>{try{let e=localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading MCP auth tokens from localStorage:",e),{}}},l=(e,t)=>{try{let r=s()[e];if(r&&r.serverAlias===t||r&&!t&&!r.serverAlias)return r.authValue;return null}catch(e){return console.error("Error getting MCP auth token:",e),null}},a=(e,t,r,l)=>{try{let a=s();a[e]={serverId:e,serverAlias:l,authValue:t,authType:r,timestamp:Date.now()},localStorage.setItem(n,JSON.stringify(a))}catch(e){console.error("Error storing MCP auth token:",e)}},o=e=>{try{let t=s();delete t[e],localStorage.setItem(n,JSON.stringify(t))}catch(e){console.error("Error removing MCP auth token:",e)}},i=()=>{try{localStorage.removeItem(n)}catch(e){console.error("Error clearing MCP auth tokens:",e)}}},65373:function(e,t,r){"use strict";r.d(t,{Z:function(){return N}});var n=r(57437),s=r(27648),l=r(2265),a=r(89970),o=r(63709),i=r(80795),c=r(19250),u=r(15883),d=r(46346),m=r(57400),x=r(91870),f=r(40428),g=r(83884),h=r(45524),p=r(3914);let y=async e=>{if(!e)return null;try{return await (0,c.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};var v=r(69734),j=r(29488),w=r(31857),N=e=>{let{userID:t,userEmail:r,userRole:N,premiumUser:_,proxySettings:b,setProxySettings:k,accessToken:S,isPublicPage:E=!1,sidebarCollapsed:P=!1,onToggleSidebar:C}=e,U=(0,c.getProxyBaseUrl)(),[I,Z]=(0,l.useState)(""),{logoUrl:L}=(0,v.F)(),{refactoredUIFlag:R,setRefactoredUIFlag:O}=(0,w.Z)();(0,l.useEffect)(()=>{(async()=>{if(S){let e=await y(S);console.log("response from fetchProxySettings",e),e&&k(e)}})()},[S]),(0,l.useEffect)(()=>{Z((null==b?void 0:b.PROXY_LOGOUT_URL)||"")},[b]);let T=[{key:"user-info",onClick:e=>{var t;return null===(t=e.domEvent)||void 0===t?void 0:t.stopPropagation()},label:(0,n.jsxs)("div",{className:"px-3 py-3 border-b border-gray-100",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(u.Z,{className:"mr-2 text-gray-700"}),(0,n.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:t})]}),_?(0,n.jsx)(a.Z,{title:"Premium User",placement:"left",children:(0,n.jsxs)("div",{className:"flex items-center bg-gradient-to-r from-amber-500 to-yellow-500 text-white px-2 py-0.5 rounded-full cursor-help",children:[(0,n.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"Premium"})]})}):(0,n.jsx)(a.Z,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,n.jsxs)("div",{className:"flex items-center bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full cursor-help",children:[(0,n.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"Standard"})]})})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center text-sm",children:[(0,n.jsx)(m.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,n.jsx)("span",{className:"text-gray-500 text-xs",children:"Role"}),(0,n.jsx)("span",{className:"ml-auto text-gray-700 font-medium",children:N})]}),(0,n.jsxs)("div",{className:"flex items-center text-sm",children:[(0,n.jsx)(x.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,n.jsx)("span",{className:"text-gray-500 text-xs",children:"Email"}),(0,n.jsx)("span",{className:"ml-auto text-gray-700 font-medium truncate max-w-[150px]",title:r||"Unknown",children:r||"Unknown"})]}),(0,n.jsxs)("div",{className:"flex items-center text-sm pt-2 mt-2 border-t border-gray-100",children:[(0,n.jsx)("span",{className:"text-gray-500 text-xs",children:"Refactored UI"}),(0,n.jsx)(o.Z,{className:"ml-auto",size:"small",checked:R,onChange:e=>O(e),"aria-label":"Toggle refactored UI feature flag"})]})]})]})},{key:"logout",label:(0,n.jsxs)("div",{className:"flex items-center py-2 px-3 hover:bg-gray-50 rounded-md mx-1 my-1",onClick:()=>{(0,p.b)(),(0,j.xd)(),window.location.href=I},children:[(0,n.jsx)(f.Z,{className:"mr-3 text-gray-600"}),(0,n.jsx)("span",{className:"text-gray-800",children:"Logout"})]})}];return(0,n.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,n.jsx)("div",{className:"w-full",children:(0,n.jsxs)("div",{className:"flex items-center h-14 px-4",children:[" ",(0,n.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[C&&(0,n.jsx)("button",{onClick:C,className:"flex items-center justify-center w-10 h-10 mr-2 text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded transition-colors",title:P?"Expand sidebar":"Collapse sidebar",children:(0,n.jsx)("span",{className:"text-lg",children:P?(0,n.jsx)(g.Z,{}):(0,n.jsx)(h.Z,{})})}),(0,n.jsx)(s.default,{href:"/",className:"flex items-center",children:(0,n.jsx)("img",{src:L||"".concat(U,"/get_image"),alt:"LiteLLM Brand",className:"h-10 w-auto"})})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,n.jsx)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-gray-600 hover:text-gray-900 transition-colors",children:"Docs"}),!E&&(0,n.jsx)(i.Z,{menu:{items:T,className:"min-w-[200px]",style:{padding:"8px",marginTop:"8px",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.08)"}},overlayStyle:{minWidth:"200px"},children:(0,n.jsxs)("button",{className:"inline-flex items-center text-sm text-gray-600 hover:text-gray-900 transition-colors",children:["User",(0,n.jsx)("svg",{className:"ml-1 w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 9l-7 7-7-7"})})]})})]})]})})})}},69734:function(e,t,r){"use strict";r.d(t,{F:function(){return o},f:function(){return i}});var n=r(57437),s=r(2265),l=r(19250);let a=(0,s.createContext)(void 0),o=()=>{let e=(0,s.useContext)(a);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},i=e=>{let{children:t,accessToken:r}=e,[o,i]=(0,s.useState)(null);return(0,s.useEffect)(()=>{(async()=>{try{let t=(0,l.getProxyBaseUrl)(),r=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{"Content-Type":"application/json"}});if(r.ok){var e;let t=await r.json();(null===(e=t.values)||void 0===e?void 0:e.logo_url)&&i(t.values.logo_url)}}catch(e){console.warn("Failed to load logo settings from backend:",e)}})()},[]),(0,n.jsx)(a.Provider,{value:{logoUrl:o,setLogoUrl:i},children:t})}},31857:function(e,t,r){"use strict";r.d(t,{FeatureFlagsProvider:function(){return u}});var n=r(57437),s=r(2265),l=r(99376);let a=()=>{let e="ui/".replace(/^\/+|\/+$/g,"");return e?"/".concat(e,"/"):"/"},o="feature.refactoredUIFlag",i=(0,s.createContext)(null);function c(e){try{localStorage.setItem(o,String(e))}catch(e){}}let u=e=>{let{children:t}=e,r=(0,l.useRouter)(),[u,d]=(0,s.useState)(()=>(function(){try{let e=localStorage.getItem(o);if(null===e)return localStorage.setItem(o,"false"),!1;let t=e.trim().toLowerCase();if("true"===t||"1"===t)return!0;if("false"===t||"0"===t)return!1;let r=JSON.parse(e);if("boolean"==typeof r)return r;return localStorage.setItem(o,"false"),!1}catch(e){try{localStorage.setItem(o,"false")}catch(e){}return!1}})());return(0,s.useEffect)(()=>{let e=e=>{if(e.key===o&&null!=e.newValue){let t=e.newValue.trim().toLowerCase();d("true"===t||"1"===t)}e.key===o&&null===e.newValue&&(c(!1),d(!1))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[]),(0,s.useEffect)(()=>{let e;if(u)return;let t=a();((e=window.location.pathname).endsWith("/")?e:e+"/")!==t&&r.replace(t)},[u,r]),(0,n.jsx)(i.Provider,{value:{refactoredUIFlag:u,setRefactoredUIFlag:e=>{d(e),c(e)}},children:t})};t.Z=()=>{let e=(0,s.useContext)(i);if(!e)throw Error("useFeatureFlags must be used within FeatureFlagsProvider");return e}},20347:function(e,t,r){"use strict";r.d(t,{LQ:function(){return l},ZL:function(){return n},lo:function(){return s},tY:function(){return a}});let n=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],s=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],a=e=>n.includes(e)}},function(e){e.O(0,[9820,1491,1526,3709,1529,3603,9165,8098,8049,2019,2971,2117,1744],function(){return e(e.s=77935)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js similarity index 98% rename from ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js index 6c21f141e7..3875773090 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5642],{77935:function(e,t,r){Promise.resolve().then(r.bind(r,89219))},1309:function(e,t,r){"use strict";r.d(t,{C:function(){return n.Z}});var n=r(41649)},39760:function(e,t,r){"use strict";var n=r(2265),s=r(99376),l=r(14474),a=r(3914);t.Z=()=>{var e,t,r,o,i,c,u;let d=(0,s.useRouter)(),m="undefined"!=typeof document?(0,a.e)("token"):null;(0,n.useEffect)(()=>{m||d.replace("/sso/key/generate")},[m,d]);let x=(0,n.useMemo)(()=>{if(!m)return null;try{return(0,l.o)(m)}catch(e){return(0,a.b)(),d.replace("/sso/key/generate"),null}},[m,d]);return{token:m,accessToken:null!==(e=null==x?void 0:x.key)&&void 0!==e?e:null,userId:null!==(t=null==x?void 0:x.user_id)&&void 0!==t?t:null,userEmail:null!==(r=null==x?void 0:x.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(o=null==x?void 0:x.user_role)&&void 0!==o?o:null),premiumUser:null!==(i=null==x?void 0:x.premium_user)&&void 0!==i?i:null,disabledPersonalKeyCreation:null!==(c=null==x?void 0:x.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==x?void 0:x.login_method)==="username_password"}}},89219:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return u}});var n=r(57437),s=r(2265),l=r(65373),a=r(69734),o=r(92019),i=r(39760),c=r(99376);function u(e){let{children:t}=e;(0,c.useRouter)();let r=(0,c.useSearchParams)(),{accessToken:u,userRole:d,userId:m,userEmail:x,premiumUser:f}=(0,i.Z)(),[g,h]=s.useState(!1),[p,y]=(0,s.useState)(()=>r.get("page")||"api-keys");return(0,s.useEffect)(()=>{y(r.get("page")||"api-keys")},[r]),(0,n.jsx)(a.f,{accessToken:"",children:(0,n.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,n.jsx)(l.Z,{isPublicPage:!1,sidebarCollapsed:g,onToggleSidebar:()=>h(e=>!e),userID:m,userEmail:x,userRole:d,premiumUser:f,proxySettings:void 0,setProxySettings:()=>{},accessToken:u}),(0,n.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(o.Z,{defaultSelectedKey:p,accessToken:u,userRole:d})}),(0,n.jsx)("main",{className:"flex-1",children:t})]})]})})}!function(e){let t="ui/".trim();if(t)t.replace(/^\/+/,"").replace(/\/+$/,"")}(0)},29488:function(e,t,r){"use strict";r.d(t,{Hc:function(){return a},Ui:function(){return l},e4:function(){return o},xd:function(){return i}});let n="litellm_mcp_auth_tokens",s=()=>{try{let e=localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading MCP auth tokens from localStorage:",e),{}}},l=(e,t)=>{try{let r=s()[e];if(r&&r.serverAlias===t||r&&!t&&!r.serverAlias)return r.authValue;return null}catch(e){return console.error("Error getting MCP auth token:",e),null}},a=(e,t,r,l)=>{try{let a=s();a[e]={serverId:e,serverAlias:l,authValue:t,authType:r,timestamp:Date.now()},localStorage.setItem(n,JSON.stringify(a))}catch(e){console.error("Error storing MCP auth token:",e)}},o=e=>{try{let t=s();delete t[e],localStorage.setItem(n,JSON.stringify(t))}catch(e){console.error("Error removing MCP auth token:",e)}},i=()=>{try{localStorage.removeItem(n)}catch(e){console.error("Error clearing MCP auth tokens:",e)}}},65373:function(e,t,r){"use strict";r.d(t,{Z:function(){return N}});var n=r(57437),s=r(27648),l=r(2265),a=r(89970),o=r(63709),i=r(80795),c=r(19250),u=r(15883),d=r(46346),m=r(57400),x=r(91870),f=r(40428),g=r(83884),h=r(45524),p=r(3914);let y=async e=>{if(!e)return null;try{return await (0,c.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};var v=r(69734),j=r(29488),w=r(31857),N=e=>{let{userID:t,userEmail:r,userRole:N,premiumUser:_,proxySettings:b,setProxySettings:k,accessToken:S,isPublicPage:E=!1,sidebarCollapsed:P=!1,onToggleSidebar:C}=e,U=(0,c.getProxyBaseUrl)(),[I,Z]=(0,l.useState)(""),{logoUrl:L}=(0,v.F)(),{refactoredUIFlag:R,setRefactoredUIFlag:O}=(0,w.Z)();(0,l.useEffect)(()=>{(async()=>{if(S){let e=await y(S);console.log("response from fetchProxySettings",e),e&&k(e)}})()},[S]),(0,l.useEffect)(()=>{Z((null==b?void 0:b.PROXY_LOGOUT_URL)||"")},[b]);let T=[{key:"user-info",onClick:e=>{var t;return null===(t=e.domEvent)||void 0===t?void 0:t.stopPropagation()},label:(0,n.jsxs)("div",{className:"px-3 py-3 border-b border-gray-100",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(u.Z,{className:"mr-2 text-gray-700"}),(0,n.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:t})]}),_?(0,n.jsx)(a.Z,{title:"Premium User",placement:"left",children:(0,n.jsxs)("div",{className:"flex items-center bg-gradient-to-r from-amber-500 to-yellow-500 text-white px-2 py-0.5 rounded-full cursor-help",children:[(0,n.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"Premium"})]})}):(0,n.jsx)(a.Z,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,n.jsxs)("div",{className:"flex items-center bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full cursor-help",children:[(0,n.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"Standard"})]})})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center text-sm",children:[(0,n.jsx)(m.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,n.jsx)("span",{className:"text-gray-500 text-xs",children:"Role"}),(0,n.jsx)("span",{className:"ml-auto text-gray-700 font-medium",children:N})]}),(0,n.jsxs)("div",{className:"flex items-center text-sm",children:[(0,n.jsx)(x.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,n.jsx)("span",{className:"text-gray-500 text-xs",children:"Email"}),(0,n.jsx)("span",{className:"ml-auto text-gray-700 font-medium truncate max-w-[150px]",title:r||"Unknown",children:r||"Unknown"})]}),(0,n.jsxs)("div",{className:"flex items-center text-sm pt-2 mt-2 border-t border-gray-100",children:[(0,n.jsx)("span",{className:"text-gray-500 text-xs",children:"Refactored UI"}),(0,n.jsx)(o.Z,{className:"ml-auto",size:"small",checked:R,onChange:e=>O(e),"aria-label":"Toggle refactored UI feature flag"})]})]})]})},{key:"logout",label:(0,n.jsxs)("div",{className:"flex items-center py-2 px-3 hover:bg-gray-50 rounded-md mx-1 my-1",onClick:()=>{(0,p.b)(),(0,j.xd)(),window.location.href=I},children:[(0,n.jsx)(f.Z,{className:"mr-3 text-gray-600"}),(0,n.jsx)("span",{className:"text-gray-800",children:"Logout"})]})}];return(0,n.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,n.jsx)("div",{className:"w-full",children:(0,n.jsxs)("div",{className:"flex items-center h-14 px-4",children:[" ",(0,n.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[C&&(0,n.jsx)("button",{onClick:C,className:"flex items-center justify-center w-10 h-10 mr-2 text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded transition-colors",title:P?"Expand sidebar":"Collapse sidebar",children:(0,n.jsx)("span",{className:"text-lg",children:P?(0,n.jsx)(g.Z,{}):(0,n.jsx)(h.Z,{})})}),(0,n.jsx)(s.default,{href:"/",className:"flex items-center",children:(0,n.jsx)("img",{src:L||"".concat(U,"/get_image"),alt:"LiteLLM Brand",className:"h-10 w-auto"})})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,n.jsx)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-gray-600 hover:text-gray-900 transition-colors",children:"Docs"}),!E&&(0,n.jsx)(i.Z,{menu:{items:T,className:"min-w-[200px]",style:{padding:"8px",marginTop:"8px",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.08)"}},overlayStyle:{minWidth:"200px"},children:(0,n.jsxs)("button",{className:"inline-flex items-center text-sm text-gray-600 hover:text-gray-900 transition-colors",children:["User",(0,n.jsx)("svg",{className:"ml-1 w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 9l-7 7-7-7"})})]})})]})]})})})}},69734:function(e,t,r){"use strict";r.d(t,{F:function(){return o},f:function(){return i}});var n=r(57437),s=r(2265),l=r(19250);let a=(0,s.createContext)(void 0),o=()=>{let e=(0,s.useContext)(a);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},i=e=>{let{children:t,accessToken:r}=e,[o,i]=(0,s.useState)(null);return(0,s.useEffect)(()=>{(async()=>{try{let t=(0,l.getProxyBaseUrl)(),r=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{"Content-Type":"application/json"}});if(r.ok){var e;let t=await r.json();(null===(e=t.values)||void 0===e?void 0:e.logo_url)&&i(t.values.logo_url)}}catch(e){console.warn("Failed to load logo settings from backend:",e)}})()},[]),(0,n.jsx)(a.Provider,{value:{logoUrl:o,setLogoUrl:i},children:t})}},31857:function(e,t,r){"use strict";r.d(t,{FeatureFlagsProvider:function(){return u}});var n=r(57437),s=r(2265),l=r(99376);let a=()=>{let e="ui/".replace(/^\/+|\/+$/g,"");return e?"/".concat(e,"/"):"/"},o="feature.refactoredUIFlag",i=(0,s.createContext)(null);function c(e){try{localStorage.setItem(o,String(e))}catch(e){}}let u=e=>{let{children:t}=e,r=(0,l.useRouter)(),[u,d]=(0,s.useState)(()=>(function(){try{let e=localStorage.getItem(o);if(null===e)return localStorage.setItem(o,"false"),!1;let t=e.trim().toLowerCase();if("true"===t||"1"===t)return!0;if("false"===t||"0"===t)return!1;let r=JSON.parse(e);if("boolean"==typeof r)return r;return localStorage.setItem(o,"false"),!1}catch(e){try{localStorage.setItem(o,"false")}catch(e){}return!1}})());return(0,s.useEffect)(()=>{let e=e=>{if(e.key===o&&null!=e.newValue){let t=e.newValue.trim().toLowerCase();d("true"===t||"1"===t)}e.key===o&&null===e.newValue&&(c(!1),d(!1))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[]),(0,s.useEffect)(()=>{let e;if(u)return;let t=a();((e=window.location.pathname).endsWith("/")?e:e+"/")!==t&&r.replace(t)},[u,r]),(0,n.jsx)(i.Provider,{value:{refactoredUIFlag:u,setRefactoredUIFlag:e=>{d(e),c(e)}},children:t})};t.Z=()=>{let e=(0,s.useContext)(i);if(!e)throw Error("useFeatureFlags must be used within FeatureFlagsProvider");return e}},20347:function(e,t,r){"use strict";r.d(t,{LQ:function(){return l},ZL:function(){return n},lo:function(){return s},tY:function(){return a}});let n=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],s=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],a=e=>n.includes(e)}},function(e){e.O(0,[9820,1491,1526,3709,1529,3603,9165,8098,8049,2019,2971,2117,1744],function(){return e(e.s=77935)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5642],{77935:function(e,t,r){Promise.resolve().then(r.bind(r,89219))},1309:function(e,t,r){"use strict";r.d(t,{C:function(){return n.Z}});var n=r(41649)},80443:function(e,t,r){"use strict";var n=r(2265),s=r(99376),l=r(14474),a=r(3914);t.Z=()=>{var e,t,r,o,i,c,u;let d=(0,s.useRouter)(),m="undefined"!=typeof document?(0,a.e)("token"):null;(0,n.useEffect)(()=>{m||d.replace("/sso/key/generate")},[m,d]);let x=(0,n.useMemo)(()=>{if(!m)return null;try{return(0,l.o)(m)}catch(e){return(0,a.b)(),d.replace("/sso/key/generate"),null}},[m,d]);return{token:m,accessToken:null!==(e=null==x?void 0:x.key)&&void 0!==e?e:null,userId:null!==(t=null==x?void 0:x.user_id)&&void 0!==t?t:null,userEmail:null!==(r=null==x?void 0:x.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(o=null==x?void 0:x.user_role)&&void 0!==o?o:null),premiumUser:null!==(i=null==x?void 0:x.premium_user)&&void 0!==i?i:null,disabledPersonalKeyCreation:null!==(c=null==x?void 0:x.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==x?void 0:x.login_method)==="username_password"}}},89219:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return u}});var n=r(57437),s=r(2265),l=r(65373),a=r(69734),o=r(92019),i=r(80443),c=r(99376);function u(e){let{children:t}=e;(0,c.useRouter)();let r=(0,c.useSearchParams)(),{accessToken:u,userRole:d,userId:m,userEmail:x,premiumUser:f}=(0,i.Z)(),[g,h]=s.useState(!1),[p,y]=(0,s.useState)(()=>r.get("page")||"api-keys");return(0,s.useEffect)(()=>{y(r.get("page")||"api-keys")},[r]),(0,n.jsx)(a.f,{accessToken:"",children:(0,n.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,n.jsx)(l.Z,{isPublicPage:!1,sidebarCollapsed:g,onToggleSidebar:()=>h(e=>!e),userID:m,userEmail:x,userRole:d,premiumUser:f,proxySettings:void 0,setProxySettings:()=>{},accessToken:u}),(0,n.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(o.Z,{defaultSelectedKey:p,accessToken:u,userRole:d})}),(0,n.jsx)("main",{className:"flex-1",children:t})]})]})})}!function(e){let t="ui/".trim();if(t)t.replace(/^\/+/,"").replace(/\/+$/,"")}(0)},29488:function(e,t,r){"use strict";r.d(t,{Hc:function(){return a},Ui:function(){return l},e4:function(){return o},xd:function(){return i}});let n="litellm_mcp_auth_tokens",s=()=>{try{let e=localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading MCP auth tokens from localStorage:",e),{}}},l=(e,t)=>{try{let r=s()[e];if(r&&r.serverAlias===t||r&&!t&&!r.serverAlias)return r.authValue;return null}catch(e){return console.error("Error getting MCP auth token:",e),null}},a=(e,t,r,l)=>{try{let a=s();a[e]={serverId:e,serverAlias:l,authValue:t,authType:r,timestamp:Date.now()},localStorage.setItem(n,JSON.stringify(a))}catch(e){console.error("Error storing MCP auth token:",e)}},o=e=>{try{let t=s();delete t[e],localStorage.setItem(n,JSON.stringify(t))}catch(e){console.error("Error removing MCP auth token:",e)}},i=()=>{try{localStorage.removeItem(n)}catch(e){console.error("Error clearing MCP auth tokens:",e)}}},65373:function(e,t,r){"use strict";r.d(t,{Z:function(){return N}});var n=r(57437),s=r(27648),l=r(2265),a=r(89970),o=r(63709),i=r(80795),c=r(19250),u=r(15883),d=r(46346),m=r(57400),x=r(91870),f=r(40428),g=r(83884),h=r(45524),p=r(3914);let y=async e=>{if(!e)return null;try{return await (0,c.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};var v=r(69734),j=r(29488),w=r(31857),N=e=>{let{userID:t,userEmail:r,userRole:N,premiumUser:_,proxySettings:b,setProxySettings:k,accessToken:S,isPublicPage:E=!1,sidebarCollapsed:P=!1,onToggleSidebar:C}=e,U=(0,c.getProxyBaseUrl)(),[I,Z]=(0,l.useState)(""),{logoUrl:L}=(0,v.F)(),{refactoredUIFlag:R,setRefactoredUIFlag:O}=(0,w.Z)();(0,l.useEffect)(()=>{(async()=>{if(S){let e=await y(S);console.log("response from fetchProxySettings",e),e&&k(e)}})()},[S]),(0,l.useEffect)(()=>{Z((null==b?void 0:b.PROXY_LOGOUT_URL)||"")},[b]);let T=[{key:"user-info",onClick:e=>{var t;return null===(t=e.domEvent)||void 0===t?void 0:t.stopPropagation()},label:(0,n.jsxs)("div",{className:"px-3 py-3 border-b border-gray-100",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(u.Z,{className:"mr-2 text-gray-700"}),(0,n.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:t})]}),_?(0,n.jsx)(a.Z,{title:"Premium User",placement:"left",children:(0,n.jsxs)("div",{className:"flex items-center bg-gradient-to-r from-amber-500 to-yellow-500 text-white px-2 py-0.5 rounded-full cursor-help",children:[(0,n.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"Premium"})]})}):(0,n.jsx)(a.Z,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,n.jsxs)("div",{className:"flex items-center bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full cursor-help",children:[(0,n.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"Standard"})]})})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center text-sm",children:[(0,n.jsx)(m.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,n.jsx)("span",{className:"text-gray-500 text-xs",children:"Role"}),(0,n.jsx)("span",{className:"ml-auto text-gray-700 font-medium",children:N})]}),(0,n.jsxs)("div",{className:"flex items-center text-sm",children:[(0,n.jsx)(x.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,n.jsx)("span",{className:"text-gray-500 text-xs",children:"Email"}),(0,n.jsx)("span",{className:"ml-auto text-gray-700 font-medium truncate max-w-[150px]",title:r||"Unknown",children:r||"Unknown"})]}),(0,n.jsxs)("div",{className:"flex items-center text-sm pt-2 mt-2 border-t border-gray-100",children:[(0,n.jsx)("span",{className:"text-gray-500 text-xs",children:"Refactored UI"}),(0,n.jsx)(o.Z,{className:"ml-auto",size:"small",checked:R,onChange:e=>O(e),"aria-label":"Toggle refactored UI feature flag"})]})]})]})},{key:"logout",label:(0,n.jsxs)("div",{className:"flex items-center py-2 px-3 hover:bg-gray-50 rounded-md mx-1 my-1",onClick:()=>{(0,p.b)(),(0,j.xd)(),window.location.href=I},children:[(0,n.jsx)(f.Z,{className:"mr-3 text-gray-600"}),(0,n.jsx)("span",{className:"text-gray-800",children:"Logout"})]})}];return(0,n.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,n.jsx)("div",{className:"w-full",children:(0,n.jsxs)("div",{className:"flex items-center h-14 px-4",children:[" ",(0,n.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[C&&(0,n.jsx)("button",{onClick:C,className:"flex items-center justify-center w-10 h-10 mr-2 text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded transition-colors",title:P?"Expand sidebar":"Collapse sidebar",children:(0,n.jsx)("span",{className:"text-lg",children:P?(0,n.jsx)(g.Z,{}):(0,n.jsx)(h.Z,{})})}),(0,n.jsx)(s.default,{href:"/",className:"flex items-center",children:(0,n.jsx)("img",{src:L||"".concat(U,"/get_image"),alt:"LiteLLM Brand",className:"h-10 w-auto"})})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,n.jsx)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-gray-600 hover:text-gray-900 transition-colors",children:"Docs"}),!E&&(0,n.jsx)(i.Z,{menu:{items:T,className:"min-w-[200px]",style:{padding:"8px",marginTop:"8px",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.08)"}},overlayStyle:{minWidth:"200px"},children:(0,n.jsxs)("button",{className:"inline-flex items-center text-sm text-gray-600 hover:text-gray-900 transition-colors",children:["User",(0,n.jsx)("svg",{className:"ml-1 w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 9l-7 7-7-7"})})]})})]})]})})})}},69734:function(e,t,r){"use strict";r.d(t,{F:function(){return o},f:function(){return i}});var n=r(57437),s=r(2265),l=r(19250);let a=(0,s.createContext)(void 0),o=()=>{let e=(0,s.useContext)(a);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},i=e=>{let{children:t,accessToken:r}=e,[o,i]=(0,s.useState)(null);return(0,s.useEffect)(()=>{(async()=>{try{let t=(0,l.getProxyBaseUrl)(),r=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{"Content-Type":"application/json"}});if(r.ok){var e;let t=await r.json();(null===(e=t.values)||void 0===e?void 0:e.logo_url)&&i(t.values.logo_url)}}catch(e){console.warn("Failed to load logo settings from backend:",e)}})()},[]),(0,n.jsx)(a.Provider,{value:{logoUrl:o,setLogoUrl:i},children:t})}},31857:function(e,t,r){"use strict";r.d(t,{FeatureFlagsProvider:function(){return u}});var n=r(57437),s=r(2265),l=r(99376);let a=()=>{let e="ui/".replace(/^\/+|\/+$/g,"");return e?"/".concat(e,"/"):"/"},o="feature.refactoredUIFlag",i=(0,s.createContext)(null);function c(e){try{localStorage.setItem(o,String(e))}catch(e){}}let u=e=>{let{children:t}=e,r=(0,l.useRouter)(),[u,d]=(0,s.useState)(()=>(function(){try{let e=localStorage.getItem(o);if(null===e)return localStorage.setItem(o,"false"),!1;let t=e.trim().toLowerCase();if("true"===t||"1"===t)return!0;if("false"===t||"0"===t)return!1;let r=JSON.parse(e);if("boolean"==typeof r)return r;return localStorage.setItem(o,"false"),!1}catch(e){try{localStorage.setItem(o,"false")}catch(e){}return!1}})());return(0,s.useEffect)(()=>{let e=e=>{if(e.key===o&&null!=e.newValue){let t=e.newValue.trim().toLowerCase();d("true"===t||"1"===t)}e.key===o&&null===e.newValue&&(c(!1),d(!1))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[]),(0,s.useEffect)(()=>{let e;if(u)return;let t=a();((e=window.location.pathname).endsWith("/")?e:e+"/")!==t&&r.replace(t)},[u,r]),(0,n.jsx)(i.Provider,{value:{refactoredUIFlag:u,setRefactoredUIFlag:e=>{d(e),c(e)}},children:t})};t.Z=()=>{let e=(0,s.useContext)(i);if(!e)throw Error("useFeatureFlags must be used within FeatureFlagsProvider");return e}},20347:function(e,t,r){"use strict";r.d(t,{LQ:function(){return l},ZL:function(){return n},lo:function(){return s},tY:function(){return a}});let n=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],s=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],a=e=>n.includes(e)}},function(e){e.O(0,[9820,1491,1526,3709,1529,3603,9165,8098,8049,2019,2971,2117,1744],function(){return e(e.s=77935)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-009011bc6f8bc171.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-009011bc6f8bc171.js deleted file mode 100644 index 2b193016ab..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-009011bc6f8bc171.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/logs/page-f2aa7dcce4de54a3.js -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2100],{15956:function(e,n,o){Promise.resolve().then(o.bind(o,19056))},19130:function(e,n,o){"use strict";o.d(n,{RM:function(){return t.Z},SC:function(){return c.Z},iA:function(){return r.Z},pj:function(){return a.Z},ss:function(){return i.Z},xs:function(){return l.Z}});var r=o(21626),t=o(97214),a=o(28241),i=o(58834),l=o(69552),c=o(71876)},11318:function(e,n,o){"use strict";o.d(n,{Z:function(){return l}});var r=o(2265),t=o(39760),a=o(19250);let i=async(e,n,o,r)=>"Admin"!=o&&"Admin Viewer"!=o?await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null,n):await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null);var l=()=>{let[e,n]=(0,r.useState)([]),{accessToken:o,userId:a,userRole:l}=(0,t.Z)();return(0,r.useEffect)(()=>{(async()=>{n(await i(o,a,l,null))})()},[o,a,l]),{teams:e,setTeams:n}}},19056:function(e,n,o){"use strict";o.r(n);var r=o(57437),t=o(33801),a=o(39760),i=o(11318),l=o(21623),c=o(29827);n.default=()=>{let{accessToken:e,token:n,userRole:o,userId:s,premiumUser:u}=(0,a.Z)(),{teams:p}=(0,i.Z)(),d=new l.S;return(0,r.jsx)(c.aH,{client:d,children:(0,r.jsx)(t.Z,{accessToken:e,token:n,userRole:o,userID:s,allTeams:p||[],premiumUser:u})})}},42673:function(e,n,o){"use strict";var r,t;o.d(n,{Cl:function(){return r},bK:function(){return u},cd:function(){return l},dr:function(){return c},fK:function(){return a},ph:function(){return s}}),(t=r||(r={})).AIML="AI/ML API",t.Bedrock="Amazon Bedrock",t.Anthropic="Anthropic",t.AssemblyAI="AssemblyAI",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.Cerebras="Cerebras",t.Cohere="Cohere",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.ElevenLabs="ElevenLabs",t.FireworksAI="Fireworks AI",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.Hosted_Vllm="vllm",t.Infinity="Infinity",t.JinaAI="Jina AI",t.MistralAI="Mistral AI",t.Ollama="Ollama",t.OpenAI="OpenAI",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.Perplexity="Perplexity",t.Sambanova="Sambanova",t.Snowflake="Snowflake",t.TogetherAI="TogetherAI",t.Triton="Triton",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},i="/ui/assets/logos/",l={"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},c=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let n=Object.keys(a).find(n=>a[n].toLowerCase()===e.toLowerCase());if(!n)return{logo:"",displayName:e};let o=r[n];return{logo:l[o],displayName:o}},s=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},u=(e,n)=>{console.log("Provider key: ".concat(e));let o=a[e];console.log("Provider mapped to: ".concat(o));let r=[];return e&&"object"==typeof n&&(Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&(t.litellm_provider===o||t.litellm_provider.includes(o))&&r.push(n)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(n).forEach(e=>{let[n,o]=e;null!==o&&"object"==typeof o&&"litellm_provider"in o&&"cohere_chat"===o.litellm_provider&&r.push(n)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(n).forEach(e=>{let[n,o]=e;null!==o&&"object"==typeof o&&"litellm_provider"in o&&"sagemaker_chat"===o.litellm_provider&&r.push(n)}))),r}},12322:function(e,n,o){"use strict";o.d(n,{w:function(){return c}});var r=o(57437),t=o(2265),a=o(71594),i=o(24525),l=o(19130);function c(e){let{data:n=[],columns:o,getRowCanExpand:c,renderSubComponent:s,isLoading:u=!1,loadingMessage:p="\uD83D\uDE85 Loading logs...",noDataMessage:d="No logs found"}=e,g=(0,a.b7)({data:n,columns:o,getRowCanExpand:c,getRowId:(e,n)=>{var o;return null!==(o=null==e?void 0:e.request_id)&&void 0!==o?o:String(n)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,r.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,r.jsxs)(l.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,r.jsx)(l.ss,{children:g.getHeaderGroups().map(e=>(0,r.jsx)(l.SC,{children:e.headers.map(e=>(0,r.jsx)(l.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,a.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,r.jsx)(l.RM,{children:u?(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:o.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:p})})})}):g.getRowModel().rows.length>0?g.getRowModel().rows.map(e=>(0,r.jsxs)(t.Fragment,{children:[(0,r.jsx)(l.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,r.jsx)(l.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,a.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,r.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:s({row:e})})})})]},e.id)):(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:o.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:d})})})})})]})})}}},function(e){e.O(0,[6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,6494,5188,6202,1264,5079,8049,131,2202,874,4292,3801,2971,2117,1744],function(){return e(e.s=15956)}),_N_E=e.O()}]); -======== -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2100],{15956:function(e,n,o){Promise.resolve().then(o.bind(o,19056))},19130:function(e,n,o){"use strict";o.d(n,{RM:function(){return t.Z},SC:function(){return c.Z},iA:function(){return r.Z},pj:function(){return a.Z},ss:function(){return i.Z},xs:function(){return l.Z}});var r=o(21626),t=o(97214),a=o(28241),i=o(58834),l=o(69552),c=o(71876)},11318:function(e,n,o){"use strict";o.d(n,{Z:function(){return l}});var r=o(2265),t=o(39760),a=o(19250);let i=async(e,n,o,r)=>"Admin"!=o&&"Admin Viewer"!=o?await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null,n):await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null);var l=()=>{let[e,n]=(0,r.useState)([]),{accessToken:o,userId:a,userRole:l}=(0,t.Z)();return(0,r.useEffect)(()=>{(async()=>{n(await i(o,a,l,null))})()},[o,a,l]),{teams:e,setTeams:n}}},19056:function(e,n,o){"use strict";o.r(n);var r=o(57437),t=o(33801),a=o(39760),i=o(11318),l=o(21623),c=o(29827);n.default=()=>{let{accessToken:e,token:n,userRole:o,userId:s,premiumUser:u}=(0,a.Z)(),{teams:p}=(0,i.Z)(),d=new l.S;return(0,r.jsx)(c.aH,{client:d,children:(0,r.jsx)(t.Z,{accessToken:e,token:n,userRole:o,userID:s,allTeams:p||[],premiumUser:u})})}},42673:function(e,n,o){"use strict";var r,t;o.d(n,{Cl:function(){return r},bK:function(){return u},cd:function(){return l},dr:function(){return c},fK:function(){return a},ph:function(){return s}}),(t=r||(r={})).AIML="AI/ML API",t.Bedrock="Amazon Bedrock",t.Anthropic="Anthropic",t.AssemblyAI="AssemblyAI",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.Cerebras="Cerebras",t.Cohere="Cohere",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.ElevenLabs="ElevenLabs",t.FireworksAI="Fireworks AI",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.Hosted_Vllm="vllm",t.Infinity="Infinity",t.JinaAI="Jina AI",t.MistralAI="Mistral AI",t.Ollama="Ollama",t.OpenAI="OpenAI",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.Perplexity="Perplexity",t.Sambanova="Sambanova",t.Snowflake="Snowflake",t.TogetherAI="TogetherAI",t.Triton="Triton",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},i="/ui/assets/logos/",l={"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},c=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let n=Object.keys(a).find(n=>a[n].toLowerCase()===e.toLowerCase());if(!n)return{logo:"",displayName:e};let o=r[n];return{logo:l[o],displayName:o}},s=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},u=(e,n)=>{console.log("Provider key: ".concat(e));let o=a[e];console.log("Provider mapped to: ".concat(o));let r=[];return e&&"object"==typeof n&&(Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&(t.litellm_provider===o||t.litellm_provider.includes(o))&&r.push(n)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(n).forEach(e=>{let[n,o]=e;null!==o&&"object"==typeof o&&"litellm_provider"in o&&"cohere_chat"===o.litellm_provider&&r.push(n)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(n).forEach(e=>{let[n,o]=e;null!==o&&"object"==typeof o&&"litellm_provider"in o&&"sagemaker_chat"===o.litellm_provider&&r.push(n)}))),r}},12322:function(e,n,o){"use strict";o.d(n,{w:function(){return c}});var r=o(57437),t=o(2265),a=o(71594),i=o(24525),l=o(19130);function c(e){let{data:n=[],columns:o,getRowCanExpand:c,renderSubComponent:s,isLoading:u=!1,loadingMessage:p="\uD83D\uDE85 Loading logs...",noDataMessage:d="No logs found"}=e,g=(0,a.b7)({data:n,columns:o,getRowCanExpand:c,getRowId:(e,n)=>{var o;return null!==(o=null==e?void 0:e.request_id)&&void 0!==o?o:String(n)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,r.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,r.jsxs)(l.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,r.jsx)(l.ss,{children:g.getHeaderGroups().map(e=>(0,r.jsx)(l.SC,{children:e.headers.map(e=>(0,r.jsx)(l.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,a.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,r.jsx)(l.RM,{children:u?(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:o.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:p})})})}):g.getRowModel().rows.length>0?g.getRowModel().rows.map(e=>(0,r.jsxs)(t.Fragment,{children:[(0,r.jsx)(l.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,r.jsx)(l.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,a.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,r.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:s({row:e})})})})]},e.id)):(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:o.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:d})})})})})]})})}}},function(e){e.O(0,[6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,6494,5188,6202,1264,5079,8049,1633,2202,874,4292,3801,2971,2117,1744],function(){return e(e.s=15956)}),_N_E=e.O()}]); ->>>>>>>> ef0d6f0207 (Resolve conflicts in generated HTML files):litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-009011bc6f8bc171.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-6a747c73e6811499.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-5019bcc8a011ed8c.js similarity index 54% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-6a747c73e6811499.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-5019bcc8a011ed8c.js index 4d86d0b4d7..3d889a283f 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-6a747c73e6811499.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-5019bcc8a011ed8c.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6248],{64362:function(e,n,r){Promise.resolve().then(r.bind(r,77438))},16312:function(e,n,r){"use strict";r.d(n,{z:function(){return o.Z}});var o=r(20831)},64504:function(e,n,r){"use strict";r.d(n,{o:function(){return t.Z},z:function(){return o.Z}});var o=r(20831),t=r(49566)},39760:function(e,n,r){"use strict";var o=r(2265),t=r(99376),a=r(14474),i=r(3914);n.Z=()=>{var e,n,r,l,c,s,u;let p=(0,t.useRouter)(),d="undefined"!=typeof document?(0,i.e)("token"):null;(0,o.useEffect)(()=>{d||p.replace("/sso/key/generate")},[d,p]);let g=(0,o.useMemo)(()=>{if(!d)return null;try{return(0,a.o)(d)}catch(e){return(0,i.b)(),p.replace("/sso/key/generate"),null}},[d,p]);return{token:d,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(n=null==g?void 0:g.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==g?void 0:g.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(l=null==g?void 0:g.user_role)&&void 0!==l?l:null),premiumUser:null!==(c=null==g?void 0:g.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(s=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},77438:function(e,n,r){"use strict";r.r(n);var o=r(57437),t=r(6204),a=r(39760);n.default=()=>{let{accessToken:e,userId:n,userRole:r}=(0,a.Z)();return(0,o.jsx)(t.Z,{accessToken:e,userID:n,userRole:r})}},42673:function(e,n,r){"use strict";var o,t;r.d(n,{Cl:function(){return o},bK:function(){return u},cd:function(){return l},dr:function(){return c},fK:function(){return a},ph:function(){return s}}),(t=o||(o={})).AIML="AI/ML API",t.Bedrock="Amazon Bedrock",t.Anthropic="Anthropic",t.AssemblyAI="AssemblyAI",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.Cerebras="Cerebras",t.Cohere="Cohere",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.ElevenLabs="ElevenLabs",t.FireworksAI="Fireworks AI",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.Hosted_Vllm="vllm",t.Infinity="Infinity",t.JinaAI="Jina AI",t.MistralAI="Mistral AI",t.Ollama="Ollama",t.OpenAI="OpenAI",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.Perplexity="Perplexity",t.Sambanova="Sambanova",t.Snowflake="Snowflake",t.TogetherAI="TogetherAI",t.Triton="Triton",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},i="/ui/assets/logos/",l={"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},c=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let n=Object.keys(a).find(n=>a[n].toLowerCase()===e.toLowerCase());if(!n)return{logo:"",displayName:e};let r=o[n];return{logo:l[r],displayName:r}},s=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},u=(e,n)=>{console.log("Provider key: ".concat(e));let r=a[e];console.log("Provider mapped to: ".concat(r));let o=[];return e&&"object"==typeof n&&(Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&(t.litellm_provider===r||t.litellm_provider.includes(r))&&o.push(n)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(n).forEach(e=>{let[n,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"cohere_chat"===r.litellm_provider&&o.push(n)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(n).forEach(e=>{let[n,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"sagemaker_chat"===r.litellm_provider&&o.push(n)}))),o}},20347:function(e,n,r){"use strict";r.d(n,{LQ:function(){return a},ZL:function(){return o},lo:function(){return t},tY:function(){return i}});let o=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],t=["Internal User","Internal Viewer"],a=["Internal User","Admin","proxy_admin"],i=e=>o.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,9775,2525,1529,7908,3669,8791,8049,6204,2971,2117,1744],function(){return e(e.s=64362)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2100],{15956:function(e,n,o){Promise.resolve().then(o.bind(o,19056))},19130:function(e,n,o){"use strict";o.d(n,{RM:function(){return t.Z},SC:function(){return c.Z},iA:function(){return r.Z},pj:function(){return a.Z},ss:function(){return i.Z},xs:function(){return l.Z}});var r=o(21626),t=o(97214),a=o(28241),i=o(58834),l=o(69552),c=o(71876)},11318:function(e,n,o){"use strict";o.d(n,{Z:function(){return l}});var r=o(2265),t=o(80443),a=o(19250);let i=async(e,n,o,r)=>"Admin"!=o&&"Admin Viewer"!=o?await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null,n):await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null);var l=()=>{let[e,n]=(0,r.useState)([]),{accessToken:o,userId:a,userRole:l}=(0,t.Z)();return(0,r.useEffect)(()=>{(async()=>{n(await i(o,a,l,null))})()},[o,a,l]),{teams:e,setTeams:n}}},19056:function(e,n,o){"use strict";o.r(n);var r=o(57437),t=o(33801),a=o(80443),i=o(11318),l=o(21623),c=o(29827);n.default=()=>{let{accessToken:e,token:n,userRole:o,userId:s,premiumUser:u}=(0,a.Z)(),{teams:p}=(0,i.Z)(),d=new l.S;return(0,r.jsx)(c.aH,{client:d,children:(0,r.jsx)(t.Z,{accessToken:e,token:n,userRole:o,userID:s,allTeams:p||[],premiumUser:u})})}},42673:function(e,n,o){"use strict";var r,t;o.d(n,{Cl:function(){return r},bK:function(){return u},cd:function(){return l},dr:function(){return c},fK:function(){return a},ph:function(){return s}}),(t=r||(r={})).AIML="AI/ML API",t.Bedrock="Amazon Bedrock",t.Anthropic="Anthropic",t.AssemblyAI="AssemblyAI",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.Cerebras="Cerebras",t.Cohere="Cohere",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.ElevenLabs="ElevenLabs",t.FireworksAI="Fireworks AI",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.Hosted_Vllm="vllm",t.Infinity="Infinity",t.JinaAI="Jina AI",t.MistralAI="Mistral AI",t.Ollama="Ollama",t.OpenAI="OpenAI",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.Perplexity="Perplexity",t.Sambanova="Sambanova",t.Snowflake="Snowflake",t.TogetherAI="TogetherAI",t.Triton="Triton",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},i="/ui/assets/logos/",l={"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},c=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let n=Object.keys(a).find(n=>a[n].toLowerCase()===e.toLowerCase());if(!n)return{logo:"",displayName:e};let o=r[n];return{logo:l[o],displayName:o}},s=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},u=(e,n)=>{console.log("Provider key: ".concat(e));let o=a[e];console.log("Provider mapped to: ".concat(o));let r=[];return e&&"object"==typeof n&&(Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&(t.litellm_provider===o||t.litellm_provider.includes(o))&&r.push(n)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(n).forEach(e=>{let[n,o]=e;null!==o&&"object"==typeof o&&"litellm_provider"in o&&"cohere_chat"===o.litellm_provider&&r.push(n)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(n).forEach(e=>{let[n,o]=e;null!==o&&"object"==typeof o&&"litellm_provider"in o&&"sagemaker_chat"===o.litellm_provider&&r.push(n)}))),r}},12322:function(e,n,o){"use strict";o.d(n,{w:function(){return c}});var r=o(57437),t=o(2265),a=o(71594),i=o(24525),l=o(19130);function c(e){let{data:n=[],columns:o,getRowCanExpand:c,renderSubComponent:s,isLoading:u=!1,loadingMessage:p="\uD83D\uDE85 Loading logs...",noDataMessage:d="No logs found"}=e,g=(0,a.b7)({data:n,columns:o,getRowCanExpand:c,getRowId:(e,n)=>{var o;return null!==(o=null==e?void 0:e.request_id)&&void 0!==o?o:String(n)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,r.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,r.jsxs)(l.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,r.jsx)(l.ss,{children:g.getHeaderGroups().map(e=>(0,r.jsx)(l.SC,{children:e.headers.map(e=>(0,r.jsx)(l.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,a.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,r.jsx)(l.RM,{children:u?(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:o.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:p})})})}):g.getRowModel().rows.length>0?g.getRowModel().rows.map(e=>(0,r.jsxs)(t.Fragment,{children:[(0,r.jsx)(l.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,r.jsx)(l.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,a.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,r.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:s({row:e})})})})]},e.id)):(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:o.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:d})})})})})]})})}}},function(e){e.O(0,[6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,6494,5188,6202,1264,5079,8049,131,2202,874,4292,3801,2971,2117,1744],function(){return e(e.s=15956)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-f38983c7e128e2f2.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-28a4881b81368e36.js similarity index 98% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-f38983c7e128e2f2.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-28a4881b81368e36.js index 7389508f44..dc6b6e021b 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-f38983c7e128e2f2.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-28a4881b81368e36.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2678],{24181:function(e,t,r){Promise.resolve().then(r.bind(r,30615))},23639:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),i=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},a=r(55015),s=i.forwardRef(function(e,t){return i.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},41649:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var n=r(5853),i=r(2265),o=r(1526),a=r(7084),s=r(26898),u=r(97324),c=r(1153);let l={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},d={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},f=(0,c.fn)("Badge"),p=i.forwardRef((e,t)=>{let{color:r,icon:p,size:h=a.u8.SM,tooltip:m,className:g,children:w}=e,v=(0,n._T)(e,["color","icon","size","tooltip","className","children"]),k=p||null,{tooltipProps:x,getReferenceProps:b}=(0,o.l)();return i.createElement("span",Object.assign({ref:(0,c.lq)([t,x.refs.setReference]),className:(0,u.q)(f("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-full",r?(0,u.q)((0,c.bM)(r,s.K.background).bgColor,(0,c.bM)(r,s.K.text).textColor,"bg-opacity-20 dark:bg-opacity-25"):(0,u.q)("bg-tremor-brand-muted text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted dark:text-dark-tremor-brand-emphasis"),l[h].paddingX,l[h].paddingY,l[h].fontSize,g)},b,v),i.createElement(o.Z,Object.assign({text:m},x)),k?i.createElement(k,{className:(0,u.q)(f("icon"),"shrink-0 -ml-1 mr-1.5",d[h].height,d[h].width)}):null,i.createElement("p",{className:(0,u.q)(f("text"),"text-sm whitespace-nowrap")},w))});p.displayName="Badge"},28617:function(e,t,r){"use strict";var n=r(2265),i=r(27380),o=r(51646),a=r(6543);t.Z=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,n.useRef)({}),r=(0,o.Z)(),s=(0,a.ZP)();return(0,i.Z)(()=>{let n=s.subscribe(n=>{t.current=n,e&&r()});return()=>s.unsubscribe(n)},[]),t.current}},78867:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},33245:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},95704:function(e,t,r){"use strict";r.d(t,{Dx:function(){return d.Z},RM:function(){return o.Z},SC:function(){return c.Z},Zb:function(){return n.Z},iA:function(){return i.Z},pj:function(){return a.Z},ss:function(){return s.Z},xs:function(){return u.Z},xv:function(){return l.Z}});var n=r(12514),i=r(21626),o=r(97214),a=r(28241),s=r(58834),u=r(69552),c=r(71876),l=r(84264),d=r(96761)},39760:function(e,t,r){"use strict";var n=r(2265),i=r(99376),o=r(14474),a=r(3914);t.Z=()=>{var e,t,r,s,u,c,l;let d=(0,i.useRouter)(),f="undefined"!=typeof document?(0,a.e)("token"):null;(0,n.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let p=(0,n.useMemo)(()=>{if(!f)return null;try{return(0,o.o)(f)}catch(e){return(0,a.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==p?void 0:p.key)&&void 0!==e?e:null,userId:null!==(t=null==p?void 0:p.user_id)&&void 0!==t?t:null,userEmail:null!==(r=null==p?void 0:p.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(s=null==p?void 0:p.user_role)&&void 0!==s?s:null),premiumUser:null!==(u=null==p?void 0:p.premium_user)&&void 0!==u?u:null,disabledPersonalKeyCreation:null!==(c=null==p?void 0:p.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==p?void 0:p.login_method)==="username_password"}}},30615:function(e,t,r){"use strict";r.r(t);var n=r(57437),i=r(18160),o=r(39760);t.default=()=>{let{accessToken:e,premiumUser:t,userRole:r}=(0,o.Z)();return(0,n.jsx)(i.Z,{accessToken:e,publicPage:!1,premiumUser:t,userRole:r})}},20347:function(e,t,r){"use strict";r.d(t,{LQ:function(){return o},ZL:function(){return n},lo:function(){return i},tY:function(){return a}});let n=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],i=["Internal User","Internal Viewer"],o=["Internal User","Admin","proxy_admin"],a=e=>n.includes(e)},86462:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});t.Z=i},47686:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});t.Z=i},3477:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});t.Z=i},93416:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});t.Z=i},77355:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=i},17732:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))});t.Z=i},14474:function(e,t,r){"use strict";r.d(t,{o:function(){return i}});class n extends Error{}function i(e,t){let r;if("string"!=typeof e)throw new n("Invalid token specified: must be a string");t||(t={});let i=!0===t.header?0:1,o=e.split(".")[i];if("string"!=typeof o)throw new n(`Invalid token specified: missing part #${i+1}`);try{r=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var r;return r=t,decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(o)}catch(e){throw new n(`Invalid token specified: invalid base64 for part #${i+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new n(`Invalid token specified: invalid json for part #${i+1} (${e.message})`)}}n.prototype.name="InvalidTokenError"}},function(e){e.O(0,[9820,1491,1526,2417,3709,2525,1529,2284,9011,3603,7906,9165,3752,8049,2162,8160,2971,2117,1744],function(){return e(e.s=24181)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2678],{24181:function(e,t,r){Promise.resolve().then(r.bind(r,30615))},23639:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),i=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},a=r(55015),s=i.forwardRef(function(e,t){return i.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},41649:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var n=r(5853),i=r(2265),o=r(1526),a=r(7084),s=r(26898),u=r(97324),c=r(1153);let l={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},d={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},f=(0,c.fn)("Badge"),p=i.forwardRef((e,t)=>{let{color:r,icon:p,size:h=a.u8.SM,tooltip:m,className:g,children:w}=e,v=(0,n._T)(e,["color","icon","size","tooltip","className","children"]),k=p||null,{tooltipProps:x,getReferenceProps:b}=(0,o.l)();return i.createElement("span",Object.assign({ref:(0,c.lq)([t,x.refs.setReference]),className:(0,u.q)(f("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-full",r?(0,u.q)((0,c.bM)(r,s.K.background).bgColor,(0,c.bM)(r,s.K.text).textColor,"bg-opacity-20 dark:bg-opacity-25"):(0,u.q)("bg-tremor-brand-muted text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted dark:text-dark-tremor-brand-emphasis"),l[h].paddingX,l[h].paddingY,l[h].fontSize,g)},b,v),i.createElement(o.Z,Object.assign({text:m},x)),k?i.createElement(k,{className:(0,u.q)(f("icon"),"shrink-0 -ml-1 mr-1.5",d[h].height,d[h].width)}):null,i.createElement("p",{className:(0,u.q)(f("text"),"text-sm whitespace-nowrap")},w))});p.displayName="Badge"},28617:function(e,t,r){"use strict";var n=r(2265),i=r(27380),o=r(51646),a=r(6543);t.Z=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,n.useRef)({}),r=(0,o.Z)(),s=(0,a.ZP)();return(0,i.Z)(()=>{let n=s.subscribe(n=>{t.current=n,e&&r()});return()=>s.unsubscribe(n)},[]),t.current}},78867:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},33245:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},95704:function(e,t,r){"use strict";r.d(t,{Dx:function(){return d.Z},RM:function(){return o.Z},SC:function(){return c.Z},Zb:function(){return n.Z},iA:function(){return i.Z},pj:function(){return a.Z},ss:function(){return s.Z},xs:function(){return u.Z},xv:function(){return l.Z}});var n=r(12514),i=r(21626),o=r(97214),a=r(28241),s=r(58834),u=r(69552),c=r(71876),l=r(84264),d=r(96761)},80443:function(e,t,r){"use strict";var n=r(2265),i=r(99376),o=r(14474),a=r(3914);t.Z=()=>{var e,t,r,s,u,c,l;let d=(0,i.useRouter)(),f="undefined"!=typeof document?(0,a.e)("token"):null;(0,n.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let p=(0,n.useMemo)(()=>{if(!f)return null;try{return(0,o.o)(f)}catch(e){return(0,a.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==p?void 0:p.key)&&void 0!==e?e:null,userId:null!==(t=null==p?void 0:p.user_id)&&void 0!==t?t:null,userEmail:null!==(r=null==p?void 0:p.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(s=null==p?void 0:p.user_role)&&void 0!==s?s:null),premiumUser:null!==(u=null==p?void 0:p.premium_user)&&void 0!==u?u:null,disabledPersonalKeyCreation:null!==(c=null==p?void 0:p.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==p?void 0:p.login_method)==="username_password"}}},30615:function(e,t,r){"use strict";r.r(t);var n=r(57437),i=r(18160),o=r(80443);t.default=()=>{let{accessToken:e,premiumUser:t,userRole:r}=(0,o.Z)();return(0,n.jsx)(i.Z,{accessToken:e,publicPage:!1,premiumUser:t,userRole:r})}},20347:function(e,t,r){"use strict";r.d(t,{LQ:function(){return o},ZL:function(){return n},lo:function(){return i},tY:function(){return a}});let n=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],i=["Internal User","Internal Viewer"],o=["Internal User","Admin","proxy_admin"],a=e=>n.includes(e)},86462:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});t.Z=i},47686:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});t.Z=i},3477:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});t.Z=i},93416:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});t.Z=i},77355:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=i},17732:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))});t.Z=i},14474:function(e,t,r){"use strict";r.d(t,{o:function(){return i}});class n extends Error{}function i(e,t){let r;if("string"!=typeof e)throw new n("Invalid token specified: must be a string");t||(t={});let i=!0===t.header?0:1,o=e.split(".")[i];if("string"!=typeof o)throw new n(`Invalid token specified: missing part #${i+1}`);try{r=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var r;return r=t,decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(o)}catch(e){throw new n(`Invalid token specified: invalid base64 for part #${i+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new n(`Invalid token specified: invalid json for part #${i+1} (${e.message})`)}}n.prototype.name="InvalidTokenError"}},function(e){e.O(0,[9820,1491,1526,2417,3709,2525,1529,2284,9011,3603,7906,9165,3752,8049,2162,8160,2971,2117,1744],function(){return e(e.s=24181)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-50ce8c6bb2821738.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-50ce8c6bb2821738.js deleted file mode 100644 index 9b116433a2..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-50ce8c6bb2821738.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-6137f595db4b67d2.js -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1664],{18530:function(e,t,r){Promise.resolve().then(r.bind(r,6121))},12660:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),s=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},l=r(55015),o=s.forwardRef(function(e,t){return s.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},5540:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),s=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},l=r(55015),o=s.forwardRef(function(e,t){return s.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},3810:function(e,t,r){"use strict";r.d(t,{Z:function(){return I}});var n=r(2265),s=r(49638),a=r(36760),l=r.n(a),o=r(93350),i=r(53445),c=r(6694),d=r(71744),u=r(352),m=r(36360),h=r(12918),p=r(3104),g=r(80669);let f=e=>{let{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:s,calc:a}=e,l=a(n).sub(r).equal(),o=a(t).sub(r).equal();return{[s]:Object.assign(Object.assign({},(0,h.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:l,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,opacity:1,transition:"all ".concat(e.motionDurationMid),textAlign:"start",position:"relative",["&".concat(s,"-rtl")]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},["".concat(s,"-close-icon")]:{marginInlineStart:o,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),"&:hover":{color:e.colorTextHeading}},["&".concat(s,"-has-color")]:{borderColor:"transparent",["&, a, a:hover, ".concat(e.iconCls,"-close, ").concat(e.iconCls,"-close:hover")]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",["&:not(".concat(s,"-checkable-checked):hover")]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},["> ".concat(e.iconCls," + span, > span + ").concat(e.iconCls)]:{marginInlineStart:l}}),["".concat(s,"-borderless")]:{borderColor:"transparent",background:e.tagBorderlessBg}}},x=e=>{let{lineWidth:t,fontSizeIcon:r,calc:n}=e,s=e.fontSizeSM;return(0,p.TS)(e,{tagFontSize:s,tagLineHeight:(0,u.bf)(n(e.lineHeightSM).mul(s).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary})},v=e=>({defaultBg:new m.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var b=(0,g.I$)("Tag",e=>f(x(e)),v),y=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);st.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};let _=n.forwardRef((e,t)=>{let{prefixCls:r,style:s,className:a,checked:o,onChange:i,onClick:c}=e,u=y(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:m,tag:h}=n.useContext(d.E_),p=m("tag",r),[g,f,x]=b(p),v=l()(p,"".concat(p,"-checkable"),{["".concat(p,"-checkable-checked")]:o},null==h?void 0:h.className,a,f,x);return g(n.createElement("span",Object.assign({},u,{ref:t,style:Object.assign(Object.assign({},s),null==h?void 0:h.style),className:v,onClick:e=>{null==i||i(!o),null==c||c(e)}})))});var j=r(18536);let S=e=>(0,j.Z)(e,(t,r)=>{let{textColor:n,lightBorderColor:s,lightColor:a,darkColor:l}=r;return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:n,background:a,borderColor:s,"&-inverse":{color:e.colorTextLightSolid,background:l,borderColor:l},["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var C=(0,g.bk)(["Tag","preset"],e=>S(x(e)),v);let w=(e,t,r)=>{let n="string"!=typeof r?r:r.charAt(0).toUpperCase()+r.slice(1);return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:e["color".concat(r)],background:e["color".concat(n,"Bg")],borderColor:e["color".concat(n,"Border")],["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}};var A=(0,g.bk)(["Tag","status"],e=>{let t=x(e);return[w(t,"success","Success"),w(t,"processing","Info"),w(t,"error","Error"),w(t,"warning","Warning")]},v),N=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);st.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};let k=n.forwardRef((e,t)=>{let{prefixCls:r,className:a,rootClassName:u,style:m,children:h,icon:p,color:g,onClose:f,closeIcon:x,closable:v,bordered:y=!0}=e,_=N(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:j,direction:S,tag:w}=n.useContext(d.E_),[k,I]=n.useState(!0);n.useEffect(()=>{"visible"in _&&I(_.visible)},[_.visible]);let O=(0,o.o2)(g),z=(0,o.yT)(g),Z=O||z,R=Object.assign(Object.assign({backgroundColor:g&&!Z?g:void 0},null==w?void 0:w.style),m),E=j("tag",r),[F,T,M]=b(E),P=l()(E,null==w?void 0:w.className,{["".concat(E,"-").concat(g)]:Z,["".concat(E,"-has-color")]:g&&!Z,["".concat(E,"-hidden")]:!k,["".concat(E,"-rtl")]:"rtl"===S,["".concat(E,"-borderless")]:!y},a,u,T,M),D=e=>{e.stopPropagation(),null==f||f(e),e.defaultPrevented||I(!1)},[,L]=(0,i.Z)(v,x,e=>null===e?n.createElement(s.Z,{className:"".concat(E,"-close-icon"),onClick:D}):n.createElement("span",{className:"".concat(E,"-close-icon"),onClick:D},e),null,!1),V="function"==typeof _.onClick||h&&"a"===h.type,B=p||null,G=B?n.createElement(n.Fragment,null,B,h&&n.createElement("span",null,h)):h,H=n.createElement("span",Object.assign({},_,{ref:t,className:P,style:R}),G,L,O&&n.createElement(C,{key:"preset",prefixCls:E}),z&&n.createElement(A,{key:"status",prefixCls:E}));return F(V?n.createElement(c.Z,{component:"Tag"},H):H)});k.CheckableTag=_;var I=k},40728:function(e,t,r){"use strict";r.d(t,{C:function(){return n.Z},x:function(){return s.Z}});var n=r(41649),s=r(84264)},19130:function(e,t,r){"use strict";r.d(t,{RM:function(){return s.Z},SC:function(){return i.Z},iA:function(){return n.Z},pj:function(){return a.Z},ss:function(){return l.Z},xs:function(){return o.Z}});var n=r(21626),s=r(97214),a=r(28241),l=r(58834),o=r(69552),i=r(71876)},24601:function(){},18975:function(e,t,r){"use strict";var n=r(40257);r(24601);var s=r(2265),a=s&&"object"==typeof s&&"default"in s?s:{default:s},l=void 0!==n&&n.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},i=function(){function e(e){var t=void 0===e?{}:e,r=t.name,n=void 0===r?"stylesheet":r,s=t.optimizeForSpeed,a=void 0===s?l:s;c(o(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var i="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=i?i.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(l||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,r){return"number"==typeof r?e._serverSheet.cssRules[r]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),r},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t>>0},u={};function m(e,t){if(!t)return"jsx-"+e;var r=String(t),n=e+r;return u[n]||(u[n]="jsx-"+d(e+"-"+r)),u[n]}function h(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var r=e+t;return u[r]||(u[r]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[r]}var p=function(){function e(e){var t=void 0===e?{}:e,r=t.styleSheet,n=void 0===r?null:r,s=t.optimizeForSpeed,a=void 0!==s&&s;this._sheet=n||new i({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),n&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var r=this.getIdAndRules(e),n=r.styleId,s=r.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var a=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=a,this._instancesCounts[n]=1},t.remove=function(e){var t=this,r=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var n=this._fromServer&&this._fromServer[r];n?(n.parentNode.removeChild(n),delete this._fromServer[r]):(this._indices[r].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[r]),delete this._instancesCounts[r]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],r=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return r[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,r;return t=this.cssRules(),void 0===(r=e)&&(r={}),t.map(function(e){var t=e[0],n=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,r=e.dynamic,n=e.id;if(r){var s=m(n,r);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return h(s,e)}):[h(s,t)]}}return{styleId:m(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=s.createContext(null);g.displayName="StyleSheetContext";var f=a.default.useInsertionEffect||a.default.useLayoutEffect,x="undefined"!=typeof window?new p:void 0;function v(e){var t=x||s.useContext(g);return t&&("undefined"==typeof window?t.add(e):f(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},t.style=v},29:function(e,t,r){"use strict";e.exports=r(18975).style},6121:function(e,t,r){"use strict";r.r(t);var n=r(57437),s=r(39760),a=r(11318),l=r(2265),o=r(37801);t.default=()=>{let{token:e,accessToken:t,userRole:r,userId:i,premiumUser:c}=(0,s.Z)(),[d,u]=(0,l.useState)([]),{teams:m}=(0,a.Z)();return(0,n.jsx)(o.Z,{accessToken:t,token:e,userRole:r,userID:i,modelData:{data:[]},keys:d,setModelData:()=>{},premiumUser:c,teams:m})}},84376:function(e,t,r){"use strict";var n=r(57437);r(2265);var s=r(52787);t.Z=e=>{let{teams:t,value:r,onChange:a,disabled:l}=e;return console.log("disabled",l),(0,n.jsx)(s.default,{showSearch:!0,placeholder:"Search or select a team",value:r,onChange:a,disabled:l,filterOption:(e,r)=>{if(!r)return!1;let n=null==t?void 0:t.find(e=>e.team_id===r.key);if(!n)return!1;let s=e.toLowerCase().trim(),a=(n.team_alias||"").toLowerCase(),l=(n.team_id||"").toLowerCase();return a.includes(s)||l.includes(s)},optionFilterProp:"children",children:null==t?void 0:t.map(e=>(0,n.jsxs)(s.default.Option,{value:e.team_id,children:[(0,n.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,n.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})}},33860:function(e,t,r){"use strict";var n=r(57437),s=r(2265),a=r(13634),l=r(82680),o=r(52787),i=r(89970),c=r(73002),d=r(7310),u=r.n(d),m=r(19250);t.Z=e=>{let{isVisible:t,onCancel:r,onSubmit:d,accessToken:h,title:p="Add Team Member",roles:g=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:f="user"}=e,[x]=a.Z.useForm(),[v,b]=(0,s.useState)([]),[y,_]=(0,s.useState)(!1),[j,S]=(0,s.useState)("user_email"),C=async(e,t)=>{if(!e){b([]);return}_(!0);try{let r=new URLSearchParams;if(r.append(t,e),null==h)return;let n=(await (0,m.userFilterUICall)(h,r)).map(e=>({label:"user_email"===t?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===t?e.user_email:e.user_id,user:e}));b(n)}catch(e){console.error("Error fetching users:",e)}finally{_(!1)}},w=(0,s.useCallback)(u()((e,t)=>C(e,t),300),[]),A=(e,t)=>{S(t),w(e,t)},N=(e,t)=>{let r=t.user;x.setFieldsValue({user_email:r.user_email,user_id:r.user_id,role:x.getFieldValue("role")})};return(0,n.jsx)(l.Z,{title:p,open:t,onCancel:()=>{x.resetFields(),b([]),r()},footer:null,width:800,children:(0,n.jsxs)(a.Z,{form:x,onFinish:d,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:f},children:[(0,n.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,n.jsx)(o.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>A(e,"user_email"),onSelect:(e,t)=>N(e,t),options:"user_email"===j?v:[],loading:y,allowClear:!0})}),(0,n.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,n.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,n.jsx)(o.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>A(e,"user_id"),onSelect:(e,t)=>N(e,t),options:"user_id"===j?v:[],loading:y,allowClear:!0})}),(0,n.jsx)(a.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,n.jsx)(o.default,{defaultValue:f,children:g.map(e=>(0,n.jsx)(o.default.Option,{value:e.value,children:(0,n.jsxs)(i.Z,{title:e.description,children:[(0,n.jsx)("span",{className:"font-medium",children:e.label}),(0,n.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,n.jsx)("div",{className:"text-right mt-4",children:(0,n.jsx)(c.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})}},27799:function(e,t,r){"use strict";var n=r(57437);r(2265);var s=r(40728),a=r(82182),l=r(91777),o=r(97434);t.Z=function(e){let{loggingConfigs:t=[],disabledCallbacks:r=[],variant:i="card",className:c=""}=e,d=e=>{var t;return(null===(t=Object.entries(o.Lo).find(t=>{let[r,n]=t;return n===e}))||void 0===t?void 0:t[0])||e},u=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},m=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},h=(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(a.Z,{className:"h-4 w-4 text-blue-600"}),(0,n.jsx)(s.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,n.jsx)(s.C,{color:"blue",size:"xs",children:t.length})]}),t.length>0?(0,n.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>{var r;let l=d(e.callback_name),i=null===(r=o.Dg[l])||void 0===r?void 0:r.logo;return(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[i?(0,n.jsx)("img",{src:i,alt:l,className:"w-5 h-5 object-contain"}):(0,n.jsx)(a.Z,{className:"h-5 w-5 text-gray-400"}),(0,n.jsxs)("div",{children:[(0,n.jsx)(s.x,{className:"font-medium text-blue-800",children:l}),(0,n.jsxs)(s.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,n.jsx)(s.C,{color:u(e.callback_type),size:"sm",children:m(e.callback_type)})]},t)})}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(a.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(s.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.Z,{className:"h-4 w-4 text-red-600"}),(0,n.jsx)(s.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,n.jsx)(s.C,{color:"red",size:"xs",children:r.length})]}),r.length>0?(0,n.jsx)("div",{className:"space-y-3",children:r.map((e,t)=>{var r;let a=o.RD[e]||e,i=null===(r=o.Dg[a])||void 0===r?void 0:r.logo;return(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[i?(0,n.jsx)("img",{src:i,alt:a,className:"w-5 h-5 object-contain"}):(0,n.jsx)(l.Z,{className:"h-5 w-5 text-gray-400"}),(0,n.jsxs)("div",{children:[(0,n.jsx)(s.x,{className:"font-medium text-red-800",children:a}),(0,n.jsx)(s.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,n.jsx)(s.C,{color:"red",size:"sm",children:"Disabled"})]},t)})}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(l.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(s.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===i?(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(c),children:[(0,n.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(s.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,n.jsx)(s.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),h]}):(0,n.jsxs)("div",{className:"".concat(c),children:[(0,n.jsx)(s.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),h]})}},8048:function(e,t,r){"use strict";r.d(t,{C:function(){return u}});var n=r(57437),s=r(71594),a=r(24525),l=r(2265),o=r(19130),i=r(44633),c=r(86462),d=r(49084);function u(e){let{data:t=[],columns:r,isLoading:u=!1,table:m,defaultSorting:h=[]}=e,[p,g]=l.useState(h),[f]=l.useState("onChange"),[x,v]=l.useState({}),[b,y]=l.useState({}),_=(0,s.b7)({data:t,columns:r,state:{sorting:p,columnSizing:x,columnVisibility:b},columnResizeMode:f,onSortingChange:g,onColumnSizingChange:v,onColumnVisibilityChange:y,getCoreRowModel:(0,a.sC)(),getSortedRowModel:(0,a.tj)(),enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return l.useEffect(()=>{m&&(m.current=_)},[_,m]),(0,n.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsx)("div",{className:"relative min-w-full",children:(0,n.jsxs)(o.iA,{className:"[&_td]:py-2 [&_th]:py-2 w-full",children:[(0,n.jsx)(o.ss,{children:_.getHeaderGroups().map(e=>(0,n.jsx)(o.SC,{children:e.headers.map(e=>{var t;return(0,n.jsxs)(o.xs,{className:"py-1 h-8 relative ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.id?120:e.getSize(),position:"actions"===e.id?"sticky":"relative",right:"actions"===e.id?0:"auto"},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,s.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,n.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,n.jsx)(i.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,n.jsx)(c.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,n.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"absolute right-0 top-0 h-full w-2 cursor-col-resize select-none touch-none ".concat(e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200")})]},e.id)})},e.id))}),(0,n.jsx)(o.RM,{children:u?(0,n.jsx)(o.SC,{children:(0,n.jsx)(o.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"\uD83D\uDE85 Loading models..."})})})}):_.getRowModel().rows.length>0?_.getRowModel().rows.map(e=>(0,n.jsx)(o.SC,{children:e.getVisibleCells().map(e=>{var t;return(0,n.jsx)(o.pj,{className:"py-0.5 ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.column.id?120:e.column.getSize(),position:"actions"===e.column.id?"sticky":"relative",right:"actions"===e.column.id?0:"auto"},children:(0,s.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)):(0,n.jsx)(o.SC,{children:(0,n.jsx)(o.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"No models found"})})})})})]})})})})}},98015:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var n=r(57437),s=r(2265),a=r(92280),l=r(40728),o=r(79814),i=r(19250),c=function(e){let{vectorStores:t,accessToken:r}=e,[a,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{(async()=>{if(r&&0!==t.length)try{let e=await (0,i.vectorStoreListCall)(r);e.data&&c(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[r,t.length]);let d=e=>{let t=a.find(t=>t.vector_store_id===e);return t?"".concat(t.vector_store_name||t.vector_store_id," (").concat(t.vector_store_id,")"):e};return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(o.Z,{className:"h-4 w-4 text-blue-600"}),(0,n.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,n.jsx)(l.C,{color:"blue",size:"xs",children:t.length})]}),t.length>0?(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((e,t)=>(0,n.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:d(e)},t))}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(o.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},d=r(25327),u=r(86462),m=r(47686),h=r(89970),p=function(e){let{mcpServers:t,mcpAccessGroups:a=[],mcpToolPermissions:o={},accessToken:c}=e,[p,g]=(0,s.useState)([]),[f,x]=(0,s.useState)([]),[v,b]=(0,s.useState)(new Set),y=e=>{b(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})};(0,s.useEffect)(()=>{(async()=>{if(c&&t.length>0)try{let e=await (0,i.fetchMCPServers)(c);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[c,t.length]),(0,s.useEffect)(()=>{(async()=>{if(c&&a.length>0)try{let e=await Promise.resolve().then(r.bind(r,19250)).then(e=>e.fetchMCPAccessGroups(c));x(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[c,a.length]);let _=e=>{let t=p.find(t=>t.server_id===e);if(t){let r=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(t.alias," (").concat(r,")")}return e},j=e=>e,S=[...t.map(e=>({type:"server",value:e})),...a.map(e=>({type:"accessGroup",value:e}))],C=S.length;return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(d.Z,{className:"h-4 w-4 text-blue-600"}),(0,n.jsx)(l.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,n.jsx)(l.C,{color:"blue",size:"xs",children:C})]}),C>0?(0,n.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:S.map((e,t)=>{let r="server"===e.type?o[e.value]:void 0,s=r&&r.length>0,a=v.has(e.value);return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{onClick:()=>s&&y(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(s?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,n.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,n.jsx)(h.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,n.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,n.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)})]})}):(0,n.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,n.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:j(e.value)}),(0,n.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),s&&(0,n.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-gray-600",children:r.length}),(0,n.jsx)("span",{className:"text-xs text-gray-500",children:1===r.length?"tool":"tools"}),a?(0,n.jsx)(u.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,n.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),s&&a&&(0,n.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.map((e,t)=>(0,n.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},t))})})]},t)})}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:t,variant:r="card",className:s="",accessToken:l}=e,o=(null==t?void 0:t.vector_stores)||[],i=(null==t?void 0:t.mcp_servers)||[],d=(null==t?void 0:t.mcp_access_groups)||[],u=(null==t?void 0:t.mcp_tool_permissions)||{},m=(0,n.jsxs)("div",{className:"card"===r?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,n.jsx)(c,{vectorStores:o,accessToken:l}),(0,n.jsx)(p,{mcpServers:i,mcpAccessGroups:d,mcpToolPermissions:u,accessToken:l})]});return"card"===r?(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(s),children:[(0,n.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(a.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,n.jsx)(a.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),m]}):(0,n.jsxs)("div",{className:"".concat(s),children:[(0,n.jsx)(a.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),m]})}},42673:function(e,t,r){"use strict";var n,s;r.d(t,{Cl:function(){return n},bK:function(){return d},cd:function(){return o},dr:function(){return i},fK:function(){return a},ph:function(){return c}}),(s=n||(n={})).AIML="AI/ML API",s.Bedrock="Amazon Bedrock",s.Anthropic="Anthropic",s.AssemblyAI="AssemblyAI",s.SageMaker="AWS SageMaker",s.Azure="Azure",s.Azure_AI_Studio="Azure AI Foundry (Studio)",s.Cerebras="Cerebras",s.Cohere="Cohere",s.Dashscope="Dashscope",s.Databricks="Databricks (Qwen API)",s.DeepInfra="DeepInfra",s.Deepgram="Deepgram",s.Deepseek="Deepseek",s.ElevenLabs="ElevenLabs",s.FireworksAI="Fireworks AI",s.Google_AI_Studio="Google AI Studio",s.GradientAI="GradientAI",s.Groq="Groq",s.Hosted_Vllm="vllm",s.Infinity="Infinity",s.JinaAI="Jina AI",s.MistralAI="Mistral AI",s.Ollama="Ollama",s.OpenAI="OpenAI",s.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",s.OpenAI_Text="OpenAI Text Completion",s.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",s.Openrouter="Openrouter",s.Oracle="Oracle Cloud Infrastructure (OCI)",s.Perplexity="Perplexity",s.Sambanova="Sambanova",s.Snowflake="Snowflake",s.TogetherAI="TogetherAI",s.Triton="Triton",s.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",s.VolcEngine="VolcEngine",s.Voyage="Voyage AI",s.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},l="/ui/assets/logos/",o={"AI/ML API":"".concat(l,"aiml_api.svg"),Anthropic:"".concat(l,"anthropic.svg"),AssemblyAI:"".concat(l,"assemblyai_small.png"),Azure:"".concat(l,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(l,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(l,"bedrock.svg"),"AWS SageMaker":"".concat(l,"bedrock.svg"),Cerebras:"".concat(l,"cerebras.svg"),Cohere:"".concat(l,"cohere.svg"),"Databricks (Qwen API)":"".concat(l,"databricks.svg"),Dashscope:"".concat(l,"dashscope.svg"),Deepseek:"".concat(l,"deepseek.svg"),"Fireworks AI":"".concat(l,"fireworks.svg"),Groq:"".concat(l,"groq.svg"),"Google AI Studio":"".concat(l,"google.svg"),vllm:"".concat(l,"vllm.png"),Infinity:"".concat(l,"infinity.png"),"Mistral AI":"".concat(l,"mistral.svg"),Ollama:"".concat(l,"ollama.svg"),OpenAI:"".concat(l,"openai_small.svg"),"OpenAI Text Completion":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(l,"openai_small.svg"),Openrouter:"".concat(l,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(l,"oracle.svg"),Perplexity:"".concat(l,"perplexity-ai.svg"),Sambanova:"".concat(l,"sambanova.svg"),Snowflake:"".concat(l,"snowflake.svg"),TogetherAI:"".concat(l,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(l,"google.svg"),xAI:"".concat(l,"xai.svg"),GradientAI:"".concat(l,"gradientai.svg"),Triton:"".concat(l,"nvidia_triton.png"),Deepgram:"".concat(l,"deepgram.png"),ElevenLabs:"".concat(l,"elevenlabs.png"),"Voyage AI":"".concat(l,"voyage.webp"),"Jina AI":"".concat(l,"jina.png"),VolcEngine:"".concat(l,"volcengine.png"),DeepInfra:"".concat(l,"deepinfra.png")},i=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:o[e],displayName:e}}let t=Object.keys(a).find(t=>a[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let r=n[t];return{logo:o[r],displayName:r}},c=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},d=(e,t)=>{console.log("Provider key: ".concat(e));let r=a[e];console.log("Provider mapped to: ".concat(r));let n=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(e=>{let[t,s]=e;null!==s&&"object"==typeof s&&"litellm_provider"in s&&(s.litellm_provider===r||s.litellm_provider.includes(r))&&n.push(t)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(e=>{let[t,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"cohere_chat"===r.litellm_provider&&n.push(t)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(e=>{let[t,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"sagemaker_chat"===r.litellm_provider&&n.push(t)}))),n}},21425:function(e,t,r){"use strict";var n=r(57437);r(2265);var s=r(54507);t.Z=e=>{let{value:t,onChange:r,disabledCallbacks:a=[],onDisabledCallbacksChange:l}=e;return(0,n.jsx)(s.Z,{value:t,onChange:r,disabledCallbacks:a,onDisabledCallbacksChange:l})}},10901:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(57437),s=r(2265),a=r(13634),l=r(82680),o=r(73002),i=r(27281),c=r(57365),d=r(49566),u=r(92280),m=r(24199),h=e=>{var t,r,h;let{visible:p,onCancel:g,onSubmit:f,initialData:x,mode:v,config:b}=e,[y]=a.Z.useForm();console.log("Initial Data:",x),(0,s.useEffect)(()=>{if(p){if("edit"===v&&x){let e={...x,role:x.role||b.defaultRole,max_budget_in_team:x.max_budget_in_team||null,tpm_limit:x.tpm_limit||null,rpm_limit:x.rpm_limit||null};console.log("Setting form values:",e),y.setFieldsValue(e)}else{var e;y.resetFields(),y.setFieldsValue({role:b.defaultRole||(null===(e=b.roleOptions[0])||void 0===e?void 0:e.value)})}}},[p,x,v,y,b.defaultRole,b.roleOptions]);let _=async e=>{try{let t=Object.entries(e).reduce((e,t)=>{let[r,n]=t;if("string"==typeof n){let t=n.trim();return""===t&&("max_budget_in_team"===r||"tpm_limit"===r||"rpm_limit"===r)?{...e,[r]:null}:{...e,[r]:t}}return{...e,[r]:n}},{});console.log("Submitting form data:",t),f(t),y.resetFields()}catch(e){console.error("Form submission error:",e)}},j=e=>{switch(e.type){case"input":return(0,n.jsx)(d.Z,{placeholder:e.placeholder});case"numerical":return(0,n.jsx)(m.Z,{step:e.step||1,min:e.min||0,style:{width:"100%"},placeholder:e.placeholder||"Enter a numerical value"});case"select":var t;return(0,n.jsx)(i.Z,{children:null===(t=e.options)||void 0===t?void 0:t.map(e=>(0,n.jsx)(c.Z,{value:e.value,children:e.label},e.value))});default:return null}};return(0,n.jsx)(l.Z,{title:b.title||("add"===v?"Add Member":"Edit Member"),open:p,width:1e3,footer:null,onCancel:g,children:(0,n.jsxs)(a.Z,{form:y,onFinish:_,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[b.showEmail&&(0,n.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,n.jsx)(d.Z,{placeholder:"user@example.com"})}),b.showEmail&&b.showUserId&&(0,n.jsx)("div",{className:"text-center mb-4",children:(0,n.jsx)(u.x,{children:"OR"})}),b.showUserId&&(0,n.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,n.jsx)(d.Z,{placeholder:"user_123"})}),(0,n.jsx)(a.Z.Item,{label:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{children:"Role"}),"edit"===v&&x&&(0,n.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(r=x.role,(null===(h=b.roleOptions.find(e=>e.value===r))||void 0===h?void 0:h.label)||r),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,n.jsx)(i.Z,{children:"edit"===v&&x?[...b.roleOptions.filter(e=>e.value===x.role),...b.roleOptions.filter(e=>e.value!==x.role)].map(e=>(0,n.jsx)(c.Z,{value:e.value,children:e.label},e.value)):b.roleOptions.map(e=>(0,n.jsx)(c.Z,{value:e.value,children:e.label},e.value))})}),null===(t=b.additionalFields)||void 0===t?void 0:t.map(e=>(0,n.jsx)(a.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:j(e)},e.name)),(0,n.jsxs)("div",{className:"text-right mt-6",children:[(0,n.jsx)(o.ZP,{onClick:g,className:"mr-2",children:"Cancel"}),(0,n.jsx)(o.ZP,{type:"default",htmlType:"submit",children:"add"===v?"Add Member":"Save Changes"})]})]})})}},44633:function(e,t,r){"use strict";var n=r(2265);let s=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=s},49084:function(e,t,r){"use strict";var n=r(2265);let s=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=s}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,6202,2344,3669,1487,5105,4851,9429,8049,131,2012,7801,2971,2117,1744],function(){return e(e.s=18530)}),_N_E=e.O()}]); -======== -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1664],{18530:function(e,t,r){Promise.resolve().then(r.bind(r,6121))},12660:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),s=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},l=r(55015),o=s.forwardRef(function(e,t){return s.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},5540:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),s=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},l=r(55015),o=s.forwardRef(function(e,t){return s.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},3810:function(e,t,r){"use strict";r.d(t,{Z:function(){return I}});var n=r(2265),s=r(49638),a=r(36760),l=r.n(a),o=r(93350),i=r(53445),c=r(6694),d=r(71744),u=r(352),m=r(36360),h=r(12918),p=r(3104),g=r(80669);let f=e=>{let{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:s,calc:a}=e,l=a(n).sub(r).equal(),o=a(t).sub(r).equal();return{[s]:Object.assign(Object.assign({},(0,h.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:l,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,opacity:1,transition:"all ".concat(e.motionDurationMid),textAlign:"start",position:"relative",["&".concat(s,"-rtl")]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},["".concat(s,"-close-icon")]:{marginInlineStart:o,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),"&:hover":{color:e.colorTextHeading}},["&".concat(s,"-has-color")]:{borderColor:"transparent",["&, a, a:hover, ".concat(e.iconCls,"-close, ").concat(e.iconCls,"-close:hover")]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",["&:not(".concat(s,"-checkable-checked):hover")]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},["> ".concat(e.iconCls," + span, > span + ").concat(e.iconCls)]:{marginInlineStart:l}}),["".concat(s,"-borderless")]:{borderColor:"transparent",background:e.tagBorderlessBg}}},x=e=>{let{lineWidth:t,fontSizeIcon:r,calc:n}=e,s=e.fontSizeSM;return(0,p.TS)(e,{tagFontSize:s,tagLineHeight:(0,u.bf)(n(e.lineHeightSM).mul(s).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary})},v=e=>({defaultBg:new m.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var b=(0,g.I$)("Tag",e=>f(x(e)),v),y=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);st.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};let _=n.forwardRef((e,t)=>{let{prefixCls:r,style:s,className:a,checked:o,onChange:i,onClick:c}=e,u=y(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:m,tag:h}=n.useContext(d.E_),p=m("tag",r),[g,f,x]=b(p),v=l()(p,"".concat(p,"-checkable"),{["".concat(p,"-checkable-checked")]:o},null==h?void 0:h.className,a,f,x);return g(n.createElement("span",Object.assign({},u,{ref:t,style:Object.assign(Object.assign({},s),null==h?void 0:h.style),className:v,onClick:e=>{null==i||i(!o),null==c||c(e)}})))});var j=r(18536);let S=e=>(0,j.Z)(e,(t,r)=>{let{textColor:n,lightBorderColor:s,lightColor:a,darkColor:l}=r;return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:n,background:a,borderColor:s,"&-inverse":{color:e.colorTextLightSolid,background:l,borderColor:l},["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var C=(0,g.bk)(["Tag","preset"],e=>S(x(e)),v);let w=(e,t,r)=>{let n="string"!=typeof r?r:r.charAt(0).toUpperCase()+r.slice(1);return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:e["color".concat(r)],background:e["color".concat(n,"Bg")],borderColor:e["color".concat(n,"Border")],["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}};var A=(0,g.bk)(["Tag","status"],e=>{let t=x(e);return[w(t,"success","Success"),w(t,"processing","Info"),w(t,"error","Error"),w(t,"warning","Warning")]},v),N=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);st.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};let k=n.forwardRef((e,t)=>{let{prefixCls:r,className:a,rootClassName:u,style:m,children:h,icon:p,color:g,onClose:f,closeIcon:x,closable:v,bordered:y=!0}=e,_=N(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:j,direction:S,tag:w}=n.useContext(d.E_),[k,I]=n.useState(!0);n.useEffect(()=>{"visible"in _&&I(_.visible)},[_.visible]);let O=(0,o.o2)(g),z=(0,o.yT)(g),Z=O||z,R=Object.assign(Object.assign({backgroundColor:g&&!Z?g:void 0},null==w?void 0:w.style),m),E=j("tag",r),[F,T,M]=b(E),P=l()(E,null==w?void 0:w.className,{["".concat(E,"-").concat(g)]:Z,["".concat(E,"-has-color")]:g&&!Z,["".concat(E,"-hidden")]:!k,["".concat(E,"-rtl")]:"rtl"===S,["".concat(E,"-borderless")]:!y},a,u,T,M),D=e=>{e.stopPropagation(),null==f||f(e),e.defaultPrevented||I(!1)},[,L]=(0,i.Z)(v,x,e=>null===e?n.createElement(s.Z,{className:"".concat(E,"-close-icon"),onClick:D}):n.createElement("span",{className:"".concat(E,"-close-icon"),onClick:D},e),null,!1),V="function"==typeof _.onClick||h&&"a"===h.type,B=p||null,G=B?n.createElement(n.Fragment,null,B,h&&n.createElement("span",null,h)):h,H=n.createElement("span",Object.assign({},_,{ref:t,className:P,style:R}),G,L,O&&n.createElement(C,{key:"preset",prefixCls:E}),z&&n.createElement(A,{key:"status",prefixCls:E}));return F(V?n.createElement(c.Z,{component:"Tag"},H):H)});k.CheckableTag=_;var I=k},40728:function(e,t,r){"use strict";r.d(t,{C:function(){return n.Z},x:function(){return s.Z}});var n=r(41649),s=r(84264)},19130:function(e,t,r){"use strict";r.d(t,{RM:function(){return s.Z},SC:function(){return i.Z},iA:function(){return n.Z},pj:function(){return a.Z},ss:function(){return l.Z},xs:function(){return o.Z}});var n=r(21626),s=r(97214),a=r(28241),l=r(58834),o=r(69552),i=r(71876)},24601:function(){},18975:function(e,t,r){"use strict";var n=r(40257);r(24601);var s=r(2265),a=s&&"object"==typeof s&&"default"in s?s:{default:s},l=void 0!==n&&n.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},i=function(){function e(e){var t=void 0===e?{}:e,r=t.name,n=void 0===r?"stylesheet":r,s=t.optimizeForSpeed,a=void 0===s?l:s;c(o(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var i="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=i?i.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(l||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,r){return"number"==typeof r?e._serverSheet.cssRules[r]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),r},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t>>0},u={};function m(e,t){if(!t)return"jsx-"+e;var r=String(t),n=e+r;return u[n]||(u[n]="jsx-"+d(e+"-"+r)),u[n]}function h(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var r=e+t;return u[r]||(u[r]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[r]}var p=function(){function e(e){var t=void 0===e?{}:e,r=t.styleSheet,n=void 0===r?null:r,s=t.optimizeForSpeed,a=void 0!==s&&s;this._sheet=n||new i({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),n&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var r=this.getIdAndRules(e),n=r.styleId,s=r.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var a=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=a,this._instancesCounts[n]=1},t.remove=function(e){var t=this,r=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var n=this._fromServer&&this._fromServer[r];n?(n.parentNode.removeChild(n),delete this._fromServer[r]):(this._indices[r].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[r]),delete this._instancesCounts[r]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],r=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return r[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,r;return t=this.cssRules(),void 0===(r=e)&&(r={}),t.map(function(e){var t=e[0],n=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,r=e.dynamic,n=e.id;if(r){var s=m(n,r);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return h(s,e)}):[h(s,t)]}}return{styleId:m(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=s.createContext(null);g.displayName="StyleSheetContext";var f=a.default.useInsertionEffect||a.default.useLayoutEffect,x="undefined"!=typeof window?new p:void 0;function v(e){var t=x||s.useContext(g);return t&&("undefined"==typeof window?t.add(e):f(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},t.style=v},29:function(e,t,r){"use strict";e.exports=r(18975).style},6121:function(e,t,r){"use strict";r.r(t);var n=r(57437),s=r(39760),a=r(11318),l=r(2265),o=r(37801);t.default=()=>{let{token:e,accessToken:t,userRole:r,userId:i,premiumUser:c}=(0,s.Z)(),[d,u]=(0,l.useState)([]),{teams:m}=(0,a.Z)();return(0,n.jsx)(o.Z,{accessToken:t,token:e,userRole:r,userID:i,modelData:{data:[]},keys:d,setModelData:()=>{},premiumUser:c,teams:m})}},84376:function(e,t,r){"use strict";var n=r(57437);r(2265);var s=r(52787);t.Z=e=>{let{teams:t,value:r,onChange:a,disabled:l}=e;return console.log("disabled",l),(0,n.jsx)(s.default,{showSearch:!0,placeholder:"Search or select a team",value:r,onChange:a,disabled:l,filterOption:(e,r)=>{if(!r)return!1;let n=null==t?void 0:t.find(e=>e.team_id===r.key);if(!n)return!1;let s=e.toLowerCase().trim(),a=(n.team_alias||"").toLowerCase(),l=(n.team_id||"").toLowerCase();return a.includes(s)||l.includes(s)},optionFilterProp:"children",children:null==t?void 0:t.map(e=>(0,n.jsxs)(s.default.Option,{value:e.team_id,children:[(0,n.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,n.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})}},33860:function(e,t,r){"use strict";var n=r(57437),s=r(2265),a=r(13634),l=r(82680),o=r(52787),i=r(89970),c=r(73002),d=r(7310),u=r.n(d),m=r(19250);t.Z=e=>{let{isVisible:t,onCancel:r,onSubmit:d,accessToken:h,title:p="Add Team Member",roles:g=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:f="user"}=e,[x]=a.Z.useForm(),[v,b]=(0,s.useState)([]),[y,_]=(0,s.useState)(!1),[j,S]=(0,s.useState)("user_email"),C=async(e,t)=>{if(!e){b([]);return}_(!0);try{let r=new URLSearchParams;if(r.append(t,e),null==h)return;let n=(await (0,m.userFilterUICall)(h,r)).map(e=>({label:"user_email"===t?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===t?e.user_email:e.user_id,user:e}));b(n)}catch(e){console.error("Error fetching users:",e)}finally{_(!1)}},w=(0,s.useCallback)(u()((e,t)=>C(e,t),300),[]),A=(e,t)=>{S(t),w(e,t)},N=(e,t)=>{let r=t.user;x.setFieldsValue({user_email:r.user_email,user_id:r.user_id,role:x.getFieldValue("role")})};return(0,n.jsx)(l.Z,{title:p,open:t,onCancel:()=>{x.resetFields(),b([]),r()},footer:null,width:800,children:(0,n.jsxs)(a.Z,{form:x,onFinish:d,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:f},children:[(0,n.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,n.jsx)(o.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>A(e,"user_email"),onSelect:(e,t)=>N(e,t),options:"user_email"===j?v:[],loading:y,allowClear:!0})}),(0,n.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,n.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,n.jsx)(o.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>A(e,"user_id"),onSelect:(e,t)=>N(e,t),options:"user_id"===j?v:[],loading:y,allowClear:!0})}),(0,n.jsx)(a.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,n.jsx)(o.default,{defaultValue:f,children:g.map(e=>(0,n.jsx)(o.default.Option,{value:e.value,children:(0,n.jsxs)(i.Z,{title:e.description,children:[(0,n.jsx)("span",{className:"font-medium",children:e.label}),(0,n.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,n.jsx)("div",{className:"text-right mt-4",children:(0,n.jsx)(c.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})}},27799:function(e,t,r){"use strict";var n=r(57437);r(2265);var s=r(40728),a=r(82182),l=r(91777),o=r(97434);t.Z=function(e){let{loggingConfigs:t=[],disabledCallbacks:r=[],variant:i="card",className:c=""}=e,d=e=>{var t;return(null===(t=Object.entries(o.Lo).find(t=>{let[r,n]=t;return n===e}))||void 0===t?void 0:t[0])||e},u=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},m=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},h=(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(a.Z,{className:"h-4 w-4 text-blue-600"}),(0,n.jsx)(s.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,n.jsx)(s.C,{color:"blue",size:"xs",children:t.length})]}),t.length>0?(0,n.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>{var r;let l=d(e.callback_name),i=null===(r=o.Dg[l])||void 0===r?void 0:r.logo;return(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[i?(0,n.jsx)("img",{src:i,alt:l,className:"w-5 h-5 object-contain"}):(0,n.jsx)(a.Z,{className:"h-5 w-5 text-gray-400"}),(0,n.jsxs)("div",{children:[(0,n.jsx)(s.x,{className:"font-medium text-blue-800",children:l}),(0,n.jsxs)(s.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,n.jsx)(s.C,{color:u(e.callback_type),size:"sm",children:m(e.callback_type)})]},t)})}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(a.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(s.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.Z,{className:"h-4 w-4 text-red-600"}),(0,n.jsx)(s.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,n.jsx)(s.C,{color:"red",size:"xs",children:r.length})]}),r.length>0?(0,n.jsx)("div",{className:"space-y-3",children:r.map((e,t)=>{var r;let a=o.RD[e]||e,i=null===(r=o.Dg[a])||void 0===r?void 0:r.logo;return(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[i?(0,n.jsx)("img",{src:i,alt:a,className:"w-5 h-5 object-contain"}):(0,n.jsx)(l.Z,{className:"h-5 w-5 text-gray-400"}),(0,n.jsxs)("div",{children:[(0,n.jsx)(s.x,{className:"font-medium text-red-800",children:a}),(0,n.jsx)(s.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,n.jsx)(s.C,{color:"red",size:"sm",children:"Disabled"})]},t)})}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(l.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(s.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===i?(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(c),children:[(0,n.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(s.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,n.jsx)(s.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),h]}):(0,n.jsxs)("div",{className:"".concat(c),children:[(0,n.jsx)(s.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),h]})}},8048:function(e,t,r){"use strict";r.d(t,{C:function(){return u}});var n=r(57437),s=r(71594),a=r(24525),l=r(2265),o=r(19130),i=r(44633),c=r(86462),d=r(49084);function u(e){let{data:t=[],columns:r,isLoading:u=!1,table:m,defaultSorting:h=[]}=e,[p,g]=l.useState(h),[f]=l.useState("onChange"),[x,v]=l.useState({}),[b,y]=l.useState({}),_=(0,s.b7)({data:t,columns:r,state:{sorting:p,columnSizing:x,columnVisibility:b},columnResizeMode:f,onSortingChange:g,onColumnSizingChange:v,onColumnVisibilityChange:y,getCoreRowModel:(0,a.sC)(),getSortedRowModel:(0,a.tj)(),enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return l.useEffect(()=>{m&&(m.current=_)},[_,m]),(0,n.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsx)("div",{className:"relative min-w-full",children:(0,n.jsxs)(o.iA,{className:"[&_td]:py-2 [&_th]:py-2 w-full",children:[(0,n.jsx)(o.ss,{children:_.getHeaderGroups().map(e=>(0,n.jsx)(o.SC,{children:e.headers.map(e=>{var t;return(0,n.jsxs)(o.xs,{className:"py-1 h-8 relative ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.id?120:e.getSize(),position:"actions"===e.id?"sticky":"relative",right:"actions"===e.id?0:"auto"},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,s.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,n.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,n.jsx)(i.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,n.jsx)(c.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,n.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"absolute right-0 top-0 h-full w-2 cursor-col-resize select-none touch-none ".concat(e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200")})]},e.id)})},e.id))}),(0,n.jsx)(o.RM,{children:u?(0,n.jsx)(o.SC,{children:(0,n.jsx)(o.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"\uD83D\uDE85 Loading models..."})})})}):_.getRowModel().rows.length>0?_.getRowModel().rows.map(e=>(0,n.jsx)(o.SC,{children:e.getVisibleCells().map(e=>{var t;return(0,n.jsx)(o.pj,{className:"py-0.5 ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.column.id?120:e.column.getSize(),position:"actions"===e.column.id?"sticky":"relative",right:"actions"===e.column.id?0:"auto"},children:(0,s.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)):(0,n.jsx)(o.SC,{children:(0,n.jsx)(o.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"No models found"})})})})})]})})})})}},98015:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var n=r(57437),s=r(2265),a=r(92280),l=r(40728),o=r(79814),i=r(19250),c=function(e){let{vectorStores:t,accessToken:r}=e,[a,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{(async()=>{if(r&&0!==t.length)try{let e=await (0,i.vectorStoreListCall)(r);e.data&&c(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[r,t.length]);let d=e=>{let t=a.find(t=>t.vector_store_id===e);return t?"".concat(t.vector_store_name||t.vector_store_id," (").concat(t.vector_store_id,")"):e};return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(o.Z,{className:"h-4 w-4 text-blue-600"}),(0,n.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,n.jsx)(l.C,{color:"blue",size:"xs",children:t.length})]}),t.length>0?(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((e,t)=>(0,n.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:d(e)},t))}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(o.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},d=r(25327),u=r(86462),m=r(47686),h=r(89970),p=function(e){let{mcpServers:t,mcpAccessGroups:a=[],mcpToolPermissions:o={},accessToken:c}=e,[p,g]=(0,s.useState)([]),[f,x]=(0,s.useState)([]),[v,b]=(0,s.useState)(new Set),y=e=>{b(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})};(0,s.useEffect)(()=>{(async()=>{if(c&&t.length>0)try{let e=await (0,i.fetchMCPServers)(c);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[c,t.length]),(0,s.useEffect)(()=>{(async()=>{if(c&&a.length>0)try{let e=await Promise.resolve().then(r.bind(r,19250)).then(e=>e.fetchMCPAccessGroups(c));x(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[c,a.length]);let _=e=>{let t=p.find(t=>t.server_id===e);if(t){let r=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(t.alias," (").concat(r,")")}return e},j=e=>e,S=[...t.map(e=>({type:"server",value:e})),...a.map(e=>({type:"accessGroup",value:e}))],C=S.length;return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(d.Z,{className:"h-4 w-4 text-blue-600"}),(0,n.jsx)(l.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,n.jsx)(l.C,{color:"blue",size:"xs",children:C})]}),C>0?(0,n.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:S.map((e,t)=>{let r="server"===e.type?o[e.value]:void 0,s=r&&r.length>0,a=v.has(e.value);return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{onClick:()=>s&&y(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(s?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,n.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,n.jsx)(h.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,n.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,n.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)})]})}):(0,n.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,n.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:j(e.value)}),(0,n.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),s&&(0,n.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-gray-600",children:r.length}),(0,n.jsx)("span",{className:"text-xs text-gray-500",children:1===r.length?"tool":"tools"}),a?(0,n.jsx)(u.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,n.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),s&&a&&(0,n.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.map((e,t)=>(0,n.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},t))})})]},t)})}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:t,variant:r="card",className:s="",accessToken:l}=e,o=(null==t?void 0:t.vector_stores)||[],i=(null==t?void 0:t.mcp_servers)||[],d=(null==t?void 0:t.mcp_access_groups)||[],u=(null==t?void 0:t.mcp_tool_permissions)||{},m=(0,n.jsxs)("div",{className:"card"===r?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,n.jsx)(c,{vectorStores:o,accessToken:l}),(0,n.jsx)(p,{mcpServers:i,mcpAccessGroups:d,mcpToolPermissions:u,accessToken:l})]});return"card"===r?(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(s),children:[(0,n.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(a.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,n.jsx)(a.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),m]}):(0,n.jsxs)("div",{className:"".concat(s),children:[(0,n.jsx)(a.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),m]})}},42673:function(e,t,r){"use strict";var n,s;r.d(t,{Cl:function(){return n},bK:function(){return d},cd:function(){return o},dr:function(){return i},fK:function(){return a},ph:function(){return c}}),(s=n||(n={})).AIML="AI/ML API",s.Bedrock="Amazon Bedrock",s.Anthropic="Anthropic",s.AssemblyAI="AssemblyAI",s.SageMaker="AWS SageMaker",s.Azure="Azure",s.Azure_AI_Studio="Azure AI Foundry (Studio)",s.Cerebras="Cerebras",s.Cohere="Cohere",s.Dashscope="Dashscope",s.Databricks="Databricks (Qwen API)",s.DeepInfra="DeepInfra",s.Deepgram="Deepgram",s.Deepseek="Deepseek",s.ElevenLabs="ElevenLabs",s.FireworksAI="Fireworks AI",s.Google_AI_Studio="Google AI Studio",s.GradientAI="GradientAI",s.Groq="Groq",s.Hosted_Vllm="vllm",s.Infinity="Infinity",s.JinaAI="Jina AI",s.MistralAI="Mistral AI",s.Ollama="Ollama",s.OpenAI="OpenAI",s.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",s.OpenAI_Text="OpenAI Text Completion",s.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",s.Openrouter="Openrouter",s.Oracle="Oracle Cloud Infrastructure (OCI)",s.Perplexity="Perplexity",s.Sambanova="Sambanova",s.Snowflake="Snowflake",s.TogetherAI="TogetherAI",s.Triton="Triton",s.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",s.VolcEngine="VolcEngine",s.Voyage="Voyage AI",s.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},l="/ui/assets/logos/",o={"AI/ML API":"".concat(l,"aiml_api.svg"),Anthropic:"".concat(l,"anthropic.svg"),AssemblyAI:"".concat(l,"assemblyai_small.png"),Azure:"".concat(l,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(l,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(l,"bedrock.svg"),"AWS SageMaker":"".concat(l,"bedrock.svg"),Cerebras:"".concat(l,"cerebras.svg"),Cohere:"".concat(l,"cohere.svg"),"Databricks (Qwen API)":"".concat(l,"databricks.svg"),Dashscope:"".concat(l,"dashscope.svg"),Deepseek:"".concat(l,"deepseek.svg"),"Fireworks AI":"".concat(l,"fireworks.svg"),Groq:"".concat(l,"groq.svg"),"Google AI Studio":"".concat(l,"google.svg"),vllm:"".concat(l,"vllm.png"),Infinity:"".concat(l,"infinity.png"),"Mistral AI":"".concat(l,"mistral.svg"),Ollama:"".concat(l,"ollama.svg"),OpenAI:"".concat(l,"openai_small.svg"),"OpenAI Text Completion":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(l,"openai_small.svg"),Openrouter:"".concat(l,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(l,"oracle.svg"),Perplexity:"".concat(l,"perplexity-ai.svg"),Sambanova:"".concat(l,"sambanova.svg"),Snowflake:"".concat(l,"snowflake.svg"),TogetherAI:"".concat(l,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(l,"google.svg"),xAI:"".concat(l,"xai.svg"),GradientAI:"".concat(l,"gradientai.svg"),Triton:"".concat(l,"nvidia_triton.png"),Deepgram:"".concat(l,"deepgram.png"),ElevenLabs:"".concat(l,"elevenlabs.png"),"Voyage AI":"".concat(l,"voyage.webp"),"Jina AI":"".concat(l,"jina.png"),VolcEngine:"".concat(l,"volcengine.png"),DeepInfra:"".concat(l,"deepinfra.png")},i=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:o[e],displayName:e}}let t=Object.keys(a).find(t=>a[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let r=n[t];return{logo:o[r],displayName:r}},c=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},d=(e,t)=>{console.log("Provider key: ".concat(e));let r=a[e];console.log("Provider mapped to: ".concat(r));let n=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(e=>{let[t,s]=e;null!==s&&"object"==typeof s&&"litellm_provider"in s&&(s.litellm_provider===r||s.litellm_provider.includes(r))&&n.push(t)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(e=>{let[t,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"cohere_chat"===r.litellm_provider&&n.push(t)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(e=>{let[t,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"sagemaker_chat"===r.litellm_provider&&n.push(t)}))),n}},21425:function(e,t,r){"use strict";var n=r(57437);r(2265);var s=r(54507);t.Z=e=>{let{value:t,onChange:r,disabledCallbacks:a=[],onDisabledCallbacksChange:l}=e;return(0,n.jsx)(s.Z,{value:t,onChange:r,disabledCallbacks:a,onDisabledCallbacksChange:l})}},10901:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(57437),s=r(2265),a=r(13634),l=r(82680),o=r(73002),i=r(27281),c=r(57365),d=r(49566),u=r(92280),m=r(24199),h=e=>{var t,r,h;let{visible:p,onCancel:g,onSubmit:f,initialData:x,mode:v,config:b}=e,[y]=a.Z.useForm();console.log("Initial Data:",x),(0,s.useEffect)(()=>{if(p){if("edit"===v&&x){let e={...x,role:x.role||b.defaultRole,max_budget_in_team:x.max_budget_in_team||null,tpm_limit:x.tpm_limit||null,rpm_limit:x.rpm_limit||null};console.log("Setting form values:",e),y.setFieldsValue(e)}else{var e;y.resetFields(),y.setFieldsValue({role:b.defaultRole||(null===(e=b.roleOptions[0])||void 0===e?void 0:e.value)})}}},[p,x,v,y,b.defaultRole,b.roleOptions]);let _=async e=>{try{let t=Object.entries(e).reduce((e,t)=>{let[r,n]=t;if("string"==typeof n){let t=n.trim();return""===t&&("max_budget_in_team"===r||"tpm_limit"===r||"rpm_limit"===r)?{...e,[r]:null}:{...e,[r]:t}}return{...e,[r]:n}},{});console.log("Submitting form data:",t),f(t),y.resetFields()}catch(e){console.error("Form submission error:",e)}},j=e=>{switch(e.type){case"input":return(0,n.jsx)(d.Z,{placeholder:e.placeholder});case"numerical":return(0,n.jsx)(m.Z,{step:e.step||1,min:e.min||0,style:{width:"100%"},placeholder:e.placeholder||"Enter a numerical value"});case"select":var t;return(0,n.jsx)(i.Z,{children:null===(t=e.options)||void 0===t?void 0:t.map(e=>(0,n.jsx)(c.Z,{value:e.value,children:e.label},e.value))});default:return null}};return(0,n.jsx)(l.Z,{title:b.title||("add"===v?"Add Member":"Edit Member"),open:p,width:1e3,footer:null,onCancel:g,children:(0,n.jsxs)(a.Z,{form:y,onFinish:_,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[b.showEmail&&(0,n.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,n.jsx)(d.Z,{placeholder:"user@example.com"})}),b.showEmail&&b.showUserId&&(0,n.jsx)("div",{className:"text-center mb-4",children:(0,n.jsx)(u.x,{children:"OR"})}),b.showUserId&&(0,n.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,n.jsx)(d.Z,{placeholder:"user_123"})}),(0,n.jsx)(a.Z.Item,{label:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{children:"Role"}),"edit"===v&&x&&(0,n.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(r=x.role,(null===(h=b.roleOptions.find(e=>e.value===r))||void 0===h?void 0:h.label)||r),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,n.jsx)(i.Z,{children:"edit"===v&&x?[...b.roleOptions.filter(e=>e.value===x.role),...b.roleOptions.filter(e=>e.value!==x.role)].map(e=>(0,n.jsx)(c.Z,{value:e.value,children:e.label},e.value)):b.roleOptions.map(e=>(0,n.jsx)(c.Z,{value:e.value,children:e.label},e.value))})}),null===(t=b.additionalFields)||void 0===t?void 0:t.map(e=>(0,n.jsx)(a.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:j(e)},e.name)),(0,n.jsxs)("div",{className:"text-right mt-6",children:[(0,n.jsx)(o.ZP,{onClick:g,className:"mr-2",children:"Cancel"}),(0,n.jsx)(o.ZP,{type:"default",htmlType:"submit",children:"add"===v?"Add Member":"Save Changes"})]})]})})}},44633:function(e,t,r){"use strict";var n=r(2265);let s=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=s},49084:function(e,t,r){"use strict";var n=r(2265);let s=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=s}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,6202,2344,3669,1487,5105,4851,9429,8049,1633,2012,7801,2971,2117,1744],function(){return e(e.s=18530)}),_N_E=e.O()}]); ->>>>>>>> ef0d6f0207 (Resolve conflicts in generated HTML files):litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-50ce8c6bb2821738.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-5b4a740f9549ae1e.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-5b4a740f9549ae1e.js new file mode 100644 index 0000000000..941de3c498 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-5b4a740f9549ae1e.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1664],{18530:function(e,t,r){Promise.resolve().then(r.bind(r,6121))},12660:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),s=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},l=r(55015),o=s.forwardRef(function(e,t){return s.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},5540:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),s=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},l=r(55015),o=s.forwardRef(function(e,t){return s.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},3810:function(e,t,r){"use strict";r.d(t,{Z:function(){return I}});var n=r(2265),s=r(49638),a=r(36760),l=r.n(a),o=r(93350),i=r(53445),c=r(6694),d=r(71744),u=r(352),m=r(36360),h=r(12918),p=r(3104),g=r(80669);let f=e=>{let{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:s,calc:a}=e,l=a(n).sub(r).equal(),o=a(t).sub(r).equal();return{[s]:Object.assign(Object.assign({},(0,h.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:l,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,opacity:1,transition:"all ".concat(e.motionDurationMid),textAlign:"start",position:"relative",["&".concat(s,"-rtl")]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},["".concat(s,"-close-icon")]:{marginInlineStart:o,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),"&:hover":{color:e.colorTextHeading}},["&".concat(s,"-has-color")]:{borderColor:"transparent",["&, a, a:hover, ".concat(e.iconCls,"-close, ").concat(e.iconCls,"-close:hover")]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",["&:not(".concat(s,"-checkable-checked):hover")]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},["> ".concat(e.iconCls," + span, > span + ").concat(e.iconCls)]:{marginInlineStart:l}}),["".concat(s,"-borderless")]:{borderColor:"transparent",background:e.tagBorderlessBg}}},x=e=>{let{lineWidth:t,fontSizeIcon:r,calc:n}=e,s=e.fontSizeSM;return(0,p.TS)(e,{tagFontSize:s,tagLineHeight:(0,u.bf)(n(e.lineHeightSM).mul(s).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary})},v=e=>({defaultBg:new m.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var b=(0,g.I$)("Tag",e=>f(x(e)),v),y=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);st.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};let _=n.forwardRef((e,t)=>{let{prefixCls:r,style:s,className:a,checked:o,onChange:i,onClick:c}=e,u=y(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:m,tag:h}=n.useContext(d.E_),p=m("tag",r),[g,f,x]=b(p),v=l()(p,"".concat(p,"-checkable"),{["".concat(p,"-checkable-checked")]:o},null==h?void 0:h.className,a,f,x);return g(n.createElement("span",Object.assign({},u,{ref:t,style:Object.assign(Object.assign({},s),null==h?void 0:h.style),className:v,onClick:e=>{null==i||i(!o),null==c||c(e)}})))});var j=r(18536);let S=e=>(0,j.Z)(e,(t,r)=>{let{textColor:n,lightBorderColor:s,lightColor:a,darkColor:l}=r;return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:n,background:a,borderColor:s,"&-inverse":{color:e.colorTextLightSolid,background:l,borderColor:l},["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var C=(0,g.bk)(["Tag","preset"],e=>S(x(e)),v);let w=(e,t,r)=>{let n="string"!=typeof r?r:r.charAt(0).toUpperCase()+r.slice(1);return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:e["color".concat(r)],background:e["color".concat(n,"Bg")],borderColor:e["color".concat(n,"Border")],["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}};var A=(0,g.bk)(["Tag","status"],e=>{let t=x(e);return[w(t,"success","Success"),w(t,"processing","Info"),w(t,"error","Error"),w(t,"warning","Warning")]},v),N=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);st.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};let k=n.forwardRef((e,t)=>{let{prefixCls:r,className:a,rootClassName:u,style:m,children:h,icon:p,color:g,onClose:f,closeIcon:x,closable:v,bordered:y=!0}=e,_=N(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:j,direction:S,tag:w}=n.useContext(d.E_),[k,I]=n.useState(!0);n.useEffect(()=>{"visible"in _&&I(_.visible)},[_.visible]);let O=(0,o.o2)(g),z=(0,o.yT)(g),Z=O||z,R=Object.assign(Object.assign({backgroundColor:g&&!Z?g:void 0},null==w?void 0:w.style),m),E=j("tag",r),[F,T,M]=b(E),P=l()(E,null==w?void 0:w.className,{["".concat(E,"-").concat(g)]:Z,["".concat(E,"-has-color")]:g&&!Z,["".concat(E,"-hidden")]:!k,["".concat(E,"-rtl")]:"rtl"===S,["".concat(E,"-borderless")]:!y},a,u,T,M),D=e=>{e.stopPropagation(),null==f||f(e),e.defaultPrevented||I(!1)},[,L]=(0,i.Z)(v,x,e=>null===e?n.createElement(s.Z,{className:"".concat(E,"-close-icon"),onClick:D}):n.createElement("span",{className:"".concat(E,"-close-icon"),onClick:D},e),null,!1),V="function"==typeof _.onClick||h&&"a"===h.type,B=p||null,G=B?n.createElement(n.Fragment,null,B,h&&n.createElement("span",null,h)):h,H=n.createElement("span",Object.assign({},_,{ref:t,className:P,style:R}),G,L,O&&n.createElement(C,{key:"preset",prefixCls:E}),z&&n.createElement(A,{key:"status",prefixCls:E}));return F(V?n.createElement(c.Z,{component:"Tag"},H):H)});k.CheckableTag=_;var I=k},40728:function(e,t,r){"use strict";r.d(t,{C:function(){return n.Z},x:function(){return s.Z}});var n=r(41649),s=r(84264)},19130:function(e,t,r){"use strict";r.d(t,{RM:function(){return s.Z},SC:function(){return i.Z},iA:function(){return n.Z},pj:function(){return a.Z},ss:function(){return l.Z},xs:function(){return o.Z}});var n=r(21626),s=r(97214),a=r(28241),l=r(58834),o=r(69552),i=r(71876)},24601:function(){},18975:function(e,t,r){"use strict";var n=r(40257);r(24601);var s=r(2265),a=s&&"object"==typeof s&&"default"in s?s:{default:s},l=void 0!==n&&n.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},i=function(){function e(e){var t=void 0===e?{}:e,r=t.name,n=void 0===r?"stylesheet":r,s=t.optimizeForSpeed,a=void 0===s?l:s;c(o(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var i="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=i?i.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(l||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,r){return"number"==typeof r?e._serverSheet.cssRules[r]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),r},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t>>0},u={};function m(e,t){if(!t)return"jsx-"+e;var r=String(t),n=e+r;return u[n]||(u[n]="jsx-"+d(e+"-"+r)),u[n]}function h(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var r=e+t;return u[r]||(u[r]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[r]}var p=function(){function e(e){var t=void 0===e?{}:e,r=t.styleSheet,n=void 0===r?null:r,s=t.optimizeForSpeed,a=void 0!==s&&s;this._sheet=n||new i({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),n&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var r=this.getIdAndRules(e),n=r.styleId,s=r.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var a=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=a,this._instancesCounts[n]=1},t.remove=function(e){var t=this,r=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var n=this._fromServer&&this._fromServer[r];n?(n.parentNode.removeChild(n),delete this._fromServer[r]):(this._indices[r].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[r]),delete this._instancesCounts[r]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],r=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return r[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,r;return t=this.cssRules(),void 0===(r=e)&&(r={}),t.map(function(e){var t=e[0],n=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,r=e.dynamic,n=e.id;if(r){var s=m(n,r);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return h(s,e)}):[h(s,t)]}}return{styleId:m(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=s.createContext(null);g.displayName="StyleSheetContext";var f=a.default.useInsertionEffect||a.default.useLayoutEffect,x="undefined"!=typeof window?new p:void 0;function v(e){var t=x||s.useContext(g);return t&&("undefined"==typeof window?t.add(e):f(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return m(e[0],e[1])}).join(" ")},t.style=v},29:function(e,t,r){"use strict";e.exports=r(18975).style},6121:function(e,t,r){"use strict";r.r(t);var n=r(57437),s=r(80443),a=r(11318),l=r(2265),o=r(37801);t.default=()=>{let{token:e,accessToken:t,userRole:r,userId:i,premiumUser:c}=(0,s.Z)(),[d,u]=(0,l.useState)([]),{teams:m}=(0,a.Z)();return(0,n.jsx)(o.Z,{accessToken:t,token:e,userRole:r,userID:i,modelData:{data:[]},keys:d,setModelData:()=>{},premiumUser:c,teams:m})}},84376:function(e,t,r){"use strict";var n=r(57437);r(2265);var s=r(52787);t.Z=e=>{let{teams:t,value:r,onChange:a,disabled:l}=e;return console.log("disabled",l),(0,n.jsx)(s.default,{showSearch:!0,placeholder:"Search or select a team",value:r,onChange:a,disabled:l,filterOption:(e,r)=>{if(!r)return!1;let n=null==t?void 0:t.find(e=>e.team_id===r.key);if(!n)return!1;let s=e.toLowerCase().trim(),a=(n.team_alias||"").toLowerCase(),l=(n.team_id||"").toLowerCase();return a.includes(s)||l.includes(s)},optionFilterProp:"children",children:null==t?void 0:t.map(e=>(0,n.jsxs)(s.default.Option,{value:e.team_id,children:[(0,n.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,n.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})}},33860:function(e,t,r){"use strict";var n=r(57437),s=r(2265),a=r(13634),l=r(82680),o=r(52787),i=r(89970),c=r(73002),d=r(7310),u=r.n(d),m=r(19250);t.Z=e=>{let{isVisible:t,onCancel:r,onSubmit:d,accessToken:h,title:p="Add Team Member",roles:g=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:f="user"}=e,[x]=a.Z.useForm(),[v,b]=(0,s.useState)([]),[y,_]=(0,s.useState)(!1),[j,S]=(0,s.useState)("user_email"),C=async(e,t)=>{if(!e){b([]);return}_(!0);try{let r=new URLSearchParams;if(r.append(t,e),null==h)return;let n=(await (0,m.userFilterUICall)(h,r)).map(e=>({label:"user_email"===t?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===t?e.user_email:e.user_id,user:e}));b(n)}catch(e){console.error("Error fetching users:",e)}finally{_(!1)}},w=(0,s.useCallback)(u()((e,t)=>C(e,t),300),[]),A=(e,t)=>{S(t),w(e,t)},N=(e,t)=>{let r=t.user;x.setFieldsValue({user_email:r.user_email,user_id:r.user_id,role:x.getFieldValue("role")})};return(0,n.jsx)(l.Z,{title:p,open:t,onCancel:()=>{x.resetFields(),b([]),r()},footer:null,width:800,children:(0,n.jsxs)(a.Z,{form:x,onFinish:d,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:f},children:[(0,n.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,n.jsx)(o.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>A(e,"user_email"),onSelect:(e,t)=>N(e,t),options:"user_email"===j?v:[],loading:y,allowClear:!0})}),(0,n.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,n.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,n.jsx)(o.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>A(e,"user_id"),onSelect:(e,t)=>N(e,t),options:"user_id"===j?v:[],loading:y,allowClear:!0})}),(0,n.jsx)(a.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,n.jsx)(o.default,{defaultValue:f,children:g.map(e=>(0,n.jsx)(o.default.Option,{value:e.value,children:(0,n.jsxs)(i.Z,{title:e.description,children:[(0,n.jsx)("span",{className:"font-medium",children:e.label}),(0,n.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,n.jsx)("div",{className:"text-right mt-4",children:(0,n.jsx)(c.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})}},27799:function(e,t,r){"use strict";var n=r(57437);r(2265);var s=r(40728),a=r(82182),l=r(91777),o=r(97434);t.Z=function(e){let{loggingConfigs:t=[],disabledCallbacks:r=[],variant:i="card",className:c=""}=e,d=e=>{var t;return(null===(t=Object.entries(o.Lo).find(t=>{let[r,n]=t;return n===e}))||void 0===t?void 0:t[0])||e},u=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},m=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},h=(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(a.Z,{className:"h-4 w-4 text-blue-600"}),(0,n.jsx)(s.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,n.jsx)(s.C,{color:"blue",size:"xs",children:t.length})]}),t.length>0?(0,n.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>{var r;let l=d(e.callback_name),i=null===(r=o.Dg[l])||void 0===r?void 0:r.logo;return(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[i?(0,n.jsx)("img",{src:i,alt:l,className:"w-5 h-5 object-contain"}):(0,n.jsx)(a.Z,{className:"h-5 w-5 text-gray-400"}),(0,n.jsxs)("div",{children:[(0,n.jsx)(s.x,{className:"font-medium text-blue-800",children:l}),(0,n.jsxs)(s.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,n.jsx)(s.C,{color:u(e.callback_type),size:"sm",children:m(e.callback_type)})]},t)})}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(a.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(s.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.Z,{className:"h-4 w-4 text-red-600"}),(0,n.jsx)(s.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,n.jsx)(s.C,{color:"red",size:"xs",children:r.length})]}),r.length>0?(0,n.jsx)("div",{className:"space-y-3",children:r.map((e,t)=>{var r;let a=o.RD[e]||e,i=null===(r=o.Dg[a])||void 0===r?void 0:r.logo;return(0,n.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[i?(0,n.jsx)("img",{src:i,alt:a,className:"w-5 h-5 object-contain"}):(0,n.jsx)(l.Z,{className:"h-5 w-5 text-gray-400"}),(0,n.jsxs)("div",{children:[(0,n.jsx)(s.x,{className:"font-medium text-red-800",children:a}),(0,n.jsx)(s.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,n.jsx)(s.C,{color:"red",size:"sm",children:"Disabled"})]},t)})}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(l.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(s.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===i?(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(c),children:[(0,n.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(s.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,n.jsx)(s.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),h]}):(0,n.jsxs)("div",{className:"".concat(c),children:[(0,n.jsx)(s.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),h]})}},8048:function(e,t,r){"use strict";r.d(t,{C:function(){return u}});var n=r(57437),s=r(71594),a=r(24525),l=r(2265),o=r(19130),i=r(44633),c=r(86462),d=r(49084);function u(e){let{data:t=[],columns:r,isLoading:u=!1,table:m,defaultSorting:h=[]}=e,[p,g]=l.useState(h),[f]=l.useState("onChange"),[x,v]=l.useState({}),[b,y]=l.useState({}),_=(0,s.b7)({data:t,columns:r,state:{sorting:p,columnSizing:x,columnVisibility:b},columnResizeMode:f,onSortingChange:g,onColumnSizingChange:v,onColumnVisibilityChange:y,getCoreRowModel:(0,a.sC)(),getSortedRowModel:(0,a.tj)(),enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return l.useEffect(()=>{m&&(m.current=_)},[_,m]),(0,n.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsx)("div",{className:"relative min-w-full",children:(0,n.jsxs)(o.iA,{className:"[&_td]:py-2 [&_th]:py-2 w-full",children:[(0,n.jsx)(o.ss,{children:_.getHeaderGroups().map(e=>(0,n.jsx)(o.SC,{children:e.headers.map(e=>{var t;return(0,n.jsxs)(o.xs,{className:"py-1 h-8 relative ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.id?120:e.getSize(),position:"actions"===e.id?"sticky":"relative",right:"actions"===e.id?0:"auto"},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,s.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,n.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,n.jsx)(i.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,n.jsx)(c.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,n.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"absolute right-0 top-0 h-full w-2 cursor-col-resize select-none touch-none ".concat(e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200")})]},e.id)})},e.id))}),(0,n.jsx)(o.RM,{children:u?(0,n.jsx)(o.SC,{children:(0,n.jsx)(o.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"\uD83D\uDE85 Loading models..."})})})}):_.getRowModel().rows.length>0?_.getRowModel().rows.map(e=>(0,n.jsx)(o.SC,{children:e.getVisibleCells().map(e=>{var t;return(0,n.jsx)(o.pj,{className:"py-0.5 ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.column.id?120:e.column.getSize(),position:"actions"===e.column.id?"sticky":"relative",right:"actions"===e.column.id?0:"auto"},children:(0,s.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)):(0,n.jsx)(o.SC,{children:(0,n.jsx)(o.pj,{colSpan:r.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"No models found"})})})})})]})})})})}},98015:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var n=r(57437),s=r(2265),a=r(92280),l=r(40728),o=r(79814),i=r(19250),c=function(e){let{vectorStores:t,accessToken:r}=e,[a,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{(async()=>{if(r&&0!==t.length)try{let e=await (0,i.vectorStoreListCall)(r);e.data&&c(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[r,t.length]);let d=e=>{let t=a.find(t=>t.vector_store_id===e);return t?"".concat(t.vector_store_name||t.vector_store_id," (").concat(t.vector_store_id,")"):e};return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(o.Z,{className:"h-4 w-4 text-blue-600"}),(0,n.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,n.jsx)(l.C,{color:"blue",size:"xs",children:t.length})]}),t.length>0?(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((e,t)=>(0,n.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:d(e)},t))}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(o.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},d=r(25327),u=r(86462),m=r(47686),h=r(89970),p=function(e){let{mcpServers:t,mcpAccessGroups:a=[],mcpToolPermissions:o={},accessToken:c}=e,[p,g]=(0,s.useState)([]),[f,x]=(0,s.useState)([]),[v,b]=(0,s.useState)(new Set),y=e=>{b(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})};(0,s.useEffect)(()=>{(async()=>{if(c&&t.length>0)try{let e=await (0,i.fetchMCPServers)(c);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[c,t.length]),(0,s.useEffect)(()=>{(async()=>{if(c&&a.length>0)try{let e=await Promise.resolve().then(r.bind(r,19250)).then(e=>e.fetchMCPAccessGroups(c));x(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[c,a.length]);let _=e=>{let t=p.find(t=>t.server_id===e);if(t){let r=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(t.alias," (").concat(r,")")}return e},j=e=>e,S=[...t.map(e=>({type:"server",value:e})),...a.map(e=>({type:"accessGroup",value:e}))],C=S.length;return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(d.Z,{className:"h-4 w-4 text-blue-600"}),(0,n.jsx)(l.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,n.jsx)(l.C,{color:"blue",size:"xs",children:C})]}),C>0?(0,n.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:S.map((e,t)=>{let r="server"===e.type?o[e.value]:void 0,s=r&&r.length>0,a=v.has(e.value);return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{onClick:()=>s&&y(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(s?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,n.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,n.jsx)(h.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,n.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,n.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)})]})}):(0,n.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,n.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:j(e.value)}),(0,n.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),s&&(0,n.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-gray-600",children:r.length}),(0,n.jsx)("span",{className:"text-xs text-gray-500",children:1===r.length?"tool":"tools"}),a?(0,n.jsx)(u.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,n.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),s&&a&&(0,n.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.map((e,t)=>(0,n.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},t))})})]},t)})}):(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,n.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:t,variant:r="card",className:s="",accessToken:l}=e,o=(null==t?void 0:t.vector_stores)||[],i=(null==t?void 0:t.mcp_servers)||[],d=(null==t?void 0:t.mcp_access_groups)||[],u=(null==t?void 0:t.mcp_tool_permissions)||{},m=(0,n.jsxs)("div",{className:"card"===r?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,n.jsx)(c,{vectorStores:o,accessToken:l}),(0,n.jsx)(p,{mcpServers:i,mcpAccessGroups:d,mcpToolPermissions:u,accessToken:l})]});return"card"===r?(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(s),children:[(0,n.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(a.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,n.jsx)(a.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),m]}):(0,n.jsxs)("div",{className:"".concat(s),children:[(0,n.jsx)(a.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),m]})}},42673:function(e,t,r){"use strict";var n,s;r.d(t,{Cl:function(){return n},bK:function(){return d},cd:function(){return o},dr:function(){return i},fK:function(){return a},ph:function(){return c}}),(s=n||(n={})).AIML="AI/ML API",s.Bedrock="Amazon Bedrock",s.Anthropic="Anthropic",s.AssemblyAI="AssemblyAI",s.SageMaker="AWS SageMaker",s.Azure="Azure",s.Azure_AI_Studio="Azure AI Foundry (Studio)",s.Cerebras="Cerebras",s.Cohere="Cohere",s.Dashscope="Dashscope",s.Databricks="Databricks (Qwen API)",s.DeepInfra="DeepInfra",s.Deepgram="Deepgram",s.Deepseek="Deepseek",s.ElevenLabs="ElevenLabs",s.FireworksAI="Fireworks AI",s.Google_AI_Studio="Google AI Studio",s.GradientAI="GradientAI",s.Groq="Groq",s.Hosted_Vllm="vllm",s.Infinity="Infinity",s.JinaAI="Jina AI",s.MistralAI="Mistral AI",s.Ollama="Ollama",s.OpenAI="OpenAI",s.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",s.OpenAI_Text="OpenAI Text Completion",s.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",s.Openrouter="Openrouter",s.Oracle="Oracle Cloud Infrastructure (OCI)",s.Perplexity="Perplexity",s.Sambanova="Sambanova",s.Snowflake="Snowflake",s.TogetherAI="TogetherAI",s.Triton="Triton",s.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",s.VolcEngine="VolcEngine",s.Voyage="Voyage AI",s.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},l="/ui/assets/logos/",o={"AI/ML API":"".concat(l,"aiml_api.svg"),Anthropic:"".concat(l,"anthropic.svg"),AssemblyAI:"".concat(l,"assemblyai_small.png"),Azure:"".concat(l,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(l,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(l,"bedrock.svg"),"AWS SageMaker":"".concat(l,"bedrock.svg"),Cerebras:"".concat(l,"cerebras.svg"),Cohere:"".concat(l,"cohere.svg"),"Databricks (Qwen API)":"".concat(l,"databricks.svg"),Dashscope:"".concat(l,"dashscope.svg"),Deepseek:"".concat(l,"deepseek.svg"),"Fireworks AI":"".concat(l,"fireworks.svg"),Groq:"".concat(l,"groq.svg"),"Google AI Studio":"".concat(l,"google.svg"),vllm:"".concat(l,"vllm.png"),Infinity:"".concat(l,"infinity.png"),"Mistral AI":"".concat(l,"mistral.svg"),Ollama:"".concat(l,"ollama.svg"),OpenAI:"".concat(l,"openai_small.svg"),"OpenAI Text Completion":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(l,"openai_small.svg"),Openrouter:"".concat(l,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(l,"oracle.svg"),Perplexity:"".concat(l,"perplexity-ai.svg"),Sambanova:"".concat(l,"sambanova.svg"),Snowflake:"".concat(l,"snowflake.svg"),TogetherAI:"".concat(l,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(l,"google.svg"),xAI:"".concat(l,"xai.svg"),GradientAI:"".concat(l,"gradientai.svg"),Triton:"".concat(l,"nvidia_triton.png"),Deepgram:"".concat(l,"deepgram.png"),ElevenLabs:"".concat(l,"elevenlabs.png"),"Voyage AI":"".concat(l,"voyage.webp"),"Jina AI":"".concat(l,"jina.png"),VolcEngine:"".concat(l,"volcengine.png"),DeepInfra:"".concat(l,"deepinfra.png")},i=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:o[e],displayName:e}}let t=Object.keys(a).find(t=>a[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let r=n[t];return{logo:o[r],displayName:r}},c=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},d=(e,t)=>{console.log("Provider key: ".concat(e));let r=a[e];console.log("Provider mapped to: ".concat(r));let n=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(e=>{let[t,s]=e;null!==s&&"object"==typeof s&&"litellm_provider"in s&&(s.litellm_provider===r||s.litellm_provider.includes(r))&&n.push(t)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(e=>{let[t,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"cohere_chat"===r.litellm_provider&&n.push(t)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(e=>{let[t,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"sagemaker_chat"===r.litellm_provider&&n.push(t)}))),n}},21425:function(e,t,r){"use strict";var n=r(57437);r(2265);var s=r(54507);t.Z=e=>{let{value:t,onChange:r,disabledCallbacks:a=[],onDisabledCallbacksChange:l}=e;return(0,n.jsx)(s.Z,{value:t,onChange:r,disabledCallbacks:a,onDisabledCallbacksChange:l})}},10901:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(57437),s=r(2265),a=r(13634),l=r(82680),o=r(73002),i=r(27281),c=r(57365),d=r(49566),u=r(92280),m=r(24199),h=e=>{var t,r,h;let{visible:p,onCancel:g,onSubmit:f,initialData:x,mode:v,config:b}=e,[y]=a.Z.useForm();console.log("Initial Data:",x),(0,s.useEffect)(()=>{if(p){if("edit"===v&&x){let e={...x,role:x.role||b.defaultRole,max_budget_in_team:x.max_budget_in_team||null,tpm_limit:x.tpm_limit||null,rpm_limit:x.rpm_limit||null};console.log("Setting form values:",e),y.setFieldsValue(e)}else{var e;y.resetFields(),y.setFieldsValue({role:b.defaultRole||(null===(e=b.roleOptions[0])||void 0===e?void 0:e.value)})}}},[p,x,v,y,b.defaultRole,b.roleOptions]);let _=async e=>{try{let t=Object.entries(e).reduce((e,t)=>{let[r,n]=t;if("string"==typeof n){let t=n.trim();return""===t&&("max_budget_in_team"===r||"tpm_limit"===r||"rpm_limit"===r)?{...e,[r]:null}:{...e,[r]:t}}return{...e,[r]:n}},{});console.log("Submitting form data:",t),f(t),y.resetFields()}catch(e){console.error("Form submission error:",e)}},j=e=>{switch(e.type){case"input":return(0,n.jsx)(d.Z,{placeholder:e.placeholder});case"numerical":return(0,n.jsx)(m.Z,{step:e.step||1,min:e.min||0,style:{width:"100%"},placeholder:e.placeholder||"Enter a numerical value"});case"select":var t;return(0,n.jsx)(i.Z,{children:null===(t=e.options)||void 0===t?void 0:t.map(e=>(0,n.jsx)(c.Z,{value:e.value,children:e.label},e.value))});default:return null}};return(0,n.jsx)(l.Z,{title:b.title||("add"===v?"Add Member":"Edit Member"),open:p,width:1e3,footer:null,onCancel:g,children:(0,n.jsxs)(a.Z,{form:y,onFinish:_,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[b.showEmail&&(0,n.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,n.jsx)(d.Z,{placeholder:"user@example.com"})}),b.showEmail&&b.showUserId&&(0,n.jsx)("div",{className:"text-center mb-4",children:(0,n.jsx)(u.x,{children:"OR"})}),b.showUserId&&(0,n.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,n.jsx)(d.Z,{placeholder:"user_123"})}),(0,n.jsx)(a.Z.Item,{label:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{children:"Role"}),"edit"===v&&x&&(0,n.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(r=x.role,(null===(h=b.roleOptions.find(e=>e.value===r))||void 0===h?void 0:h.label)||r),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,n.jsx)(i.Z,{children:"edit"===v&&x?[...b.roleOptions.filter(e=>e.value===x.role),...b.roleOptions.filter(e=>e.value!==x.role)].map(e=>(0,n.jsx)(c.Z,{value:e.value,children:e.label},e.value)):b.roleOptions.map(e=>(0,n.jsx)(c.Z,{value:e.value,children:e.label},e.value))})}),null===(t=b.additionalFields)||void 0===t?void 0:t.map(e=>(0,n.jsx)(a.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:j(e)},e.name)),(0,n.jsxs)("div",{className:"text-right mt-6",children:[(0,n.jsx)(o.ZP,{onClick:g,className:"mr-2",children:"Cancel"}),(0,n.jsx)(o.ZP,{type:"default",htmlType:"submit",children:"add"===v?"Add Member":"Save Changes"})]})]})})}},33304:function(e,t,r){"use strict";function n(e){return""===e?null:e}r.d(t,{C:function(){return n}})},44633:function(e,t,r){"use strict";var n=r(2265);let s=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=s},49084:function(e,t,r){"use strict";var n=r(2265);let s=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=s}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,6202,2344,3669,1487,5105,4851,9429,8049,131,2012,7801,2971,2117,1744],function(){return e(e.s=18530)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-388c7d5731acf363.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-388c7d5731acf363.js new file mode 100644 index 0000000000..3e8d2c9273 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-388c7d5731acf363.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6459],{44243:function(e,r,t){Promise.resolve().then(t.bind(t,57616))},69993:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(1119),s=t(2265),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},o=t(55015),l=s.forwardRef(function(e,r){return s.createElement(o.Z,(0,a.Z)({},e,{ref:r,icon:n}))})},47323:function(e,r,t){"use strict";t.d(r,{Z:function(){return b}});var a=t(5853),s=t(2265),n=t(1526),o=t(7084),l=t(97324),d=t(1153),c=t(26898);let i={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},m={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},u={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},g=(e,r)=>{switch(e){case"simple":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:r?(0,d.bM)(r,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:r?(0,l.q)((0,d.bM)(r,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},x=(0,d.fn)("Icon"),b=s.forwardRef((e,r)=>{let{icon:t,variant:c="simple",tooltip:b,size:h=o.u8.SM,color:f,className:p}=e,v=(0,a._T)(e,["icon","variant","tooltip","size","color","className"]),N=g(c,f),{tooltipProps:y,getReferenceProps:w}=(0,n.l)();return s.createElement("span",Object.assign({ref:(0,d.lq)([r,y.refs.setReference]),className:(0,l.q)(x("root"),"inline-flex flex-shrink-0 items-center",N.bgColor,N.textColor,N.borderColor,N.ringColor,u[c].rounded,u[c].border,u[c].shadow,u[c].ring,i[h].paddingX,i[h].paddingY,p)},w,v),s.createElement(n.Z,Object.assign({text:b},y)),s.createElement(t,{className:(0,l.q)(x("icon"),"shrink-0",m[h].height,m[h].width)}))});b.displayName="Icon"},21626:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("Table"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement("div",{className:(0,n.q)(o("root"),"overflow-auto",l)},s.createElement("table",Object.assign({ref:r,className:(0,n.q)(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},d),t))});l.displayName="Table"},97214:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableBody"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("tbody",Object.assign({ref:r,className:(0,n.q)(o("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",l)},d),t))});l.displayName="TableBody"},28241:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableCell"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("td",Object.assign({ref:r,className:(0,n.q)(o("root"),"align-middle whitespace-nowrap text-left p-4",l)},d),t))});l.displayName="TableCell"},58834:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableHead"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("thead",Object.assign({ref:r,className:(0,n.q)(o("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",l)},d),t))});l.displayName="TableHead"},69552:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableHeaderCell"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("th",Object.assign({ref:r,className:(0,n.q)(o("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content","dark:text-dark-tremor-content",l)},d),t))});l.displayName="TableHeaderCell"},71876:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableRow"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("tr",Object.assign({ref:r,className:(0,n.q)(o("row"),l)},d),t))});l.displayName="TableRow"},96761:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var a=t(5853),s=t(26898),n=t(97324),o=t(1153),l=t(2265);let d=l.forwardRef((e,r)=>{let{color:t,children:d,className:c}=e,i=(0,a._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:r,className:(0,n.q)("font-medium text-tremor-title",t?(0,o.bM)(t,s.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},i),d)});d.displayName="Title"},40728:function(e,r,t){"use strict";t.d(r,{C:function(){return a.Z},x:function(){return s.Z}});var a=t(41649),s=t(84264)},57616:function(e,r,t){"use strict";t.r(r);var a=t(57437),s=t(22004),n=t(80443),o=t(2265),l=t(30874);r.default=()=>{let{userId:e,accessToken:r,userRole:t,premiumUser:d}=(0,n.Z)(),[c,i]=(0,o.useState)([]),[m,u]=(0,o.useState)([]);return(0,o.useEffect)(()=>{(0,s.g)(r,i).then(()=>{})},[r]),(0,o.useEffect)(()=>{(0,l.Nr)(e,t,r,u).then(()=>{})},[e,t,r]),(0,a.jsx)(s.Z,{organizations:c,userRole:t,userModels:m,accessToken:r,setOrganizations:i,premiumUser:d})}},98015:function(e,r,t){"use strict";t.d(r,{Z:function(){return b}});var a=t(57437),s=t(2265),n=t(92280),o=t(40728),l=t(79814),d=t(19250),c=function(e){let{vectorStores:r,accessToken:t}=e,[n,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{(async()=>{if(t&&0!==r.length)try{let e=await (0,d.vectorStoreListCall)(t);e.data&&c(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,r.length]);let i=e=>{let r=n.find(r=>r.vector_store_id===e);return r?"".concat(r.vector_store_name||r.vector_store_id," (").concat(r.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(o.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(o.C,{color:"blue",size:"xs",children:r.length})]}),r.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map((e,r)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:i(e)},r))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(l.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(o.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},i=t(25327),m=t(86462),u=t(47686),g=t(89970),x=function(e){let{mcpServers:r,mcpAccessGroups:n=[],mcpToolPermissions:l={},accessToken:c}=e,[x,b]=(0,s.useState)([]),[h,f]=(0,s.useState)([]),[p,v]=(0,s.useState)(new Set),N=e=>{v(r=>{let t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t})};(0,s.useEffect)(()=>{(async()=>{if(c&&r.length>0)try{let e=await (0,d.fetchMCPServers)(c);e&&Array.isArray(e)?b(e):e.data&&Array.isArray(e.data)&&b(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[c,r.length]),(0,s.useEffect)(()=>{(async()=>{if(c&&n.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(c));f(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[c,n.length]);let y=e=>{let r=x.find(r=>r.server_id===e);if(r){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(r.alias," (").concat(t,")")}return e},w=e=>e,k=[...r.map(e=>({type:"server",value:e})),...n.map(e=>({type:"accessGroup",value:e}))],j=k.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(o.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(o.C,{color:"blue",size:"xs",children:j})]}),j>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:k.map((e,r)=>{let t="server"===e.type?l[e.value]:void 0,s=t&&t.length>0,n=p.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>s&&N(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(s?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(g.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:y(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:w(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),s&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:t.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===t.length?"tool":"tools"}),n?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(u.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),s&&n&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map((e,r)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},r))})})]},r)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(o.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},b=function(e){let{objectPermission:r,variant:t="card",className:s="",accessToken:o}=e,l=(null==r?void 0:r.vector_stores)||[],d=(null==r?void 0:r.mcp_servers)||[],i=(null==r?void 0:r.mcp_access_groups)||[],m=(null==r?void 0:r.mcp_tool_permissions)||{},u=(0,a.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(c,{vectorStores:l,accessToken:o}),(0,a.jsx)(x,{mcpServers:d,mcpAccessGroups:i,mcpToolPermissions:m,accessToken:o})]});return"card"===t?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(s),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(n.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(n.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(s),children:[(0,a.jsx)(n.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),u]})}},53410:function(e,r,t){"use strict";var a=t(2265);let s=a.forwardRef(function(e,r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});r.Z=s}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,8049,131,2202,874,2004,2971,2117,1744],function(){return e(e.s=44243)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-3f42c10932338e71.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-3f42c10932338e71.js deleted file mode 100644 index e4728ac6eb..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-3f42c10932338e71.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/organizations/page-81692cedbd412d5e.js -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6459],{44243:function(e,r,t){Promise.resolve().then(t.bind(t,57616))},69993:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(1119),s=t(2265),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},o=t(55015),l=s.forwardRef(function(e,r){return s.createElement(o.Z,(0,a.Z)({},e,{ref:r,icon:n}))})},47323:function(e,r,t){"use strict";t.d(r,{Z:function(){return b}});var a=t(5853),s=t(2265),n=t(1526),o=t(7084),l=t(97324),d=t(1153),c=t(26898);let i={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},m={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},u={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},g=(e,r)=>{switch(e){case"simple":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:r?(0,d.bM)(r,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:r?(0,l.q)((0,d.bM)(r,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},x=(0,d.fn)("Icon"),b=s.forwardRef((e,r)=>{let{icon:t,variant:c="simple",tooltip:b,size:h=o.u8.SM,color:f,className:p}=e,v=(0,a._T)(e,["icon","variant","tooltip","size","color","className"]),N=g(c,f),{tooltipProps:y,getReferenceProps:w}=(0,n.l)();return s.createElement("span",Object.assign({ref:(0,d.lq)([r,y.refs.setReference]),className:(0,l.q)(x("root"),"inline-flex flex-shrink-0 items-center",N.bgColor,N.textColor,N.borderColor,N.ringColor,u[c].rounded,u[c].border,u[c].shadow,u[c].ring,i[h].paddingX,i[h].paddingY,p)},w,v),s.createElement(n.Z,Object.assign({text:b},y)),s.createElement(t,{className:(0,l.q)(x("icon"),"shrink-0",m[h].height,m[h].width)}))});b.displayName="Icon"},21626:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("Table"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement("div",{className:(0,n.q)(o("root"),"overflow-auto",l)},s.createElement("table",Object.assign({ref:r,className:(0,n.q)(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},d),t))});l.displayName="Table"},97214:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableBody"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("tbody",Object.assign({ref:r,className:(0,n.q)(o("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",l)},d),t))});l.displayName="TableBody"},28241:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableCell"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("td",Object.assign({ref:r,className:(0,n.q)(o("root"),"align-middle whitespace-nowrap text-left p-4",l)},d),t))});l.displayName="TableCell"},58834:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableHead"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("thead",Object.assign({ref:r,className:(0,n.q)(o("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",l)},d),t))});l.displayName="TableHead"},69552:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableHeaderCell"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("th",Object.assign({ref:r,className:(0,n.q)(o("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content","dark:text-dark-tremor-content",l)},d),t))});l.displayName="TableHeaderCell"},71876:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableRow"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("tr",Object.assign({ref:r,className:(0,n.q)(o("row"),l)},d),t))});l.displayName="TableRow"},96761:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var a=t(5853),s=t(26898),n=t(97324),o=t(1153),l=t(2265);let d=l.forwardRef((e,r)=>{let{color:t,children:d,className:c}=e,i=(0,a._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:r,className:(0,n.q)("font-medium text-tremor-title",t?(0,o.bM)(t,s.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},i),d)});d.displayName="Title"},40728:function(e,r,t){"use strict";t.d(r,{C:function(){return a.Z},x:function(){return s.Z}});var a=t(41649),s=t(84264)},57616:function(e,r,t){"use strict";t.r(r);var a=t(57437),s=t(22004),n=t(39760),o=t(2265),l=t(30874);r.default=()=>{let{userId:e,accessToken:r,userRole:t,premiumUser:d}=(0,n.Z)(),[c,i]=(0,o.useState)([]),[m,u]=(0,o.useState)([]);return(0,o.useEffect)(()=>{(0,s.g)(r,i).then(()=>{})},[r]),(0,o.useEffect)(()=>{(0,l.Nr)(e,t,r,u).then(()=>{})},[e,t,r]),(0,a.jsx)(s.Z,{organizations:c,userRole:t,userModels:m,accessToken:r,setOrganizations:i,premiumUser:d})}},98015:function(e,r,t){"use strict";t.d(r,{Z:function(){return b}});var a=t(57437),s=t(2265),n=t(92280),o=t(40728),l=t(79814),d=t(19250),c=function(e){let{vectorStores:r,accessToken:t}=e,[n,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{(async()=>{if(t&&0!==r.length)try{let e=await (0,d.vectorStoreListCall)(t);e.data&&c(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,r.length]);let i=e=>{let r=n.find(r=>r.vector_store_id===e);return r?"".concat(r.vector_store_name||r.vector_store_id," (").concat(r.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(o.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(o.C,{color:"blue",size:"xs",children:r.length})]}),r.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map((e,r)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:i(e)},r))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(l.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(o.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},i=t(25327),m=t(86462),u=t(47686),g=t(89970),x=function(e){let{mcpServers:r,mcpAccessGroups:n=[],mcpToolPermissions:l={},accessToken:c}=e,[x,b]=(0,s.useState)([]),[h,f]=(0,s.useState)([]),[p,v]=(0,s.useState)(new Set),N=e=>{v(r=>{let t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t})};(0,s.useEffect)(()=>{(async()=>{if(c&&r.length>0)try{let e=await (0,d.fetchMCPServers)(c);e&&Array.isArray(e)?b(e):e.data&&Array.isArray(e.data)&&b(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[c,r.length]),(0,s.useEffect)(()=>{(async()=>{if(c&&n.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(c));f(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[c,n.length]);let y=e=>{let r=x.find(r=>r.server_id===e);if(r){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(r.alias," (").concat(t,")")}return e},w=e=>e,k=[...r.map(e=>({type:"server",value:e})),...n.map(e=>({type:"accessGroup",value:e}))],j=k.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(o.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(o.C,{color:"blue",size:"xs",children:j})]}),j>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:k.map((e,r)=>{let t="server"===e.type?l[e.value]:void 0,s=t&&t.length>0,n=p.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>s&&N(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(s?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(g.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:y(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:w(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),s&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:t.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===t.length?"tool":"tools"}),n?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(u.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),s&&n&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map((e,r)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},r))})})]},r)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(o.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},b=function(e){let{objectPermission:r,variant:t="card",className:s="",accessToken:o}=e,l=(null==r?void 0:r.vector_stores)||[],d=(null==r?void 0:r.mcp_servers)||[],i=(null==r?void 0:r.mcp_access_groups)||[],m=(null==r?void 0:r.mcp_tool_permissions)||{},u=(0,a.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(c,{vectorStores:l,accessToken:o}),(0,a.jsx)(x,{mcpServers:d,mcpAccessGroups:i,mcpToolPermissions:m,accessToken:o})]});return"card"===t?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(s),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(n.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(n.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(s),children:[(0,a.jsx)(n.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),u]})}},53410:function(e,r,t){"use strict";var a=t(2265);let s=a.forwardRef(function(e,r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});r.Z=s}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,8049,131,2202,874,2004,2971,2117,1744],function(){return e(e.s=44243)}),_N_E=e.O()}]); -======== -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6459],{44243:function(e,r,t){Promise.resolve().then(t.bind(t,57616))},69993:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(1119),s=t(2265),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},o=t(55015),l=s.forwardRef(function(e,r){return s.createElement(o.Z,(0,a.Z)({},e,{ref:r,icon:n}))})},47323:function(e,r,t){"use strict";t.d(r,{Z:function(){return b}});var a=t(5853),s=t(2265),n=t(1526),o=t(7084),l=t(97324),d=t(1153),c=t(26898);let i={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},m={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},u={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},g=(e,r)=>{switch(e){case"simple":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:r?(0,d.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,d.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:r?(0,d.bM)(r,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:r?(0,l.q)((0,d.bM)(r,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},x=(0,d.fn)("Icon"),b=s.forwardRef((e,r)=>{let{icon:t,variant:c="simple",tooltip:b,size:h=o.u8.SM,color:f,className:p}=e,v=(0,a._T)(e,["icon","variant","tooltip","size","color","className"]),N=g(c,f),{tooltipProps:y,getReferenceProps:w}=(0,n.l)();return s.createElement("span",Object.assign({ref:(0,d.lq)([r,y.refs.setReference]),className:(0,l.q)(x("root"),"inline-flex flex-shrink-0 items-center",N.bgColor,N.textColor,N.borderColor,N.ringColor,u[c].rounded,u[c].border,u[c].shadow,u[c].ring,i[h].paddingX,i[h].paddingY,p)},w,v),s.createElement(n.Z,Object.assign({text:b},y)),s.createElement(t,{className:(0,l.q)(x("icon"),"shrink-0",m[h].height,m[h].width)}))});b.displayName="Icon"},21626:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("Table"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement("div",{className:(0,n.q)(o("root"),"overflow-auto",l)},s.createElement("table",Object.assign({ref:r,className:(0,n.q)(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},d),t))});l.displayName="Table"},97214:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableBody"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("tbody",Object.assign({ref:r,className:(0,n.q)(o("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",l)},d),t))});l.displayName="TableBody"},28241:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableCell"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("td",Object.assign({ref:r,className:(0,n.q)(o("root"),"align-middle whitespace-nowrap text-left p-4",l)},d),t))});l.displayName="TableCell"},58834:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableHead"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("thead",Object.assign({ref:r,className:(0,n.q)(o("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",l)},d),t))});l.displayName="TableHead"},69552:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableHeaderCell"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("th",Object.assign({ref:r,className:(0,n.q)(o("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content","dark:text-dark-tremor-content",l)},d),t))});l.displayName="TableHeaderCell"},71876:function(e,r,t){"use strict";t.d(r,{Z:function(){return l}});var a=t(5853),s=t(2265),n=t(97324);let o=(0,t(1153).fn)("TableRow"),l=s.forwardRef((e,r)=>{let{children:t,className:l}=e,d=(0,a._T)(e,["children","className"]);return s.createElement(s.Fragment,null,s.createElement("tr",Object.assign({ref:r,className:(0,n.q)(o("row"),l)},d),t))});l.displayName="TableRow"},96761:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var a=t(5853),s=t(26898),n=t(97324),o=t(1153),l=t(2265);let d=l.forwardRef((e,r)=>{let{color:t,children:d,className:c}=e,i=(0,a._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:r,className:(0,n.q)("font-medium text-tremor-title",t?(0,o.bM)(t,s.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},i),d)});d.displayName="Title"},40728:function(e,r,t){"use strict";t.d(r,{C:function(){return a.Z},x:function(){return s.Z}});var a=t(41649),s=t(84264)},57616:function(e,r,t){"use strict";t.r(r);var a=t(57437),s=t(22004),n=t(39760),o=t(2265),l=t(30874);r.default=()=>{let{userId:e,accessToken:r,userRole:t,premiumUser:d}=(0,n.Z)(),[c,i]=(0,o.useState)([]),[m,u]=(0,o.useState)([]);return(0,o.useEffect)(()=>{(0,s.g)(r,i).then(()=>{})},[r]),(0,o.useEffect)(()=>{(0,l.Nr)(e,t,r,u).then(()=>{})},[e,t,r]),(0,a.jsx)(s.Z,{organizations:c,userRole:t,userModels:m,accessToken:r,setOrganizations:i,premiumUser:d})}},98015:function(e,r,t){"use strict";t.d(r,{Z:function(){return b}});var a=t(57437),s=t(2265),n=t(92280),o=t(40728),l=t(79814),d=t(19250),c=function(e){let{vectorStores:r,accessToken:t}=e,[n,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{(async()=>{if(t&&0!==r.length)try{let e=await (0,d.vectorStoreListCall)(t);e.data&&c(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,r.length]);let i=e=>{let r=n.find(r=>r.vector_store_id===e);return r?"".concat(r.vector_store_name||r.vector_store_id," (").concat(r.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(o.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(o.C,{color:"blue",size:"xs",children:r.length})]}),r.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map((e,r)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:i(e)},r))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(l.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(o.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},i=t(25327),m=t(86462),u=t(47686),g=t(89970),x=function(e){let{mcpServers:r,mcpAccessGroups:n=[],mcpToolPermissions:l={},accessToken:c}=e,[x,b]=(0,s.useState)([]),[h,f]=(0,s.useState)([]),[p,v]=(0,s.useState)(new Set),N=e=>{v(r=>{let t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t})};(0,s.useEffect)(()=>{(async()=>{if(c&&r.length>0)try{let e=await (0,d.fetchMCPServers)(c);e&&Array.isArray(e)?b(e):e.data&&Array.isArray(e.data)&&b(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[c,r.length]),(0,s.useEffect)(()=>{(async()=>{if(c&&n.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(c));f(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[c,n.length]);let y=e=>{let r=x.find(r=>r.server_id===e);if(r){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(r.alias," (").concat(t,")")}return e},w=e=>e,k=[...r.map(e=>({type:"server",value:e})),...n.map(e=>({type:"accessGroup",value:e}))],j=k.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(o.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(o.C,{color:"blue",size:"xs",children:j})]}),j>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:k.map((e,r)=>{let t="server"===e.type?l[e.value]:void 0,s=t&&t.length>0,n=p.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>s&&N(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(s?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(g.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:y(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:w(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),s&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:t.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===t.length?"tool":"tools"}),n?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(u.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),s&&n&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map((e,r)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},r))})})]},r)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(o.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},b=function(e){let{objectPermission:r,variant:t="card",className:s="",accessToken:o}=e,l=(null==r?void 0:r.vector_stores)||[],d=(null==r?void 0:r.mcp_servers)||[],i=(null==r?void 0:r.mcp_access_groups)||[],m=(null==r?void 0:r.mcp_tool_permissions)||{},u=(0,a.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(c,{vectorStores:l,accessToken:o}),(0,a.jsx)(x,{mcpServers:d,mcpAccessGroups:i,mcpToolPermissions:m,accessToken:o})]});return"card"===t?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(s),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(n.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(n.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(s),children:[(0,a.jsx)(n.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),u]})}},53410:function(e,r,t){"use strict";var a=t(2265);let s=a.forwardRef(function(e,r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});r.Z=s}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,8049,1633,2202,874,2004,2971,2117,1744],function(){return e(e.s=44243)}),_N_E=e.O()}]); ->>>>>>>> ef0d6f0207 (Resolve conflicts in generated HTML files):litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-3f42c10932338e71.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-e4fd0d8bc569d74f.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-bf35b8b5ac73a485.js similarity index 93% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-e4fd0d8bc569d74f.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-bf35b8b5ac73a485.js index b5c8852d25..c3df2139d8 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-e4fd0d8bc569d74f.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-bf35b8b5ac73a485.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8958],{22489:function(e,n,r){Promise.resolve().then(r.bind(r,8786))},25512:function(e,n,r){"use strict";r.d(n,{P:function(){return t.Z},Q:function(){return u.Z}});var t=r(27281),u=r(57365)},56522:function(e,n,r){"use strict";r.d(n,{o:function(){return u.Z},x:function(){return t.Z}});var t=r(84264),u=r(49566)},39760:function(e,n,r){"use strict";var t=r(2265),u=r(99376),l=r(14474),i=r(3914);n.Z=()=>{var e,n,r,a,o,s,c;let d=(0,u.useRouter)(),f="undefined"!=typeof document?(0,i.e)("token"):null;(0,t.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let _=(0,t.useMemo)(()=>{if(!f)return null;try{return(0,l.o)(f)}catch(e){return(0,i.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==_?void 0:_.key)&&void 0!==e?e:null,userId:null!==(n=null==_?void 0:_.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==_?void 0:_.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(a=null==_?void 0:_.user_role)&&void 0!==a?a:null),premiumUser:null!==(o=null==_?void 0:_.premium_user)&&void 0!==o?o:null,disabledPersonalKeyCreation:null!==(s=null==_?void 0:_.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==_?void 0:_.login_method)==="username_password"}}},11318:function(e,n,r){"use strict";r.d(n,{Z:function(){return a}});var t=r(2265),u=r(39760),l=r(19250);let i=async(e,n,r,t)=>"Admin"!=r&&"Admin Viewer"!=r?await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null,n):await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null);var a=()=>{let[e,n]=(0,t.useState)([]),{accessToken:r,userId:l,userRole:a}=(0,u.Z)();return(0,t.useEffect)(()=>{(async()=>{n(await i(r,l,a,null))})()},[r,l,a]),{teams:e,setTeams:n}}},8786:function(e,n,r){"use strict";r.r(n);var t=r(57437),u=r(90773),l=r(39760),i=r(2265),a=r(11318);n.default=()=>{let{teams:e,setTeams:n}=(0,a.Z)(),[r,o]=(0,i.useState)(()=>new URLSearchParams(window.location.search)),{accessToken:s,userId:c,premiumUser:d,showSSOBanner:f}=(0,l.Z)();return(0,t.jsx)(u.Z,{searchParams:r,accessToken:s,userID:c,setTeams:n,showSSOBanner:f,premiumUser:d})}},12363:function(e,n,r){"use strict";r.d(n,{d:function(){return l},n:function(){return u}});var t=r(2265);let u=()=>{let[e,n]=(0,t.useState)("http://localhost:4000");return(0,t.useEffect)(()=>{{let{protocol:e,host:r}=window.location;n("".concat(e,"//").concat(r))}},[]),e},l=25}},function(e){e.O(0,[9820,1491,1526,2417,2926,9775,9678,7281,2052,8049,773,2971,2117,1744],function(){return e(e.s=22489)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8958],{22489:function(e,n,r){Promise.resolve().then(r.bind(r,8786))},25512:function(e,n,r){"use strict";r.d(n,{P:function(){return t.Z},Q:function(){return u.Z}});var t=r(27281),u=r(57365)},56522:function(e,n,r){"use strict";r.d(n,{o:function(){return u.Z},x:function(){return t.Z}});var t=r(84264),u=r(49566)},80443:function(e,n,r){"use strict";var t=r(2265),u=r(99376),l=r(14474),i=r(3914);n.Z=()=>{var e,n,r,a,o,s,c;let d=(0,u.useRouter)(),f="undefined"!=typeof document?(0,i.e)("token"):null;(0,t.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let _=(0,t.useMemo)(()=>{if(!f)return null;try{return(0,l.o)(f)}catch(e){return(0,i.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==_?void 0:_.key)&&void 0!==e?e:null,userId:null!==(n=null==_?void 0:_.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==_?void 0:_.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(a=null==_?void 0:_.user_role)&&void 0!==a?a:null),premiumUser:null!==(o=null==_?void 0:_.premium_user)&&void 0!==o?o:null,disabledPersonalKeyCreation:null!==(s=null==_?void 0:_.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==_?void 0:_.login_method)==="username_password"}}},11318:function(e,n,r){"use strict";r.d(n,{Z:function(){return a}});var t=r(2265),u=r(80443),l=r(19250);let i=async(e,n,r,t)=>"Admin"!=r&&"Admin Viewer"!=r?await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null,n):await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null);var a=()=>{let[e,n]=(0,t.useState)([]),{accessToken:r,userId:l,userRole:a}=(0,u.Z)();return(0,t.useEffect)(()=>{(async()=>{n(await i(r,l,a,null))})()},[r,l,a]),{teams:e,setTeams:n}}},8786:function(e,n,r){"use strict";r.r(n);var t=r(57437),u=r(90773),l=r(80443),i=r(2265),a=r(11318);n.default=()=>{let{teams:e,setTeams:n}=(0,a.Z)(),[r,o]=(0,i.useState)(()=>new URLSearchParams(window.location.search)),{accessToken:s,userId:c,premiumUser:d,showSSOBanner:f}=(0,l.Z)();return(0,t.jsx)(u.Z,{searchParams:r,accessToken:s,userID:c,setTeams:n,showSSOBanner:f,premiumUser:d})}},12363:function(e,n,r){"use strict";r.d(n,{d:function(){return l},n:function(){return u}});var t=r(2265);let u=()=>{let[e,n]=(0,t.useState)("http://localhost:4000");return(0,t.useEffect)(()=>{{let{protocol:e,host:r}=window.location;n("".concat(e,"//").concat(r))}},[]),e},l=25}},function(e){e.O(0,[9820,1491,1526,2417,2926,9775,9678,7281,2052,8049,773,2971,2117,1744],function(){return e(e.s=22489)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-4bba68ba957e2904.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-4bba68ba957e2904.js new file mode 100644 index 0000000000..f684a0eac7 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-4bba68ba957e2904.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2445],{96354:function(e,n,a){Promise.resolve().then(a.bind(a,72719))},80443:function(e,n,a){"use strict";var t=a(2265),r=a(99376),s=a(14474),i=a(3914);n.Z=()=>{var e,n,a,o,l,g,u;let _=(0,r.useRouter)(),p="undefined"!=typeof document?(0,i.e)("token"):null;(0,t.useEffect)(()=>{p||_.replace("/sso/key/generate")},[p,_]);let d=(0,t.useMemo)(()=>{if(!p)return null;try{return(0,s.o)(p)}catch(e){return(0,i.b)(),_.replace("/sso/key/generate"),null}},[p,_]);return{token:p,accessToken:null!==(e=null==d?void 0:d.key)&&void 0!==e?e:null,userId:null!==(n=null==d?void 0:d.user_id)&&void 0!==n?n:null,userEmail:null!==(a=null==d?void 0:d.user_email)&&void 0!==a?a:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(o=null==d?void 0:d.user_role)&&void 0!==o?o:null),premiumUser:null!==(l=null==d?void 0:d.premium_user)&&void 0!==l?l:null,disabledPersonalKeyCreation:null!==(g=null==d?void 0:d.disabled_non_admin_personal_key_creation)&&void 0!==g?g:null,showSSOBanner:(null==d?void 0:d.login_method)==="username_password"}}},72719:function(e,n,a){"use strict";a.r(n);var t=a(57437),r=a(6925),s=a(80443);n.default=()=>{let{accessToken:e,userRole:n,userId:a,premiumUser:i}=(0,s.Z)();return(0,t.jsx)(r.Z,{accessToken:e,userRole:n,userID:a,premiumUser:i})}},97434:function(e,n,a){"use strict";a.d(n,{Dg:function(){return s},Lo:function(){return i},O0:function(){return r},PA:function(){return g},RD:function(){return o},Z3:function(){return l},_3:function(){return u}});let t="/ui/assets/logos/",r=[{id:"arize",displayName:"Arize",logo:"".concat(t,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_key:"password"},description:"Arize Logging Integration"},{id:"braintrust",displayName:"Braintrust",logo:"".concat(t,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{braintrust_api_key:"password",braintrust_project_name:"text"},description:"Braintrust Logging Integration"},{id:"custom_callback_api",displayName:"Custom Callback API",logo:"".concat(t,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{custom_callback_api_url:"text",custom_callback_api_headers:"text"},description:"Custom Callback API Logging Integration"},{id:"datadog",displayName:"Datadog",logo:"".concat(t,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{dd_api_key:"password",dd_site:"text"},description:"Datadog Logging Integration"},{id:"lago",displayName:"Lago",logo:"".concat(t,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{lago_api_url:"text",lago_api_key:"password"},description:"Lago Billing Logging Integration"},{id:"langfuse",displayName:"Langfuse",logo:"".concat(t,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v2 Logging Integration"},{id:"langfuse_otel",displayName:"Langfuse OTEL",logo:"".concat(t,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v3 OTEL Logging Integration"},{id:"langsmith",displayName:"LangSmith",logo:"".concat(t,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text",langsmith_sampling_rate:"number"},description:"Langsmith Logging Integration"},{id:"openmeter",displayName:"OpenMeter",logo:"".concat(t,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{openmeter_api_key:"password",openmeter_base_url:"text"},description:"OpenMeter Logging Integration"},{id:"otel",displayName:"Open Telemetry",logo:"".concat(t,"otel.png"),supports_key_team_logging:!1,dynamic_params:{otel_endpoint:"text",otel_headers:"text"},description:"OpenTelemetry Logging Integration"},{id:"s3",displayName:"S3",logo:"".concat(t,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{s3_bucket_name:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"S3 Bucket (AWS) Logging Integration"}],s=r.reduce((e,n)=>(e[n.displayName]=n,e),{}),i=r.reduce((e,n)=>(e[n.displayName]=n.id,e),{}),o=r.reduce((e,n)=>(e[n.id]=n.displayName,e),{}),l=e=>e.map(e=>i[e]||e),g=e=>e.map(e=>o[e]||e),u=e=>r.find(n=>n.id===e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,9775,2284,7908,9678,226,8049,6925,2971,2117,1744],function(){return e(e.s=96354)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-985e0bf863f7d9e2.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-985e0bf863f7d9e2.js deleted file mode 100644 index 4b7f7961c8..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-985e0bf863f7d9e2.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2445],{96354:function(e,n,t){Promise.resolve().then(t.bind(t,72719))},39760:function(e,n,t){"use strict";var a=t(2265),r=t(99376),o=t(14474),s=t(3914);n.Z=()=>{var e,n,t,i,g,l,u;let c=(0,r.useRouter)(),p="undefined"!=typeof document?(0,s.e)("token"):null;(0,a.useEffect)(()=>{p||c.replace("/sso/key/generate")},[p,c]);let _=(0,a.useMemo)(()=>{if(!p)return null;try{return(0,o.o)(p)}catch(e){return(0,s.b)(),c.replace("/sso/key/generate"),null}},[p,c]);return{token:p,accessToken:null!==(e=null==_?void 0:_.key)&&void 0!==e?e:null,userId:null!==(n=null==_?void 0:_.user_id)&&void 0!==n?n:null,userEmail:null!==(t=null==_?void 0:_.user_email)&&void 0!==t?t:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(i=null==_?void 0:_.user_role)&&void 0!==i?i:null),premiumUser:null!==(g=null==_?void 0:_.premium_user)&&void 0!==g?g:null,disabledPersonalKeyCreation:null!==(l=null==_?void 0:_.disabled_non_admin_personal_key_creation)&&void 0!==l?l:null,showSSOBanner:(null==_?void 0:_.login_method)==="username_password"}}},72719:function(e,n,t){"use strict";t.r(n);var a=t(57437),r=t(6925),o=t(39760);n.default=()=>{let{accessToken:e,userRole:n,userId:t,premiumUser:s}=(0,o.Z)();return(0,a.jsx)(r.Z,{accessToken:e,userRole:n,userID:t,premiumUser:s})}},97434:function(e,n,t){"use strict";var a,r;t.d(n,{Dg:function(){return u},Lo:function(){return o},PA:function(){return i},RD:function(){return s},Y5:function(){return a},Z3:function(){return g}}),(r=a||(a={})).Braintrust="Braintrust",r.CustomCallbackAPI="Custom Callback API",r.Datadog="Datadog",r.Langfuse="Langfuse",r.LangfuseOtel="LangfuseOtel",r.LangSmith="LangSmith",r.Lago="Lago",r.OpenMeter="OpenMeter",r.OTel="Open Telemetry",r.S3="S3",r.Arize="Arize";let o={Braintrust:"braintrust",CustomCallbackAPI:"custom_callback_api",Datadog:"datadog",Langfuse:"langfuse",LangfuseOtel:"langfuse_otel",LangSmith:"langsmith",Lago:"lago",OpenMeter:"openmeter",OTel:"otel",S3:"s3",Arize:"arize"},s=Object.fromEntries(Object.entries(o).map(e=>{let[n,t]=e;return[t,n]})),i=e=>e.map(e=>s[e]||e),g=e=>e.map(e=>o[e]||e),l="/ui/assets/logos/",u={Langfuse:{logo:"".concat(l,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v2 Logging Integration"},LangfuseOtel:{logo:"".concat(l,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v3 OTEL Logging Integration"},Arize:{logo:"".concat(l,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"text"},description:"Arize Logging Integration"},LangSmith:{logo:"".concat(l,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text",langsmith_sampling_rate:"number"},description:"Langsmith Logging Integration"},Braintrust:{logo:"".concat(l,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{},description:"Braintrust Logging Integration"},"Custom Callback API":{logo:"".concat(l,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{},description:"Custom Callback API Logging Integration"},Datadog:{logo:"".concat(l,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{},description:"Datadog Logging Integration"},Lago:{logo:"".concat(l,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{},description:"Lago Billing Logging Integration"},OpenMeter:{logo:"".concat(l,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{},description:"OpenMeter Logging Integration"},"Open Telemetry":{logo:"".concat(l,"otel.png"),supports_key_team_logging:!1,dynamic_params:{},description:"OpenTelemetry Logging Integration"},S3:{logo:"".concat(l,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{},description:"S3 Bucket (AWS) Logging Integration"}}}},function(e){e.O(0,[9820,1491,1526,2417,2926,9775,2284,7908,9678,226,8049,6925,2971,2117,1744],function(){return e(e.s=96354)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/page-1fc70b97618b643c.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/page-bb2dff1be677bb71.js similarity index 95% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/page-1fc70b97618b643c.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/page-bb2dff1be677bb71.js index 8341ee6f11..22a44d76cf 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/page-1fc70b97618b643c.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/page-bb2dff1be677bb71.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8021],{40915:function(e,n,r){Promise.resolve().then(r.bind(r,14809))},16312:function(e,n,r){"use strict";r.d(n,{z:function(){return u.Z}});var u=r(20831)},9335:function(e,n,r){"use strict";r.d(n,{JO:function(){return u.Z},OK:function(){return o.Z},nP:function(){return a.Z},td:function(){return t.Z},v0:function(){return l.Z},x4:function(){return i.Z}});var u=r(47323),o=r(12485),l=r(18135),t=r(35242),i=r(29706),a=r(77991)},39760:function(e,n,r){"use strict";var u=r(2265),o=r(99376),l=r(14474),t=r(3914);n.Z=()=>{var e,n,r,i,a,s,d;let c=(0,o.useRouter)(),_="undefined"!=typeof document?(0,t.e)("token"):null;(0,u.useEffect)(()=>{_||c.replace("/sso/key/generate")},[_,c]);let f=(0,u.useMemo)(()=>{if(!_)return null;try{return(0,l.o)(_)}catch(e){return(0,t.b)(),c.replace("/sso/key/generate"),null}},[_,c]);return{token:_,accessToken:null!==(e=null==f?void 0:f.key)&&void 0!==e?e:null,userId:null!==(n=null==f?void 0:f.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==f?void 0:f.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(i=null==f?void 0:f.user_role)&&void 0!==i?i:null),premiumUser:null!==(a=null==f?void 0:f.premium_user)&&void 0!==a?a:null,disabledPersonalKeyCreation:null!==(s=null==f?void 0:f.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==f?void 0:f.login_method)==="username_password"}}},14809:function(e,n,r){"use strict";r.r(n);var u=r(57437),o=r(85809),l=r(39760);n.default=()=>{let{accessToken:e,userRole:n,userId:r}=(0,l.Z)();return(0,u.jsx)(o.Z,{accessToken:e,userRole:n,userID:r,modelData:{}})}},51601:function(e,n,r){"use strict";r.d(n,{p:function(){return o}});var u=r(19250);let o=async e=>{try{let n=await (0,u.modelHubCall)(e);if(console.log("model_info:",n),(null==n?void 0:n.data.length)>0){let e=n.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,n)=>e.model_group.localeCompare(n.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}}}},function(e){e.O(0,[9820,1491,1526,2417,2926,9678,7281,6433,1223,901,8049,5809,2971,2117,1744],function(){return e(e.s=40915)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8021],{40915:function(e,n,r){Promise.resolve().then(r.bind(r,14809))},16312:function(e,n,r){"use strict";r.d(n,{z:function(){return u.Z}});var u=r(20831)},9335:function(e,n,r){"use strict";r.d(n,{JO:function(){return u.Z},OK:function(){return o.Z},nP:function(){return a.Z},td:function(){return t.Z},v0:function(){return l.Z},x4:function(){return i.Z}});var u=r(47323),o=r(12485),l=r(18135),t=r(35242),i=r(29706),a=r(77991)},80443:function(e,n,r){"use strict";var u=r(2265),o=r(99376),l=r(14474),t=r(3914);n.Z=()=>{var e,n,r,i,a,s,d;let c=(0,o.useRouter)(),_="undefined"!=typeof document?(0,t.e)("token"):null;(0,u.useEffect)(()=>{_||c.replace("/sso/key/generate")},[_,c]);let f=(0,u.useMemo)(()=>{if(!_)return null;try{return(0,l.o)(_)}catch(e){return(0,t.b)(),c.replace("/sso/key/generate"),null}},[_,c]);return{token:_,accessToken:null!==(e=null==f?void 0:f.key)&&void 0!==e?e:null,userId:null!==(n=null==f?void 0:f.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==f?void 0:f.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(i=null==f?void 0:f.user_role)&&void 0!==i?i:null),premiumUser:null!==(a=null==f?void 0:f.premium_user)&&void 0!==a?a:null,disabledPersonalKeyCreation:null!==(s=null==f?void 0:f.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==f?void 0:f.login_method)==="username_password"}}},14809:function(e,n,r){"use strict";r.r(n);var u=r(57437),o=r(85809),l=r(80443);n.default=()=>{let{accessToken:e,userRole:n,userId:r}=(0,l.Z)();return(0,u.jsx)(o.Z,{accessToken:e,userRole:n,userID:r,modelData:{}})}},51601:function(e,n,r){"use strict";r.d(n,{p:function(){return o}});var u=r(19250);let o=async e=>{try{let n=await (0,u.modelHubCall)(e);if(console.log("model_info:",n),(null==n?void 0:n.data.length)>0){let e=n.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,n)=>e.model_group.localeCompare(n.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}}}},function(e){e.O(0,[9820,1491,1526,2417,2926,9678,7281,6433,1223,901,8049,5809,2971,2117,1744],function(){return e(e.s=40915)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/page-f379dd301189ad65.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/page-74e4c4e7aa9329ea.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/page-f379dd301189ad65.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/page-74e4c4e7aa9329ea.js index b947a0c831..ba40cedcd4 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/page-f379dd301189ad65.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/page-74e4c4e7aa9329ea.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3117],{46034:function(e,t,r){Promise.resolve().then(r.bind(r,8719))},20831:function(e,t,r){"use strict";r.d(t,{Z:function(){return _}});var o=r(5853),n=r(1526),a=r(2265);let i=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],l=e=>({_s:e,status:i[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),s=e=>e?6:5,d=(e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return s(t)}},c=e=>"object"==typeof e?[e.enter,e.exit]:[e,e],u=(e,t)=>setTimeout(()=>{isNaN(document.body.offsetTop)||e(t+1)},0),m=(e,t,r,o,n)=>{clearTimeout(o.current);let a=l(e);t(a),r.current=a,n&&n({current:a})},g=({enter:e=!0,exit:t=!0,preEnter:r,preExit:o,timeout:n,initialEntered:i,mountOnEnter:g,unmountOnExit:h,onStateChange:p}={})=>{let[f,x]=(0,a.useState)(()=>l(i?2:s(g))),b=(0,a.useRef)(f),v=(0,a.useRef)(),[k,w]=c(n),y=(0,a.useCallback)(()=>{let e=d(b.current._s,h);e&&m(e,x,b,v,p)},[p,h]),C=(0,a.useCallback)(n=>{let a=e=>{switch(m(e,x,b,v,p),e){case 1:k>=0&&(v.current=setTimeout(y,k));break;case 4:w>=0&&(v.current=setTimeout(y,w));break;case 0:case 3:v.current=u(a,e)}},i=b.current.isEnter;"boolean"!=typeof n&&(n=!i),n?i||a(e?r?0:1:2):i&&a(t?o?3:4:s(h))},[y,p,e,t,r,o,k,w,h]);return(0,a.useEffect)(()=>()=>clearTimeout(v.current),[]),[f,C,y]};var h=r(7084),p=r(97324),f=r(1153);let x=e=>{var t=(0,o._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),a.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))};var b=r(26898);let v={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},k=e=>"light"!==e?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}},w=(e,t)=>{switch(e){case"primary":return{textColor:t?(0,f.bM)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:t?(0,f.bM)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,f.bM)(t,b.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:t?(0,f.bM)(t,b.K.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:t?(0,f.bM)(t,b.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:t?(0,f.bM)(t,b.K.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:t?(0,f.bM)(t,b.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,f.bM)(t,b.K.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,f.bM)("transparent").bgColor,hoverBgColor:t?(0,p.q)((0,f.bM)(t,b.K.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:t?(0,f.bM)(t,b.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:t?(0,f.bM)(t,b.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,f.bM)(t,b.K.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,f.bM)("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},y=(0,f.fn)("Button"),C=e=>{let{loading:t,iconSize:r,iconPosition:o,Icon:n,needMargin:i,transitionStatus:l}=e,s=i?o===h.zS.Left?(0,p.q)("-ml-1","mr-1.5"):(0,p.q)("-mr-1","ml-1.5"):"",d=(0,p.q)("w-0 h-0"),c={default:d,entering:d,entered:r,exiting:r,exited:d};return t?a.createElement(x,{className:(0,p.q)(y("icon"),"animate-spin shrink-0",s,c.default,c[l]),style:{transition:"width 150ms"}}):a.createElement(n,{className:(0,p.q)(y("icon"),"shrink-0",r,s)})},_=a.forwardRef((e,t)=>{let{icon:r,iconPosition:i=h.zS.Left,size:l=h.u8.SM,color:s,variant:d="primary",disabled:c,loading:u=!1,loadingText:m,children:x,tooltip:b,className:_}=e,E=(0,o._T)(e,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),N=u||c,j=void 0!==r||u,S=u&&m,T=!(!x&&!S),z=(0,p.q)(v[l].height,v[l].width),M="light"!==d?(0,p.q)("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",B=w(d,s),L=k(d)[l],{tooltipProps:R,getReferenceProps:Z}=(0,n.l)(300),[P,q]=g({timeout:50});return(0,a.useEffect)(()=>{q(u)},[u]),a.createElement("button",Object.assign({ref:(0,f.lq)([t,R.refs.setReference]),className:(0,p.q)(y("root"),"flex-shrink-0 inline-flex justify-center items-center group font-medium outline-none",M,L.paddingX,L.paddingY,L.fontSize,B.textColor,B.bgColor,B.borderColor,B.hoverBorderColor,N?"opacity-50 cursor-not-allowed":(0,p.q)(w(d,s).hoverTextColor,w(d,s).hoverBgColor,w(d,s).hoverBorderColor),_),disabled:N},Z,E),a.createElement(n.Z,Object.assign({text:b},R)),j&&i!==h.zS.Right?a.createElement(C,{loading:u,iconSize:z,iconPosition:i,Icon:r,transitionStatus:P.status,needMargin:T}):null,S||x?a.createElement("span",{className:(0,p.q)(y("text"),"text-tremor-default whitespace-nowrap")},S?m:x):null,j&&i===h.zS.Right?a.createElement(C,{loading:u,iconSize:z,iconPosition:i,Icon:r,transitionStatus:P.status,needMargin:T}):null)});_.displayName="Button"},12514:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var o=r(5853),n=r(2265),a=r(7084),i=r(26898),l=r(97324),s=r(1153);let d=(0,s.fn)("Card"),c=e=>{if(!e)return"";switch(e){case a.zS.Left:return"border-l-4";case a.m.Top:return"border-t-4";case a.zS.Right:return"border-r-4";case a.m.Bottom:return"border-b-4";default:return""}},u=n.forwardRef((e,t)=>{let{decoration:r="",decorationColor:a,children:u,className:m}=e,g=(0,o._T)(e,["decoration","decorationColor","children","className"]);return n.createElement("div",Object.assign({ref:t,className:(0,l.q)(d("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",a?(0,s.bM)(a,i.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",c(r),m)},g),u)});u.displayName="Card"},84264:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var o=r(26898),n=r(97324),a=r(1153),i=r(2265);let l=i.forwardRef((e,t)=>{let{color:r,className:l,children:s}=e;return i.createElement("p",{ref:t,className:(0,n.q)("text-tremor-default",r?(0,a.bM)(r,o.K.text).textColor:(0,n.q)("text-tremor-content","dark:text-dark-tremor-content"),l)},s)});l.displayName="Text"},96761:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var o=r(5853),n=r(26898),a=r(97324),i=r(1153),l=r(2265);let s=l.forwardRef((e,t)=>{let{color:r,children:s,className:d}=e,c=(0,o._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)("font-medium text-tremor-title",r?(0,i.bM)(r,n.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",d)},c),s)});s.displayName="Title"},19046:function(e,t,r){"use strict";r.d(t,{Dx:function(){return l.Z},Zb:function(){return n.Z},oi:function(){return i.Z},xv:function(){return a.Z},zx:function(){return o.Z}});var o=r(20831),n=r(12514),a=r(84264),i=r(49566),l=r(96761)},39760:function(e,t,r){"use strict";var o=r(2265),n=r(99376),a=r(14474),i=r(3914);t.Z=()=>{var e,t,r,l,s,d,c;let u=(0,n.useRouter)(),m="undefined"!=typeof document?(0,i.e)("token"):null;(0,o.useEffect)(()=>{m||u.replace("/sso/key/generate")},[m,u]);let g=(0,o.useMemo)(()=>{if(!m)return null;try{return(0,a.o)(m)}catch(e){return(0,i.b)(),u.replace("/sso/key/generate"),null}},[m,u]);return{token:m,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(t=null==g?void 0:g.user_id)&&void 0!==t?t:null,userEmail:null!==(r=null==g?void 0:g.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(l=null==g?void 0:g.user_role)&&void 0!==l?l:null),premiumUser:null!==(s=null==g?void 0:g.premium_user)&&void 0!==s?s:null,disabledPersonalKeyCreation:null!==(d=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==d?d:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},8719:function(e,t,r){"use strict";r.r(t);var o=r(57437),n=r(5183),a=r(39760);t.default=()=>{let{userId:e,userRole:t,accessToken:r}=(0,a.Z)();return(0,o.jsx)(n.Z,{userID:e,userRole:t,accessToken:r})}},5183:function(e,t,r){"use strict";var o=r(57437),n=r(2265),a=r(19046),i=r(69734),l=r(19250),s=r(9114);t.Z=e=>{let{userID:t,userRole:r,accessToken:d}=e,{logoUrl:c,setLogoUrl:u}=(0,i.F)(),[m,g]=(0,n.useState)(""),[h,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{d&&f()},[d]);let f=async()=>{try{let t=(0,l.getProxyBaseUrl)(),r=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{Authorization:"Bearer ".concat(d),"Content-Type":"application/json"}});if(r.ok){var e;let t=await r.json(),o=(null===(e=t.values)||void 0===e?void 0:e.logo_url)||"";g(o),u(o||null)}}catch(e){console.error("Error fetching theme settings:",e)}},x=async()=>{p(!0);try{let e=(0,l.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(d),"Content-Type":"application/json"},body:JSON.stringify({logo_url:m||null})})).ok)s.Z.success("Logo settings updated successfully!"),u(m||null);else throw Error("Failed to update settings")}catch(e){console.error("Error updating logo settings:",e),s.Z.fromBackend("Failed to update logo settings")}finally{p(!1)}},b=async()=>{g(""),u(null),p(!0);try{let e=(0,l.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(d),"Content-Type":"application/json"},body:JSON.stringify({logo_url:null})})).ok)s.Z.success("Logo reset to default!");else throw Error("Failed to reset logo")}catch(e){console.error("Error resetting logo:",e),s.Z.fromBackend("Failed to reset logo")}finally{p(!1)}};return d?(0,o.jsxs)("div",{className:"w-full mx-auto max-w-4xl px-6 py-8",children:[(0,o.jsxs)("div",{className:"mb-8",children:[(0,o.jsx)(a.Dx,{className:"text-2xl font-bold mb-2",children:"Logo Customization"}),(0,o.jsx)(a.xv,{className:"text-gray-600",children:"Customize your LiteLLM admin dashboard with a custom logo."})]}),(0,o.jsx)(a.Zb,{className:"shadow-sm p-6",children:(0,o.jsxs)("div",{className:"space-y-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(a.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Logo URL"}),(0,o.jsx)(a.oi,{placeholder:"https://example.com/logo.png",value:m,onValueChange:e=>{g(e),u(e||null)},className:"w-full"}),(0,o.jsx)(a.xv,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom logo or leave empty to use the default LiteLLM logo"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Current Logo"}),(0,o.jsx)("div",{className:"bg-gray-50 rounded-lg p-6 flex items-center justify-center min-h-[120px]",children:m?(0,o.jsx)("img",{src:m,alt:"Custom logo",className:"max-w-full max-h-24 object-contain",onError:e=>{var t;let r=e.target;r.style.display="none";let o=document.createElement("div");o.className="text-gray-500 text-sm",o.textContent="Failed to load image",null===(t=r.parentElement)||void 0===t||t.appendChild(o)}}):(0,o.jsx)(a.xv,{className:"text-gray-500 text-sm",children:"Default LiteLLM logo will be used"})})]}),(0,o.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,o.jsx)(a.zx,{onClick:x,loading:h,disabled:h,color:"indigo",children:"Save Changes"}),(0,o.jsx)(a.zx,{onClick:b,loading:h,disabled:h,variant:"secondary",color:"gray",children:"Reset to Default"})]})]})})]}):null}},69734:function(e,t,r){"use strict";r.d(t,{F:function(){return l},f:function(){return s}});var o=r(57437),n=r(2265),a=r(19250);let i=(0,n.createContext)(void 0),l=()=>{let e=(0,n.useContext)(i);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},s=e=>{let{children:t,accessToken:r}=e,[l,s]=(0,n.useState)(null);return(0,n.useEffect)(()=>{(async()=>{try{let t=(0,a.getProxyBaseUrl)(),r=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{"Content-Type":"application/json"}});if(r.ok){var e;let t=await r.json();(null===(e=t.values)||void 0===e?void 0:e.logo_url)&&s(t.values.logo_url)}}catch(e){console.warn("Failed to load logo settings from backend:",e)}})()},[]),(0,o.jsx)(i.Provider,{value:{logoUrl:l,setLogoUrl:s},children:t})}},14474:function(e,t,r){"use strict";r.d(t,{o:function(){return n}});class o extends Error{}function n(e,t){let r;if("string"!=typeof e)throw new o("Invalid token specified: must be a string");t||(t={});let n=!0===t.header?0:1,a=e.split(".")[n];if("string"!=typeof a)throw new o(`Invalid token specified: missing part #${n+1}`);try{r=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var r;return r=t,decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(a)}catch(e){throw new o(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new o(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}o.prototype.name="InvalidTokenError"}},function(e){e.O(0,[9820,1491,1526,8049,2971,2117,1744],function(){return e(e.s=46034)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3117],{46034:function(e,t,r){Promise.resolve().then(r.bind(r,8719))},20831:function(e,t,r){"use strict";r.d(t,{Z:function(){return _}});var o=r(5853),n=r(1526),a=r(2265);let i=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],l=e=>({_s:e,status:i[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),s=e=>e?6:5,d=(e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return s(t)}},c=e=>"object"==typeof e?[e.enter,e.exit]:[e,e],u=(e,t)=>setTimeout(()=>{isNaN(document.body.offsetTop)||e(t+1)},0),m=(e,t,r,o,n)=>{clearTimeout(o.current);let a=l(e);t(a),r.current=a,n&&n({current:a})},g=({enter:e=!0,exit:t=!0,preEnter:r,preExit:o,timeout:n,initialEntered:i,mountOnEnter:g,unmountOnExit:h,onStateChange:p}={})=>{let[f,x]=(0,a.useState)(()=>l(i?2:s(g))),b=(0,a.useRef)(f),v=(0,a.useRef)(),[k,w]=c(n),y=(0,a.useCallback)(()=>{let e=d(b.current._s,h);e&&m(e,x,b,v,p)},[p,h]),C=(0,a.useCallback)(n=>{let a=e=>{switch(m(e,x,b,v,p),e){case 1:k>=0&&(v.current=setTimeout(y,k));break;case 4:w>=0&&(v.current=setTimeout(y,w));break;case 0:case 3:v.current=u(a,e)}},i=b.current.isEnter;"boolean"!=typeof n&&(n=!i),n?i||a(e?r?0:1:2):i&&a(t?o?3:4:s(h))},[y,p,e,t,r,o,k,w,h]);return(0,a.useEffect)(()=>()=>clearTimeout(v.current),[]),[f,C,y]};var h=r(7084),p=r(97324),f=r(1153);let x=e=>{var t=(0,o._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),a.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))};var b=r(26898);let v={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},k=e=>"light"!==e?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}},w=(e,t)=>{switch(e){case"primary":return{textColor:t?(0,f.bM)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:t?(0,f.bM)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,f.bM)(t,b.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:t?(0,f.bM)(t,b.K.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:t?(0,f.bM)(t,b.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:t?(0,f.bM)(t,b.K.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:t?(0,f.bM)(t,b.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,f.bM)(t,b.K.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,f.bM)("transparent").bgColor,hoverBgColor:t?(0,p.q)((0,f.bM)(t,b.K.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:t?(0,f.bM)(t,b.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:t?(0,f.bM)(t,b.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,f.bM)(t,b.K.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,f.bM)("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},y=(0,f.fn)("Button"),C=e=>{let{loading:t,iconSize:r,iconPosition:o,Icon:n,needMargin:i,transitionStatus:l}=e,s=i?o===h.zS.Left?(0,p.q)("-ml-1","mr-1.5"):(0,p.q)("-mr-1","ml-1.5"):"",d=(0,p.q)("w-0 h-0"),c={default:d,entering:d,entered:r,exiting:r,exited:d};return t?a.createElement(x,{className:(0,p.q)(y("icon"),"animate-spin shrink-0",s,c.default,c[l]),style:{transition:"width 150ms"}}):a.createElement(n,{className:(0,p.q)(y("icon"),"shrink-0",r,s)})},_=a.forwardRef((e,t)=>{let{icon:r,iconPosition:i=h.zS.Left,size:l=h.u8.SM,color:s,variant:d="primary",disabled:c,loading:u=!1,loadingText:m,children:x,tooltip:b,className:_}=e,E=(0,o._T)(e,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),N=u||c,j=void 0!==r||u,S=u&&m,T=!(!x&&!S),z=(0,p.q)(v[l].height,v[l].width),M="light"!==d?(0,p.q)("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",B=w(d,s),L=k(d)[l],{tooltipProps:R,getReferenceProps:Z}=(0,n.l)(300),[P,q]=g({timeout:50});return(0,a.useEffect)(()=>{q(u)},[u]),a.createElement("button",Object.assign({ref:(0,f.lq)([t,R.refs.setReference]),className:(0,p.q)(y("root"),"flex-shrink-0 inline-flex justify-center items-center group font-medium outline-none",M,L.paddingX,L.paddingY,L.fontSize,B.textColor,B.bgColor,B.borderColor,B.hoverBorderColor,N?"opacity-50 cursor-not-allowed":(0,p.q)(w(d,s).hoverTextColor,w(d,s).hoverBgColor,w(d,s).hoverBorderColor),_),disabled:N},Z,E),a.createElement(n.Z,Object.assign({text:b},R)),j&&i!==h.zS.Right?a.createElement(C,{loading:u,iconSize:z,iconPosition:i,Icon:r,transitionStatus:P.status,needMargin:T}):null,S||x?a.createElement("span",{className:(0,p.q)(y("text"),"text-tremor-default whitespace-nowrap")},S?m:x):null,j&&i===h.zS.Right?a.createElement(C,{loading:u,iconSize:z,iconPosition:i,Icon:r,transitionStatus:P.status,needMargin:T}):null)});_.displayName="Button"},12514:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var o=r(5853),n=r(2265),a=r(7084),i=r(26898),l=r(97324),s=r(1153);let d=(0,s.fn)("Card"),c=e=>{if(!e)return"";switch(e){case a.zS.Left:return"border-l-4";case a.m.Top:return"border-t-4";case a.zS.Right:return"border-r-4";case a.m.Bottom:return"border-b-4";default:return""}},u=n.forwardRef((e,t)=>{let{decoration:r="",decorationColor:a,children:u,className:m}=e,g=(0,o._T)(e,["decoration","decorationColor","children","className"]);return n.createElement("div",Object.assign({ref:t,className:(0,l.q)(d("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",a?(0,s.bM)(a,i.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",c(r),m)},g),u)});u.displayName="Card"},84264:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var o=r(26898),n=r(97324),a=r(1153),i=r(2265);let l=i.forwardRef((e,t)=>{let{color:r,className:l,children:s}=e;return i.createElement("p",{ref:t,className:(0,n.q)("text-tremor-default",r?(0,a.bM)(r,o.K.text).textColor:(0,n.q)("text-tremor-content","dark:text-dark-tremor-content"),l)},s)});l.displayName="Text"},96761:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var o=r(5853),n=r(26898),a=r(97324),i=r(1153),l=r(2265);let s=l.forwardRef((e,t)=>{let{color:r,children:s,className:d}=e,c=(0,o._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)("font-medium text-tremor-title",r?(0,i.bM)(r,n.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",d)},c),s)});s.displayName="Title"},19046:function(e,t,r){"use strict";r.d(t,{Dx:function(){return l.Z},Zb:function(){return n.Z},oi:function(){return i.Z},xv:function(){return a.Z},zx:function(){return o.Z}});var o=r(20831),n=r(12514),a=r(84264),i=r(49566),l=r(96761)},80443:function(e,t,r){"use strict";var o=r(2265),n=r(99376),a=r(14474),i=r(3914);t.Z=()=>{var e,t,r,l,s,d,c;let u=(0,n.useRouter)(),m="undefined"!=typeof document?(0,i.e)("token"):null;(0,o.useEffect)(()=>{m||u.replace("/sso/key/generate")},[m,u]);let g=(0,o.useMemo)(()=>{if(!m)return null;try{return(0,a.o)(m)}catch(e){return(0,i.b)(),u.replace("/sso/key/generate"),null}},[m,u]);return{token:m,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(t=null==g?void 0:g.user_id)&&void 0!==t?t:null,userEmail:null!==(r=null==g?void 0:g.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(l=null==g?void 0:g.user_role)&&void 0!==l?l:null),premiumUser:null!==(s=null==g?void 0:g.premium_user)&&void 0!==s?s:null,disabledPersonalKeyCreation:null!==(d=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==d?d:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},8719:function(e,t,r){"use strict";r.r(t);var o=r(57437),n=r(5183),a=r(80443);t.default=()=>{let{userId:e,userRole:t,accessToken:r}=(0,a.Z)();return(0,o.jsx)(n.Z,{userID:e,userRole:t,accessToken:r})}},5183:function(e,t,r){"use strict";var o=r(57437),n=r(2265),a=r(19046),i=r(69734),l=r(19250),s=r(9114);t.Z=e=>{let{userID:t,userRole:r,accessToken:d}=e,{logoUrl:c,setLogoUrl:u}=(0,i.F)(),[m,g]=(0,n.useState)(""),[h,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{d&&f()},[d]);let f=async()=>{try{let t=(0,l.getProxyBaseUrl)(),r=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{Authorization:"Bearer ".concat(d),"Content-Type":"application/json"}});if(r.ok){var e;let t=await r.json(),o=(null===(e=t.values)||void 0===e?void 0:e.logo_url)||"";g(o),u(o||null)}}catch(e){console.error("Error fetching theme settings:",e)}},x=async()=>{p(!0);try{let e=(0,l.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(d),"Content-Type":"application/json"},body:JSON.stringify({logo_url:m||null})})).ok)s.Z.success("Logo settings updated successfully!"),u(m||null);else throw Error("Failed to update settings")}catch(e){console.error("Error updating logo settings:",e),s.Z.fromBackend("Failed to update logo settings")}finally{p(!1)}},b=async()=>{g(""),u(null),p(!0);try{let e=(0,l.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(d),"Content-Type":"application/json"},body:JSON.stringify({logo_url:null})})).ok)s.Z.success("Logo reset to default!");else throw Error("Failed to reset logo")}catch(e){console.error("Error resetting logo:",e),s.Z.fromBackend("Failed to reset logo")}finally{p(!1)}};return d?(0,o.jsxs)("div",{className:"w-full mx-auto max-w-4xl px-6 py-8",children:[(0,o.jsxs)("div",{className:"mb-8",children:[(0,o.jsx)(a.Dx,{className:"text-2xl font-bold mb-2",children:"Logo Customization"}),(0,o.jsx)(a.xv,{className:"text-gray-600",children:"Customize your LiteLLM admin dashboard with a custom logo."})]}),(0,o.jsx)(a.Zb,{className:"shadow-sm p-6",children:(0,o.jsxs)("div",{className:"space-y-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(a.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Logo URL"}),(0,o.jsx)(a.oi,{placeholder:"https://example.com/logo.png",value:m,onValueChange:e=>{g(e),u(e||null)},className:"w-full"}),(0,o.jsx)(a.xv,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom logo or leave empty to use the default LiteLLM logo"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Current Logo"}),(0,o.jsx)("div",{className:"bg-gray-50 rounded-lg p-6 flex items-center justify-center min-h-[120px]",children:m?(0,o.jsx)("img",{src:m,alt:"Custom logo",className:"max-w-full max-h-24 object-contain",onError:e=>{var t;let r=e.target;r.style.display="none";let o=document.createElement("div");o.className="text-gray-500 text-sm",o.textContent="Failed to load image",null===(t=r.parentElement)||void 0===t||t.appendChild(o)}}):(0,o.jsx)(a.xv,{className:"text-gray-500 text-sm",children:"Default LiteLLM logo will be used"})})]}),(0,o.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,o.jsx)(a.zx,{onClick:x,loading:h,disabled:h,color:"indigo",children:"Save Changes"}),(0,o.jsx)(a.zx,{onClick:b,loading:h,disabled:h,variant:"secondary",color:"gray",children:"Reset to Default"})]})]})})]}):null}},69734:function(e,t,r){"use strict";r.d(t,{F:function(){return l},f:function(){return s}});var o=r(57437),n=r(2265),a=r(19250);let i=(0,n.createContext)(void 0),l=()=>{let e=(0,n.useContext)(i);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},s=e=>{let{children:t,accessToken:r}=e,[l,s]=(0,n.useState)(null);return(0,n.useEffect)(()=>{(async()=>{try{let t=(0,a.getProxyBaseUrl)(),r=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{"Content-Type":"application/json"}});if(r.ok){var e;let t=await r.json();(null===(e=t.values)||void 0===e?void 0:e.logo_url)&&s(t.values.logo_url)}}catch(e){console.warn("Failed to load logo settings from backend:",e)}})()},[]),(0,o.jsx)(i.Provider,{value:{logoUrl:l,setLogoUrl:s},children:t})}},14474:function(e,t,r){"use strict";r.d(t,{o:function(){return n}});class o extends Error{}function n(e,t){let r;if("string"!=typeof e)throw new o("Invalid token specified: must be a string");t||(t={});let n=!0===t.header?0:1,a=e.split(".")[n];if("string"!=typeof a)throw new o(`Invalid token specified: missing part #${n+1}`);try{r=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var r;return r=t,decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(a)}catch(e){throw new o(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new o(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}o.prototype.name="InvalidTokenError"}},function(e){e.O(0,[9820,1491,1526,8049,2971,2117,1744],function(){return e(e.s=46034)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-7a73148e728ec98a.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-7a73148e728ec98a.js deleted file mode 100644 index 34dac74c92..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-7a73148e728ec98a.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9483],{77403:function(e,s,l){Promise.resolve().then(l.bind(l,67578))},40728:function(e,s,l){"use strict";l.d(s,{C:function(){return a.Z},x:function(){return t.Z}});var a=l(41649),t=l(84264)},88913:function(e,s,l){"use strict";l.d(s,{Dx:function(){return c.Z},Zb:function(){return t.Z},iz:function(){return r.Z},oi:function(){return n.Z},xv:function(){return i.Z},zx:function(){return a.Z}});var a=l(20831),t=l(12514),r=l(67982),i=l(84264),n=l(49566),c=l(96761)},25512:function(e,s,l){"use strict";l.d(s,{P:function(){return a.Z},Q:function(){return t.Z}});var a=l(27281),t=l(57365)},67578:function(e,s,l){"use strict";l.r(s),l.d(s,{default:function(){return ej}});var a=l(57437),t=l(2265),r=l(19250),i=l(39210),n=l(13634),c=l(33293),o=l(88904),d=l(20347),m=l(20831),x=l(12514),u=l(49804),h=l(67101),g=l(29706),p=l(84264),j=l(918),f=l(59872),b=l(47323),v=l(12485),y=l(18135),_=l(35242),N=l(77991),w=l(23628),Z=e=>{let{lastRefreshed:s,onRefresh:l,userRole:t,children:r}=e;return(0,a.jsxs)(y.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(_.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(v.Z,{children:"Your Teams"}),(0,a.jsx)(v.Z,{children:"Available Teams"}),(0,d.tY)(t||"")&&(0,a.jsx)(v.Z,{children:"Default Team Settings"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,a.jsxs)(p.Z,{children:["Last Refreshed: ",s]}),(0,a.jsx)(b.Z,{icon:w.Z,variant:"shadow",size:"xs",className:"self-center",onClick:l})]})]}),(0,a.jsx)(N.Z,{children:r})]})},C=l(25512),S=e=>{let{filters:s,organizations:l,showFilters:t,onToggleFilters:r,onChange:i,onReset:n}=e;return(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("div",{className:"relative w-64",children:[(0,a.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:s.team_alias,onChange:e=>i("team_alias",e.target.value)}),(0,a.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,a.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(t?"bg-gray-100":""),onClick:()=>r(!t),children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(s.team_id||s.team_alias||s.organization_id)&&(0,a.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,a.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:n,children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),t&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,a.jsxs)("div",{className:"relative w-64",children:[(0,a.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:s.team_id,onChange:e=>i("team_id",e.target.value)}),(0,a.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,a.jsx)("div",{className:"w-64",children:(0,a.jsx)(C.P,{value:s.organization_id||"",onValueChange:e=>i("organization_id",e),placeholder:"Select Organization",children:null==l?void 0:l.map(e=>(0,a.jsx)(C.Q,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})},k=l(39760),T=e=>{let{currentOrg:s,setTeams:l}=e,[a,r]=(0,t.useState)(""),{accessToken:n,userId:c,userRole:o}=(0,k.Z)(),d=(0,t.useCallback)(()=>{r(new Date().toLocaleString())},[]);return(0,t.useEffect)(()=>{n&&(0,i.Z)(n,c,o,s,l).then(),d()},[n,s,a,d,l,c,o]),{lastRefreshed:a,setLastRefreshed:r,onRefreshClick:d}},M=l(21626),z=l(97214),A=l(28241),E=l(58834),D=l(69552),F=l(71876),L=l(89970),P=l(53410),O=l(74998),I=l(41649),V=l(86462),R=l(47686),B=l(46468),W=e=>{let{team:s}=e,[l,r]=(0,t.useState)(!1);return(0,a.jsx)(A.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:s.models.length>3?"px-0":"",children:(0,a.jsx)("div",{className:"flex flex-col",children:Array.isArray(s.models)?(0,a.jsx)("div",{className:"flex flex-col",children:0===s.models.length?(0,a.jsx)(I.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex items-start",children:[s.models.length>3&&(0,a.jsx)("div",{children:(0,a.jsx)(b.Z,{icon:l?V.Z:R.Z,className:"cursor-pointer",size:"xs",onClick:()=>{r(e=>!e)}})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,a.jsx)(I.Z,{size:"xs",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})},s):(0,a.jsx)(I.Z,{size:"xs",color:"blue",children:(0,a.jsx)(p.Z,{children:e.length>30?"".concat((0,B.W0)(e).slice(0,30),"..."):(0,B.W0)(e)})},s)),s.models.length>3&&!l&&(0,a.jsx)(I.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,a.jsxs)(p.Z,{children:["+",s.models.length-3," ",s.models.length-3==1?"more model":"more models"]})}),l&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:s.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,a.jsx)(I.Z,{size:"xs",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})},s+3):(0,a.jsx)(I.Z,{size:"xs",color:"blue",children:(0,a.jsx)(p.Z,{children:e.length>30?"".concat((0,B.W0)(e).slice(0,30),"..."):(0,B.W0)(e)})},s+3))})]})]})})}):null})})},U=l(88906),G=l(92369),J=e=>{let s="inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium border";return"admin"===e?(0,a.jsxs)("span",{className:s,style:{backgroundColor:"#EEF2FF",color:"#3730A3",borderColor:"#C7D2FE"},children:[(0,a.jsx)(U.Z,{className:"h-3 w-3 mr-1"}),"Admin"]}):(0,a.jsxs)("span",{className:s,style:{backgroundColor:"#F3F4F6",color:"#4B5563",borderColor:"#E5E7EB"},children:[(0,a.jsx)(G.Z,{className:"h-3 w-3 mr-1"}),"Member"]})};let Q=(e,s)=>{var l,a;if(!s)return null;let t=null===(l=e.members_with_roles)||void 0===l?void 0:l.find(e=>e.user_id===s);return null!==(a=null==t?void 0:t.role)&&void 0!==a?a:null};var q=e=>{let{team:s,userId:l}=e,t=J(Q(s,l));return(0,a.jsx)(A.Z,{children:t})},K=e=>{let{teams:s,currentOrg:l,setSelectedTeamId:t,perTeamInfo:r,userRole:i,userId:n,setEditTeam:c,onDeleteTeam:o}=e;return(0,a.jsxs)(M.Z,{children:[(0,a.jsx)(E.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(D.Z,{children:"Team Name"}),(0,a.jsx)(D.Z,{children:"Team ID"}),(0,a.jsx)(D.Z,{children:"Created"}),(0,a.jsx)(D.Z,{children:"Spend (USD)"}),(0,a.jsx)(D.Z,{children:"Budget (USD)"}),(0,a.jsx)(D.Z,{children:"Models"}),(0,a.jsx)(D.Z,{children:"Organization"}),(0,a.jsx)(D.Z,{children:"Your Role"}),(0,a.jsx)(D.Z,{children:"Info"})]})}),(0,a.jsx)(z.Z,{children:s&&s.length>0?s.filter(e=>!l||e.organization_id===l.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,a.jsx)(A.Z,{children:(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(L.Z,{title:e.team_id,children:(0,a.jsxs)(m.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{t(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,f.pw)(e.spend,4)}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,a.jsx)(W,{team:e}),(0,a.jsx)(A.Z,{children:e.organization_id}),(0,a.jsx)(q,{team:e,userId:n}),(0,a.jsxs)(A.Z,{children:[(0,a.jsxs)(p.Z,{children:[r&&e.team_id&&r[e.team_id]&&r[e.team_id].keys&&r[e.team_id].keys.length," ","Keys"]}),(0,a.jsxs)(p.Z,{children:[r&&e.team_id&&r[e.team_id]&&r[e.team_id].team_info&&r[e.team_id].team_info.members_with_roles&&r[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,a.jsx)(A.Z,{children:"Admin"==i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.Z,{icon:P.Z,size:"sm",onClick:()=>{t(e.team_id),c(!0)}}),(0,a.jsx)(b.Z,{onClick:()=>o(e.team_id),icon:O.Z,size:"sm"})]}):null})]},e.team_id)):null})]})},X=l(32489),Y=l(76865),H=e=>{var s;let{teams:l,teamToDelete:r,onCancel:i,onConfirm:n}=e,[c,o]=(0,t.useState)(""),d=null==l?void 0:l.find(e=>e.team_id===r),m=(null==d?void 0:d.team_alias)||"",x=(null==d?void 0:null===(s=d.keys)||void 0===s?void 0:s.length)||0,u=c===m;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Team"}),(0,a.jsx)("button",{onClick:()=>{i(),o("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,a.jsx)(X.Z,{size:20})})]}),(0,a.jsxs)("div",{className:"px-6 py-4",children:[x>0&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,a.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,a.jsx)(Y.Z,{size:20})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-base font-medium text-red-600",children:["Warning: This team has ",x," associated key",x>1?"s":"","."]}),(0,a.jsx)("p",{className:"text-base text-red-600 mt-2",children:"Deleting the team will also delete all associated keys. This action is irreversible."})]})]}),(0,a.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to force delete this team and all its keys?"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,a.jsx)("span",{className:"underline",children:m})," to confirm deletion:"]}),(0,a.jsx)("input",{type:"text",value:c,onChange:e=>o(e.target.value),placeholder:"Enter team name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,a.jsx)("button",{onClick:()=>{i(),o("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,a.jsx)("button",{onClick:n,disabled:!u,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(u?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Force Delete"})]})]})})},$=l(82680),ee=l(52787),es=l(64482),el=l(73002),ea=l(26210),et=l(15424),er=l(24199),ei=l(97415),en=l(95920),ec=l(2597),eo=l(51750),ed=l(9114),em=l(68473);let ex=(e,s)=>{let l=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),l=e.models):l=s,(0,B.Ob)(l,s)};var eu=e=>{let{isTeamModalVisible:s,handleOk:l,handleCancel:i,currentOrg:c,organizations:o,teams:d,setTeams:m,modelAliases:x,setModelAliases:u,loggingSettings:h,setLoggingSettings:g,setIsTeamModalVisible:p}=e,{userId:j,userRole:f,accessToken:b,premiumUser:v}=(0,k.Z)(),[y]=n.Z.useForm(),[_,N]=(0,t.useState)([]),[w,Z]=(0,t.useState)(null),[C,S]=(0,t.useState)([]),[T,M]=(0,t.useState)([]),[z,A]=(0,t.useState)([]),[E,D]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(async()=>{try{if(null===j||null===f||null===b)return;let e=await (0,B.K2)(j,f,b);e&&N(e)}catch(e){console.error("Error fetching user models:",e)}})()},[b,j,f,d]),(0,t.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(w));let e=ex(w,_);console.log("models: ".concat(e)),S(e),y.setFieldValue("models",[])},[w,_]),(0,t.useEffect)(()=>{F()},[b]),(0,t.useEffect)(()=>{(async()=>{try{if(null==b)return;let e=(await (0,r.getGuardrailsList)(b)).guardrails.map(e=>e.guardrail_name);M(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[b]);let F=async()=>{try{if(null==b)return;let e=await (0,r.fetchMCPAccessGroups)(b);A(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}},P=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=b){var s,l,a;let t=null==e?void 0:e.team_alias,i=null!==(a=null==d?void 0:d.map(e=>e.team_alias))&&void 0!==a?a:[],n=(null==e?void 0:e.organization_id)||(null==c?void 0:c.organization_id);if(""===n||"string"!=typeof n?e.organization_id=null:e.organization_id=n.trim(),i.includes(t))throw Error("Team alias ".concat(t," already exists, please pick another alias"));if(ed.Z.info("Creating Team"),h.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:h.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(s=e.allowed_mcp_servers_and_groups.servers)||void 0===s?void 0:s.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0||e.allowed_mcp_servers_and_groups.toolPermissions)){if(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups){let{servers:s,accessGroups:l}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),l&&l.length>0&&(e.object_permission.mcp_access_groups=l),delete e.allowed_mcp_servers_and_groups}e.mcp_tool_permissions&&Object.keys(e.mcp_tool_permissions).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=e.mcp_tool_permissions,delete e.mcp_tool_permissions)}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(x).length>0&&(e.model_aliases=x);let o=await (0,r.teamCreateCall)(b,e);null!==d?m([...d,o]):m([o]),console.log("response for team create call: ".concat(o)),ed.Z.success("Team created"),y.resetFields(),g([]),u({}),p(!1)}}catch(e){console.error("Error creating the team:",e),ed.Z.fromBackend("Error creating the team: "+e)}};return(0,a.jsx)($.Z,{title:"Create Team",open:s,width:1e3,footer:null,onOk:l,onCancel:i,children:(0,a.jsxs)(n.Z,{form:y,onFinish:P,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(ea.oi,{placeholder:""})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Organization"," ",(0,a.jsx)(L.Z,{title:(0,a.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:c?c.organization_id:null,className:"mt-8",children:(0,a.jsx)(ee.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{y.setFieldValue("organization_id",e),Z((null==o?void 0:o.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var l;return!!s&&((null===(l=s.children)||void 0===l?void 0:l.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==o?void 0:o.map(e=>(0,a.jsxs)(ee.default.Option,{value:e.organization_id,children:[(0,a.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,a.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Models"," ",(0,a.jsx)(L.Z,{title:"These are the models that your selected team has access to",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,a.jsxs)(ee.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(ee.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),C.map(e=>(0,a.jsx)(ee.default.Option,{value:e,children:(0,B.W0)(e)},e))]})}),(0,a.jsx)(n.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(er.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(n.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(ee.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(ee.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(ee.default.Option,{value:"7d",children:"weekly"}),(0,a.jsx)(ee.default.Option,{value:"30d",children:"monthly"})]})}),(0,a.jsx)(n.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsxs)(ea.UQ,{className:"mt-20 mb-8",onClick:()=>{E||(F(),D(!0))},children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Additional Settings"})}),(0,a.jsxs)(ea.X1,{children:[(0,a.jsx)(n.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,a.jsx)(ea.oi,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,a.jsx)(n.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,a.jsx)(er.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(n.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,a.jsx)(ea.oi,{placeholder:"e.g., 30d"})}),(0,a.jsx)(n.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,a.jsx)(es.default.TextArea,{rows:4})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Guardrails"," ",(0,a.jsx)(L.Z,{title:"Setup your first guardrail",children:(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,a.jsx)(ee.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:T.map(e=>({value:e,label:e}))})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,a.jsx)(L.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,a.jsx)(ei.Z,{onChange:e=>y.setFieldValue("allowed_vector_store_ids",e),value:y.getFieldValue("allowed_vector_store_ids"),accessToken:b||"",placeholder:"Select vector stores (optional)"})})]})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"MCP Settings"})}),(0,a.jsxs)(ea.X1,{children:[(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,a.jsx)(L.Z,{title:"Select which MCP servers or access groups this team can access",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,a.jsx)(en.Z,{onChange:e=>y.setFieldValue("allowed_mcp_servers_and_groups",e),value:y.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:b||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(n.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(es.default,{type:"hidden"})}),(0,a.jsx)(n.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,a.jsx)("div",{className:"mt-6",children:(0,a.jsx)(em.Z,{accessToken:b||"",selectedServers:(null===(e=y.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:y.getFieldValue("mcp_tool_permissions")||{},onChange:e=>y.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Logging Settings"})}),(0,a.jsx)(ea.X1,{children:(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(ec.Z,{value:h,onChange:g,premiumUser:v})})})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Model Aliases"})}),(0,a.jsx)(ea.X1,{children:(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)(ea.xv,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,a.jsx)(eo.Z,{accessToken:b||"",initialModelAliases:x,onAliasUpdate:u,showExampleConfig:!1})]})})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(el.ZP,{htmlType:"submit",children:"Create Team"})})]})})},eh=e=>{let{teams:s,accessToken:l,setTeams:b,userID:v,userRole:y,organizations:_,premiumUser:N=!1}=e,[w,C]=(0,t.useState)(null),[k,M]=(0,t.useState)(!1),[z,A]=(0,t.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),[E]=n.Z.useForm(),[D]=n.Z.useForm(),[F,L]=(0,t.useState)(null),[P,O]=(0,t.useState)(!1),[I,V]=(0,t.useState)(!1),[R,B]=(0,t.useState)(!1),[W,U]=(0,t.useState)(!1),[G,J]=(0,t.useState)([]),[Q,q]=(0,t.useState)(!1),[X,Y]=(0,t.useState)(null),[$,ee]=(0,t.useState)({}),[es,el]=(0,t.useState)([]),[ea,et]=(0,t.useState)({}),{lastRefreshed:er,onRefreshClick:ei}=T({currentOrg:w,setTeams:b});(0,t.useEffect)(()=>{s&&ee(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let en=async e=>{Y(e),q(!0)},ec=async()=>{if(null!=X&&null!=s&&null!=l){try{await (0,r.teamDeleteCall)(l,X),(0,i.Z)(l,v,y,w,b)}catch(e){console.error("Error deleting the team:",e)}q(!1),Y(null)}};return(0,a.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,a.jsx)(h.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,a.jsxs)(u.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==y||"Org Admin"==y)&&(0,a.jsx)(m.Z,{className:"w-fit",onClick:()=>V(!0),children:"+ Create New Team"}),F?(0,a.jsx)(c.Z,{teamId:F,onUpdate:e=>{b(s=>{if(null==s)return s;let a=s.map(s=>e.team_id===s.team_id?(0,f.nl)(s,e):s);return l&&(0,i.Z)(l,v,y,w,b),a})},onClose:()=>{L(null),O(!1)},accessToken:l,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;se.team_id===F)),is_proxy_admin:"Admin"==y,userModels:G,editTeam:P}):(0,a.jsxs)(Z,{lastRefreshed:er,onRefresh:ei,userRole:y,children:[(0,a.jsxs)(g.Z,{children:[(0,a.jsxs)(p.Z,{children:["Click on “Team ID” to view team details ",(0,a.jsx)("b",{children:"and"})," manage team members."]}),(0,a.jsx)(h.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,a.jsx)(u.Z,{numColSpan:1,children:(0,a.jsxs)(x.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,a.jsx)("div",{className:"border-b px-6 py-4",children:(0,a.jsx)("div",{className:"flex flex-col space-y-4",children:(0,a.jsx)(S,{filters:z,organizations:_,showFilters:k,onToggleFilters:M,onChange:(e,s)=>{let a={...z,[e]:s};A(a),l&&(0,r.v2TeamListCall)(l,a.organization_id||null,null,a.team_id||null,a.team_alias||null).then(e=>{e&&e.teams&&b(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},onReset:()=>{A({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),l&&(0,r.v2TeamListCall)(l,null,v||null,null,null).then(e=>{e&&e.teams&&b(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})}})})}),(0,a.jsx)(K,{teams:s,currentOrg:w,perTeamInfo:$,userRole:y,userId:v,setSelectedTeamId:L,setEditTeam:O,onDeleteTeam:en}),Q&&(0,a.jsx)(H,{teams:s,teamToDelete:X,onCancel:()=>{q(!1),Y(null)},onConfirm:ec})]})})})]}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(j.Z,{accessToken:l,userID:v})}),(0,d.tY)(y||"")&&(0,a.jsx)(g.Z,{children:(0,a.jsx)(o.Z,{accessToken:l,userID:v||"",userRole:y||""})})]}),("Admin"==y||"Org Admin"==y)&&(0,a.jsx)(eu,{isTeamModalVisible:I,handleOk:()=>{V(!1),E.resetFields(),el([]),et({})},handleCancel:()=>{V(!1),E.resetFields(),el([]),et({})},currentOrg:w,organizations:_,teams:s,setTeams:b,modelAliases:ea,setModelAliases:et,loggingSettings:es,setLoggingSettings:el,setIsTeamModalVisible:V})]})})})},eg=l(11318),ep=l(22004),ej=()=>{let{accessToken:e,userId:s,userRole:l}=(0,k.Z)(),{teams:r,setTeams:i}=(0,eg.Z)(),[n,c]=(0,t.useState)([]);return(0,t.useEffect)(()=>{(0,ep.g)(e,c).then(()=>{})},[e]),(0,a.jsx)(eh,{teams:r,accessToken:e,setTeams:i,userID:s,userRole:l,organizations:n})}},88904:function(e,s,l){"use strict";var a=l(57437),t=l(2265),r=l(88913),i=l(93192),n=l(52787),c=l(63709),o=l(87908),d=l(19250),m=l(65925),x=l(46468),u=l(9114);s.Z=e=>{var s;let{accessToken:l,userID:h,userRole:g}=e,[p,j]=(0,t.useState)(!0),[f,b]=(0,t.useState)(null),[v,y]=(0,t.useState)(!1),[_,N]=(0,t.useState)({}),[w,Z]=(0,t.useState)(!1),[C,S]=(0,t.useState)([]),{Paragraph:k}=i.default,{Option:T}=n.default;(0,t.useEffect)(()=>{(async()=>{if(!l){j(!1);return}try{let e=await (0,d.getDefaultTeamSettings)(l);if(b(e),N(e.values||{}),l)try{let e=await (0,d.modelAvailableCall)(l,h,g);if(e&&e.data){let s=e.data.map(e=>e.id);S(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),u.Z.fromBackend("Failed to fetch team settings")}finally{j(!1)}})()},[l]);let M=async()=>{if(l){Z(!0);try{let e=await (0,d.updateDefaultTeamSettings)(l,_);b({...f,values:e.settings}),y(!1),u.Z.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),u.Z.fromBackend("Failed to update team settings")}finally{Z(!1)}}},z=(e,s)=>{N(l=>({...l,[e]:s}))},A=(e,s,l)=>{var t;let i=s.type;return"budget_duration"===e?(0,a.jsx)(m.Z,{value:_[e]||null,onChange:s=>z(e,s),className:"mt-2"}):"boolean"===i?(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(c.Z,{checked:!!_[e],onChange:s=>z(e,s)})}):"array"===i&&(null===(t=s.items)||void 0===t?void 0:t.enum)?(0,a.jsx)(n.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>z(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,a.jsx)(T,{value:e,children:e},e))}):"models"===e?(0,a.jsx)(n.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>z(e,s),className:"mt-2",children:C.map(e=>(0,a.jsx)(T,{value:e,children:(0,x.W0)(e)},e))}):"string"===i&&s.enum?(0,a.jsx)(n.default,{style:{width:"100%"},value:_[e]||"",onChange:s=>z(e,s),className:"mt-2",children:s.enum.map(e=>(0,a.jsx)(T,{value:e,children:e},e))}):(0,a.jsx)(r.oi,{value:void 0!==_[e]?String(_[e]):"",onChange:s=>z(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},E=(e,s)=>null==s?(0,a.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,a.jsx)("span",{children:(0,m.m)(s)}):"boolean"==typeof s?(0,a.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,a.jsx)("span",{className:"text-gray-400",children:"None"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,x.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,a.jsx)("span",{className:"text-gray-400",children:"None"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,a.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,a.jsx)("span",{children:String(s)});return p?(0,a.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,a.jsx)(o.Z,{size:"large"})}):f?(0,a.jsxs)(r.Zb,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(r.Dx,{className:"text-xl",children:"Default Team Settings"}),!p&&f&&(v?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(r.zx,{variant:"secondary",onClick:()=>{y(!1),N(f.values||{})},disabled:w,children:"Cancel"}),(0,a.jsx)(r.zx,{onClick:M,loading:w,children:"Save Changes"})]}):(0,a.jsx)(r.zx,{onClick:()=>y(!0),children:"Edit Settings"}))]}),(0,a.jsx)(r.xv,{children:"These settings will be applied by default when creating new teams."}),(null==f?void 0:null===(s=f.field_schema)||void 0===s?void 0:s.description)&&(0,a.jsx)(k,{className:"mb-4 mt-2",children:f.field_schema.description}),(0,a.jsx)(r.iz,{}),(0,a.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=f;return s&&s.properties?Object.entries(s.properties).map(s=>{let[l,t]=s,i=e[l],n=l.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,a.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,a.jsx)(r.xv,{className:"font-medium text-lg",children:n}),(0,a.jsx)(k,{className:"text-sm text-gray-500 mt-1",children:t.description||"No description available"}),v?(0,a.jsx)("div",{className:"mt-2",children:A(l,t,i)}):(0,a.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:E(l,i)})]},l)}):(0,a.jsx)(r.xv,{children:"No schema information available"})})()})]}):(0,a.jsx)(r.Zb,{children:(0,a.jsx)(r.xv,{children:"No team settings available or you do not have permission to view them."})})}},51750:function(e,s,l){"use strict";l.d(s,{Z:function(){return g}});var a=l(57437),t=l(2265),r=l(77355),i=l(93416),n=l(74998),c=l(95704),o=l(56522),d=l(52787),m=l(69993),x=l(51601),u=e=>{let{accessToken:s,value:l,placeholder:r="Select a Model",onChange:i,disabled:n=!1,style:c,className:u,showLabel:h=!0,labelText:g="Select Model"}=e,[p,j]=(0,t.useState)(l),[f,b]=(0,t.useState)(!1),[v,y]=(0,t.useState)([]),_=(0,t.useRef)(null);return(0,t.useEffect)(()=>{j(l)},[l]),(0,t.useEffect)(()=>{s&&(async()=>{try{let e=await (0,x.p)(s);console.log("Fetched models for selector:",e),e.length>0&&y(e)}catch(e){console.error("Error fetching model info:",e)}})()},[s]),(0,a.jsxs)("div",{children:[h&&(0,a.jsxs)(o.x,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-2"})," ",g]}),(0,a.jsx)(d.default,{value:p,placeholder:r,onChange:e=>{"custom"===e?(b(!0),j(void 0)):(b(!1),j(e),i&&i(e))},options:[...Array.from(new Set(v.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...c},showSearch:!0,className:"rounded-md ".concat(u||""),disabled:n}),f&&(0,a.jsx)(o.o,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{j(e),i&&i(e)},500)},disabled:n})]})},h=l(9114),g=e=>{let{accessToken:s,initialModelAliases:l={},onAliasUpdate:o,showExampleConfig:d=!0}=e,[m,x]=(0,t.useState)([]),[g,p]=(0,t.useState)({aliasName:"",targetModel:""}),[j,f]=(0,t.useState)(null);(0,t.useEffect)(()=>{x(Object.entries(l).map((e,s)=>{let[l,a]=e;return{id:"".concat(s,"-").concat(l),aliasName:l,targetModel:a}}))},[l]);let b=e=>{f({...e})},v=()=>{if(!j)return;if(!j.aliasName||!j.targetModel){h.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.id!==j.id&&e.aliasName===j.aliasName)){h.Z.fromBackend("An alias with this name already exists");return}let e=m.map(e=>e.id===j.id?j:e);x(e),f(null);let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),o&&o(s),h.Z.success("Alias updated successfully")},y=()=>{f(null)},_=e=>{let s=m.filter(s=>s.id!==e);x(s);let l={};s.forEach(e=>{l[e.aliasName]=e.targetModel}),o&&o(l),h.Z.success("Alias deleted successfully")},N=m.reduce((e,s)=>(e[s.aliasName]=s.targetModel,e),{});return(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(c.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,a.jsx)("input",{type:"text",value:g.aliasName,onChange:e=>p({...g,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model"}),(0,a.jsx)(u,{accessToken:s,value:g.targetModel,placeholder:"Select target model",onChange:e=>p({...g,targetModel:e}),showLabel:!1})]}),(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsxs)("button",{onClick:()=>{if(!g.aliasName||!g.targetModel){h.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.aliasName===g.aliasName)){h.Z.fromBackend("An alias with this name already exists");return}let e=[...m,{id:"".concat(Date.now(),"-").concat(g.aliasName),aliasName:g.aliasName,targetModel:g.targetModel}];x(e),p({aliasName:"",targetModel:""});let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),o&&o(s),h.Z.success("Alias added successfully")},disabled:!g.aliasName||!g.targetModel,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(g.aliasName&&g.targetModel?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,a.jsx)(r.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,a.jsx)(c.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,a.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)(c.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,a.jsx)(c.ss,{children:(0,a.jsxs)(c.SC,{children:[(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Target Model"}),(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,a.jsxs)(c.RM,{children:[m.map(e=>(0,a.jsx)(c.SC,{className:"h-8",children:j&&j.id===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:j.aliasName,onChange:e=>f({...j,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(c.pj,{className:"py-0.5",children:(0,a.jsx)(u,{accessToken:s,value:j.targetModel,onChange:e=>f({...j,targetModel:e}),showLabel:!1,style:{height:"32px"}})}),(0,a.jsx)(c.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:v,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,a.jsx)("button",{onClick:y,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,a.jsx)(c.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModel}),(0,a.jsx)(c.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>b(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,a.jsx)(i.Z,{className:"w-3 h-3"})}),(0,a.jsx)("button",{onClick:()=>_(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,a.jsx)(n.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===m.length&&(0,a.jsx)(c.SC,{children:(0,a.jsx)(c.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),d&&(0,a.jsxs)(c.Zb,{children:[(0,a.jsx)(c.Dx,{className:"mb-4",children:"Configuration Example"}),(0,a.jsx)(c.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config:"}),(0,a.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,a.jsxs)("div",{className:"text-gray-700",children:["model_aliases:",0===Object.keys(N).length?(0,a.jsxs)("span",{className:"text-gray-500",children:[(0,a.jsx)("br",{}),"\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[s,l]=e;return(0,a.jsxs)("span",{children:[(0,a.jsx)("br",{}),'\xa0\xa0"',s,'": "',l,'"']},s)})]})})]})]})}},2597:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(92280),r=l(54507);s.Z=function(e){let{value:s,onChange:l,premiumUser:i=!1,disabledCallbacks:n=[],onDisabledCallbacksChange:c}=e;return i?(0,a.jsx)(r.Z,{value:s,onChange:l,disabledCallbacks:n,onDisabledCallbacksChange:c}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,a.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,a.jsxs)(t.x,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key"," ",(0,a.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})}},65925:function(e,s,l){"use strict";l.d(s,{m:function(){return i}});var a=l(57437);l(2265);var t=l(52787);let{Option:r}=t.default,i=e=>e?({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set";s.Z=e=>{let{value:s,onChange:l,className:i="",style:n={}}=e;return(0,a.jsxs)(t.default,{style:{width:"100%",...n},value:s||void 0,onChange:l,className:i,placeholder:"n/a",children:[(0,a.jsx)(r,{value:"24h",children:"daily"}),(0,a.jsx)(r,{value:"7d",children:"weekly"}),(0,a.jsx)(r,{value:"30d",children:"monthly"})]})}},39210:function(e,s,l){"use strict";l.d(s,{Z:function(){return t}});var a=l(19250);let t=async(e,s,l,t,r)=>{let i;i="Admin"!=l&&"Admin Viewer"!=l?await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null,s):await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null),console.log("givenTeams: ".concat(i)),r(i)}},27799:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(40728),r=l(82182),i=l(91777),n=l(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:l=[],variant:c="card",className:o=""}=e,d=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[l,a]=s;return a===e}))||void 0===s?void 0:s[0])||e},m=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},x=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},u=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,a.jsx)(t.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var l;let i=d(e.callback_name),c=null===(l=n.Dg[i])||void 0===l?void 0:l.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[c?(0,a.jsx)("img",{src:c,alt:i,className:"w-5 h-5 object-contain"}):(0,a.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-medium text-blue-800",children:i}),(0,a.jsxs)(t.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,a.jsx)(t.C,{color:m(e.callback_type),size:"sm",children:x(e.callback_type)})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(t.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,a.jsx)(t.C,{color:"red",size:"xs",children:l.length})]}),l.length>0?(0,a.jsx)("div",{className:"space-y-3",children:l.map((e,s)=>{var l;let r=n.RD[e]||e,c=null===(l=n.Dg[r])||void 0===l?void 0:l.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[c?(0,a.jsx)("img",{src:c,alt:r,className:"w-5 h-5 object-contain"}):(0,a.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-medium text-red-800",children:r}),(0,a.jsx)(t.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,a.jsx)(t.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(t.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===c?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,a.jsx)(t.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(t.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),u]})}},98015:function(e,s,l){"use strict";l.d(s,{Z:function(){return g}});var a=l(57437),t=l(2265),r=l(92280),i=l(40728),n=l(79814),c=l(19250),o=function(e){let{vectorStores:s,accessToken:l}=e,[r,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{(async()=>{if(l&&0!==s.length)try{let e=await (0,c.vectorStoreListCall)(l);e.data&&o(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[l,s.length]);let d=e=>{let s=r.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:d(e)},s))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},d=l(25327),m=l(86462),x=l(47686),u=l(89970),h=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:o}=e,[h,g]=(0,t.useState)([]),[p,j]=(0,t.useState)([]),[f,b]=(0,t.useState)(new Set),v=e=>{b(s=>{let l=new Set(s);return l.has(e)?l.delete(e):l.add(e),l})};(0,t.useEffect)(()=>{(async()=>{if(o&&s.length>0)try{let e=await (0,c.fetchMCPServers)(o);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[o,s.length]),(0,t.useEffect)(()=>{(async()=>{if(o&&r.length>0)try{let e=await Promise.resolve().then(l.bind(l,19250)).then(e=>e.fetchMCPAccessGroups(o));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let y=e=>{let s=h.find(s=>s.server_id===e);if(s){let l=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(l,")")}return e},_=e=>e,N=[...s.map(e=>({type:"server",value:e})),...r.map(e=>({type:"accessGroup",value:e}))],w=N.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:w})]}),w>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let l="server"===e.type?n[e.value]:void 0,t=l&&l.length>0,r=f.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>t&&v(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(t?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(u.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:y(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),t&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:l.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===l.length?"tool":"tools"}),r?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),t&&r&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map((e,s)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:s,variant:l="card",className:t="",accessToken:i}=e,n=(null==s?void 0:s.vector_stores)||[],c=(null==s?void 0:s.mcp_servers)||[],d=(null==s?void 0:s.mcp_access_groups)||[],m=(null==s?void 0:s.mcp_tool_permissions)||{},x=(0,a.jsxs)("div",{className:"card"===l?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(o,{vectorStores:n,accessToken:i}),(0,a.jsx)(h,{mcpServers:c,mcpAccessGroups:d,mcpToolPermissions:m,accessToken:i})]});return"card"===l?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(t),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),x]}):(0,a.jsxs)("div",{className:"".concat(t),children:[(0,a.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),x]})}},21425:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(54507);s.Z=e=>{let{value:s,onChange:l,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,a.jsx)(t.Z,{value:s,onChange:l,disabledCallbacks:r,onDisabledCallbacksChange:i})}},918:function(e,s,l){"use strict";var a=l(57437),t=l(2265),r=l(62490),i=l(19250),n=l(9114);s.Z=e=>{let{accessToken:s,userID:l}=e,[c,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{(async()=>{if(s&&l)try{let e=await (0,i.availableTeamListCall)(s);o(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,l]);let d=async e=>{if(s&&l)try{await (0,i.teamMemberAddCall)(s,e,{user_id:l,role:"user"}),n.Z.success("Successfully joined team"),o(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),n.Z.fromBackend("Failed to join team")}};return(0,a.jsx)(r.Zb,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(r.iA,{children:[(0,a.jsx)(r.ss,{children:(0,a.jsxs)(r.SC,{children:[(0,a.jsx)(r.xs,{children:"Team Name"}),(0,a.jsx)(r.xs,{children:"Description"}),(0,a.jsx)(r.xs,{children:"Members"}),(0,a.jsx)(r.xs,{children:"Models"}),(0,a.jsx)(r.xs,{children:"Actions"})]})}),(0,a.jsxs)(r.RM,{children:[c.map(e=>(0,a.jsxs)(r.SC,{children:[(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.xv,{children:e.team_alias})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.xv,{children:e.description||"No description available"})}),(0,a.jsx)(r.pj,{children:(0,a.jsxs)(r.xv,{children:[e.members_with_roles.length," members"]})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,a.jsx)(r.Ct,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(r.xv,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,a.jsx)(r.Ct,{size:"xs",color:"red",children:(0,a.jsx)(r.xv,{children:"All Proxy Models"})})})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.zx,{size:"xs",variant:"secondary",onClick:()=>d(e.team_id),children:"Join Team"})})]},e.team_id)),0===c.length&&(0,a.jsx)(r.SC,{children:(0,a.jsx)(r.pj,{colSpan:5,className:"text-center",children:(0,a.jsx)(r.xv,{children:"No available teams to join"})})})]})]})})}}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2284,7908,9678,1853,7281,6202,7640,8049,1633,2004,2012,2971,2117,1744],function(){return e(e.s=77403)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-a69ee3fd18d83caf.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-a69ee3fd18d83caf.js deleted file mode 100644 index 8e90057161..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-a69ee3fd18d83caf.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9483],{77403:function(e,s,l){Promise.resolve().then(l.bind(l,67578))},40728:function(e,s,l){"use strict";l.d(s,{C:function(){return a.Z},x:function(){return t.Z}});var a=l(41649),t=l(84264)},88913:function(e,s,l){"use strict";l.d(s,{Dx:function(){return c.Z},Zb:function(){return t.Z},iz:function(){return r.Z},oi:function(){return n.Z},xv:function(){return i.Z},zx:function(){return a.Z}});var a=l(20831),t=l(12514),r=l(67982),i=l(84264),n=l(49566),c=l(96761)},25512:function(e,s,l){"use strict";l.d(s,{P:function(){return a.Z},Q:function(){return t.Z}});var a=l(27281),t=l(57365)},67578:function(e,s,l){"use strict";l.r(s),l.d(s,{default:function(){return ej}});var a=l(57437),t=l(2265),r=l(19250),i=l(39210),n=l(13634),c=l(33293),o=l(88904),d=l(20347),m=l(20831),x=l(12514),u=l(49804),h=l(67101),g=l(29706),p=l(84264),j=l(918),f=l(59872),b=l(47323),v=l(12485),y=l(18135),_=l(35242),N=l(77991),w=l(23628),Z=e=>{let{lastRefreshed:s,onRefresh:l,userRole:t,children:r}=e;return(0,a.jsxs)(y.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(_.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(v.Z,{children:"Your Teams"}),(0,a.jsx)(v.Z,{children:"Available Teams"}),(0,d.tY)(t||"")&&(0,a.jsx)(v.Z,{children:"Default Team Settings"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,a.jsxs)(p.Z,{children:["Last Refreshed: ",s]}),(0,a.jsx)(b.Z,{icon:w.Z,variant:"shadow",size:"xs",className:"self-center",onClick:l})]})]}),(0,a.jsx)(N.Z,{children:r})]})},C=l(25512),S=e=>{let{filters:s,organizations:l,showFilters:t,onToggleFilters:r,onChange:i,onReset:n}=e;return(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("div",{className:"relative w-64",children:[(0,a.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:s.team_alias,onChange:e=>i("team_alias",e.target.value)}),(0,a.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,a.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(t?"bg-gray-100":""),onClick:()=>r(!t),children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(s.team_id||s.team_alias||s.organization_id)&&(0,a.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,a.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:n,children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),t&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,a.jsxs)("div",{className:"relative w-64",children:[(0,a.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:s.team_id,onChange:e=>i("team_id",e.target.value)}),(0,a.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,a.jsx)("div",{className:"w-64",children:(0,a.jsx)(C.P,{value:s.organization_id||"",onValueChange:e=>i("organization_id",e),placeholder:"Select Organization",children:null==l?void 0:l.map(e=>(0,a.jsx)(C.Q,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})},k=l(39760),T=e=>{let{currentOrg:s,setTeams:l}=e,[a,r]=(0,t.useState)(""),{accessToken:n,userId:c,userRole:o}=(0,k.Z)(),d=(0,t.useCallback)(()=>{r(new Date().toLocaleString())},[]);return(0,t.useEffect)(()=>{n&&(0,i.Z)(n,c,o,s,l).then(),d()},[n,s,a,d,l,c,o]),{lastRefreshed:a,setLastRefreshed:r,onRefreshClick:d}},M=l(21626),z=l(97214),A=l(28241),E=l(58834),D=l(69552),F=l(71876),L=l(89970),P=l(53410),O=l(74998),I=l(41649),V=l(86462),R=l(47686),B=l(46468),W=e=>{let{team:s}=e,[l,r]=(0,t.useState)(!1);return(0,a.jsx)(A.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:s.models.length>3?"px-0":"",children:(0,a.jsx)("div",{className:"flex flex-col",children:Array.isArray(s.models)?(0,a.jsx)("div",{className:"flex flex-col",children:0===s.models.length?(0,a.jsx)(I.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex items-start",children:[s.models.length>3&&(0,a.jsx)("div",{children:(0,a.jsx)(b.Z,{icon:l?V.Z:R.Z,className:"cursor-pointer",size:"xs",onClick:()=>{r(e=>!e)}})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,a.jsx)(I.Z,{size:"xs",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})},s):(0,a.jsx)(I.Z,{size:"xs",color:"blue",children:(0,a.jsx)(p.Z,{children:e.length>30?"".concat((0,B.W0)(e).slice(0,30),"..."):(0,B.W0)(e)})},s)),s.models.length>3&&!l&&(0,a.jsx)(I.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,a.jsxs)(p.Z,{children:["+",s.models.length-3," ",s.models.length-3==1?"more model":"more models"]})}),l&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:s.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,a.jsx)(I.Z,{size:"xs",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})},s+3):(0,a.jsx)(I.Z,{size:"xs",color:"blue",children:(0,a.jsx)(p.Z,{children:e.length>30?"".concat((0,B.W0)(e).slice(0,30),"..."):(0,B.W0)(e)})},s+3))})]})]})})}):null})})},U=l(88906),G=l(92369),J=e=>{let s="inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium border";return"admin"===e?(0,a.jsxs)("span",{className:s,style:{backgroundColor:"#EEF2FF",color:"#3730A3",borderColor:"#C7D2FE"},children:[(0,a.jsx)(U.Z,{className:"h-3 w-3 mr-1"}),"Admin"]}):(0,a.jsxs)("span",{className:s,style:{backgroundColor:"#F3F4F6",color:"#4B5563",borderColor:"#E5E7EB"},children:[(0,a.jsx)(G.Z,{className:"h-3 w-3 mr-1"}),"Member"]})};let Q=(e,s)=>{var l,a;if(!s)return null;let t=null===(l=e.members_with_roles)||void 0===l?void 0:l.find(e=>e.user_id===s);return null!==(a=null==t?void 0:t.role)&&void 0!==a?a:null};var q=e=>{let{team:s,userId:l}=e,t=J(Q(s,l));return(0,a.jsx)(A.Z,{children:t})},K=e=>{let{teams:s,currentOrg:l,setSelectedTeamId:t,perTeamInfo:r,userRole:i,userId:n,setEditTeam:c,onDeleteTeam:o}=e;return(0,a.jsxs)(M.Z,{children:[(0,a.jsx)(E.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(D.Z,{children:"Team Name"}),(0,a.jsx)(D.Z,{children:"Team ID"}),(0,a.jsx)(D.Z,{children:"Created"}),(0,a.jsx)(D.Z,{children:"Spend (USD)"}),(0,a.jsx)(D.Z,{children:"Budget (USD)"}),(0,a.jsx)(D.Z,{children:"Models"}),(0,a.jsx)(D.Z,{children:"Organization"}),(0,a.jsx)(D.Z,{children:"Your Role"}),(0,a.jsx)(D.Z,{children:"Info"})]})}),(0,a.jsx)(z.Z,{children:s&&s.length>0?s.filter(e=>!l||e.organization_id===l.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,a.jsx)(A.Z,{children:(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(L.Z,{title:e.team_id,children:(0,a.jsxs)(m.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{t(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,f.pw)(e.spend,4)}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,a.jsx)(W,{team:e}),(0,a.jsx)(A.Z,{children:e.organization_id}),(0,a.jsx)(q,{team:e,userId:n}),(0,a.jsxs)(A.Z,{children:[(0,a.jsxs)(p.Z,{children:[r&&e.team_id&&r[e.team_id]&&r[e.team_id].keys&&r[e.team_id].keys.length," ","Keys"]}),(0,a.jsxs)(p.Z,{children:[r&&e.team_id&&r[e.team_id]&&r[e.team_id].team_info&&r[e.team_id].team_info.members_with_roles&&r[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,a.jsx)(A.Z,{children:"Admin"==i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.Z,{icon:P.Z,size:"sm",onClick:()=>{t(e.team_id),c(!0)}}),(0,a.jsx)(b.Z,{onClick:()=>o(e.team_id),icon:O.Z,size:"sm"})]}):null})]},e.team_id)):null})]})},X=l(32489),Y=l(76865),H=e=>{var s;let{teams:l,teamToDelete:r,onCancel:i,onConfirm:n}=e,[c,o]=(0,t.useState)(""),d=null==l?void 0:l.find(e=>e.team_id===r),m=(null==d?void 0:d.team_alias)||"",x=(null==d?void 0:null===(s=d.keys)||void 0===s?void 0:s.length)||0,u=c===m;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Team"}),(0,a.jsx)("button",{onClick:()=>{i(),o("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,a.jsx)(X.Z,{size:20})})]}),(0,a.jsxs)("div",{className:"px-6 py-4",children:[x>0&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,a.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,a.jsx)(Y.Z,{size:20})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-base font-medium text-red-600",children:["Warning: This team has ",x," associated key",x>1?"s":"","."]}),(0,a.jsx)("p",{className:"text-base text-red-600 mt-2",children:"Deleting the team will also delete all associated keys. This action is irreversible."})]})]}),(0,a.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to force delete this team and all its keys?"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,a.jsx)("span",{className:"underline",children:m})," to confirm deletion:"]}),(0,a.jsx)("input",{type:"text",value:c,onChange:e=>o(e.target.value),placeholder:"Enter team name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,a.jsx)("button",{onClick:()=>{i(),o("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,a.jsx)("button",{onClick:n,disabled:!u,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(u?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Force Delete"})]})]})})},$=l(82680),ee=l(52787),es=l(64482),el=l(73002),ea=l(26210),et=l(15424),er=l(24199),ei=l(97415),en=l(95920),ec=l(2597),eo=l(51750),ed=l(9114),em=l(68473);let ex=(e,s)=>{let l=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),l=e.models):l=s,(0,B.Ob)(l,s)};var eu=e=>{let{isTeamModalVisible:s,handleOk:l,handleCancel:i,currentOrg:c,organizations:o,teams:d,setTeams:m,modelAliases:x,setModelAliases:u,loggingSettings:h,setLoggingSettings:g,setIsTeamModalVisible:p}=e,{userId:j,userRole:f,accessToken:b,premiumUser:v}=(0,k.Z)(),[y]=n.Z.useForm(),[_,N]=(0,t.useState)([]),[w,Z]=(0,t.useState)(null),[C,S]=(0,t.useState)([]),[T,M]=(0,t.useState)([]),[z,A]=(0,t.useState)([]),[E,D]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(async()=>{try{if(null===j||null===f||null===b)return;let e=await (0,B.K2)(j,f,b);e&&N(e)}catch(e){console.error("Error fetching user models:",e)}})()},[b,j,f,d]),(0,t.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(w));let e=ex(w,_);console.log("models: ".concat(e)),S(e),y.setFieldValue("models",[])},[w,_,y]);let F=async()=>{try{if(null==b)return;let e=await (0,r.fetchMCPAccessGroups)(b);A(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,t.useEffect)(()=>{F()},[b,F]),(0,t.useEffect)(()=>{(async()=>{try{if(null==b)return;let e=(await (0,r.getGuardrailsList)(b)).guardrails.map(e=>e.guardrail_name);M(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[b]);let P=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=b){var s,l,a;let t=null==e?void 0:e.team_alias,i=null!==(a=null==d?void 0:d.map(e=>e.team_alias))&&void 0!==a?a:[],n=(null==e?void 0:e.organization_id)||(null==c?void 0:c.organization_id);if(""===n||"string"!=typeof n?e.organization_id=null:e.organization_id=n.trim(),i.includes(t))throw Error("Team alias ".concat(t," already exists, please pick another alias"));if(ed.Z.info("Creating Team"),h.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:h.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(s=e.allowed_mcp_servers_and_groups.servers)||void 0===s?void 0:s.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0||e.allowed_mcp_servers_and_groups.toolPermissions)){if(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups){let{servers:s,accessGroups:l}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),l&&l.length>0&&(e.object_permission.mcp_access_groups=l),delete e.allowed_mcp_servers_and_groups}e.mcp_tool_permissions&&Object.keys(e.mcp_tool_permissions).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=e.mcp_tool_permissions,delete e.mcp_tool_permissions)}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(x).length>0&&(e.model_aliases=x);let o=await (0,r.teamCreateCall)(b,e);null!==d?m([...d,o]):m([o]),console.log("response for team create call: ".concat(o)),ed.Z.success("Team created"),y.resetFields(),g([]),u({}),p(!1)}}catch(e){console.error("Error creating the team:",e),ed.Z.fromBackend("Error creating the team: "+e)}};return(0,a.jsx)($.Z,{title:"Create Team",open:s,width:1e3,footer:null,onOk:l,onCancel:i,children:(0,a.jsxs)(n.Z,{form:y,onFinish:P,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(ea.oi,{placeholder:""})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Organization"," ",(0,a.jsx)(L.Z,{title:(0,a.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:c?c.organization_id:null,className:"mt-8",children:(0,a.jsx)(ee.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{y.setFieldValue("organization_id",e),Z((null==o?void 0:o.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var l;return!!s&&((null===(l=s.children)||void 0===l?void 0:l.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==o?void 0:o.map(e=>(0,a.jsxs)(ee.default.Option,{value:e.organization_id,children:[(0,a.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,a.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Models"," ",(0,a.jsx)(L.Z,{title:"These are the models that your selected team has access to",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,a.jsxs)(ee.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(ee.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),C.map(e=>(0,a.jsx)(ee.default.Option,{value:e,children:(0,B.W0)(e)},e))]})}),(0,a.jsx)(n.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(er.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(n.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(ee.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(ee.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(ee.default.Option,{value:"7d",children:"weekly"}),(0,a.jsx)(ee.default.Option,{value:"30d",children:"monthly"})]})}),(0,a.jsx)(n.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsxs)(ea.UQ,{className:"mt-20 mb-8",onClick:()=>{E||(F(),D(!0))},children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Additional Settings"})}),(0,a.jsxs)(ea.X1,{children:[(0,a.jsx)(n.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,a.jsx)(ea.oi,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,a.jsx)(n.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,a.jsx)(er.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(n.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,a.jsx)(ea.oi,{placeholder:"e.g., 30d"})}),(0,a.jsx)(n.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,a.jsx)(es.default.TextArea,{rows:4})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Guardrails"," ",(0,a.jsx)(L.Z,{title:"Setup your first guardrail",children:(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,a.jsx)(ee.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:T.map(e=>({value:e,label:e}))})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,a.jsx)(L.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,a.jsx)(ei.Z,{onChange:e=>y.setFieldValue("allowed_vector_store_ids",e),value:y.getFieldValue("allowed_vector_store_ids"),accessToken:b||"",placeholder:"Select vector stores (optional)"})})]})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"MCP Settings"})}),(0,a.jsxs)(ea.X1,{children:[(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,a.jsx)(L.Z,{title:"Select which MCP servers or access groups this team can access",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,a.jsx)(en.Z,{onChange:e=>y.setFieldValue("allowed_mcp_servers_and_groups",e),value:y.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:b||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(n.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(es.default,{type:"hidden"})}),(0,a.jsx)(n.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,a.jsx)("div",{className:"mt-6",children:(0,a.jsx)(em.Z,{accessToken:b||"",selectedServers:(null===(e=y.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:y.getFieldValue("mcp_tool_permissions")||{},onChange:e=>y.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Logging Settings"})}),(0,a.jsx)(ea.X1,{children:(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(ec.Z,{value:h,onChange:g,premiumUser:v})})})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Model Aliases"})}),(0,a.jsx)(ea.X1,{children:(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)(ea.xv,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,a.jsx)(eo.Z,{accessToken:b||"",initialModelAliases:x,onAliasUpdate:u,showExampleConfig:!1})]})})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(el.ZP,{htmlType:"submit",children:"Create Team"})})]})})},eh=e=>{let{teams:s,accessToken:l,setTeams:b,userID:v,userRole:y,organizations:_,premiumUser:N=!1}=e,[w,C]=(0,t.useState)(null),[k,M]=(0,t.useState)(!1),[z,A]=(0,t.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),[E]=n.Z.useForm(),[D]=n.Z.useForm(),[F,L]=(0,t.useState)(null),[P,O]=(0,t.useState)(!1),[I,V]=(0,t.useState)(!1),[R,B]=(0,t.useState)(!1),[W,U]=(0,t.useState)(!1),[G,J]=(0,t.useState)([]),[Q,q]=(0,t.useState)(!1),[X,Y]=(0,t.useState)(null),[$,ee]=(0,t.useState)({}),[es,el]=(0,t.useState)([]),[ea,et]=(0,t.useState)({}),{lastRefreshed:er,onRefreshClick:ei}=T({currentOrg:w,setTeams:b});(0,t.useEffect)(()=>{s&&ee(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let en=async e=>{Y(e),q(!0)},ec=async()=>{if(null!=X&&null!=s&&null!=l){try{await (0,r.teamDeleteCall)(l,X),(0,i.Z)(l,v,y,w,b)}catch(e){console.error("Error deleting the team:",e)}q(!1),Y(null)}};return(0,a.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,a.jsx)(h.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,a.jsxs)(u.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==y||"Org Admin"==y)&&(0,a.jsx)(m.Z,{className:"w-fit",onClick:()=>V(!0),children:"+ Create New Team"}),F?(0,a.jsx)(c.Z,{teamId:F,onUpdate:e=>{b(s=>{if(null==s)return s;let a=s.map(s=>e.team_id===s.team_id?(0,f.nl)(s,e):s);return l&&(0,i.Z)(l,v,y,w,b),a})},onClose:()=>{L(null),O(!1)},accessToken:l,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;se.team_id===F)),is_proxy_admin:"Admin"==y,userModels:G,editTeam:P}):(0,a.jsxs)(Z,{lastRefreshed:er,onRefresh:ei,userRole:y,children:[(0,a.jsxs)(g.Z,{children:[(0,a.jsxs)(p.Z,{children:["Click on “Team ID” to view team details ",(0,a.jsx)("b",{children:"and"})," manage team members."]}),(0,a.jsx)(h.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,a.jsx)(u.Z,{numColSpan:1,children:(0,a.jsxs)(x.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,a.jsx)("div",{className:"border-b px-6 py-4",children:(0,a.jsx)("div",{className:"flex flex-col space-y-4",children:(0,a.jsx)(S,{filters:z,organizations:_,showFilters:k,onToggleFilters:M,onChange:(e,s)=>{let a={...z,[e]:s};A(a),l&&(0,r.v2TeamListCall)(l,a.organization_id||null,null,a.team_id||null,a.team_alias||null).then(e=>{e&&e.teams&&b(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},onReset:()=>{A({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),l&&(0,r.v2TeamListCall)(l,null,v||null,null,null).then(e=>{e&&e.teams&&b(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})}})})}),(0,a.jsx)(K,{teams:s,currentOrg:w,perTeamInfo:$,userRole:y,userId:v,setSelectedTeamId:L,setEditTeam:O,onDeleteTeam:en}),Q&&(0,a.jsx)(H,{teams:s,teamToDelete:X,onCancel:()=>{q(!1),Y(null)},onConfirm:ec})]})})})]}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(j.Z,{accessToken:l,userID:v})}),(0,d.tY)(y||"")&&(0,a.jsx)(g.Z,{children:(0,a.jsx)(o.Z,{accessToken:l,userID:v||"",userRole:y||""})})]}),("Admin"==y||"Org Admin"==y)&&(0,a.jsx)(eu,{isTeamModalVisible:I,handleOk:()=>{V(!1),E.resetFields(),el([]),et({})},handleCancel:()=>{V(!1),E.resetFields(),el([]),et({})},currentOrg:w,organizations:_,teams:s,setTeams:b,modelAliases:ea,setModelAliases:et,loggingSettings:es,setLoggingSettings:el,setIsTeamModalVisible:V})]})})})},eg=l(11318),ep=l(22004),ej=()=>{let{accessToken:e,userId:s,userRole:l}=(0,k.Z)(),{teams:r,setTeams:i}=(0,eg.Z)(),[n,c]=(0,t.useState)([]);return(0,t.useEffect)(()=>{(0,ep.g)(e,c).then(()=>{})},[e]),(0,a.jsx)(eh,{teams:r,accessToken:e,setTeams:i,userID:s,userRole:l,organizations:n})}},88904:function(e,s,l){"use strict";var a=l(57437),t=l(2265),r=l(88913),i=l(93192),n=l(52787),c=l(63709),o=l(87908),d=l(19250),m=l(65925),x=l(46468),u=l(9114);s.Z=e=>{var s;let{accessToken:l,userID:h,userRole:g}=e,[p,j]=(0,t.useState)(!0),[f,b]=(0,t.useState)(null),[v,y]=(0,t.useState)(!1),[_,N]=(0,t.useState)({}),[w,Z]=(0,t.useState)(!1),[C,S]=(0,t.useState)([]),{Paragraph:k}=i.default,{Option:T}=n.default;(0,t.useEffect)(()=>{(async()=>{if(!l){j(!1);return}try{let e=await (0,d.getDefaultTeamSettings)(l);if(b(e),N(e.values||{}),l)try{let e=await (0,d.modelAvailableCall)(l,h,g);if(e&&e.data){let s=e.data.map(e=>e.id);S(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),u.Z.fromBackend("Failed to fetch team settings")}finally{j(!1)}})()},[l]);let M=async()=>{if(l){Z(!0);try{let e=await (0,d.updateDefaultTeamSettings)(l,_);b({...f,values:e.settings}),y(!1),u.Z.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),u.Z.fromBackend("Failed to update team settings")}finally{Z(!1)}}},z=(e,s)=>{N(l=>({...l,[e]:s}))},A=(e,s,l)=>{var t;let i=s.type;return"budget_duration"===e?(0,a.jsx)(m.Z,{value:_[e]||null,onChange:s=>z(e,s),className:"mt-2"}):"boolean"===i?(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(c.Z,{checked:!!_[e],onChange:s=>z(e,s)})}):"array"===i&&(null===(t=s.items)||void 0===t?void 0:t.enum)?(0,a.jsx)(n.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>z(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,a.jsx)(T,{value:e,children:e},e))}):"models"===e?(0,a.jsx)(n.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>z(e,s),className:"mt-2",children:C.map(e=>(0,a.jsx)(T,{value:e,children:(0,x.W0)(e)},e))}):"string"===i&&s.enum?(0,a.jsx)(n.default,{style:{width:"100%"},value:_[e]||"",onChange:s=>z(e,s),className:"mt-2",children:s.enum.map(e=>(0,a.jsx)(T,{value:e,children:e},e))}):(0,a.jsx)(r.oi,{value:void 0!==_[e]?String(_[e]):"",onChange:s=>z(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},E=(e,s)=>null==s?(0,a.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,a.jsx)("span",{children:(0,m.m)(s)}):"boolean"==typeof s?(0,a.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,a.jsx)("span",{className:"text-gray-400",children:"None"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,x.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,a.jsx)("span",{className:"text-gray-400",children:"None"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,a.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,a.jsx)("span",{children:String(s)});return p?(0,a.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,a.jsx)(o.Z,{size:"large"})}):f?(0,a.jsxs)(r.Zb,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(r.Dx,{className:"text-xl",children:"Default Team Settings"}),!p&&f&&(v?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(r.zx,{variant:"secondary",onClick:()=>{y(!1),N(f.values||{})},disabled:w,children:"Cancel"}),(0,a.jsx)(r.zx,{onClick:M,loading:w,children:"Save Changes"})]}):(0,a.jsx)(r.zx,{onClick:()=>y(!0),children:"Edit Settings"}))]}),(0,a.jsx)(r.xv,{children:"These settings will be applied by default when creating new teams."}),(null==f?void 0:null===(s=f.field_schema)||void 0===s?void 0:s.description)&&(0,a.jsx)(k,{className:"mb-4 mt-2",children:f.field_schema.description}),(0,a.jsx)(r.iz,{}),(0,a.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=f;return s&&s.properties?Object.entries(s.properties).map(s=>{let[l,t]=s,i=e[l],n=l.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,a.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,a.jsx)(r.xv,{className:"font-medium text-lg",children:n}),(0,a.jsx)(k,{className:"text-sm text-gray-500 mt-1",children:t.description||"No description available"}),v?(0,a.jsx)("div",{className:"mt-2",children:A(l,t,i)}):(0,a.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:E(l,i)})]},l)}):(0,a.jsx)(r.xv,{children:"No schema information available"})})()})]}):(0,a.jsx)(r.Zb,{children:(0,a.jsx)(r.xv,{children:"No team settings available or you do not have permission to view them."})})}},51750:function(e,s,l){"use strict";l.d(s,{Z:function(){return g}});var a=l(57437),t=l(2265),r=l(77355),i=l(93416),n=l(74998),c=l(95704),o=l(56522),d=l(52787),m=l(69993),x=l(51601),u=e=>{let{accessToken:s,value:l,placeholder:r="Select a Model",onChange:i,disabled:n=!1,style:c,className:u,showLabel:h=!0,labelText:g="Select Model"}=e,[p,j]=(0,t.useState)(l),[f,b]=(0,t.useState)(!1),[v,y]=(0,t.useState)([]),_=(0,t.useRef)(null);return(0,t.useEffect)(()=>{j(l)},[l]),(0,t.useEffect)(()=>{s&&(async()=>{try{let e=await (0,x.p)(s);console.log("Fetched models for selector:",e),e.length>0&&y(e)}catch(e){console.error("Error fetching model info:",e)}})()},[s]),(0,a.jsxs)("div",{children:[h&&(0,a.jsxs)(o.x,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-2"})," ",g]}),(0,a.jsx)(d.default,{value:p,placeholder:r,onChange:e=>{"custom"===e?(b(!0),j(void 0)):(b(!1),j(e),i&&i(e))},options:[...Array.from(new Set(v.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...c},showSearch:!0,className:"rounded-md ".concat(u||""),disabled:n}),f&&(0,a.jsx)(o.o,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{j(e),i&&i(e)},500)},disabled:n})]})},h=l(9114),g=e=>{let{accessToken:s,initialModelAliases:l={},onAliasUpdate:o,showExampleConfig:d=!0}=e,[m,x]=(0,t.useState)([]),[g,p]=(0,t.useState)({aliasName:"",targetModel:""}),[j,f]=(0,t.useState)(null);(0,t.useEffect)(()=>{x(Object.entries(l).map((e,s)=>{let[l,a]=e;return{id:"".concat(s,"-").concat(l),aliasName:l,targetModel:a}}))},[l]);let b=e=>{f({...e})},v=()=>{if(!j)return;if(!j.aliasName||!j.targetModel){h.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.id!==j.id&&e.aliasName===j.aliasName)){h.Z.fromBackend("An alias with this name already exists");return}let e=m.map(e=>e.id===j.id?j:e);x(e),f(null);let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),o&&o(s),h.Z.success("Alias updated successfully")},y=()=>{f(null)},_=e=>{let s=m.filter(s=>s.id!==e);x(s);let l={};s.forEach(e=>{l[e.aliasName]=e.targetModel}),o&&o(l),h.Z.success("Alias deleted successfully")},N=m.reduce((e,s)=>(e[s.aliasName]=s.targetModel,e),{});return(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(c.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,a.jsx)("input",{type:"text",value:g.aliasName,onChange:e=>p({...g,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model"}),(0,a.jsx)(u,{accessToken:s,value:g.targetModel,placeholder:"Select target model",onChange:e=>p({...g,targetModel:e}),showLabel:!1})]}),(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsxs)("button",{onClick:()=>{if(!g.aliasName||!g.targetModel){h.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.aliasName===g.aliasName)){h.Z.fromBackend("An alias with this name already exists");return}let e=[...m,{id:"".concat(Date.now(),"-").concat(g.aliasName),aliasName:g.aliasName,targetModel:g.targetModel}];x(e),p({aliasName:"",targetModel:""});let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),o&&o(s),h.Z.success("Alias added successfully")},disabled:!g.aliasName||!g.targetModel,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(g.aliasName&&g.targetModel?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,a.jsx)(r.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,a.jsx)(c.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,a.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)(c.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,a.jsx)(c.ss,{children:(0,a.jsxs)(c.SC,{children:[(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Target Model"}),(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,a.jsxs)(c.RM,{children:[m.map(e=>(0,a.jsx)(c.SC,{className:"h-8",children:j&&j.id===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:j.aliasName,onChange:e=>f({...j,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(c.pj,{className:"py-0.5",children:(0,a.jsx)(u,{accessToken:s,value:j.targetModel,onChange:e=>f({...j,targetModel:e}),showLabel:!1,style:{height:"32px"}})}),(0,a.jsx)(c.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:v,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,a.jsx)("button",{onClick:y,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,a.jsx)(c.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModel}),(0,a.jsx)(c.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>b(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,a.jsx)(i.Z,{className:"w-3 h-3"})}),(0,a.jsx)("button",{onClick:()=>_(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,a.jsx)(n.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===m.length&&(0,a.jsx)(c.SC,{children:(0,a.jsx)(c.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),d&&(0,a.jsxs)(c.Zb,{children:[(0,a.jsx)(c.Dx,{className:"mb-4",children:"Configuration Example"}),(0,a.jsx)(c.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config:"}),(0,a.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,a.jsxs)("div",{className:"text-gray-700",children:["model_aliases:",0===Object.keys(N).length?(0,a.jsxs)("span",{className:"text-gray-500",children:[(0,a.jsx)("br",{}),"\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[s,l]=e;return(0,a.jsxs)("span",{children:[(0,a.jsx)("br",{}),'\xa0\xa0"',s,'": "',l,'"']},s)})]})})]})]})}},2597:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(92280),r=l(54507);s.Z=function(e){let{value:s,onChange:l,premiumUser:i=!1,disabledCallbacks:n=[],onDisabledCallbacksChange:c}=e;return i?(0,a.jsx)(r.Z,{value:s,onChange:l,disabledCallbacks:n,onDisabledCallbacksChange:c}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,a.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,a.jsxs)(t.x,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key"," ",(0,a.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})}},65925:function(e,s,l){"use strict";l.d(s,{m:function(){return i}});var a=l(57437);l(2265);var t=l(52787);let{Option:r}=t.default,i=e=>e?({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set";s.Z=e=>{let{value:s,onChange:l,className:i="",style:n={}}=e;return(0,a.jsxs)(t.default,{style:{width:"100%",...n},value:s||void 0,onChange:l,className:i,placeholder:"n/a",children:[(0,a.jsx)(r,{value:"24h",children:"daily"}),(0,a.jsx)(r,{value:"7d",children:"weekly"}),(0,a.jsx)(r,{value:"30d",children:"monthly"})]})}},39210:function(e,s,l){"use strict";l.d(s,{Z:function(){return t}});var a=l(19250);let t=async(e,s,l,t,r)=>{let i;i="Admin"!=l&&"Admin Viewer"!=l?await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null,s):await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null),console.log("givenTeams: ".concat(i)),r(i)}},27799:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(40728),r=l(82182),i=l(91777),n=l(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:l=[],variant:c="card",className:o=""}=e,d=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[l,a]=s;return a===e}))||void 0===s?void 0:s[0])||e},m=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},x=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},u=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,a.jsx)(t.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var l;let i=d(e.callback_name),c=null===(l=n.Dg[i])||void 0===l?void 0:l.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[c?(0,a.jsx)("img",{src:c,alt:i,className:"w-5 h-5 object-contain"}):(0,a.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-medium text-blue-800",children:i}),(0,a.jsxs)(t.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,a.jsx)(t.C,{color:m(e.callback_type),size:"sm",children:x(e.callback_type)})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(t.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,a.jsx)(t.C,{color:"red",size:"xs",children:l.length})]}),l.length>0?(0,a.jsx)("div",{className:"space-y-3",children:l.map((e,s)=>{var l;let r=n.RD[e]||e,c=null===(l=n.Dg[r])||void 0===l?void 0:l.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[c?(0,a.jsx)("img",{src:c,alt:r,className:"w-5 h-5 object-contain"}):(0,a.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-medium text-red-800",children:r}),(0,a.jsx)(t.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,a.jsx)(t.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(t.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===c?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,a.jsx)(t.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(t.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),u]})}},98015:function(e,s,l){"use strict";l.d(s,{Z:function(){return g}});var a=l(57437),t=l(2265),r=l(92280),i=l(40728),n=l(79814),c=l(19250),o=function(e){let{vectorStores:s,accessToken:l}=e,[r,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{(async()=>{if(l&&0!==s.length)try{let e=await (0,c.vectorStoreListCall)(l);e.data&&o(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[l,s.length]);let d=e=>{let s=r.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:d(e)},s))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},d=l(25327),m=l(86462),x=l(47686),u=l(89970),h=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:o}=e,[h,g]=(0,t.useState)([]),[p,j]=(0,t.useState)([]),[f,b]=(0,t.useState)(new Set),v=e=>{b(s=>{let l=new Set(s);return l.has(e)?l.delete(e):l.add(e),l})};(0,t.useEffect)(()=>{(async()=>{if(o&&s.length>0)try{let e=await (0,c.fetchMCPServers)(o);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[o,s.length]),(0,t.useEffect)(()=>{(async()=>{if(o&&r.length>0)try{let e=await Promise.resolve().then(l.bind(l,19250)).then(e=>e.fetchMCPAccessGroups(o));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let y=e=>{let s=h.find(s=>s.server_id===e);if(s){let l=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(l,")")}return e},_=e=>e,N=[...s.map(e=>({type:"server",value:e})),...r.map(e=>({type:"accessGroup",value:e}))],w=N.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:w})]}),w>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let l="server"===e.type?n[e.value]:void 0,t=l&&l.length>0,r=f.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>t&&v(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(t?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(u.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:y(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),t&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:l.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===l.length?"tool":"tools"}),r?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),t&&r&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map((e,s)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:s,variant:l="card",className:t="",accessToken:i}=e,n=(null==s?void 0:s.vector_stores)||[],c=(null==s?void 0:s.mcp_servers)||[],d=(null==s?void 0:s.mcp_access_groups)||[],m=(null==s?void 0:s.mcp_tool_permissions)||{},x=(0,a.jsxs)("div",{className:"card"===l?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(o,{vectorStores:n,accessToken:i}),(0,a.jsx)(h,{mcpServers:c,mcpAccessGroups:d,mcpToolPermissions:m,accessToken:i})]});return"card"===l?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(t),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),x]}):(0,a.jsxs)("div",{className:"".concat(t),children:[(0,a.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),x]})}},21425:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(54507);s.Z=e=>{let{value:s,onChange:l,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,a.jsx)(t.Z,{value:s,onChange:l,disabledCallbacks:r,onDisabledCallbacksChange:i})}},918:function(e,s,l){"use strict";var a=l(57437),t=l(2265),r=l(62490),i=l(19250),n=l(9114);s.Z=e=>{let{accessToken:s,userID:l}=e,[c,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{(async()=>{if(s&&l)try{let e=await (0,i.availableTeamListCall)(s);o(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,l]);let d=async e=>{if(s&&l)try{await (0,i.teamMemberAddCall)(s,e,{user_id:l,role:"user"}),n.Z.success("Successfully joined team"),o(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),n.Z.fromBackend("Failed to join team")}};return(0,a.jsx)(r.Zb,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(r.iA,{children:[(0,a.jsx)(r.ss,{children:(0,a.jsxs)(r.SC,{children:[(0,a.jsx)(r.xs,{children:"Team Name"}),(0,a.jsx)(r.xs,{children:"Description"}),(0,a.jsx)(r.xs,{children:"Members"}),(0,a.jsx)(r.xs,{children:"Models"}),(0,a.jsx)(r.xs,{children:"Actions"})]})}),(0,a.jsxs)(r.RM,{children:[c.map(e=>(0,a.jsxs)(r.SC,{children:[(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.xv,{children:e.team_alias})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.xv,{children:e.description||"No description available"})}),(0,a.jsx)(r.pj,{children:(0,a.jsxs)(r.xv,{children:[e.members_with_roles.length," members"]})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,a.jsx)(r.Ct,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(r.xv,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,a.jsx)(r.Ct,{size:"xs",color:"red",children:(0,a.jsx)(r.xv,{children:"All Proxy Models"})})})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.zx,{size:"xs",variant:"secondary",onClick:()=>d(e.team_id),children:"Join Team"})})]},e.team_id)),0===c.length&&(0,a.jsx)(r.SC,{children:(0,a.jsx)(r.pj,{colSpan:5,className:"text-center",children:(0,a.jsx)(r.xv,{children:"No available teams to join"})})})]})]})})}}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2284,7908,9678,1853,7281,6202,7640,8049,131,2004,2012,2971,2117,1744],function(){return e(e.s=77403)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/teams/page-a69ee3fd18d83caf.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-e8dfff543471e450.js similarity index 99% rename from ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/teams/page-a69ee3fd18d83caf.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-e8dfff543471e450.js index 8e90057161..3990d8d56a 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/teams/page-a69ee3fd18d83caf.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-e8dfff543471e450.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9483],{77403:function(e,s,l){Promise.resolve().then(l.bind(l,67578))},40728:function(e,s,l){"use strict";l.d(s,{C:function(){return a.Z},x:function(){return t.Z}});var a=l(41649),t=l(84264)},88913:function(e,s,l){"use strict";l.d(s,{Dx:function(){return c.Z},Zb:function(){return t.Z},iz:function(){return r.Z},oi:function(){return n.Z},xv:function(){return i.Z},zx:function(){return a.Z}});var a=l(20831),t=l(12514),r=l(67982),i=l(84264),n=l(49566),c=l(96761)},25512:function(e,s,l){"use strict";l.d(s,{P:function(){return a.Z},Q:function(){return t.Z}});var a=l(27281),t=l(57365)},67578:function(e,s,l){"use strict";l.r(s),l.d(s,{default:function(){return ej}});var a=l(57437),t=l(2265),r=l(19250),i=l(39210),n=l(13634),c=l(33293),o=l(88904),d=l(20347),m=l(20831),x=l(12514),u=l(49804),h=l(67101),g=l(29706),p=l(84264),j=l(918),f=l(59872),b=l(47323),v=l(12485),y=l(18135),_=l(35242),N=l(77991),w=l(23628),Z=e=>{let{lastRefreshed:s,onRefresh:l,userRole:t,children:r}=e;return(0,a.jsxs)(y.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(_.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(v.Z,{children:"Your Teams"}),(0,a.jsx)(v.Z,{children:"Available Teams"}),(0,d.tY)(t||"")&&(0,a.jsx)(v.Z,{children:"Default Team Settings"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,a.jsxs)(p.Z,{children:["Last Refreshed: ",s]}),(0,a.jsx)(b.Z,{icon:w.Z,variant:"shadow",size:"xs",className:"self-center",onClick:l})]})]}),(0,a.jsx)(N.Z,{children:r})]})},C=l(25512),S=e=>{let{filters:s,organizations:l,showFilters:t,onToggleFilters:r,onChange:i,onReset:n}=e;return(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("div",{className:"relative w-64",children:[(0,a.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:s.team_alias,onChange:e=>i("team_alias",e.target.value)}),(0,a.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,a.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(t?"bg-gray-100":""),onClick:()=>r(!t),children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(s.team_id||s.team_alias||s.organization_id)&&(0,a.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,a.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:n,children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),t&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,a.jsxs)("div",{className:"relative w-64",children:[(0,a.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:s.team_id,onChange:e=>i("team_id",e.target.value)}),(0,a.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,a.jsx)("div",{className:"w-64",children:(0,a.jsx)(C.P,{value:s.organization_id||"",onValueChange:e=>i("organization_id",e),placeholder:"Select Organization",children:null==l?void 0:l.map(e=>(0,a.jsx)(C.Q,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})},k=l(39760),T=e=>{let{currentOrg:s,setTeams:l}=e,[a,r]=(0,t.useState)(""),{accessToken:n,userId:c,userRole:o}=(0,k.Z)(),d=(0,t.useCallback)(()=>{r(new Date().toLocaleString())},[]);return(0,t.useEffect)(()=>{n&&(0,i.Z)(n,c,o,s,l).then(),d()},[n,s,a,d,l,c,o]),{lastRefreshed:a,setLastRefreshed:r,onRefreshClick:d}},M=l(21626),z=l(97214),A=l(28241),E=l(58834),D=l(69552),F=l(71876),L=l(89970),P=l(53410),O=l(74998),I=l(41649),V=l(86462),R=l(47686),B=l(46468),W=e=>{let{team:s}=e,[l,r]=(0,t.useState)(!1);return(0,a.jsx)(A.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:s.models.length>3?"px-0":"",children:(0,a.jsx)("div",{className:"flex flex-col",children:Array.isArray(s.models)?(0,a.jsx)("div",{className:"flex flex-col",children:0===s.models.length?(0,a.jsx)(I.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex items-start",children:[s.models.length>3&&(0,a.jsx)("div",{children:(0,a.jsx)(b.Z,{icon:l?V.Z:R.Z,className:"cursor-pointer",size:"xs",onClick:()=>{r(e=>!e)}})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,a.jsx)(I.Z,{size:"xs",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})},s):(0,a.jsx)(I.Z,{size:"xs",color:"blue",children:(0,a.jsx)(p.Z,{children:e.length>30?"".concat((0,B.W0)(e).slice(0,30),"..."):(0,B.W0)(e)})},s)),s.models.length>3&&!l&&(0,a.jsx)(I.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,a.jsxs)(p.Z,{children:["+",s.models.length-3," ",s.models.length-3==1?"more model":"more models"]})}),l&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:s.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,a.jsx)(I.Z,{size:"xs",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})},s+3):(0,a.jsx)(I.Z,{size:"xs",color:"blue",children:(0,a.jsx)(p.Z,{children:e.length>30?"".concat((0,B.W0)(e).slice(0,30),"..."):(0,B.W0)(e)})},s+3))})]})]})})}):null})})},U=l(88906),G=l(92369),J=e=>{let s="inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium border";return"admin"===e?(0,a.jsxs)("span",{className:s,style:{backgroundColor:"#EEF2FF",color:"#3730A3",borderColor:"#C7D2FE"},children:[(0,a.jsx)(U.Z,{className:"h-3 w-3 mr-1"}),"Admin"]}):(0,a.jsxs)("span",{className:s,style:{backgroundColor:"#F3F4F6",color:"#4B5563",borderColor:"#E5E7EB"},children:[(0,a.jsx)(G.Z,{className:"h-3 w-3 mr-1"}),"Member"]})};let Q=(e,s)=>{var l,a;if(!s)return null;let t=null===(l=e.members_with_roles)||void 0===l?void 0:l.find(e=>e.user_id===s);return null!==(a=null==t?void 0:t.role)&&void 0!==a?a:null};var q=e=>{let{team:s,userId:l}=e,t=J(Q(s,l));return(0,a.jsx)(A.Z,{children:t})},K=e=>{let{teams:s,currentOrg:l,setSelectedTeamId:t,perTeamInfo:r,userRole:i,userId:n,setEditTeam:c,onDeleteTeam:o}=e;return(0,a.jsxs)(M.Z,{children:[(0,a.jsx)(E.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(D.Z,{children:"Team Name"}),(0,a.jsx)(D.Z,{children:"Team ID"}),(0,a.jsx)(D.Z,{children:"Created"}),(0,a.jsx)(D.Z,{children:"Spend (USD)"}),(0,a.jsx)(D.Z,{children:"Budget (USD)"}),(0,a.jsx)(D.Z,{children:"Models"}),(0,a.jsx)(D.Z,{children:"Organization"}),(0,a.jsx)(D.Z,{children:"Your Role"}),(0,a.jsx)(D.Z,{children:"Info"})]})}),(0,a.jsx)(z.Z,{children:s&&s.length>0?s.filter(e=>!l||e.organization_id===l.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,a.jsx)(A.Z,{children:(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(L.Z,{title:e.team_id,children:(0,a.jsxs)(m.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{t(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,f.pw)(e.spend,4)}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,a.jsx)(W,{team:e}),(0,a.jsx)(A.Z,{children:e.organization_id}),(0,a.jsx)(q,{team:e,userId:n}),(0,a.jsxs)(A.Z,{children:[(0,a.jsxs)(p.Z,{children:[r&&e.team_id&&r[e.team_id]&&r[e.team_id].keys&&r[e.team_id].keys.length," ","Keys"]}),(0,a.jsxs)(p.Z,{children:[r&&e.team_id&&r[e.team_id]&&r[e.team_id].team_info&&r[e.team_id].team_info.members_with_roles&&r[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,a.jsx)(A.Z,{children:"Admin"==i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.Z,{icon:P.Z,size:"sm",onClick:()=>{t(e.team_id),c(!0)}}),(0,a.jsx)(b.Z,{onClick:()=>o(e.team_id),icon:O.Z,size:"sm"})]}):null})]},e.team_id)):null})]})},X=l(32489),Y=l(76865),H=e=>{var s;let{teams:l,teamToDelete:r,onCancel:i,onConfirm:n}=e,[c,o]=(0,t.useState)(""),d=null==l?void 0:l.find(e=>e.team_id===r),m=(null==d?void 0:d.team_alias)||"",x=(null==d?void 0:null===(s=d.keys)||void 0===s?void 0:s.length)||0,u=c===m;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Team"}),(0,a.jsx)("button",{onClick:()=>{i(),o("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,a.jsx)(X.Z,{size:20})})]}),(0,a.jsxs)("div",{className:"px-6 py-4",children:[x>0&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,a.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,a.jsx)(Y.Z,{size:20})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-base font-medium text-red-600",children:["Warning: This team has ",x," associated key",x>1?"s":"","."]}),(0,a.jsx)("p",{className:"text-base text-red-600 mt-2",children:"Deleting the team will also delete all associated keys. This action is irreversible."})]})]}),(0,a.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to force delete this team and all its keys?"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,a.jsx)("span",{className:"underline",children:m})," to confirm deletion:"]}),(0,a.jsx)("input",{type:"text",value:c,onChange:e=>o(e.target.value),placeholder:"Enter team name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,a.jsx)("button",{onClick:()=>{i(),o("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,a.jsx)("button",{onClick:n,disabled:!u,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(u?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Force Delete"})]})]})})},$=l(82680),ee=l(52787),es=l(64482),el=l(73002),ea=l(26210),et=l(15424),er=l(24199),ei=l(97415),en=l(95920),ec=l(2597),eo=l(51750),ed=l(9114),em=l(68473);let ex=(e,s)=>{let l=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),l=e.models):l=s,(0,B.Ob)(l,s)};var eu=e=>{let{isTeamModalVisible:s,handleOk:l,handleCancel:i,currentOrg:c,organizations:o,teams:d,setTeams:m,modelAliases:x,setModelAliases:u,loggingSettings:h,setLoggingSettings:g,setIsTeamModalVisible:p}=e,{userId:j,userRole:f,accessToken:b,premiumUser:v}=(0,k.Z)(),[y]=n.Z.useForm(),[_,N]=(0,t.useState)([]),[w,Z]=(0,t.useState)(null),[C,S]=(0,t.useState)([]),[T,M]=(0,t.useState)([]),[z,A]=(0,t.useState)([]),[E,D]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(async()=>{try{if(null===j||null===f||null===b)return;let e=await (0,B.K2)(j,f,b);e&&N(e)}catch(e){console.error("Error fetching user models:",e)}})()},[b,j,f,d]),(0,t.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(w));let e=ex(w,_);console.log("models: ".concat(e)),S(e),y.setFieldValue("models",[])},[w,_,y]);let F=async()=>{try{if(null==b)return;let e=await (0,r.fetchMCPAccessGroups)(b);A(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,t.useEffect)(()=>{F()},[b,F]),(0,t.useEffect)(()=>{(async()=>{try{if(null==b)return;let e=(await (0,r.getGuardrailsList)(b)).guardrails.map(e=>e.guardrail_name);M(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[b]);let P=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=b){var s,l,a;let t=null==e?void 0:e.team_alias,i=null!==(a=null==d?void 0:d.map(e=>e.team_alias))&&void 0!==a?a:[],n=(null==e?void 0:e.organization_id)||(null==c?void 0:c.organization_id);if(""===n||"string"!=typeof n?e.organization_id=null:e.organization_id=n.trim(),i.includes(t))throw Error("Team alias ".concat(t," already exists, please pick another alias"));if(ed.Z.info("Creating Team"),h.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:h.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(s=e.allowed_mcp_servers_and_groups.servers)||void 0===s?void 0:s.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0||e.allowed_mcp_servers_and_groups.toolPermissions)){if(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups){let{servers:s,accessGroups:l}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),l&&l.length>0&&(e.object_permission.mcp_access_groups=l),delete e.allowed_mcp_servers_and_groups}e.mcp_tool_permissions&&Object.keys(e.mcp_tool_permissions).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=e.mcp_tool_permissions,delete e.mcp_tool_permissions)}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(x).length>0&&(e.model_aliases=x);let o=await (0,r.teamCreateCall)(b,e);null!==d?m([...d,o]):m([o]),console.log("response for team create call: ".concat(o)),ed.Z.success("Team created"),y.resetFields(),g([]),u({}),p(!1)}}catch(e){console.error("Error creating the team:",e),ed.Z.fromBackend("Error creating the team: "+e)}};return(0,a.jsx)($.Z,{title:"Create Team",open:s,width:1e3,footer:null,onOk:l,onCancel:i,children:(0,a.jsxs)(n.Z,{form:y,onFinish:P,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(ea.oi,{placeholder:""})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Organization"," ",(0,a.jsx)(L.Z,{title:(0,a.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:c?c.organization_id:null,className:"mt-8",children:(0,a.jsx)(ee.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{y.setFieldValue("organization_id",e),Z((null==o?void 0:o.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var l;return!!s&&((null===(l=s.children)||void 0===l?void 0:l.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==o?void 0:o.map(e=>(0,a.jsxs)(ee.default.Option,{value:e.organization_id,children:[(0,a.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,a.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Models"," ",(0,a.jsx)(L.Z,{title:"These are the models that your selected team has access to",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,a.jsxs)(ee.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(ee.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),C.map(e=>(0,a.jsx)(ee.default.Option,{value:e,children:(0,B.W0)(e)},e))]})}),(0,a.jsx)(n.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(er.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(n.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(ee.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(ee.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(ee.default.Option,{value:"7d",children:"weekly"}),(0,a.jsx)(ee.default.Option,{value:"30d",children:"monthly"})]})}),(0,a.jsx)(n.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsxs)(ea.UQ,{className:"mt-20 mb-8",onClick:()=>{E||(F(),D(!0))},children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Additional Settings"})}),(0,a.jsxs)(ea.X1,{children:[(0,a.jsx)(n.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,a.jsx)(ea.oi,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,a.jsx)(n.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,a.jsx)(er.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(n.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,a.jsx)(ea.oi,{placeholder:"e.g., 30d"})}),(0,a.jsx)(n.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,a.jsx)(es.default.TextArea,{rows:4})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Guardrails"," ",(0,a.jsx)(L.Z,{title:"Setup your first guardrail",children:(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,a.jsx)(ee.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:T.map(e=>({value:e,label:e}))})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,a.jsx)(L.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,a.jsx)(ei.Z,{onChange:e=>y.setFieldValue("allowed_vector_store_ids",e),value:y.getFieldValue("allowed_vector_store_ids"),accessToken:b||"",placeholder:"Select vector stores (optional)"})})]})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"MCP Settings"})}),(0,a.jsxs)(ea.X1,{children:[(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,a.jsx)(L.Z,{title:"Select which MCP servers or access groups this team can access",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,a.jsx)(en.Z,{onChange:e=>y.setFieldValue("allowed_mcp_servers_and_groups",e),value:y.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:b||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(n.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(es.default,{type:"hidden"})}),(0,a.jsx)(n.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,a.jsx)("div",{className:"mt-6",children:(0,a.jsx)(em.Z,{accessToken:b||"",selectedServers:(null===(e=y.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:y.getFieldValue("mcp_tool_permissions")||{},onChange:e=>y.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Logging Settings"})}),(0,a.jsx)(ea.X1,{children:(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(ec.Z,{value:h,onChange:g,premiumUser:v})})})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Model Aliases"})}),(0,a.jsx)(ea.X1,{children:(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)(ea.xv,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,a.jsx)(eo.Z,{accessToken:b||"",initialModelAliases:x,onAliasUpdate:u,showExampleConfig:!1})]})})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(el.ZP,{htmlType:"submit",children:"Create Team"})})]})})},eh=e=>{let{teams:s,accessToken:l,setTeams:b,userID:v,userRole:y,organizations:_,premiumUser:N=!1}=e,[w,C]=(0,t.useState)(null),[k,M]=(0,t.useState)(!1),[z,A]=(0,t.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),[E]=n.Z.useForm(),[D]=n.Z.useForm(),[F,L]=(0,t.useState)(null),[P,O]=(0,t.useState)(!1),[I,V]=(0,t.useState)(!1),[R,B]=(0,t.useState)(!1),[W,U]=(0,t.useState)(!1),[G,J]=(0,t.useState)([]),[Q,q]=(0,t.useState)(!1),[X,Y]=(0,t.useState)(null),[$,ee]=(0,t.useState)({}),[es,el]=(0,t.useState)([]),[ea,et]=(0,t.useState)({}),{lastRefreshed:er,onRefreshClick:ei}=T({currentOrg:w,setTeams:b});(0,t.useEffect)(()=>{s&&ee(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let en=async e=>{Y(e),q(!0)},ec=async()=>{if(null!=X&&null!=s&&null!=l){try{await (0,r.teamDeleteCall)(l,X),(0,i.Z)(l,v,y,w,b)}catch(e){console.error("Error deleting the team:",e)}q(!1),Y(null)}};return(0,a.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,a.jsx)(h.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,a.jsxs)(u.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==y||"Org Admin"==y)&&(0,a.jsx)(m.Z,{className:"w-fit",onClick:()=>V(!0),children:"+ Create New Team"}),F?(0,a.jsx)(c.Z,{teamId:F,onUpdate:e=>{b(s=>{if(null==s)return s;let a=s.map(s=>e.team_id===s.team_id?(0,f.nl)(s,e):s);return l&&(0,i.Z)(l,v,y,w,b),a})},onClose:()=>{L(null),O(!1)},accessToken:l,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;se.team_id===F)),is_proxy_admin:"Admin"==y,userModels:G,editTeam:P}):(0,a.jsxs)(Z,{lastRefreshed:er,onRefresh:ei,userRole:y,children:[(0,a.jsxs)(g.Z,{children:[(0,a.jsxs)(p.Z,{children:["Click on “Team ID” to view team details ",(0,a.jsx)("b",{children:"and"})," manage team members."]}),(0,a.jsx)(h.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,a.jsx)(u.Z,{numColSpan:1,children:(0,a.jsxs)(x.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,a.jsx)("div",{className:"border-b px-6 py-4",children:(0,a.jsx)("div",{className:"flex flex-col space-y-4",children:(0,a.jsx)(S,{filters:z,organizations:_,showFilters:k,onToggleFilters:M,onChange:(e,s)=>{let a={...z,[e]:s};A(a),l&&(0,r.v2TeamListCall)(l,a.organization_id||null,null,a.team_id||null,a.team_alias||null).then(e=>{e&&e.teams&&b(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},onReset:()=>{A({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),l&&(0,r.v2TeamListCall)(l,null,v||null,null,null).then(e=>{e&&e.teams&&b(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})}})})}),(0,a.jsx)(K,{teams:s,currentOrg:w,perTeamInfo:$,userRole:y,userId:v,setSelectedTeamId:L,setEditTeam:O,onDeleteTeam:en}),Q&&(0,a.jsx)(H,{teams:s,teamToDelete:X,onCancel:()=>{q(!1),Y(null)},onConfirm:ec})]})})})]}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(j.Z,{accessToken:l,userID:v})}),(0,d.tY)(y||"")&&(0,a.jsx)(g.Z,{children:(0,a.jsx)(o.Z,{accessToken:l,userID:v||"",userRole:y||""})})]}),("Admin"==y||"Org Admin"==y)&&(0,a.jsx)(eu,{isTeamModalVisible:I,handleOk:()=>{V(!1),E.resetFields(),el([]),et({})},handleCancel:()=>{V(!1),E.resetFields(),el([]),et({})},currentOrg:w,organizations:_,teams:s,setTeams:b,modelAliases:ea,setModelAliases:et,loggingSettings:es,setLoggingSettings:el,setIsTeamModalVisible:V})]})})})},eg=l(11318),ep=l(22004),ej=()=>{let{accessToken:e,userId:s,userRole:l}=(0,k.Z)(),{teams:r,setTeams:i}=(0,eg.Z)(),[n,c]=(0,t.useState)([]);return(0,t.useEffect)(()=>{(0,ep.g)(e,c).then(()=>{})},[e]),(0,a.jsx)(eh,{teams:r,accessToken:e,setTeams:i,userID:s,userRole:l,organizations:n})}},88904:function(e,s,l){"use strict";var a=l(57437),t=l(2265),r=l(88913),i=l(93192),n=l(52787),c=l(63709),o=l(87908),d=l(19250),m=l(65925),x=l(46468),u=l(9114);s.Z=e=>{var s;let{accessToken:l,userID:h,userRole:g}=e,[p,j]=(0,t.useState)(!0),[f,b]=(0,t.useState)(null),[v,y]=(0,t.useState)(!1),[_,N]=(0,t.useState)({}),[w,Z]=(0,t.useState)(!1),[C,S]=(0,t.useState)([]),{Paragraph:k}=i.default,{Option:T}=n.default;(0,t.useEffect)(()=>{(async()=>{if(!l){j(!1);return}try{let e=await (0,d.getDefaultTeamSettings)(l);if(b(e),N(e.values||{}),l)try{let e=await (0,d.modelAvailableCall)(l,h,g);if(e&&e.data){let s=e.data.map(e=>e.id);S(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),u.Z.fromBackend("Failed to fetch team settings")}finally{j(!1)}})()},[l]);let M=async()=>{if(l){Z(!0);try{let e=await (0,d.updateDefaultTeamSettings)(l,_);b({...f,values:e.settings}),y(!1),u.Z.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),u.Z.fromBackend("Failed to update team settings")}finally{Z(!1)}}},z=(e,s)=>{N(l=>({...l,[e]:s}))},A=(e,s,l)=>{var t;let i=s.type;return"budget_duration"===e?(0,a.jsx)(m.Z,{value:_[e]||null,onChange:s=>z(e,s),className:"mt-2"}):"boolean"===i?(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(c.Z,{checked:!!_[e],onChange:s=>z(e,s)})}):"array"===i&&(null===(t=s.items)||void 0===t?void 0:t.enum)?(0,a.jsx)(n.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>z(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,a.jsx)(T,{value:e,children:e},e))}):"models"===e?(0,a.jsx)(n.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>z(e,s),className:"mt-2",children:C.map(e=>(0,a.jsx)(T,{value:e,children:(0,x.W0)(e)},e))}):"string"===i&&s.enum?(0,a.jsx)(n.default,{style:{width:"100%"},value:_[e]||"",onChange:s=>z(e,s),className:"mt-2",children:s.enum.map(e=>(0,a.jsx)(T,{value:e,children:e},e))}):(0,a.jsx)(r.oi,{value:void 0!==_[e]?String(_[e]):"",onChange:s=>z(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},E=(e,s)=>null==s?(0,a.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,a.jsx)("span",{children:(0,m.m)(s)}):"boolean"==typeof s?(0,a.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,a.jsx)("span",{className:"text-gray-400",children:"None"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,x.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,a.jsx)("span",{className:"text-gray-400",children:"None"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,a.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,a.jsx)("span",{children:String(s)});return p?(0,a.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,a.jsx)(o.Z,{size:"large"})}):f?(0,a.jsxs)(r.Zb,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(r.Dx,{className:"text-xl",children:"Default Team Settings"}),!p&&f&&(v?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(r.zx,{variant:"secondary",onClick:()=>{y(!1),N(f.values||{})},disabled:w,children:"Cancel"}),(0,a.jsx)(r.zx,{onClick:M,loading:w,children:"Save Changes"})]}):(0,a.jsx)(r.zx,{onClick:()=>y(!0),children:"Edit Settings"}))]}),(0,a.jsx)(r.xv,{children:"These settings will be applied by default when creating new teams."}),(null==f?void 0:null===(s=f.field_schema)||void 0===s?void 0:s.description)&&(0,a.jsx)(k,{className:"mb-4 mt-2",children:f.field_schema.description}),(0,a.jsx)(r.iz,{}),(0,a.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=f;return s&&s.properties?Object.entries(s.properties).map(s=>{let[l,t]=s,i=e[l],n=l.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,a.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,a.jsx)(r.xv,{className:"font-medium text-lg",children:n}),(0,a.jsx)(k,{className:"text-sm text-gray-500 mt-1",children:t.description||"No description available"}),v?(0,a.jsx)("div",{className:"mt-2",children:A(l,t,i)}):(0,a.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:E(l,i)})]},l)}):(0,a.jsx)(r.xv,{children:"No schema information available"})})()})]}):(0,a.jsx)(r.Zb,{children:(0,a.jsx)(r.xv,{children:"No team settings available or you do not have permission to view them."})})}},51750:function(e,s,l){"use strict";l.d(s,{Z:function(){return g}});var a=l(57437),t=l(2265),r=l(77355),i=l(93416),n=l(74998),c=l(95704),o=l(56522),d=l(52787),m=l(69993),x=l(51601),u=e=>{let{accessToken:s,value:l,placeholder:r="Select a Model",onChange:i,disabled:n=!1,style:c,className:u,showLabel:h=!0,labelText:g="Select Model"}=e,[p,j]=(0,t.useState)(l),[f,b]=(0,t.useState)(!1),[v,y]=(0,t.useState)([]),_=(0,t.useRef)(null);return(0,t.useEffect)(()=>{j(l)},[l]),(0,t.useEffect)(()=>{s&&(async()=>{try{let e=await (0,x.p)(s);console.log("Fetched models for selector:",e),e.length>0&&y(e)}catch(e){console.error("Error fetching model info:",e)}})()},[s]),(0,a.jsxs)("div",{children:[h&&(0,a.jsxs)(o.x,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-2"})," ",g]}),(0,a.jsx)(d.default,{value:p,placeholder:r,onChange:e=>{"custom"===e?(b(!0),j(void 0)):(b(!1),j(e),i&&i(e))},options:[...Array.from(new Set(v.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...c},showSearch:!0,className:"rounded-md ".concat(u||""),disabled:n}),f&&(0,a.jsx)(o.o,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{j(e),i&&i(e)},500)},disabled:n})]})},h=l(9114),g=e=>{let{accessToken:s,initialModelAliases:l={},onAliasUpdate:o,showExampleConfig:d=!0}=e,[m,x]=(0,t.useState)([]),[g,p]=(0,t.useState)({aliasName:"",targetModel:""}),[j,f]=(0,t.useState)(null);(0,t.useEffect)(()=>{x(Object.entries(l).map((e,s)=>{let[l,a]=e;return{id:"".concat(s,"-").concat(l),aliasName:l,targetModel:a}}))},[l]);let b=e=>{f({...e})},v=()=>{if(!j)return;if(!j.aliasName||!j.targetModel){h.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.id!==j.id&&e.aliasName===j.aliasName)){h.Z.fromBackend("An alias with this name already exists");return}let e=m.map(e=>e.id===j.id?j:e);x(e),f(null);let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),o&&o(s),h.Z.success("Alias updated successfully")},y=()=>{f(null)},_=e=>{let s=m.filter(s=>s.id!==e);x(s);let l={};s.forEach(e=>{l[e.aliasName]=e.targetModel}),o&&o(l),h.Z.success("Alias deleted successfully")},N=m.reduce((e,s)=>(e[s.aliasName]=s.targetModel,e),{});return(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(c.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,a.jsx)("input",{type:"text",value:g.aliasName,onChange:e=>p({...g,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model"}),(0,a.jsx)(u,{accessToken:s,value:g.targetModel,placeholder:"Select target model",onChange:e=>p({...g,targetModel:e}),showLabel:!1})]}),(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsxs)("button",{onClick:()=>{if(!g.aliasName||!g.targetModel){h.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.aliasName===g.aliasName)){h.Z.fromBackend("An alias with this name already exists");return}let e=[...m,{id:"".concat(Date.now(),"-").concat(g.aliasName),aliasName:g.aliasName,targetModel:g.targetModel}];x(e),p({aliasName:"",targetModel:""});let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),o&&o(s),h.Z.success("Alias added successfully")},disabled:!g.aliasName||!g.targetModel,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(g.aliasName&&g.targetModel?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,a.jsx)(r.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,a.jsx)(c.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,a.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)(c.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,a.jsx)(c.ss,{children:(0,a.jsxs)(c.SC,{children:[(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Target Model"}),(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,a.jsxs)(c.RM,{children:[m.map(e=>(0,a.jsx)(c.SC,{className:"h-8",children:j&&j.id===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:j.aliasName,onChange:e=>f({...j,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(c.pj,{className:"py-0.5",children:(0,a.jsx)(u,{accessToken:s,value:j.targetModel,onChange:e=>f({...j,targetModel:e}),showLabel:!1,style:{height:"32px"}})}),(0,a.jsx)(c.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:v,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,a.jsx)("button",{onClick:y,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,a.jsx)(c.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModel}),(0,a.jsx)(c.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>b(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,a.jsx)(i.Z,{className:"w-3 h-3"})}),(0,a.jsx)("button",{onClick:()=>_(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,a.jsx)(n.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===m.length&&(0,a.jsx)(c.SC,{children:(0,a.jsx)(c.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),d&&(0,a.jsxs)(c.Zb,{children:[(0,a.jsx)(c.Dx,{className:"mb-4",children:"Configuration Example"}),(0,a.jsx)(c.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config:"}),(0,a.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,a.jsxs)("div",{className:"text-gray-700",children:["model_aliases:",0===Object.keys(N).length?(0,a.jsxs)("span",{className:"text-gray-500",children:[(0,a.jsx)("br",{}),"\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[s,l]=e;return(0,a.jsxs)("span",{children:[(0,a.jsx)("br",{}),'\xa0\xa0"',s,'": "',l,'"']},s)})]})})]})]})}},2597:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(92280),r=l(54507);s.Z=function(e){let{value:s,onChange:l,premiumUser:i=!1,disabledCallbacks:n=[],onDisabledCallbacksChange:c}=e;return i?(0,a.jsx)(r.Z,{value:s,onChange:l,disabledCallbacks:n,onDisabledCallbacksChange:c}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,a.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,a.jsxs)(t.x,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key"," ",(0,a.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})}},65925:function(e,s,l){"use strict";l.d(s,{m:function(){return i}});var a=l(57437);l(2265);var t=l(52787);let{Option:r}=t.default,i=e=>e?({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set";s.Z=e=>{let{value:s,onChange:l,className:i="",style:n={}}=e;return(0,a.jsxs)(t.default,{style:{width:"100%",...n},value:s||void 0,onChange:l,className:i,placeholder:"n/a",children:[(0,a.jsx)(r,{value:"24h",children:"daily"}),(0,a.jsx)(r,{value:"7d",children:"weekly"}),(0,a.jsx)(r,{value:"30d",children:"monthly"})]})}},39210:function(e,s,l){"use strict";l.d(s,{Z:function(){return t}});var a=l(19250);let t=async(e,s,l,t,r)=>{let i;i="Admin"!=l&&"Admin Viewer"!=l?await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null,s):await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null),console.log("givenTeams: ".concat(i)),r(i)}},27799:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(40728),r=l(82182),i=l(91777),n=l(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:l=[],variant:c="card",className:o=""}=e,d=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[l,a]=s;return a===e}))||void 0===s?void 0:s[0])||e},m=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},x=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},u=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,a.jsx)(t.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var l;let i=d(e.callback_name),c=null===(l=n.Dg[i])||void 0===l?void 0:l.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[c?(0,a.jsx)("img",{src:c,alt:i,className:"w-5 h-5 object-contain"}):(0,a.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-medium text-blue-800",children:i}),(0,a.jsxs)(t.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,a.jsx)(t.C,{color:m(e.callback_type),size:"sm",children:x(e.callback_type)})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(t.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,a.jsx)(t.C,{color:"red",size:"xs",children:l.length})]}),l.length>0?(0,a.jsx)("div",{className:"space-y-3",children:l.map((e,s)=>{var l;let r=n.RD[e]||e,c=null===(l=n.Dg[r])||void 0===l?void 0:l.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[c?(0,a.jsx)("img",{src:c,alt:r,className:"w-5 h-5 object-contain"}):(0,a.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-medium text-red-800",children:r}),(0,a.jsx)(t.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,a.jsx)(t.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(t.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===c?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,a.jsx)(t.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(t.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),u]})}},98015:function(e,s,l){"use strict";l.d(s,{Z:function(){return g}});var a=l(57437),t=l(2265),r=l(92280),i=l(40728),n=l(79814),c=l(19250),o=function(e){let{vectorStores:s,accessToken:l}=e,[r,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{(async()=>{if(l&&0!==s.length)try{let e=await (0,c.vectorStoreListCall)(l);e.data&&o(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[l,s.length]);let d=e=>{let s=r.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:d(e)},s))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},d=l(25327),m=l(86462),x=l(47686),u=l(89970),h=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:o}=e,[h,g]=(0,t.useState)([]),[p,j]=(0,t.useState)([]),[f,b]=(0,t.useState)(new Set),v=e=>{b(s=>{let l=new Set(s);return l.has(e)?l.delete(e):l.add(e),l})};(0,t.useEffect)(()=>{(async()=>{if(o&&s.length>0)try{let e=await (0,c.fetchMCPServers)(o);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[o,s.length]),(0,t.useEffect)(()=>{(async()=>{if(o&&r.length>0)try{let e=await Promise.resolve().then(l.bind(l,19250)).then(e=>e.fetchMCPAccessGroups(o));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let y=e=>{let s=h.find(s=>s.server_id===e);if(s){let l=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(l,")")}return e},_=e=>e,N=[...s.map(e=>({type:"server",value:e})),...r.map(e=>({type:"accessGroup",value:e}))],w=N.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:w})]}),w>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let l="server"===e.type?n[e.value]:void 0,t=l&&l.length>0,r=f.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>t&&v(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(t?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(u.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:y(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),t&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:l.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===l.length?"tool":"tools"}),r?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),t&&r&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map((e,s)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:s,variant:l="card",className:t="",accessToken:i}=e,n=(null==s?void 0:s.vector_stores)||[],c=(null==s?void 0:s.mcp_servers)||[],d=(null==s?void 0:s.mcp_access_groups)||[],m=(null==s?void 0:s.mcp_tool_permissions)||{},x=(0,a.jsxs)("div",{className:"card"===l?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(o,{vectorStores:n,accessToken:i}),(0,a.jsx)(h,{mcpServers:c,mcpAccessGroups:d,mcpToolPermissions:m,accessToken:i})]});return"card"===l?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(t),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),x]}):(0,a.jsxs)("div",{className:"".concat(t),children:[(0,a.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),x]})}},21425:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(54507);s.Z=e=>{let{value:s,onChange:l,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,a.jsx)(t.Z,{value:s,onChange:l,disabledCallbacks:r,onDisabledCallbacksChange:i})}},918:function(e,s,l){"use strict";var a=l(57437),t=l(2265),r=l(62490),i=l(19250),n=l(9114);s.Z=e=>{let{accessToken:s,userID:l}=e,[c,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{(async()=>{if(s&&l)try{let e=await (0,i.availableTeamListCall)(s);o(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,l]);let d=async e=>{if(s&&l)try{await (0,i.teamMemberAddCall)(s,e,{user_id:l,role:"user"}),n.Z.success("Successfully joined team"),o(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),n.Z.fromBackend("Failed to join team")}};return(0,a.jsx)(r.Zb,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(r.iA,{children:[(0,a.jsx)(r.ss,{children:(0,a.jsxs)(r.SC,{children:[(0,a.jsx)(r.xs,{children:"Team Name"}),(0,a.jsx)(r.xs,{children:"Description"}),(0,a.jsx)(r.xs,{children:"Members"}),(0,a.jsx)(r.xs,{children:"Models"}),(0,a.jsx)(r.xs,{children:"Actions"})]})}),(0,a.jsxs)(r.RM,{children:[c.map(e=>(0,a.jsxs)(r.SC,{children:[(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.xv,{children:e.team_alias})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.xv,{children:e.description||"No description available"})}),(0,a.jsx)(r.pj,{children:(0,a.jsxs)(r.xv,{children:[e.members_with_roles.length," members"]})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,a.jsx)(r.Ct,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(r.xv,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,a.jsx)(r.Ct,{size:"xs",color:"red",children:(0,a.jsx)(r.xv,{children:"All Proxy Models"})})})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.zx,{size:"xs",variant:"secondary",onClick:()=>d(e.team_id),children:"Join Team"})})]},e.team_id)),0===c.length&&(0,a.jsx)(r.SC,{children:(0,a.jsx)(r.pj,{colSpan:5,className:"text-center",children:(0,a.jsx)(r.xv,{children:"No available teams to join"})})})]})]})})}}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2284,7908,9678,1853,7281,6202,7640,8049,131,2004,2012,2971,2117,1744],function(){return e(e.s=77403)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9483],{77403:function(e,s,l){Promise.resolve().then(l.bind(l,67578))},40728:function(e,s,l){"use strict";l.d(s,{C:function(){return a.Z},x:function(){return t.Z}});var a=l(41649),t=l(84264)},88913:function(e,s,l){"use strict";l.d(s,{Dx:function(){return c.Z},Zb:function(){return t.Z},iz:function(){return r.Z},oi:function(){return n.Z},xv:function(){return i.Z},zx:function(){return a.Z}});var a=l(20831),t=l(12514),r=l(67982),i=l(84264),n=l(49566),c=l(96761)},25512:function(e,s,l){"use strict";l.d(s,{P:function(){return a.Z},Q:function(){return t.Z}});var a=l(27281),t=l(57365)},67578:function(e,s,l){"use strict";l.r(s),l.d(s,{default:function(){return ej}});var a=l(57437),t=l(2265),r=l(19250),i=l(39210),n=l(13634),c=l(33293),o=l(88904),d=l(20347),m=l(20831),x=l(12514),u=l(49804),h=l(67101),g=l(29706),p=l(84264),j=l(918),f=l(59872),b=l(47323),v=l(12485),y=l(18135),_=l(35242),N=l(77991),w=l(23628),Z=e=>{let{lastRefreshed:s,onRefresh:l,userRole:t,children:r}=e;return(0,a.jsxs)(y.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,a.jsxs)(_.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)(v.Z,{children:"Your Teams"}),(0,a.jsx)(v.Z,{children:"Available Teams"}),(0,d.tY)(t||"")&&(0,a.jsx)(v.Z,{children:"Default Team Settings"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,a.jsxs)(p.Z,{children:["Last Refreshed: ",s]}),(0,a.jsx)(b.Z,{icon:w.Z,variant:"shadow",size:"xs",className:"self-center",onClick:l})]})]}),(0,a.jsx)(N.Z,{children:r})]})},C=l(25512),S=e=>{let{filters:s,organizations:l,showFilters:t,onToggleFilters:r,onChange:i,onReset:n}=e;return(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("div",{className:"relative w-64",children:[(0,a.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:s.team_alias,onChange:e=>i("team_alias",e.target.value)}),(0,a.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,a.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(t?"bg-gray-100":""),onClick:()=>r(!t),children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(s.team_id||s.team_alias||s.organization_id)&&(0,a.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,a.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:n,children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),t&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,a.jsxs)("div",{className:"relative w-64",children:[(0,a.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:s.team_id,onChange:e=>i("team_id",e.target.value)}),(0,a.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,a.jsx)("div",{className:"w-64",children:(0,a.jsx)(C.P,{value:s.organization_id||"",onValueChange:e=>i("organization_id",e),placeholder:"Select Organization",children:null==l?void 0:l.map(e=>(0,a.jsx)(C.Q,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})},k=l(80443),T=e=>{let{currentOrg:s,setTeams:l}=e,[a,r]=(0,t.useState)(""),{accessToken:n,userId:c,userRole:o}=(0,k.Z)(),d=(0,t.useCallback)(()=>{r(new Date().toLocaleString())},[]);return(0,t.useEffect)(()=>{n&&(0,i.Z)(n,c,o,s,l).then(),d()},[n,s,a,d,l,c,o]),{lastRefreshed:a,setLastRefreshed:r,onRefreshClick:d}},M=l(21626),z=l(97214),A=l(28241),E=l(58834),D=l(69552),F=l(71876),L=l(89970),P=l(53410),O=l(74998),I=l(41649),V=l(86462),R=l(47686),B=l(46468),W=e=>{let{team:s}=e,[l,r]=(0,t.useState)(!1);return(0,a.jsx)(A.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:s.models.length>3?"px-0":"",children:(0,a.jsx)("div",{className:"flex flex-col",children:Array.isArray(s.models)?(0,a.jsx)("div",{className:"flex flex-col",children:0===s.models.length?(0,a.jsx)(I.Z,{size:"xs",className:"mb-1",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex items-start",children:[s.models.length>3&&(0,a.jsx)("div",{children:(0,a.jsx)(b.Z,{icon:l?V.Z:R.Z,className:"cursor-pointer",size:"xs",onClick:()=>{r(e=>!e)}})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,a.jsx)(I.Z,{size:"xs",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})},s):(0,a.jsx)(I.Z,{size:"xs",color:"blue",children:(0,a.jsx)(p.Z,{children:e.length>30?"".concat((0,B.W0)(e).slice(0,30),"..."):(0,B.W0)(e)})},s)),s.models.length>3&&!l&&(0,a.jsx)(I.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,a.jsxs)(p.Z,{children:["+",s.models.length-3," ",s.models.length-3==1?"more model":"more models"]})}),l&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:s.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,a.jsx)(I.Z,{size:"xs",color:"red",children:(0,a.jsx)(p.Z,{children:"All Proxy Models"})},s+3):(0,a.jsx)(I.Z,{size:"xs",color:"blue",children:(0,a.jsx)(p.Z,{children:e.length>30?"".concat((0,B.W0)(e).slice(0,30),"..."):(0,B.W0)(e)})},s+3))})]})]})})}):null})})},U=l(88906),G=l(92369),J=e=>{let s="inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium border";return"admin"===e?(0,a.jsxs)("span",{className:s,style:{backgroundColor:"#EEF2FF",color:"#3730A3",borderColor:"#C7D2FE"},children:[(0,a.jsx)(U.Z,{className:"h-3 w-3 mr-1"}),"Admin"]}):(0,a.jsxs)("span",{className:s,style:{backgroundColor:"#F3F4F6",color:"#4B5563",borderColor:"#E5E7EB"},children:[(0,a.jsx)(G.Z,{className:"h-3 w-3 mr-1"}),"Member"]})};let Q=(e,s)=>{var l,a;if(!s)return null;let t=null===(l=e.members_with_roles)||void 0===l?void 0:l.find(e=>e.user_id===s);return null!==(a=null==t?void 0:t.role)&&void 0!==a?a:null};var q=e=>{let{team:s,userId:l}=e,t=J(Q(s,l));return(0,a.jsx)(A.Z,{children:t})},K=e=>{let{teams:s,currentOrg:l,setSelectedTeamId:t,perTeamInfo:r,userRole:i,userId:n,setEditTeam:c,onDeleteTeam:o}=e;return(0,a.jsxs)(M.Z,{children:[(0,a.jsx)(E.Z,{children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(D.Z,{children:"Team Name"}),(0,a.jsx)(D.Z,{children:"Team ID"}),(0,a.jsx)(D.Z,{children:"Created"}),(0,a.jsx)(D.Z,{children:"Spend (USD)"}),(0,a.jsx)(D.Z,{children:"Budget (USD)"}),(0,a.jsx)(D.Z,{children:"Models"}),(0,a.jsx)(D.Z,{children:"Organization"}),(0,a.jsx)(D.Z,{children:"Your Role"}),(0,a.jsx)(D.Z,{children:"Info"})]})}),(0,a.jsx)(z.Z,{children:s&&s.length>0?s.filter(e=>!l||e.organization_id===l.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,a.jsx)(A.Z,{children:(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(L.Z,{title:e.team_id,children:(0,a.jsxs)(m.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{t(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,f.pw)(e.spend,4)}),(0,a.jsx)(A.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,a.jsx)(W,{team:e}),(0,a.jsx)(A.Z,{children:e.organization_id}),(0,a.jsx)(q,{team:e,userId:n}),(0,a.jsxs)(A.Z,{children:[(0,a.jsxs)(p.Z,{children:[r&&e.team_id&&r[e.team_id]&&r[e.team_id].keys&&r[e.team_id].keys.length," ","Keys"]}),(0,a.jsxs)(p.Z,{children:[r&&e.team_id&&r[e.team_id]&&r[e.team_id].team_info&&r[e.team_id].team_info.members_with_roles&&r[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,a.jsx)(A.Z,{children:"Admin"==i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.Z,{icon:P.Z,size:"sm",onClick:()=>{t(e.team_id),c(!0)}}),(0,a.jsx)(b.Z,{onClick:()=>o(e.team_id),icon:O.Z,size:"sm"})]}):null})]},e.team_id)):null})]})},X=l(32489),Y=l(76865),H=e=>{var s;let{teams:l,teamToDelete:r,onCancel:i,onConfirm:n}=e,[c,o]=(0,t.useState)(""),d=null==l?void 0:l.find(e=>e.team_id===r),m=(null==d?void 0:d.team_alias)||"",x=(null==d?void 0:null===(s=d.keys)||void 0===s?void 0:s.length)||0,u=c===m;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Team"}),(0,a.jsx)("button",{onClick:()=>{i(),o("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,a.jsx)(X.Z,{size:20})})]}),(0,a.jsxs)("div",{className:"px-6 py-4",children:[x>0&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,a.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,a.jsx)(Y.Z,{size:20})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-base font-medium text-red-600",children:["Warning: This team has ",x," associated key",x>1?"s":"","."]}),(0,a.jsx)("p",{className:"text-base text-red-600 mt-2",children:"Deleting the team will also delete all associated keys. This action is irreversible."})]})]}),(0,a.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to force delete this team and all its keys?"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,a.jsx)("span",{className:"underline",children:m})," to confirm deletion:"]}),(0,a.jsx)("input",{type:"text",value:c,onChange:e=>o(e.target.value),placeholder:"Enter team name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,a.jsx)("button",{onClick:()=>{i(),o("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,a.jsx)("button",{onClick:n,disabled:!u,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(u?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Force Delete"})]})]})})},$=l(82680),ee=l(52787),es=l(64482),el=l(73002),ea=l(26210),et=l(15424),er=l(24199),ei=l(97415),en=l(95920),ec=l(2597),eo=l(51750),ed=l(9114),em=l(68473);let ex=(e,s)=>{let l=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),l=e.models):l=s,(0,B.Ob)(l,s)};var eu=e=>{let{isTeamModalVisible:s,handleOk:l,handleCancel:i,currentOrg:c,organizations:o,teams:d,setTeams:m,modelAliases:x,setModelAliases:u,loggingSettings:h,setLoggingSettings:g,setIsTeamModalVisible:p}=e,{userId:j,userRole:f,accessToken:b,premiumUser:v}=(0,k.Z)(),[y]=n.Z.useForm(),[_,N]=(0,t.useState)([]),[w,Z]=(0,t.useState)(null),[C,S]=(0,t.useState)([]),[T,M]=(0,t.useState)([]),[z,A]=(0,t.useState)([]),[E,D]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(async()=>{try{if(null===j||null===f||null===b)return;let e=await (0,B.K2)(j,f,b);e&&N(e)}catch(e){console.error("Error fetching user models:",e)}})()},[b,j,f,d]),(0,t.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(w));let e=ex(w,_);console.log("models: ".concat(e)),S(e),y.setFieldValue("models",[])},[w,_,y]);let F=async()=>{try{if(null==b)return;let e=await (0,r.fetchMCPAccessGroups)(b);A(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,t.useEffect)(()=>{F()},[b,F]),(0,t.useEffect)(()=>{(async()=>{try{if(null==b)return;let e=(await (0,r.getGuardrailsList)(b)).guardrails.map(e=>e.guardrail_name);M(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[b]);let P=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=b){var s,l,a;let t=null==e?void 0:e.team_alias,i=null!==(a=null==d?void 0:d.map(e=>e.team_alias))&&void 0!==a?a:[],n=(null==e?void 0:e.organization_id)||(null==c?void 0:c.organization_id);if(""===n||"string"!=typeof n?e.organization_id=null:e.organization_id=n.trim(),i.includes(t))throw Error("Team alias ".concat(t," already exists, please pick another alias"));if(ed.Z.info("Creating Team"),h.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:h.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(s=e.allowed_mcp_servers_and_groups.servers)||void 0===s?void 0:s.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0||e.allowed_mcp_servers_and_groups.toolPermissions)){if(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups){let{servers:s,accessGroups:l}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),l&&l.length>0&&(e.object_permission.mcp_access_groups=l),delete e.allowed_mcp_servers_and_groups}e.mcp_tool_permissions&&Object.keys(e.mcp_tool_permissions).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=e.mcp_tool_permissions,delete e.mcp_tool_permissions)}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(x).length>0&&(e.model_aliases=x);let o=await (0,r.teamCreateCall)(b,e);null!==d?m([...d,o]):m([o]),console.log("response for team create call: ".concat(o)),ed.Z.success("Team created"),y.resetFields(),g([]),u({}),p(!1)}}catch(e){console.error("Error creating the team:",e),ed.Z.fromBackend("Error creating the team: "+e)}};return(0,a.jsx)($.Z,{title:"Create Team",open:s,width:1e3,footer:null,onOk:l,onCancel:i,children:(0,a.jsxs)(n.Z,{form:y,onFinish:P,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,a.jsx)(ea.oi,{placeholder:""})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Organization"," ",(0,a.jsx)(L.Z,{title:(0,a.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:c?c.organization_id:null,className:"mt-8",children:(0,a.jsx)(ee.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{y.setFieldValue("organization_id",e),Z((null==o?void 0:o.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var l;return!!s&&((null===(l=s.children)||void 0===l?void 0:l.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==o?void 0:o.map(e=>(0,a.jsxs)(ee.default.Option,{value:e.organization_id,children:[(0,a.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,a.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Models"," ",(0,a.jsx)(L.Z,{title:"These are the models that your selected team has access to",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,a.jsxs)(ee.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,a.jsx)(ee.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),C.map(e=>(0,a.jsx)(ee.default.Option,{value:e,children:(0,B.W0)(e)},e))]})}),(0,a.jsx)(n.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(er.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(n.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(ee.default,{defaultValue:null,placeholder:"n/a",children:[(0,a.jsx)(ee.default.Option,{value:"24h",children:"daily"}),(0,a.jsx)(ee.default.Option,{value:"7d",children:"weekly"}),(0,a.jsx)(ee.default.Option,{value:"30d",children:"monthly"})]})}),(0,a.jsx)(n.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsxs)(ea.UQ,{className:"mt-20 mb-8",onClick:()=>{E||(F(),D(!0))},children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Additional Settings"})}),(0,a.jsxs)(ea.X1,{children:[(0,a.jsx)(n.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,a.jsx)(ea.oi,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,a.jsx)(n.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,a.jsx)(er.Z,{step:.01,precision:2,width:200})}),(0,a.jsx)(n.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,a.jsx)(ea.oi,{placeholder:"e.g., 30d"})}),(0,a.jsx)(n.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,a.jsx)(er.Z,{step:1,width:400})}),(0,a.jsx)(n.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,a.jsx)(es.default.TextArea,{rows:4})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Guardrails"," ",(0,a.jsx)(L.Z,{title:"Setup your first guardrail",children:(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,a.jsx)(ee.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:T.map(e=>({value:e,label:e}))})}),(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,a.jsx)(L.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,a.jsx)(ei.Z,{onChange:e=>y.setFieldValue("allowed_vector_store_ids",e),value:y.getFieldValue("allowed_vector_store_ids"),accessToken:b||"",placeholder:"Select vector stores (optional)"})})]})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"MCP Settings"})}),(0,a.jsxs)(ea.X1,{children:[(0,a.jsx)(n.Z.Item,{label:(0,a.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,a.jsx)(L.Z,{title:"Select which MCP servers or access groups this team can access",children:(0,a.jsx)(et.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,a.jsx)(en.Z,{onChange:e=>y.setFieldValue("allowed_mcp_servers_and_groups",e),value:y.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:b||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(n.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(es.default,{type:"hidden"})}),(0,a.jsx)(n.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,a.jsx)("div",{className:"mt-6",children:(0,a.jsx)(em.Z,{accessToken:b||"",selectedServers:(null===(e=y.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:y.getFieldValue("mcp_tool_permissions")||{},onChange:e=>y.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Logging Settings"})}),(0,a.jsx)(ea.X1,{children:(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(ec.Z,{value:h,onChange:g,premiumUser:v})})})]}),(0,a.jsxs)(ea.UQ,{className:"mt-8 mb-8",children:[(0,a.jsx)(ea._m,{children:(0,a.jsx)("b",{children:"Model Aliases"})}),(0,a.jsx)(ea.X1,{children:(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)(ea.xv,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,a.jsx)(eo.Z,{accessToken:b||"",initialModelAliases:x,onAliasUpdate:u,showExampleConfig:!1})]})})]})]}),(0,a.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,a.jsx)(el.ZP,{htmlType:"submit",children:"Create Team"})})]})})},eh=e=>{let{teams:s,accessToken:l,setTeams:b,userID:v,userRole:y,organizations:_,premiumUser:N=!1}=e,[w,C]=(0,t.useState)(null),[k,M]=(0,t.useState)(!1),[z,A]=(0,t.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),[E]=n.Z.useForm(),[D]=n.Z.useForm(),[F,L]=(0,t.useState)(null),[P,O]=(0,t.useState)(!1),[I,V]=(0,t.useState)(!1),[R,B]=(0,t.useState)(!1),[W,U]=(0,t.useState)(!1),[G,J]=(0,t.useState)([]),[Q,q]=(0,t.useState)(!1),[X,Y]=(0,t.useState)(null),[$,ee]=(0,t.useState)({}),[es,el]=(0,t.useState)([]),[ea,et]=(0,t.useState)({}),{lastRefreshed:er,onRefreshClick:ei}=T({currentOrg:w,setTeams:b});(0,t.useEffect)(()=>{s&&ee(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let en=async e=>{Y(e),q(!0)},ec=async()=>{if(null!=X&&null!=s&&null!=l){try{await (0,r.teamDeleteCall)(l,X),(0,i.Z)(l,v,y,w,b)}catch(e){console.error("Error deleting the team:",e)}q(!1),Y(null)}};return(0,a.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,a.jsx)(h.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,a.jsxs)(u.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==y||"Org Admin"==y)&&(0,a.jsx)(m.Z,{className:"w-fit",onClick:()=>V(!0),children:"+ Create New Team"}),F?(0,a.jsx)(c.Z,{teamId:F,onUpdate:e=>{b(s=>{if(null==s)return s;let a=s.map(s=>e.team_id===s.team_id?(0,f.nl)(s,e):s);return l&&(0,i.Z)(l,v,y,w,b),a})},onClose:()=>{L(null),O(!1)},accessToken:l,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;se.team_id===F)),is_proxy_admin:"Admin"==y,userModels:G,editTeam:P}):(0,a.jsxs)(Z,{lastRefreshed:er,onRefresh:ei,userRole:y,children:[(0,a.jsxs)(g.Z,{children:[(0,a.jsxs)(p.Z,{children:["Click on “Team ID” to view team details ",(0,a.jsx)("b",{children:"and"})," manage team members."]}),(0,a.jsx)(h.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,a.jsx)(u.Z,{numColSpan:1,children:(0,a.jsxs)(x.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,a.jsx)("div",{className:"border-b px-6 py-4",children:(0,a.jsx)("div",{className:"flex flex-col space-y-4",children:(0,a.jsx)(S,{filters:z,organizations:_,showFilters:k,onToggleFilters:M,onChange:(e,s)=>{let a={...z,[e]:s};A(a),l&&(0,r.v2TeamListCall)(l,a.organization_id||null,null,a.team_id||null,a.team_alias||null).then(e=>{e&&e.teams&&b(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},onReset:()=>{A({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),l&&(0,r.v2TeamListCall)(l,null,v||null,null,null).then(e=>{e&&e.teams&&b(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})}})})}),(0,a.jsx)(K,{teams:s,currentOrg:w,perTeamInfo:$,userRole:y,userId:v,setSelectedTeamId:L,setEditTeam:O,onDeleteTeam:en}),Q&&(0,a.jsx)(H,{teams:s,teamToDelete:X,onCancel:()=>{q(!1),Y(null)},onConfirm:ec})]})})})]}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(j.Z,{accessToken:l,userID:v})}),(0,d.tY)(y||"")&&(0,a.jsx)(g.Z,{children:(0,a.jsx)(o.Z,{accessToken:l,userID:v||"",userRole:y||""})})]}),("Admin"==y||"Org Admin"==y)&&(0,a.jsx)(eu,{isTeamModalVisible:I,handleOk:()=>{V(!1),E.resetFields(),el([]),et({})},handleCancel:()=>{V(!1),E.resetFields(),el([]),et({})},currentOrg:w,organizations:_,teams:s,setTeams:b,modelAliases:ea,setModelAliases:et,loggingSettings:es,setLoggingSettings:el,setIsTeamModalVisible:V})]})})})},eg=l(11318),ep=l(22004),ej=()=>{let{accessToken:e,userId:s,userRole:l}=(0,k.Z)(),{teams:r,setTeams:i}=(0,eg.Z)(),[n,c]=(0,t.useState)([]);return(0,t.useEffect)(()=>{(0,ep.g)(e,c).then(()=>{})},[e]),(0,a.jsx)(eh,{teams:r,accessToken:e,setTeams:i,userID:s,userRole:l,organizations:n})}},88904:function(e,s,l){"use strict";var a=l(57437),t=l(2265),r=l(88913),i=l(93192),n=l(52787),c=l(63709),o=l(87908),d=l(19250),m=l(65925),x=l(46468),u=l(9114);s.Z=e=>{var s;let{accessToken:l,userID:h,userRole:g}=e,[p,j]=(0,t.useState)(!0),[f,b]=(0,t.useState)(null),[v,y]=(0,t.useState)(!1),[_,N]=(0,t.useState)({}),[w,Z]=(0,t.useState)(!1),[C,S]=(0,t.useState)([]),{Paragraph:k}=i.default,{Option:T}=n.default;(0,t.useEffect)(()=>{(async()=>{if(!l){j(!1);return}try{let e=await (0,d.getDefaultTeamSettings)(l);if(b(e),N(e.values||{}),l)try{let e=await (0,d.modelAvailableCall)(l,h,g);if(e&&e.data){let s=e.data.map(e=>e.id);S(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),u.Z.fromBackend("Failed to fetch team settings")}finally{j(!1)}})()},[l]);let M=async()=>{if(l){Z(!0);try{let e=await (0,d.updateDefaultTeamSettings)(l,_);b({...f,values:e.settings}),y(!1),u.Z.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),u.Z.fromBackend("Failed to update team settings")}finally{Z(!1)}}},z=(e,s)=>{N(l=>({...l,[e]:s}))},A=(e,s,l)=>{var t;let i=s.type;return"budget_duration"===e?(0,a.jsx)(m.Z,{value:_[e]||null,onChange:s=>z(e,s),className:"mt-2"}):"boolean"===i?(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(c.Z,{checked:!!_[e],onChange:s=>z(e,s)})}):"array"===i&&(null===(t=s.items)||void 0===t?void 0:t.enum)?(0,a.jsx)(n.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>z(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,a.jsx)(T,{value:e,children:e},e))}):"models"===e?(0,a.jsx)(n.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>z(e,s),className:"mt-2",children:C.map(e=>(0,a.jsx)(T,{value:e,children:(0,x.W0)(e)},e))}):"string"===i&&s.enum?(0,a.jsx)(n.default,{style:{width:"100%"},value:_[e]||"",onChange:s=>z(e,s),className:"mt-2",children:s.enum.map(e=>(0,a.jsx)(T,{value:e,children:e},e))}):(0,a.jsx)(r.oi,{value:void 0!==_[e]?String(_[e]):"",onChange:s=>z(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},E=(e,s)=>null==s?(0,a.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,a.jsx)("span",{children:(0,m.m)(s)}):"boolean"==typeof s?(0,a.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,a.jsx)("span",{className:"text-gray-400",children:"None"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,x.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,a.jsx)("span",{className:"text-gray-400",children:"None"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,a.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,a.jsx)("span",{children:String(s)});return p?(0,a.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,a.jsx)(o.Z,{size:"large"})}):f?(0,a.jsxs)(r.Zb,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(r.Dx,{className:"text-xl",children:"Default Team Settings"}),!p&&f&&(v?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(r.zx,{variant:"secondary",onClick:()=>{y(!1),N(f.values||{})},disabled:w,children:"Cancel"}),(0,a.jsx)(r.zx,{onClick:M,loading:w,children:"Save Changes"})]}):(0,a.jsx)(r.zx,{onClick:()=>y(!0),children:"Edit Settings"}))]}),(0,a.jsx)(r.xv,{children:"These settings will be applied by default when creating new teams."}),(null==f?void 0:null===(s=f.field_schema)||void 0===s?void 0:s.description)&&(0,a.jsx)(k,{className:"mb-4 mt-2",children:f.field_schema.description}),(0,a.jsx)(r.iz,{}),(0,a.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=f;return s&&s.properties?Object.entries(s.properties).map(s=>{let[l,t]=s,i=e[l],n=l.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,a.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,a.jsx)(r.xv,{className:"font-medium text-lg",children:n}),(0,a.jsx)(k,{className:"text-sm text-gray-500 mt-1",children:t.description||"No description available"}),v?(0,a.jsx)("div",{className:"mt-2",children:A(l,t,i)}):(0,a.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:E(l,i)})]},l)}):(0,a.jsx)(r.xv,{children:"No schema information available"})})()})]}):(0,a.jsx)(r.Zb,{children:(0,a.jsx)(r.xv,{children:"No team settings available or you do not have permission to view them."})})}},51750:function(e,s,l){"use strict";l.d(s,{Z:function(){return g}});var a=l(57437),t=l(2265),r=l(77355),i=l(93416),n=l(74998),c=l(95704),o=l(56522),d=l(52787),m=l(69993),x=l(51601),u=e=>{let{accessToken:s,value:l,placeholder:r="Select a Model",onChange:i,disabled:n=!1,style:c,className:u,showLabel:h=!0,labelText:g="Select Model"}=e,[p,j]=(0,t.useState)(l),[f,b]=(0,t.useState)(!1),[v,y]=(0,t.useState)([]),_=(0,t.useRef)(null);return(0,t.useEffect)(()=>{j(l)},[l]),(0,t.useEffect)(()=>{s&&(async()=>{try{let e=await (0,x.p)(s);console.log("Fetched models for selector:",e),e.length>0&&y(e)}catch(e){console.error("Error fetching model info:",e)}})()},[s]),(0,a.jsxs)("div",{children:[h&&(0,a.jsxs)(o.x,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-2"})," ",g]}),(0,a.jsx)(d.default,{value:p,placeholder:r,onChange:e=>{"custom"===e?(b(!0),j(void 0)):(b(!1),j(e),i&&i(e))},options:[...Array.from(new Set(v.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...c},showSearch:!0,className:"rounded-md ".concat(u||""),disabled:n}),f&&(0,a.jsx)(o.o,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{j(e),i&&i(e)},500)},disabled:n})]})},h=l(9114),g=e=>{let{accessToken:s,initialModelAliases:l={},onAliasUpdate:o,showExampleConfig:d=!0}=e,[m,x]=(0,t.useState)([]),[g,p]=(0,t.useState)({aliasName:"",targetModel:""}),[j,f]=(0,t.useState)(null);(0,t.useEffect)(()=>{x(Object.entries(l).map((e,s)=>{let[l,a]=e;return{id:"".concat(s,"-").concat(l),aliasName:l,targetModel:a}}))},[l]);let b=e=>{f({...e})},v=()=>{if(!j)return;if(!j.aliasName||!j.targetModel){h.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.id!==j.id&&e.aliasName===j.aliasName)){h.Z.fromBackend("An alias with this name already exists");return}let e=m.map(e=>e.id===j.id?j:e);x(e),f(null);let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),o&&o(s),h.Z.success("Alias updated successfully")},y=()=>{f(null)},_=e=>{let s=m.filter(s=>s.id!==e);x(s);let l={};s.forEach(e=>{l[e.aliasName]=e.targetModel}),o&&o(l),h.Z.success("Alias deleted successfully")},N=m.reduce((e,s)=>(e[s.aliasName]=s.targetModel,e),{});return(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(c.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,a.jsx)("input",{type:"text",value:g.aliasName,onChange:e=>p({...g,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model"}),(0,a.jsx)(u,{accessToken:s,value:g.targetModel,placeholder:"Select target model",onChange:e=>p({...g,targetModel:e}),showLabel:!1})]}),(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsxs)("button",{onClick:()=>{if(!g.aliasName||!g.targetModel){h.Z.fromBackend("Please provide both alias name and target model");return}if(m.some(e=>e.aliasName===g.aliasName)){h.Z.fromBackend("An alias with this name already exists");return}let e=[...m,{id:"".concat(Date.now(),"-").concat(g.aliasName),aliasName:g.aliasName,targetModel:g.targetModel}];x(e),p({aliasName:"",targetModel:""});let s={};e.forEach(e=>{s[e.aliasName]=e.targetModel}),o&&o(s),h.Z.success("Alias added successfully")},disabled:!g.aliasName||!g.targetModel,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(g.aliasName&&g.targetModel?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,a.jsx)(r.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,a.jsx)(c.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,a.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)(c.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,a.jsx)(c.ss,{children:(0,a.jsxs)(c.SC,{children:[(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Target Model"}),(0,a.jsx)(c.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,a.jsxs)(c.RM,{children:[m.map(e=>(0,a.jsx)(c.SC,{className:"h-8",children:j&&j.id===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:j.aliasName,onChange:e=>f({...j,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(c.pj,{className:"py-0.5",children:(0,a.jsx)(u,{accessToken:s,value:j.targetModel,onChange:e=>f({...j,targetModel:e}),showLabel:!1,style:{height:"32px"}})}),(0,a.jsx)(c.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:v,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,a.jsx)("button",{onClick:y,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,a.jsx)(c.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModel}),(0,a.jsx)(c.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>b(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,a.jsx)(i.Z,{className:"w-3 h-3"})}),(0,a.jsx)("button",{onClick:()=>_(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,a.jsx)(n.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===m.length&&(0,a.jsx)(c.SC,{children:(0,a.jsx)(c.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),d&&(0,a.jsxs)(c.Zb,{children:[(0,a.jsx)(c.Dx,{className:"mb-4",children:"Configuration Example"}),(0,a.jsx)(c.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config:"}),(0,a.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,a.jsxs)("div",{className:"text-gray-700",children:["model_aliases:",0===Object.keys(N).length?(0,a.jsxs)("span",{className:"text-gray-500",children:[(0,a.jsx)("br",{}),"\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[s,l]=e;return(0,a.jsxs)("span",{children:[(0,a.jsx)("br",{}),'\xa0\xa0"',s,'": "',l,'"']},s)})]})})]})]})}},2597:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(92280),r=l(54507);s.Z=function(e){let{value:s,onChange:l,premiumUser:i=!1,disabledCallbacks:n=[],onDisabledCallbacksChange:c}=e;return i?(0,a.jsx)(r.Z,{value:s,onChange:l,disabledCallbacks:n,onDisabledCallbacksChange:c}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,a.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,a.jsxs)(t.x,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key"," ",(0,a.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})}},65925:function(e,s,l){"use strict";l.d(s,{m:function(){return i}});var a=l(57437);l(2265);var t=l(52787);let{Option:r}=t.default,i=e=>e?({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set";s.Z=e=>{let{value:s,onChange:l,className:i="",style:n={}}=e;return(0,a.jsxs)(t.default,{style:{width:"100%",...n},value:s||void 0,onChange:l,className:i,placeholder:"n/a",children:[(0,a.jsx)(r,{value:"24h",children:"daily"}),(0,a.jsx)(r,{value:"7d",children:"weekly"}),(0,a.jsx)(r,{value:"30d",children:"monthly"})]})}},39210:function(e,s,l){"use strict";l.d(s,{Z:function(){return t}});var a=l(19250);let t=async(e,s,l,t,r)=>{let i;i="Admin"!=l&&"Admin Viewer"!=l?await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null,s):await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null),console.log("givenTeams: ".concat(i)),r(i)}},27799:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(40728),r=l(82182),i=l(91777),n=l(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:l=[],variant:c="card",className:o=""}=e,d=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[l,a]=s;return a===e}))||void 0===s?void 0:s[0])||e},m=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},x=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},u=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,a.jsx)(t.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var l;let i=d(e.callback_name),c=null===(l=n.Dg[i])||void 0===l?void 0:l.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[c?(0,a.jsx)("img",{src:c,alt:i,className:"w-5 h-5 object-contain"}):(0,a.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-medium text-blue-800",children:i}),(0,a.jsxs)(t.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,a.jsx)(t.C,{color:m(e.callback_type),size:"sm",children:x(e.callback_type)})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(t.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,a.jsx)(t.C,{color:"red",size:"xs",children:l.length})]}),l.length>0?(0,a.jsx)("div",{className:"space-y-3",children:l.map((e,s)=>{var l;let r=n.RD[e]||e,c=null===(l=n.Dg[r])||void 0===l?void 0:l.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[c?(0,a.jsx)("img",{src:c,alt:r,className:"w-5 h-5 object-contain"}):(0,a.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-medium text-red-800",children:r}),(0,a.jsx)(t.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,a.jsx)(t.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(t.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===c?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(t.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,a.jsx)(t.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(t.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),u]})}},98015:function(e,s,l){"use strict";l.d(s,{Z:function(){return g}});var a=l(57437),t=l(2265),r=l(92280),i=l(40728),n=l(79814),c=l(19250),o=function(e){let{vectorStores:s,accessToken:l}=e,[r,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{(async()=>{if(l&&0!==s.length)try{let e=await (0,c.vectorStoreListCall)(l);e.data&&o(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[l,s.length]);let d=e=>{let s=r.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,a.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:d(e)},s))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},d=l(25327),m=l(86462),x=l(47686),u=l(89970),h=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:o}=e,[h,g]=(0,t.useState)([]),[p,j]=(0,t.useState)([]),[f,b]=(0,t.useState)(new Set),v=e=>{b(s=>{let l=new Set(s);return l.has(e)?l.delete(e):l.add(e),l})};(0,t.useEffect)(()=>{(async()=>{if(o&&s.length>0)try{let e=await (0,c.fetchMCPServers)(o);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[o,s.length]),(0,t.useEffect)(()=>{(async()=>{if(o&&r.length>0)try{let e=await Promise.resolve().then(l.bind(l,19250)).then(e=>e.fetchMCPAccessGroups(o));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let y=e=>{let s=h.find(s=>s.server_id===e);if(s){let l=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(l,")")}return e},_=e=>e,N=[...s.map(e=>({type:"server",value:e})),...r.map(e=>({type:"accessGroup",value:e}))],w=N.length;return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:w})]}),w>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let l="server"===e.type?n[e.value]:void 0,t=l&&l.length>0,r=f.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>t&&v(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(t?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(u.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:y(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)}),(0,a.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),t&&(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:l.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===l.length?"tool":"tools"}),r?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),t&&r&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map((e,s)=>(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:s,variant:l="card",className:t="",accessToken:i}=e,n=(null==s?void 0:s.vector_stores)||[],c=(null==s?void 0:s.mcp_servers)||[],d=(null==s?void 0:s.mcp_access_groups)||[],m=(null==s?void 0:s.mcp_tool_permissions)||{},x=(0,a.jsxs)("div",{className:"card"===l?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(o,{vectorStores:n,accessToken:i}),(0,a.jsx)(h,{mcpServers:c,mcpAccessGroups:d,mcpToolPermissions:m,accessToken:i})]});return"card"===l?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(t),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),x]}):(0,a.jsxs)("div",{className:"".concat(t),children:[(0,a.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),x]})}},21425:function(e,s,l){"use strict";var a=l(57437);l(2265);var t=l(54507);s.Z=e=>{let{value:s,onChange:l,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,a.jsx)(t.Z,{value:s,onChange:l,disabledCallbacks:r,onDisabledCallbacksChange:i})}},918:function(e,s,l){"use strict";var a=l(57437),t=l(2265),r=l(62490),i=l(19250),n=l(9114);s.Z=e=>{let{accessToken:s,userID:l}=e,[c,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{(async()=>{if(s&&l)try{let e=await (0,i.availableTeamListCall)(s);o(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,l]);let d=async e=>{if(s&&l)try{await (0,i.teamMemberAddCall)(s,e,{user_id:l,role:"user"}),n.Z.success("Successfully joined team"),o(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),n.Z.fromBackend("Failed to join team")}};return(0,a.jsx)(r.Zb,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,a.jsxs)(r.iA,{children:[(0,a.jsx)(r.ss,{children:(0,a.jsxs)(r.SC,{children:[(0,a.jsx)(r.xs,{children:"Team Name"}),(0,a.jsx)(r.xs,{children:"Description"}),(0,a.jsx)(r.xs,{children:"Members"}),(0,a.jsx)(r.xs,{children:"Models"}),(0,a.jsx)(r.xs,{children:"Actions"})]})}),(0,a.jsxs)(r.RM,{children:[c.map(e=>(0,a.jsxs)(r.SC,{children:[(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.xv,{children:e.team_alias})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.xv,{children:e.description||"No description available"})}),(0,a.jsx)(r.pj,{children:(0,a.jsxs)(r.xv,{children:[e.members_with_roles.length," members"]})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,a.jsx)(r.Ct,{size:"xs",className:"mb-1",color:"blue",children:(0,a.jsx)(r.xv,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,a.jsx)(r.Ct,{size:"xs",color:"red",children:(0,a.jsx)(r.xv,{children:"All Proxy Models"})})})}),(0,a.jsx)(r.pj,{children:(0,a.jsx)(r.zx,{size:"xs",variant:"secondary",onClick:()=>d(e.team_id),children:"Join Team"})})]},e.team_id)),0===c.length&&(0,a.jsx)(r.SC,{children:(0,a.jsx)(r.pj,{colSpan:5,className:"text-center",children:(0,a.jsx)(r.xv,{children:"No available teams to join"})})})]})]})})}},33304:function(e,s,l){"use strict";function a(e){return""===e?null:e}l.d(s,{C:function(){return a}})}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2284,7908,9678,1853,7281,6202,7640,8049,131,2004,2012,2971,2117,1744],function(){return e(e.s=77403)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-1870641393210367.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-1870641393210367.js new file mode 100644 index 0000000000..87e1e2f8a6 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-1870641393210367.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2322],{35831:function(e,n,t){Promise.resolve().then(t.bind(t,38511))},38434:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var a=t(1119),i=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},r=t(55015),s=i.forwardRef(function(e,n){return i.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},77565:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var a=t(1119),i=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},r=t(55015),s=i.forwardRef(function(e,n){return i.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},69993:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var a=t(1119),i=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},r=t(55015),s=i.forwardRef(function(e,n){return i.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},57400:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var a=t(1119),i=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64L128 192v384c0 212.1 171.9 384 384 384s384-171.9 384-384V192L512 64zm312 512c0 172.3-139.7 312-312 312S200 748.3 200 576V246l312-110 312 110v330z"}},{tag:"path",attrs:{d:"M378.4 475.1a35.91 35.91 0 00-50.9 0 35.91 35.91 0 000 50.9l129.4 129.4 2.1 2.1a33.98 33.98 0 0048.1 0L730.6 434a33.98 33.98 0 000-48.1l-2.8-2.8a33.98 33.98 0 00-48.1 0L483 579.7 378.4 475.1z"}}]},name:"safety",theme:"outlined"},r=t(55015),s=i.forwardRef(function(e,n){return i.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},15883:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var a=t(1119),i=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},r=t(55015),s=i.forwardRef(function(e,n){return i.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},96761:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var a=t(5853),i=t(26898),o=t(97324),r=t(1153),s=t(2265);let l=s.forwardRef((e,n)=>{let{color:t,children:l,className:p}=e,c=(0,a._T)(e,["color","children","className"]);return s.createElement("p",Object.assign({ref:n,className:(0,o.q)("font-medium text-tremor-title",t?(0,r.bM)(t,i.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",p)},c),l)});l.displayName="Title"},92280:function(e,n,t){"use strict";t.d(n,{x:function(){return a.Z}});var a=t(84264)},80443:function(e,n,t){"use strict";var a=t(2265),i=t(99376),o=t(14474),r=t(3914);n.Z=()=>{var e,n,t,s,l,p,c;let m=(0,i.useRouter)(),u="undefined"!=typeof document?(0,r.e)("token"):null;(0,a.useEffect)(()=>{u||m.replace("/sso/key/generate")},[u,m]);let d=(0,a.useMemo)(()=>{if(!u)return null;try{return(0,o.o)(u)}catch(e){return(0,r.b)(),m.replace("/sso/key/generate"),null}},[u,m]);return{token:u,accessToken:null!==(e=null==d?void 0:d.key)&&void 0!==e?e:null,userId:null!==(n=null==d?void 0:d.user_id)&&void 0!==n?n:null,userEmail:null!==(t=null==d?void 0:d.user_email)&&void 0!==t?t:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(s=null==d?void 0:d.user_role)&&void 0!==s?s:null),premiumUser:null!==(l=null==d?void 0:d.premium_user)&&void 0!==l?l:null,disabledPersonalKeyCreation:null!==(p=null==d?void 0:d.disabled_non_admin_personal_key_creation)&&void 0!==p?p:null,showSSOBanner:(null==d?void 0:d.login_method)==="username_password"}}},38511:function(e,n,t){"use strict";t.r(n);var a=t(57437),i=t(39681),o=t(80443);n.default=()=>{let{token:e,accessToken:n,userRole:t,userId:r,disabledPersonalKeyCreation:s}=(0,o.Z)();return(0,a.jsx)(i.Z,{accessToken:n,token:e,userRole:t,userID:r,disabledPersonalKeyCreation:s})}},88658:function(e,n,t){"use strict";t.d(n,{L:function(){return i}});var a=t(49817);let i=e=>{let n;let{apiKeySource:t,accessToken:i,apiKey:o,inputMessage:r,chatHistory:s,selectedTags:l,selectedVectorStores:p,selectedGuardrails:c,selectedMCPTools:m,endpointType:u,selectedModel:d,selectedSdk:g}=e,_="session"===t?i:o,f=window.location.origin,h=r||"Your prompt here",b=h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),v=s.filter(e=>!e.isImage).map(e=>{let{role:n,content:t}=e;return{role:n,content:t}}),y={};l.length>0&&(y.tags=l),p.length>0&&(y.vector_stores=p),c.length>0&&(y.guardrails=c);let w=d||"your-model-name",x="azure"===g?'import openai\n\nclient = openai.AzureOpenAI(\n api_key="'.concat(_||"YOUR_LITELLM_API_KEY",'",\n azure_endpoint="').concat(f,'",\n api_version="2024-02-01"\n)'):'import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(_||"YOUR_LITELLM_API_KEY",'",\n base_url="').concat(f,'"\n)');switch(u){case a.KP.CHAT:{let e=Object.keys(y).length>0,t="";if(e){let e=JSON.stringify({metadata:y},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();t=",\n extra_body=".concat(e)}let a=v.length>0?v:[{role:"user",content:h}];n='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.chat.completions.create(\n model="'.concat(w,'",\n messages=').concat(JSON.stringify(a,null,4)).concat(t,'\n)\n\nprint(response)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.chat.completions.create(\n# model="').concat(w,'",\n# messages=[\n# {\n# "role": "user",\n# "content": [\n# {\n# "type": "text",\n# "text": "').concat(b,'"\n# },\n# {\n# "type": "image_url",\n# "image_url": {\n# "url": f"data:image/jpeg;base64,{base64_file}" # or data:application/pdf;base64,{base64_file}\n# }\n# }\n# ]\n# }\n# ]').concat(t,"\n# )\n# print(response_with_file)\n");break}case a.KP.RESPONSES:{let e=Object.keys(y).length>0,t="";if(e){let e=JSON.stringify({metadata:y},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();t=",\n extra_body=".concat(e)}let a=v.length>0?v:[{role:"user",content:h}];n='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.responses.create(\n model="'.concat(w,'",\n input=').concat(JSON.stringify(a,null,4)).concat(t,'\n)\n\nprint(response.output_text)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.responses.create(\n# model="').concat(w,'",\n# input=[\n# {\n# "role": "user",\n# "content": [\n# {"type": "input_text", "text": "').concat(b,'"},\n# {\n# "type": "input_image",\n# "image_url": f"data:image/jpeg;base64,{base64_file}", # or data:application/pdf;base64,{base64_file}\n# },\n# ],\n# }\n# ]').concat(t,"\n# )\n# print(response_with_file.output_text)\n");break}case a.KP.IMAGE:n="azure"===g?"\n# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.\n# This snippet uses 'client.images.generate' and will create a new image based on your prompt.\n# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.\nimport os\nimport requests\nimport json\nimport time\nfrom PIL import Image\n\nresult = client.images.generate(\n model=\"".concat(w,'",\n prompt="').concat(r,'",\n n=1\n)\n\njson_response = json.loads(result.model_dump_json())\n\n# Set the directory for the stored image\nimage_dir = os.path.join(os.curdir, \'images\')\n\n# If the directory doesn\'t exist, create it\nif not os.path.isdir(image_dir):\n os.mkdir(image_dir)\n\n# Initialize the image path\nimage_filename = f"generated_image_{int(time.time())}.png"\nimage_path = os.path.join(image_dir, image_filename)\n\ntry:\n # Retrieve the generated image\n if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):\n image_url = json_response["data"][0]["url"]\n generated_image = requests.get(image_url).content\n with open(image_path, "wb") as image_file:\n image_file.write(generated_image)\n\n print(f"Image saved to {image_path}")\n # Display the image\n image = Image.open(image_path)\n image.show()\n else:\n print("Could not find image URL in response.")\n print("Full response:", json_response)\nexcept Exception as e:\n print(f"An error occurred: {e}")\n print("Full response:", json_response)\n'):"\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(b,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case a.KP.IMAGE_EDITS:n="azure"===g?'\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# The prompt entered by the user\nprompt = "'.concat(b,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n'):"\nimport base64\nimport os\nimport time\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(b,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;default:n="\n# Code generation for this endpoint is not implemented yet."}return"".concat(x,"\n").concat(n)}},51601:function(e,n,t){"use strict";t.d(n,{p:function(){return i}});var a=t(19250);let i=async e=>{try{let n=await (0,a.modelHubCall)(e);if(console.log("model_info:",n),(null==n?void 0:n.data.length)>0){let e=n.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,n)=>e.model_group.localeCompare(n.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}}},49817:function(e,n,t){"use strict";var a,i,o,r;t.d(n,{KP:function(){return i},vf:function(){return l}}),(o=a||(a={})).IMAGE_GENERATION="image_generation",o.CHAT="chat",o.RESPONSES="responses",o.IMAGE_EDITS="image_edits",o.ANTHROPIC_MESSAGES="anthropic_messages",(r=i||(i={})).IMAGE="image",r.CHAT="chat",r.RESPONSES="responses",r.IMAGE_EDITS="image_edits",r.ANTHROPIC_MESSAGES="anthropic_messages";let s={image_generation:"image",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages"},l=e=>{if(console.log("getEndpointType:",e),Object.values(a).includes(e)){let n=s[e];return console.log("endpointType:",n),n}return"chat"}},67479:function(e,n,t){"use strict";var a=t(57437),i=t(2265),o=t(52787),r=t(19250);n.Z=e=>{let{onChange:n,value:t,className:s,accessToken:l,disabled:p}=e,[c,m]=(0,i.useState)([]),[u,d]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{(async()=>{if(l){d(!0);try{let e=await (0,r.getGuardrailsList)(l);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),m(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{d(!1)}}})()},[l]),(0,a.jsx)("div",{children:(0,a.jsx)(o.default,{mode:"multiple",disabled:p,placeholder:p?"Setting guardrails is a premium feature.":"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),n(e)},value:t,loading:u,className:s,options:c.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}},97415:function(e,n,t){"use strict";var a=t(57437),i=t(2265),o=t(52787),r=t(19250);n.Z=e=>{let{onChange:n,value:t,className:s,accessToken:l,placeholder:p="Select vector stores",disabled:c=!1}=e,[m,u]=(0,i.useState)([]),[d,g]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{(async()=>{if(l){g(!0);try{let e=await (0,r.vectorStoreListCall)(l);e.data&&u(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{g(!1)}}})()},[l]),(0,a.jsx)("div",{children:(0,a.jsx)(o.default,{mode:"multiple",placeholder:p,onChange:n,value:t,loading:d,className:s,options:m.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:c})})}}},function(e){e.O(0,[9820,1491,1526,2417,3709,9775,7908,9011,5319,7906,4851,6433,9888,8049,9681,2971,2117,1744],function(){return e(e.s=35831)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-a89ea5aaed337567.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-a89ea5aaed337567.js deleted file mode 100644 index 71cbc56f1a..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-a89ea5aaed337567.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2322],{35831:function(e,n,t){Promise.resolve().then(t.bind(t,38511))},77565:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var a=t(1119),i=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},r=t(55015),s=i.forwardRef(function(e,n){return i.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},69993:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var a=t(1119),i=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},r=t(55015),s=i.forwardRef(function(e,n){return i.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},57400:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var a=t(1119),i=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64L128 192v384c0 212.1 171.9 384 384 384s384-171.9 384-384V192L512 64zm312 512c0 172.3-139.7 312-312 312S200 748.3 200 576V246l312-110 312 110v330z"}},{tag:"path",attrs:{d:"M378.4 475.1a35.91 35.91 0 00-50.9 0 35.91 35.91 0 000 50.9l129.4 129.4 2.1 2.1a33.98 33.98 0 0048.1 0L730.6 434a33.98 33.98 0 000-48.1l-2.8-2.8a33.98 33.98 0 00-48.1 0L483 579.7 378.4 475.1z"}}]},name:"safety",theme:"outlined"},r=t(55015),s=i.forwardRef(function(e,n){return i.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},15883:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var a=t(1119),i=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},r=t(55015),s=i.forwardRef(function(e,n){return i.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},96761:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var a=t(5853),i=t(26898),o=t(97324),r=t(1153),s=t(2265);let l=s.forwardRef((e,n)=>{let{color:t,children:l,className:p}=e,c=(0,a._T)(e,["color","children","className"]);return s.createElement("p",Object.assign({ref:n,className:(0,o.q)("font-medium text-tremor-title",t?(0,r.bM)(t,i.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",p)},c),l)});l.displayName="Title"},92280:function(e,n,t){"use strict";t.d(n,{x:function(){return a.Z}});var a=t(84264)},39760:function(e,n,t){"use strict";var a=t(2265),i=t(99376),o=t(14474),r=t(3914);n.Z=()=>{var e,n,t,s,l,p,c;let m=(0,i.useRouter)(),u="undefined"!=typeof document?(0,r.e)("token"):null;(0,a.useEffect)(()=>{u||m.replace("/sso/key/generate")},[u,m]);let d=(0,a.useMemo)(()=>{if(!u)return null;try{return(0,o.o)(u)}catch(e){return(0,r.b)(),m.replace("/sso/key/generate"),null}},[u,m]);return{token:u,accessToken:null!==(e=null==d?void 0:d.key)&&void 0!==e?e:null,userId:null!==(n=null==d?void 0:d.user_id)&&void 0!==n?n:null,userEmail:null!==(t=null==d?void 0:d.user_email)&&void 0!==t?t:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(s=null==d?void 0:d.user_role)&&void 0!==s?s:null),premiumUser:null!==(l=null==d?void 0:d.premium_user)&&void 0!==l?l:null,disabledPersonalKeyCreation:null!==(p=null==d?void 0:d.disabled_non_admin_personal_key_creation)&&void 0!==p?p:null,showSSOBanner:(null==d?void 0:d.login_method)==="username_password"}}},38511:function(e,n,t){"use strict";t.r(n);var a=t(57437),i=t(31052),o=t(39760);n.default=()=>{let{token:e,accessToken:n,userRole:t,userId:r,disabledPersonalKeyCreation:s}=(0,o.Z)();return(0,a.jsx)(i.Z,{accessToken:n,token:e,userRole:t,userID:r,disabledPersonalKeyCreation:s})}},88658:function(e,n,t){"use strict";t.d(n,{L:function(){return i}});var a=t(49817);let i=e=>{let n;let{apiKeySource:t,accessToken:i,apiKey:o,inputMessage:r,chatHistory:s,selectedTags:l,selectedVectorStores:p,selectedGuardrails:c,selectedMCPTools:m,endpointType:u,selectedModel:d,selectedSdk:g}=e,_="session"===t?i:o,f=window.location.origin,h=r||"Your prompt here",b=h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),y=s.filter(e=>!e.isImage).map(e=>{let{role:n,content:t}=e;return{role:n,content:t}}),v={};l.length>0&&(v.tags=l),p.length>0&&(v.vector_stores=p),c.length>0&&(v.guardrails=c);let w=d||"your-model-name",x="azure"===g?'import openai\n\nclient = openai.AzureOpenAI(\n api_key="'.concat(_||"YOUR_LITELLM_API_KEY",'",\n azure_endpoint="').concat(f,'",\n api_version="2024-02-01"\n)'):'import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(_||"YOUR_LITELLM_API_KEY",'",\n base_url="').concat(f,'"\n)');switch(u){case a.KP.CHAT:{let e=Object.keys(v).length>0,t="";if(e){let e=JSON.stringify({metadata:v},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();t=",\n extra_body=".concat(e)}let a=y.length>0?y:[{role:"user",content:h}];n='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.chat.completions.create(\n model="'.concat(w,'",\n messages=').concat(JSON.stringify(a,null,4)).concat(t,'\n)\n\nprint(response)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.chat.completions.create(\n# model="').concat(w,'",\n# messages=[\n# {\n# "role": "user",\n# "content": [\n# {\n# "type": "text",\n# "text": "').concat(b,'"\n# },\n# {\n# "type": "image_url",\n# "image_url": {\n# "url": f"data:image/jpeg;base64,{base64_file}" # or data:application/pdf;base64,{base64_file}\n# }\n# }\n# ]\n# }\n# ]').concat(t,"\n# )\n# print(response_with_file)\n");break}case a.KP.RESPONSES:{let e=Object.keys(v).length>0,t="";if(e){let e=JSON.stringify({metadata:v},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();t=",\n extra_body=".concat(e)}let a=y.length>0?y:[{role:"user",content:h}];n='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.responses.create(\n model="'.concat(w,'",\n input=').concat(JSON.stringify(a,null,4)).concat(t,'\n)\n\nprint(response.output_text)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.responses.create(\n# model="').concat(w,'",\n# input=[\n# {\n# "role": "user",\n# "content": [\n# {"type": "input_text", "text": "').concat(b,'"},\n# {\n# "type": "input_image",\n# "image_url": f"data:image/jpeg;base64,{base64_file}", # or data:application/pdf;base64,{base64_file}\n# },\n# ],\n# }\n# ]').concat(t,"\n# )\n# print(response_with_file.output_text)\n");break}case a.KP.IMAGE:n="azure"===g?"\n# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.\n# This snippet uses 'client.images.generate' and will create a new image based on your prompt.\n# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.\nimport os\nimport requests\nimport json\nimport time\nfrom PIL import Image\n\nresult = client.images.generate(\n model=\"".concat(w,'",\n prompt="').concat(r,'",\n n=1\n)\n\njson_response = json.loads(result.model_dump_json())\n\n# Set the directory for the stored image\nimage_dir = os.path.join(os.curdir, \'images\')\n\n# If the directory doesn\'t exist, create it\nif not os.path.isdir(image_dir):\n os.mkdir(image_dir)\n\n# Initialize the image path\nimage_filename = f"generated_image_{int(time.time())}.png"\nimage_path = os.path.join(image_dir, image_filename)\n\ntry:\n # Retrieve the generated image\n if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):\n image_url = json_response["data"][0]["url"]\n generated_image = requests.get(image_url).content\n with open(image_path, "wb") as image_file:\n image_file.write(generated_image)\n\n print(f"Image saved to {image_path}")\n # Display the image\n image = Image.open(image_path)\n image.show()\n else:\n print("Could not find image URL in response.")\n print("Full response:", json_response)\nexcept Exception as e:\n print(f"An error occurred: {e}")\n print("Full response:", json_response)\n'):"\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(b,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case a.KP.IMAGE_EDITS:n="azure"===g?'\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# The prompt entered by the user\nprompt = "'.concat(b,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n'):"\nimport base64\nimport os\nimport time\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(b,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;default:n="\n# Code generation for this endpoint is not implemented yet."}return"".concat(x,"\n").concat(n)}},51601:function(e,n,t){"use strict";t.d(n,{p:function(){return i}});var a=t(19250);let i=async e=>{try{let n=await (0,a.modelHubCall)(e);if(console.log("model_info:",n),(null==n?void 0:n.data.length)>0){let e=n.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,n)=>e.model_group.localeCompare(n.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}}},49817:function(e,n,t){"use strict";var a,i,o,r;t.d(n,{KP:function(){return i},vf:function(){return l}}),(o=a||(a={})).IMAGE_GENERATION="image_generation",o.CHAT="chat",o.RESPONSES="responses",o.IMAGE_EDITS="image_edits",o.ANTHROPIC_MESSAGES="anthropic_messages",(r=i||(i={})).IMAGE="image",r.CHAT="chat",r.RESPONSES="responses",r.IMAGE_EDITS="image_edits",r.ANTHROPIC_MESSAGES="anthropic_messages";let s={image_generation:"image",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages"},l=e=>{if(console.log("getEndpointType:",e),Object.values(a).includes(e)){let n=s[e];return console.log("endpointType:",n),n}return"chat"}},67479:function(e,n,t){"use strict";var a=t(57437),i=t(2265),o=t(52787),r=t(19250);n.Z=e=>{let{onChange:n,value:t,className:s,accessToken:l,disabled:p}=e,[c,m]=(0,i.useState)([]),[u,d]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{(async()=>{if(l){d(!0);try{let e=await (0,r.getGuardrailsList)(l);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),m(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{d(!1)}}})()},[l]),(0,a.jsx)("div",{children:(0,a.jsx)(o.default,{mode:"multiple",disabled:p,placeholder:p?"Setting guardrails is a premium feature.":"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),n(e)},value:t,loading:u,className:s,options:c.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}},97415:function(e,n,t){"use strict";var a=t(57437),i=t(2265),o=t(52787),r=t(19250);n.Z=e=>{let{onChange:n,value:t,className:s,accessToken:l,placeholder:p="Select vector stores",disabled:c=!1}=e,[m,u]=(0,i.useState)([]),[d,g]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{(async()=>{if(l){g(!0);try{let e=await (0,r.vectorStoreListCall)(l);e.data&&u(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{g(!1)}}})()},[l]),(0,a.jsx)("div",{children:(0,a.jsx)(o.default,{mode:"multiple",placeholder:p,onChange:n,value:t,loading:d,className:s,options:m.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:c})})}}},function(e){e.O(0,[9820,1491,1526,2417,3709,9775,7908,9011,5319,7906,4851,6433,9888,8049,1052,2971,2117,1744],function(){return e(e.s=35831)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-91876f4e21ac7596.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-2fd597d070592ae4.js similarity index 98% rename from ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-91876f4e21ac7596.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-2fd597d070592ae4.js index ddf6d09fa7..c7d888c2ca 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-91876f4e21ac7596.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-2fd597d070592ae4.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6940],{61621:function(e,r,n){Promise.resolve().then(n.bind(n,45045))},36724:function(e,r,n){"use strict";n.d(r,{Dx:function(){return i.Z},Zb:function(){return o.Z},xv:function(){return l.Z},zx:function(){return t.Z}});var t=n(20831),o=n(12514),l=n(84264),i=n(96761)},64504:function(e,r,n){"use strict";n.d(r,{o:function(){return o.Z},z:function(){return t.Z}});var t=n(20831),o=n(49566)},19130:function(e,r,n){"use strict";n.d(r,{RM:function(){return o.Z},SC:function(){return c.Z},iA:function(){return t.Z},pj:function(){return l.Z},ss:function(){return i.Z},xs:function(){return u.Z}});var t=n(21626),o=n(97214),l=n(28241),i=n(58834),u=n(69552),c=n(71876)},92280:function(e,r,n){"use strict";n.d(r,{x:function(){return t.Z}});var t=n(84264)},39760:function(e,r,n){"use strict";var t=n(2265),o=n(99376),l=n(14474),i=n(3914);r.Z=()=>{var e,r,n,u,c,s,a;let d=(0,o.useRouter)(),f="undefined"!=typeof document?(0,i.e)("token"):null;(0,t.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let m=(0,t.useMemo)(()=>{if(!f)return null;try{return(0,l.o)(f)}catch(e){return(0,i.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(r=null==m?void 0:m.user_id)&&void 0!==r?r:null,userEmail:null!==(n=null==m?void 0:m.user_email)&&void 0!==n?n:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(u=null==m?void 0:m.user_role)&&void 0!==u?u:null),premiumUser:null!==(c=null==m?void 0:m.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(s=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},45045:function(e,r,n){"use strict";n.r(r);var t=n(57437),o=n(21307),l=n(39760),i=n(21623),u=n(29827);r.default=()=>{let{accessToken:e,userRole:r,userId:n}=(0,l.Z)(),c=new i.S;return(0,t.jsx)(u.aH,{client:c,children:(0,t.jsx)(o.d,{accessToken:e,userRole:r,userID:n})})}},29488:function(e,r,n){"use strict";n.d(r,{Hc:function(){return i},Ui:function(){return l},e4:function(){return u},xd:function(){return c}});let t="litellm_mcp_auth_tokens",o=()=>{try{let e=localStorage.getItem(t);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading MCP auth tokens from localStorage:",e),{}}},l=(e,r)=>{try{let n=o()[e];if(n&&n.serverAlias===r||n&&!r&&!n.serverAlias)return n.authValue;return null}catch(e){return console.error("Error getting MCP auth token:",e),null}},i=(e,r,n,l)=>{try{let i=o();i[e]={serverId:e,serverAlias:l,authValue:r,authType:n,timestamp:Date.now()},localStorage.setItem(t,JSON.stringify(i))}catch(e){console.error("Error storing MCP auth token:",e)}},u=e=>{try{let r=o();delete r[e],localStorage.setItem(t,JSON.stringify(r))}catch(e){console.error("Error removing MCP auth token:",e)}},c=()=>{try{localStorage.removeItem(t)}catch(e){console.error("Error clearing MCP auth tokens:",e)}}},12322:function(e,r,n){"use strict";n.d(r,{w:function(){return c}});var t=n(57437),o=n(2265),l=n(71594),i=n(24525),u=n(19130);function c(e){let{data:r=[],columns:n,getRowCanExpand:c,renderSubComponent:s,isLoading:a=!1,loadingMessage:d="\uD83D\uDE85 Loading logs...",noDataMessage:f="No logs found"}=e,m=(0,l.b7)({data:r,columns:n,getRowCanExpand:c,getRowId:(e,r)=>{var n;return null!==(n=null==e?void 0:e.request_id)&&void 0!==n?n:String(r)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,t.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,t.jsxs)(u.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,t.jsx)(u.ss,{children:m.getHeaderGroups().map(e=>(0,t.jsx)(u.SC,{children:e.headers.map(e=>(0,t.jsx)(u.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,l.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,t.jsx)(u.RM,{children:a?(0,t.jsx)(u.SC,{children:(0,t.jsx)(u.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:d})})})}):m.getRowModel().rows.length>0?m.getRowModel().rows.map(e=>(0,t.jsxs)(o.Fragment,{children:[(0,t.jsx)(u.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(u.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,l.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,t.jsx)(u.SC,{children:(0,t.jsx)(u.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:s({row:e})})})})]},e.id)):(0,t.jsx)(u.SC,{children:(0,t.jsx)(u.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:f})})})})})]})})}},59872:function(e,r,n){"use strict";n.d(r,{nl:function(){return o},pw:function(){return l},vQ:function(){return i}});var t=n(9114);function o(e,r){let n=structuredClone(e);for(let[e,t]of Object.entries(r))e in n&&(n[e]=t);return n}let l=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let t={minimumFractionDigits:r,maximumFractionDigits:r};if(!n)return e.toLocaleString("en-US",t);let o=Math.abs(e),l=o,i="";return o>=1e6?(l=o/1e6,i="M"):o>=1e3&&(l=o/1e3,i="K"),"".concat(e<0?"-":"").concat(l.toLocaleString("en-US",t)).concat(i)},i=async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return u(e,r);try{return await navigator.clipboard.writeText(e),t.Z.success(r),!0}catch(n){return console.error("Clipboard API failed: ",n),u(e,r)}},u=(e,r)=>{try{let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.left="-999999px",n.style.top="-999999px",n.setAttribute("readonly",""),document.body.appendChild(n),n.focus(),n.select();let o=document.execCommand("copy");if(document.body.removeChild(n),o)return t.Z.success(r),!0;throw Error("execCommand failed")}catch(e){return t.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,r,n){"use strict";n.d(r,{LQ:function(){return l},ZL:function(){return t},lo:function(){return o},tY:function(){return i}});let t=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],o=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],i=e=>t.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,3669,1264,4851,3866,6836,8049,1307,2971,2117,1744],function(){return e(e.s=61621)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6940],{61621:function(e,r,n){Promise.resolve().then(n.bind(n,45045))},36724:function(e,r,n){"use strict";n.d(r,{Dx:function(){return i.Z},Zb:function(){return o.Z},xv:function(){return l.Z},zx:function(){return t.Z}});var t=n(20831),o=n(12514),l=n(84264),i=n(96761)},64504:function(e,r,n){"use strict";n.d(r,{o:function(){return o.Z},z:function(){return t.Z}});var t=n(20831),o=n(49566)},19130:function(e,r,n){"use strict";n.d(r,{RM:function(){return o.Z},SC:function(){return c.Z},iA:function(){return t.Z},pj:function(){return l.Z},ss:function(){return i.Z},xs:function(){return u.Z}});var t=n(21626),o=n(97214),l=n(28241),i=n(58834),u=n(69552),c=n(71876)},92280:function(e,r,n){"use strict";n.d(r,{x:function(){return t.Z}});var t=n(84264)},80443:function(e,r,n){"use strict";var t=n(2265),o=n(99376),l=n(14474),i=n(3914);r.Z=()=>{var e,r,n,u,c,s,a;let d=(0,o.useRouter)(),f="undefined"!=typeof document?(0,i.e)("token"):null;(0,t.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let m=(0,t.useMemo)(()=>{if(!f)return null;try{return(0,l.o)(f)}catch(e){return(0,i.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(r=null==m?void 0:m.user_id)&&void 0!==r?r:null,userEmail:null!==(n=null==m?void 0:m.user_email)&&void 0!==n?n:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(u=null==m?void 0:m.user_role)&&void 0!==u?u:null),premiumUser:null!==(c=null==m?void 0:m.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(s=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},45045:function(e,r,n){"use strict";n.r(r);var t=n(57437),o=n(21307),l=n(80443),i=n(21623),u=n(29827);r.default=()=>{let{accessToken:e,userRole:r,userId:n}=(0,l.Z)(),c=new i.S;return(0,t.jsx)(u.aH,{client:c,children:(0,t.jsx)(o.d,{accessToken:e,userRole:r,userID:n})})}},29488:function(e,r,n){"use strict";n.d(r,{Hc:function(){return i},Ui:function(){return l},e4:function(){return u},xd:function(){return c}});let t="litellm_mcp_auth_tokens",o=()=>{try{let e=localStorage.getItem(t);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading MCP auth tokens from localStorage:",e),{}}},l=(e,r)=>{try{let n=o()[e];if(n&&n.serverAlias===r||n&&!r&&!n.serverAlias)return n.authValue;return null}catch(e){return console.error("Error getting MCP auth token:",e),null}},i=(e,r,n,l)=>{try{let i=o();i[e]={serverId:e,serverAlias:l,authValue:r,authType:n,timestamp:Date.now()},localStorage.setItem(t,JSON.stringify(i))}catch(e){console.error("Error storing MCP auth token:",e)}},u=e=>{try{let r=o();delete r[e],localStorage.setItem(t,JSON.stringify(r))}catch(e){console.error("Error removing MCP auth token:",e)}},c=()=>{try{localStorage.removeItem(t)}catch(e){console.error("Error clearing MCP auth tokens:",e)}}},12322:function(e,r,n){"use strict";n.d(r,{w:function(){return c}});var t=n(57437),o=n(2265),l=n(71594),i=n(24525),u=n(19130);function c(e){let{data:r=[],columns:n,getRowCanExpand:c,renderSubComponent:s,isLoading:a=!1,loadingMessage:d="\uD83D\uDE85 Loading logs...",noDataMessage:f="No logs found"}=e,m=(0,l.b7)({data:r,columns:n,getRowCanExpand:c,getRowId:(e,r)=>{var n;return null!==(n=null==e?void 0:e.request_id)&&void 0!==n?n:String(r)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,t.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,t.jsxs)(u.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,t.jsx)(u.ss,{children:m.getHeaderGroups().map(e=>(0,t.jsx)(u.SC,{children:e.headers.map(e=>(0,t.jsx)(u.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,l.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,t.jsx)(u.RM,{children:a?(0,t.jsx)(u.SC,{children:(0,t.jsx)(u.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:d})})})}):m.getRowModel().rows.length>0?m.getRowModel().rows.map(e=>(0,t.jsxs)(o.Fragment,{children:[(0,t.jsx)(u.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(u.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,l.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,t.jsx)(u.SC,{children:(0,t.jsx)(u.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:s({row:e})})})})]},e.id)):(0,t.jsx)(u.SC,{children:(0,t.jsx)(u.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:f})})})})})]})})}},59872:function(e,r,n){"use strict";n.d(r,{nl:function(){return o},pw:function(){return l},vQ:function(){return i}});var t=n(9114);function o(e,r){let n=structuredClone(e);for(let[e,t]of Object.entries(r))e in n&&(n[e]=t);return n}let l=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let t={minimumFractionDigits:r,maximumFractionDigits:r};if(!n)return e.toLocaleString("en-US",t);let o=Math.abs(e),l=o,i="";return o>=1e6?(l=o/1e6,i="M"):o>=1e3&&(l=o/1e3,i="K"),"".concat(e<0?"-":"").concat(l.toLocaleString("en-US",t)).concat(i)},i=async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return u(e,r);try{return await navigator.clipboard.writeText(e),t.Z.success(r),!0}catch(n){return console.error("Clipboard API failed: ",n),u(e,r)}},u=(e,r)=>{try{let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.left="-999999px",n.style.top="-999999px",n.setAttribute("readonly",""),document.body.appendChild(n),n.focus(),n.select();let o=document.execCommand("copy");if(document.body.removeChild(n),o)return t.Z.success(r),!0;throw Error("execCommand failed")}catch(e){return t.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,r,n){"use strict";n.d(r,{LQ:function(){return l},ZL:function(){return t},lo:function(){return o},tY:function(){return i}});let t=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],o=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],i=e=>t.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,3669,1264,4851,3866,6836,8049,1307,2971,2117,1744],function(){return e(e.s=61621)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-91876f4e21ac7596.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-91876f4e21ac7596.js deleted file mode 100644 index ddf6d09fa7..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-91876f4e21ac7596.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6940],{61621:function(e,r,n){Promise.resolve().then(n.bind(n,45045))},36724:function(e,r,n){"use strict";n.d(r,{Dx:function(){return i.Z},Zb:function(){return o.Z},xv:function(){return l.Z},zx:function(){return t.Z}});var t=n(20831),o=n(12514),l=n(84264),i=n(96761)},64504:function(e,r,n){"use strict";n.d(r,{o:function(){return o.Z},z:function(){return t.Z}});var t=n(20831),o=n(49566)},19130:function(e,r,n){"use strict";n.d(r,{RM:function(){return o.Z},SC:function(){return c.Z},iA:function(){return t.Z},pj:function(){return l.Z},ss:function(){return i.Z},xs:function(){return u.Z}});var t=n(21626),o=n(97214),l=n(28241),i=n(58834),u=n(69552),c=n(71876)},92280:function(e,r,n){"use strict";n.d(r,{x:function(){return t.Z}});var t=n(84264)},39760:function(e,r,n){"use strict";var t=n(2265),o=n(99376),l=n(14474),i=n(3914);r.Z=()=>{var e,r,n,u,c,s,a;let d=(0,o.useRouter)(),f="undefined"!=typeof document?(0,i.e)("token"):null;(0,t.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let m=(0,t.useMemo)(()=>{if(!f)return null;try{return(0,l.o)(f)}catch(e){return(0,i.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(r=null==m?void 0:m.user_id)&&void 0!==r?r:null,userEmail:null!==(n=null==m?void 0:m.user_email)&&void 0!==n?n:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(u=null==m?void 0:m.user_role)&&void 0!==u?u:null),premiumUser:null!==(c=null==m?void 0:m.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(s=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},45045:function(e,r,n){"use strict";n.r(r);var t=n(57437),o=n(21307),l=n(39760),i=n(21623),u=n(29827);r.default=()=>{let{accessToken:e,userRole:r,userId:n}=(0,l.Z)(),c=new i.S;return(0,t.jsx)(u.aH,{client:c,children:(0,t.jsx)(o.d,{accessToken:e,userRole:r,userID:n})})}},29488:function(e,r,n){"use strict";n.d(r,{Hc:function(){return i},Ui:function(){return l},e4:function(){return u},xd:function(){return c}});let t="litellm_mcp_auth_tokens",o=()=>{try{let e=localStorage.getItem(t);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading MCP auth tokens from localStorage:",e),{}}},l=(e,r)=>{try{let n=o()[e];if(n&&n.serverAlias===r||n&&!r&&!n.serverAlias)return n.authValue;return null}catch(e){return console.error("Error getting MCP auth token:",e),null}},i=(e,r,n,l)=>{try{let i=o();i[e]={serverId:e,serverAlias:l,authValue:r,authType:n,timestamp:Date.now()},localStorage.setItem(t,JSON.stringify(i))}catch(e){console.error("Error storing MCP auth token:",e)}},u=e=>{try{let r=o();delete r[e],localStorage.setItem(t,JSON.stringify(r))}catch(e){console.error("Error removing MCP auth token:",e)}},c=()=>{try{localStorage.removeItem(t)}catch(e){console.error("Error clearing MCP auth tokens:",e)}}},12322:function(e,r,n){"use strict";n.d(r,{w:function(){return c}});var t=n(57437),o=n(2265),l=n(71594),i=n(24525),u=n(19130);function c(e){let{data:r=[],columns:n,getRowCanExpand:c,renderSubComponent:s,isLoading:a=!1,loadingMessage:d="\uD83D\uDE85 Loading logs...",noDataMessage:f="No logs found"}=e,m=(0,l.b7)({data:r,columns:n,getRowCanExpand:c,getRowId:(e,r)=>{var n;return null!==(n=null==e?void 0:e.request_id)&&void 0!==n?n:String(r)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,t.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,t.jsxs)(u.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,t.jsx)(u.ss,{children:m.getHeaderGroups().map(e=>(0,t.jsx)(u.SC,{children:e.headers.map(e=>(0,t.jsx)(u.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,l.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,t.jsx)(u.RM,{children:a?(0,t.jsx)(u.SC,{children:(0,t.jsx)(u.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:d})})})}):m.getRowModel().rows.length>0?m.getRowModel().rows.map(e=>(0,t.jsxs)(o.Fragment,{children:[(0,t.jsx)(u.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(u.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,l.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,t.jsx)(u.SC,{children:(0,t.jsx)(u.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:s({row:e})})})})]},e.id)):(0,t.jsx)(u.SC,{children:(0,t.jsx)(u.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:f})})})})})]})})}},59872:function(e,r,n){"use strict";n.d(r,{nl:function(){return o},pw:function(){return l},vQ:function(){return i}});var t=n(9114);function o(e,r){let n=structuredClone(e);for(let[e,t]of Object.entries(r))e in n&&(n[e]=t);return n}let l=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let t={minimumFractionDigits:r,maximumFractionDigits:r};if(!n)return e.toLocaleString("en-US",t);let o=Math.abs(e),l=o,i="";return o>=1e6?(l=o/1e6,i="M"):o>=1e3&&(l=o/1e3,i="K"),"".concat(e<0?"-":"").concat(l.toLocaleString("en-US",t)).concat(i)},i=async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return u(e,r);try{return await navigator.clipboard.writeText(e),t.Z.success(r),!0}catch(n){return console.error("Clipboard API failed: ",n),u(e,r)}},u=(e,r)=>{try{let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.left="-999999px",n.style.top="-999999px",n.setAttribute("readonly",""),document.body.appendChild(n),n.focus(),n.select();let o=document.execCommand("copy");if(document.body.removeChild(n),o)return t.Z.success(r),!0;throw Error("execCommand failed")}catch(e){return t.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,r,n){"use strict";n.d(r,{LQ:function(){return l},ZL:function(){return t},lo:function(){return o},tY:function(){return i}});let t=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],o=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],i=e=>t.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,3669,1264,4851,3866,6836,8049,1307,2971,2117,1744],function(){return e(e.s=61621)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-6a747c73e6811499.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-2c5e185717ef32c7.js similarity index 98% rename from ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-6a747c73e6811499.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-2c5e185717ef32c7.js index 4d86d0b4d7..bb46ab4072 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-6a747c73e6811499.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-2c5e185717ef32c7.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6248],{64362:function(e,n,r){Promise.resolve().then(r.bind(r,77438))},16312:function(e,n,r){"use strict";r.d(n,{z:function(){return o.Z}});var o=r(20831)},64504:function(e,n,r){"use strict";r.d(n,{o:function(){return t.Z},z:function(){return o.Z}});var o=r(20831),t=r(49566)},39760:function(e,n,r){"use strict";var o=r(2265),t=r(99376),a=r(14474),i=r(3914);n.Z=()=>{var e,n,r,l,c,s,u;let p=(0,t.useRouter)(),d="undefined"!=typeof document?(0,i.e)("token"):null;(0,o.useEffect)(()=>{d||p.replace("/sso/key/generate")},[d,p]);let g=(0,o.useMemo)(()=>{if(!d)return null;try{return(0,a.o)(d)}catch(e){return(0,i.b)(),p.replace("/sso/key/generate"),null}},[d,p]);return{token:d,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(n=null==g?void 0:g.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==g?void 0:g.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(l=null==g?void 0:g.user_role)&&void 0!==l?l:null),premiumUser:null!==(c=null==g?void 0:g.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(s=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},77438:function(e,n,r){"use strict";r.r(n);var o=r(57437),t=r(6204),a=r(39760);n.default=()=>{let{accessToken:e,userId:n,userRole:r}=(0,a.Z)();return(0,o.jsx)(t.Z,{accessToken:e,userID:n,userRole:r})}},42673:function(e,n,r){"use strict";var o,t;r.d(n,{Cl:function(){return o},bK:function(){return u},cd:function(){return l},dr:function(){return c},fK:function(){return a},ph:function(){return s}}),(t=o||(o={})).AIML="AI/ML API",t.Bedrock="Amazon Bedrock",t.Anthropic="Anthropic",t.AssemblyAI="AssemblyAI",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.Cerebras="Cerebras",t.Cohere="Cohere",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.ElevenLabs="ElevenLabs",t.FireworksAI="Fireworks AI",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.Hosted_Vllm="vllm",t.Infinity="Infinity",t.JinaAI="Jina AI",t.MistralAI="Mistral AI",t.Ollama="Ollama",t.OpenAI="OpenAI",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.Perplexity="Perplexity",t.Sambanova="Sambanova",t.Snowflake="Snowflake",t.TogetherAI="TogetherAI",t.Triton="Triton",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},i="/ui/assets/logos/",l={"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},c=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let n=Object.keys(a).find(n=>a[n].toLowerCase()===e.toLowerCase());if(!n)return{logo:"",displayName:e};let r=o[n];return{logo:l[r],displayName:r}},s=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},u=(e,n)=>{console.log("Provider key: ".concat(e));let r=a[e];console.log("Provider mapped to: ".concat(r));let o=[];return e&&"object"==typeof n&&(Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&(t.litellm_provider===r||t.litellm_provider.includes(r))&&o.push(n)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(n).forEach(e=>{let[n,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"cohere_chat"===r.litellm_provider&&o.push(n)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(n).forEach(e=>{let[n,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"sagemaker_chat"===r.litellm_provider&&o.push(n)}))),o}},20347:function(e,n,r){"use strict";r.d(n,{LQ:function(){return a},ZL:function(){return o},lo:function(){return t},tY:function(){return i}});let o=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],t=["Internal User","Internal Viewer"],a=["Internal User","Admin","proxy_admin"],i=e=>o.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,9775,2525,1529,7908,3669,8791,8049,6204,2971,2117,1744],function(){return e(e.s=64362)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6248],{64362:function(e,n,r){Promise.resolve().then(r.bind(r,77438))},16312:function(e,n,r){"use strict";r.d(n,{z:function(){return o.Z}});var o=r(20831)},64504:function(e,n,r){"use strict";r.d(n,{o:function(){return t.Z},z:function(){return o.Z}});var o=r(20831),t=r(49566)},80443:function(e,n,r){"use strict";var o=r(2265),t=r(99376),a=r(14474),i=r(3914);n.Z=()=>{var e,n,r,l,c,s,u;let p=(0,t.useRouter)(),d="undefined"!=typeof document?(0,i.e)("token"):null;(0,o.useEffect)(()=>{d||p.replace("/sso/key/generate")},[d,p]);let g=(0,o.useMemo)(()=>{if(!d)return null;try{return(0,a.o)(d)}catch(e){return(0,i.b)(),p.replace("/sso/key/generate"),null}},[d,p]);return{token:d,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(n=null==g?void 0:g.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==g?void 0:g.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(l=null==g?void 0:g.user_role)&&void 0!==l?l:null),premiumUser:null!==(c=null==g?void 0:g.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(s=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},77438:function(e,n,r){"use strict";r.r(n);var o=r(57437),t=r(6204),a=r(80443);n.default=()=>{let{accessToken:e,userId:n,userRole:r}=(0,a.Z)();return(0,o.jsx)(t.Z,{accessToken:e,userID:n,userRole:r})}},42673:function(e,n,r){"use strict";var o,t;r.d(n,{Cl:function(){return o},bK:function(){return u},cd:function(){return l},dr:function(){return c},fK:function(){return a},ph:function(){return s}}),(t=o||(o={})).AIML="AI/ML API",t.Bedrock="Amazon Bedrock",t.Anthropic="Anthropic",t.AssemblyAI="AssemblyAI",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.Cerebras="Cerebras",t.Cohere="Cohere",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.ElevenLabs="ElevenLabs",t.FireworksAI="Fireworks AI",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.Hosted_Vllm="vllm",t.Infinity="Infinity",t.JinaAI="Jina AI",t.MistralAI="Mistral AI",t.Ollama="Ollama",t.OpenAI="OpenAI",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.Perplexity="Perplexity",t.Sambanova="Sambanova",t.Snowflake="Snowflake",t.TogetherAI="TogetherAI",t.Triton="Triton",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},i="/ui/assets/logos/",l={"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},c=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let n=Object.keys(a).find(n=>a[n].toLowerCase()===e.toLowerCase());if(!n)return{logo:"",displayName:e};let r=o[n];return{logo:l[r],displayName:r}},s=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},u=(e,n)=>{console.log("Provider key: ".concat(e));let r=a[e];console.log("Provider mapped to: ".concat(r));let o=[];return e&&"object"==typeof n&&(Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&(t.litellm_provider===r||t.litellm_provider.includes(r))&&o.push(n)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(n).forEach(e=>{let[n,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"cohere_chat"===r.litellm_provider&&o.push(n)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(n).forEach(e=>{let[n,r]=e;null!==r&&"object"==typeof r&&"litellm_provider"in r&&"sagemaker_chat"===r.litellm_provider&&o.push(n)}))),o}},20347:function(e,n,r){"use strict";r.d(n,{LQ:function(){return a},ZL:function(){return o},lo:function(){return t},tY:function(){return i}});let o=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],t=["Internal User","Internal Viewer"],a=["Internal User","Admin","proxy_admin"],i=e=>o.includes(e)}},function(e){e.O(0,[9820,1491,1526,2417,2926,9775,2525,1529,7908,3669,8791,8049,6204,2971,2117,1744],function(){return e(e.s=64362)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-0087e951a6403a40.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-0087e951a6403a40.js deleted file mode 100644 index d92de50377..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-0087e951a6403a40.js +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<<< HEAD:ui/litellm-dashboard/out/_next/static/chunks/app/(dashboard)/usage/page-200c5767e6a376ed.js -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4746],{58109:function(e,n,t){Promise.resolve().then(t.bind(t,26661))},5540:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(1119),o=t(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},i=t(55015),l=o.forwardRef(function(e,n){return o.createElement(i.Z,(0,r.Z)({},e,{ref:n,icon:a}))})},16312:function(e,n,t){"use strict";t.d(n,{z:function(){return r.Z}});var r=t(20831)},19130:function(e,n,t){"use strict";t.d(n,{RM:function(){return o.Z},SC:function(){return c.Z},iA:function(){return r.Z},pj:function(){return a.Z},ss:function(){return i.Z},xs:function(){return l.Z}});var r=t(21626),o=t(97214),a=t(28241),i=t(58834),l=t(69552),c=t(71876)},11318:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(2265),o=t(39760),a=t(19250);let i=async(e,n,t,r)=>"Admin"!=t&&"Admin Viewer"!=t?await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null,n):await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null);var l=()=>{let[e,n]=(0,r.useState)([]),{accessToken:t,userId:a,userRole:l}=(0,o.Z)();return(0,r.useEffect)(()=>{(async()=>{n(await i(t,a,l,null))})()},[t,a,l]),{teams:e,setTeams:n}}},26661:function(e,n,t){"use strict";t.r(n);var r=t(57437),o=t(62306),a=t(39760),i=t(11318);n.default=()=>{let{accessToken:e,userRole:n,userId:t,premiumUser:l}=(0,a.Z)(),{teams:c}=(0,i.Z)();return(0,r.jsx)(o.Z,{accessToken:e,userRole:n,userID:t,teams:null!=c?c:[],premiumUser:l})}},42673:function(e,n,t){"use strict";var r,o;t.d(n,{Cl:function(){return r},bK:function(){return u},cd:function(){return l},dr:function(){return c},fK:function(){return a},ph:function(){return s}}),(o=r||(r={})).AIML="AI/ML API",o.Bedrock="Amazon Bedrock",o.Anthropic="Anthropic",o.AssemblyAI="AssemblyAI",o.SageMaker="AWS SageMaker",o.Azure="Azure",o.Azure_AI_Studio="Azure AI Foundry (Studio)",o.Cerebras="Cerebras",o.Cohere="Cohere",o.Dashscope="Dashscope",o.Databricks="Databricks (Qwen API)",o.DeepInfra="DeepInfra",o.Deepgram="Deepgram",o.Deepseek="Deepseek",o.ElevenLabs="ElevenLabs",o.FireworksAI="Fireworks AI",o.Google_AI_Studio="Google AI Studio",o.GradientAI="GradientAI",o.Groq="Groq",o.Hosted_Vllm="vllm",o.Infinity="Infinity",o.JinaAI="Jina AI",o.MistralAI="Mistral AI",o.Ollama="Ollama",o.OpenAI="OpenAI",o.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",o.OpenAI_Text="OpenAI Text Completion",o.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",o.Openrouter="Openrouter",o.Oracle="Oracle Cloud Infrastructure (OCI)",o.Perplexity="Perplexity",o.Sambanova="Sambanova",o.Snowflake="Snowflake",o.TogetherAI="TogetherAI",o.Triton="Triton",o.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",o.VolcEngine="VolcEngine",o.Voyage="Voyage AI",o.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},i="/ui/assets/logos/",l={"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},c=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let n=Object.keys(a).find(n=>a[n].toLowerCase()===e.toLowerCase());if(!n)return{logo:"",displayName:e};let t=r[n];return{logo:l[t],displayName:t}},s=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},u=(e,n)=>{console.log("Provider key: ".concat(e));let t=a[e];console.log("Provider mapped to: ".concat(t));let r=[];return e&&"object"==typeof n&&(Object.entries(n).forEach(e=>{let[n,o]=e;null!==o&&"object"==typeof o&&"litellm_provider"in o&&(o.litellm_provider===t||o.litellm_provider.includes(t))&&r.push(n)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&r.push(n)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&r.push(n)}))),r}},12322:function(e,n,t){"use strict";t.d(n,{w:function(){return c}});var r=t(57437),o=t(2265),a=t(71594),i=t(24525),l=t(19130);function c(e){let{data:n=[],columns:t,getRowCanExpand:c,renderSubComponent:s,isLoading:u=!1,loadingMessage:d="\uD83D\uDE85 Loading logs...",noDataMessage:p="No logs found"}=e,g=(0,a.b7)({data:n,columns:t,getRowCanExpand:c,getRowId:(e,n)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(n)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,r.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,r.jsxs)(l.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,r.jsx)(l.ss,{children:g.getHeaderGroups().map(e=>(0,r.jsx)(l.SC,{children:e.headers.map(e=>(0,r.jsx)(l.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,a.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,r.jsx)(l.RM,{children:u?(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:d})})})}):g.getRowModel().rows.length>0?g.getRowModel().rows.map(e=>(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(l.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,r.jsx)(l.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,a.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,r.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:s({row:e})})})})]},e.id)):(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:p})})})})})]})})}},44633:function(e,n,t){"use strict";var r=t(2265);let o=r.forwardRef(function(e,n){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:n},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});n.Z=o}},function(e){e.O(0,[6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,6494,5188,6202,2344,5105,4851,1160,3250,8049,131,2202,874,4292,2306,2971,2117,1744],function(){return e(e.s=58109)}),_N_E=e.O()}]); -======== -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4746],{58109:function(e,n,t){Promise.resolve().then(t.bind(t,26661))},5540:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(1119),o=t(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},i=t(55015),l=o.forwardRef(function(e,n){return o.createElement(i.Z,(0,r.Z)({},e,{ref:n,icon:a}))})},16312:function(e,n,t){"use strict";t.d(n,{z:function(){return r.Z}});var r=t(20831)},19130:function(e,n,t){"use strict";t.d(n,{RM:function(){return o.Z},SC:function(){return c.Z},iA:function(){return r.Z},pj:function(){return a.Z},ss:function(){return i.Z},xs:function(){return l.Z}});var r=t(21626),o=t(97214),a=t(28241),i=t(58834),l=t(69552),c=t(71876)},11318:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(2265),o=t(39760),a=t(19250);let i=async(e,n,t,r)=>"Admin"!=t&&"Admin Viewer"!=t?await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null,n):await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null);var l=()=>{let[e,n]=(0,r.useState)([]),{accessToken:t,userId:a,userRole:l}=(0,o.Z)();return(0,r.useEffect)(()=>{(async()=>{n(await i(t,a,l,null))})()},[t,a,l]),{teams:e,setTeams:n}}},26661:function(e,n,t){"use strict";t.r(n);var r=t(57437),o=t(99883),a=t(39760),i=t(11318);n.default=()=>{let{accessToken:e,userRole:n,userId:t,premiumUser:l}=(0,a.Z)(),{teams:c}=(0,i.Z)();return(0,r.jsx)(o.Z,{accessToken:e,userRole:n,userID:t,teams:null!=c?c:[],premiumUser:l})}},42673:function(e,n,t){"use strict";var r,o;t.d(n,{Cl:function(){return r},bK:function(){return u},cd:function(){return l},dr:function(){return c},fK:function(){return a},ph:function(){return s}}),(o=r||(r={})).AIML="AI/ML API",o.Bedrock="Amazon Bedrock",o.Anthropic="Anthropic",o.AssemblyAI="AssemblyAI",o.SageMaker="AWS SageMaker",o.Azure="Azure",o.Azure_AI_Studio="Azure AI Foundry (Studio)",o.Cerebras="Cerebras",o.Cohere="Cohere",o.Dashscope="Dashscope",o.Databricks="Databricks (Qwen API)",o.DeepInfra="DeepInfra",o.Deepgram="Deepgram",o.Deepseek="Deepseek",o.ElevenLabs="ElevenLabs",o.FireworksAI="Fireworks AI",o.Google_AI_Studio="Google AI Studio",o.GradientAI="GradientAI",o.Groq="Groq",o.Hosted_Vllm="vllm",o.Infinity="Infinity",o.JinaAI="Jina AI",o.MistralAI="Mistral AI",o.Ollama="Ollama",o.OpenAI="OpenAI",o.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",o.OpenAI_Text="OpenAI Text Completion",o.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",o.Openrouter="Openrouter",o.Oracle="Oracle Cloud Infrastructure (OCI)",o.Perplexity="Perplexity",o.Sambanova="Sambanova",o.Snowflake="Snowflake",o.TogetherAI="TogetherAI",o.Triton="Triton",o.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",o.VolcEngine="VolcEngine",o.Voyage="Voyage AI",o.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},i="/ui/assets/logos/",l={"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},c=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let n=Object.keys(a).find(n=>a[n].toLowerCase()===e.toLowerCase());if(!n)return{logo:"",displayName:e};let t=r[n];return{logo:l[t],displayName:t}},s=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},u=(e,n)=>{console.log("Provider key: ".concat(e));let t=a[e];console.log("Provider mapped to: ".concat(t));let r=[];return e&&"object"==typeof n&&(Object.entries(n).forEach(e=>{let[n,o]=e;null!==o&&"object"==typeof o&&"litellm_provider"in o&&(o.litellm_provider===t||o.litellm_provider.includes(t))&&r.push(n)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&r.push(n)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&r.push(n)}))),r}},12322:function(e,n,t){"use strict";t.d(n,{w:function(){return c}});var r=t(57437),o=t(2265),a=t(71594),i=t(24525),l=t(19130);function c(e){let{data:n=[],columns:t,getRowCanExpand:c,renderSubComponent:s,isLoading:u=!1,loadingMessage:d="\uD83D\uDE85 Loading logs...",noDataMessage:p="No logs found"}=e,g=(0,a.b7)({data:n,columns:t,getRowCanExpand:c,getRowId:(e,n)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(n)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,r.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,r.jsxs)(l.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,r.jsx)(l.ss,{children:g.getHeaderGroups().map(e=>(0,r.jsx)(l.SC,{children:e.headers.map(e=>(0,r.jsx)(l.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,a.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,r.jsx)(l.RM,{children:u?(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:d})})})}):g.getRowModel().rows.length>0?g.getRowModel().rows.map(e=>(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(l.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,r.jsx)(l.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,a.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,r.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:s({row:e})})})})]},e.id)):(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:p})})})})})]})})}},44633:function(e,n,t){"use strict";var r=t(2265);let o=r.forwardRef(function(e,n){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:n},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});n.Z=o}},function(e){e.O(0,[6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,6494,5188,6202,2344,5105,4851,1160,3250,8049,1633,2202,874,4292,9883,2971,2117,1744],function(){return e(e.s=58109)}),_N_E=e.O()}]); ->>>>>>>> ef0d6f0207 (Resolve conflicts in generated HTML files):litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-0087e951a6403a40.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-af5d7ad6e47d0b01.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-af5d7ad6e47d0b01.js new file mode 100644 index 0000000000..3f98f99e61 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-af5d7ad6e47d0b01.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4746],{58109:function(e,n,t){Promise.resolve().then(t.bind(t,26661))},5540:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(1119),o=t(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},i=t(55015),l=o.forwardRef(function(e,n){return o.createElement(i.Z,(0,r.Z)({},e,{ref:n,icon:a}))})},16312:function(e,n,t){"use strict";t.d(n,{z:function(){return r.Z}});var r=t(20831)},19130:function(e,n,t){"use strict";t.d(n,{RM:function(){return o.Z},SC:function(){return c.Z},iA:function(){return r.Z},pj:function(){return a.Z},ss:function(){return i.Z},xs:function(){return l.Z}});var r=t(21626),o=t(97214),a=t(28241),i=t(58834),l=t(69552),c=t(71876)},11318:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(2265),o=t(80443),a=t(19250);let i=async(e,n,t,r)=>"Admin"!=t&&"Admin Viewer"!=t?await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null,n):await (0,a.teamListCall)(e,(null==r?void 0:r.organization_id)||null);var l=()=>{let[e,n]=(0,r.useState)([]),{accessToken:t,userId:a,userRole:l}=(0,o.Z)();return(0,r.useEffect)(()=>{(async()=>{n(await i(t,a,l,null))})()},[t,a,l]),{teams:e,setTeams:n}}},26661:function(e,n,t){"use strict";t.r(n);var r=t(57437),o=t(62306),a=t(80443),i=t(11318);n.default=()=>{let{accessToken:e,userRole:n,userId:t,premiumUser:l}=(0,a.Z)(),{teams:c}=(0,i.Z)();return(0,r.jsx)(o.Z,{accessToken:e,userRole:n,userID:t,teams:null!=c?c:[],premiumUser:l})}},42673:function(e,n,t){"use strict";var r,o;t.d(n,{Cl:function(){return r},bK:function(){return u},cd:function(){return l},dr:function(){return c},fK:function(){return a},ph:function(){return s}}),(o=r||(r={})).AIML="AI/ML API",o.Bedrock="Amazon Bedrock",o.Anthropic="Anthropic",o.AssemblyAI="AssemblyAI",o.SageMaker="AWS SageMaker",o.Azure="Azure",o.Azure_AI_Studio="Azure AI Foundry (Studio)",o.Cerebras="Cerebras",o.Cohere="Cohere",o.Dashscope="Dashscope",o.Databricks="Databricks (Qwen API)",o.DeepInfra="DeepInfra",o.Deepgram="Deepgram",o.Deepseek="Deepseek",o.ElevenLabs="ElevenLabs",o.FireworksAI="Fireworks AI",o.Google_AI_Studio="Google AI Studio",o.GradientAI="GradientAI",o.Groq="Groq",o.Hosted_Vllm="vllm",o.Infinity="Infinity",o.JinaAI="Jina AI",o.MistralAI="Mistral AI",o.Ollama="Ollama",o.OpenAI="OpenAI",o.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",o.OpenAI_Text="OpenAI Text Completion",o.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",o.Openrouter="Openrouter",o.Oracle="Oracle Cloud Infrastructure (OCI)",o.Perplexity="Perplexity",o.Sambanova="Sambanova",o.Snowflake="Snowflake",o.TogetherAI="TogetherAI",o.Triton="Triton",o.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",o.VolcEngine="VolcEngine",o.Voyage="Voyage AI",o.xAI="xAI";let a={AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},i="/ui/assets/logos/",l={"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},c=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let n=Object.keys(a).find(n=>a[n].toLowerCase()===e.toLowerCase());if(!n)return{logo:"",displayName:e};let t=r[n];return{logo:l[t],displayName:t}},s=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"azure/my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},u=(e,n)=>{console.log("Provider key: ".concat(e));let t=a[e];console.log("Provider mapped to: ".concat(t));let r=[];return e&&"object"==typeof n&&(Object.entries(n).forEach(e=>{let[n,o]=e;null!==o&&"object"==typeof o&&"litellm_provider"in o&&(o.litellm_provider===t||o.litellm_provider.includes(t))&&r.push(n)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&r.push(n)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(n).forEach(e=>{let[n,t]=e;null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&r.push(n)}))),r}},12322:function(e,n,t){"use strict";t.d(n,{w:function(){return c}});var r=t(57437),o=t(2265),a=t(71594),i=t(24525),l=t(19130);function c(e){let{data:n=[],columns:t,getRowCanExpand:c,renderSubComponent:s,isLoading:u=!1,loadingMessage:d="\uD83D\uDE85 Loading logs...",noDataMessage:p="No logs found"}=e,g=(0,a.b7)({data:n,columns:t,getRowCanExpand:c,getRowId:(e,n)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(n)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,r.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,r.jsxs)(l.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,r.jsx)(l.ss,{children:g.getHeaderGroups().map(e=>(0,r.jsx)(l.SC,{children:e.headers.map(e=>(0,r.jsx)(l.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,a.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,r.jsx)(l.RM,{children:u?(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:d})})})}):g.getRowModel().rows.length>0?g.getRowModel().rows.map(e=>(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(l.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,r.jsx)(l.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,a.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,r.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:s({row:e})})})})]},e.id)):(0,r.jsx)(l.SC,{children:(0,r.jsx)(l.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,r.jsx)("div",{className:"text-center text-gray-500",children:(0,r.jsx)("p",{children:p})})})})})]})})}},44633:function(e,n,t){"use strict";var r=t(2265);let o=r.forwardRef(function(e,n){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:n},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});n.Z=o}},function(e){e.O(0,[6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,6494,5188,6202,2344,5105,4851,1160,3250,8049,131,2202,874,4292,2306,2971,2117,1744],function(){return e(e.s=58109)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-5350004f9323e706.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-c5cc93238455fee0.js similarity index 98% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-5350004f9323e706.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-c5cc93238455fee0.js index e0460f8884..db1d7a4e50 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-5350004f9323e706.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-c5cc93238455fee0.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7297],{32963:function(e,t,n){Promise.resolve().then(n.bind(n,87654))},16853:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),i=n(96398),o=n(44140),a=n(2265),u=n(97324),l=n(1153);let s=(0,l.fn)("Textarea"),c=a.forwardRef((e,t)=>{let{value:n,defaultValue:c="",placeholder:d="Type...",error:f=!1,errorMessage:m,disabled:h=!1,className:p,onChange:g,onValueChange:v}=e,_=(0,r._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[x,w]=(0,o.Z)(c,n),b=(0,a.useRef)(null),k=(0,i.Uh)(x);return a.createElement(a.Fragment,null,a.createElement("textarea",Object.assign({ref:(0,l.lq)([b,t]),value:x,placeholder:d,disabled:h,className:(0,u.q)(s("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,i.um)(k,h,f),h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",p),"data-testid":"text-area",onChange:e=>{null==g||g(e),w(e.target.value),null==v||v(e.target.value)}},_)),f&&m?a.createElement("p",{className:(0,u.q)(s("errorMessage"),"text-sm text-red-500 mt-1")},m):null)});c.displayName="Textarea"},67982:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(5853),i=n(97324),o=n(1153),a=n(2265);let u=(0,o.fn)("Divider"),l=a.forwardRef((e,t)=>{let{className:n,children:o}=e,l=(0,r._T)(e,["className","children"]);return a.createElement("div",Object.assign({ref:t,className:(0,i.q)(u("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",n)},l),o?a.createElement(a.Fragment,null,a.createElement("div",{className:(0,i.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),a.createElement("div",{className:(0,i.q)("text-inherit whitespace-nowrap")},o),a.createElement("div",{className:(0,i.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):a.createElement("div",{className:(0,i.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});l.displayName="Divider"},84717:function(e,t,n){"use strict";n.d(t,{Ct:function(){return r.Z},Dx:function(){return m.Z},OK:function(){return u.Z},Zb:function(){return o.Z},nP:function(){return d.Z},rj:function(){return a.Z},td:function(){return s.Z},v0:function(){return l.Z},x4:function(){return c.Z},xv:function(){return f.Z},zx:function(){return i.Z}});var r=n(41649),i=n(20831),o=n(12514),a=n(67101),u=n(12485),l=n(18135),s=n(35242),c=n(29706),d=n(77991),f=n(84264),m=n(96761)},16312:function(e,t,n){"use strict";n.d(t,{z:function(){return r.Z}});var r=n(20831)},58643:function(e,t,n){"use strict";n.d(t,{OK:function(){return r.Z},nP:function(){return u.Z},td:function(){return o.Z},v0:function(){return i.Z},x4:function(){return a.Z}});var r=n(12485),i=n(18135),o=n(35242),a=n(29706),u=n(77991)},39760:function(e,t,n){"use strict";var r=n(2265),i=n(99376),o=n(14474),a=n(3914);t.Z=()=>{var e,t,n,u,l,s,c;let d=(0,i.useRouter)(),f="undefined"!=typeof document?(0,a.e)("token"):null;(0,r.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let m=(0,r.useMemo)(()=>{if(!f)return null;try{return(0,o.o)(f)}catch(e){return(0,a.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(t=null==m?void 0:m.user_id)&&void 0!==t?t:null,userEmail:null!==(n=null==m?void 0:m.user_email)&&void 0!==n?n:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(u=null==m?void 0:m.user_role)&&void 0!==u?u:null),premiumUser:null!==(l=null==m?void 0:m.premium_user)&&void 0!==l?l:null,disabledPersonalKeyCreation:null!==(s=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},11318:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(2265),i=n(39760),o=n(19250);let a=async(e,t,n,r)=>"Admin"!=n&&"Admin Viewer"!=n?await (0,o.teamListCall)(e,(null==r?void 0:r.organization_id)||null,t):await (0,o.teamListCall)(e,(null==r?void 0:r.organization_id)||null);var u=()=>{let[e,t]=(0,r.useState)([]),{accessToken:n,userId:o,userRole:u}=(0,i.Z)();return(0,r.useEffect)(()=>{(async()=>{t(await a(n,o,u,null))})()},[n,o,u]),{teams:e,setTeams:t}}},87654:function(e,t,n){"use strict";n.r(t);var r=n(57437),i=n(77155),o=n(39760),a=n(11318),u=n(2265),l=n(21623),s=n(29827);t.default=()=>{let{accessToken:e,userRole:t,userId:n,token:c}=(0,o.Z)(),[d,f]=(0,u.useState)([]),{teams:m}=(0,a.Z)(),h=new l.S;return(0,r.jsx)(s.aH,{client:h,children:(0,r.jsx)(i.Z,{accessToken:e,token:c,keys:d,userRole:t,userID:n,teams:m,setKeys:f})})}},46468:function(e,t,n){"use strict";n.d(t,{K2:function(){return i},Ob:function(){return a},W0:function(){return o}});var r=n(19250);let i=async(e,t,n)=>{try{if(null===e||null===t)return;if(null!==n){let i=(await (0,r.modelAvailableCall)(n,e,t,!0,null,!0)).data.map(e=>e.id),o=[],a=[];return i.forEach(e=>{e.endsWith("/*")?o.push(e):a.push(e)}),[...o,...a]}}catch(e){console.error("Error fetching user models:",e)}},o=e=>{if(e.endsWith("/*")){let t=e.replace("/*","");return"All ".concat(t," models")}return e},a=(e,t)=>{let n=[],r=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let i=e.replace("/*",""),o=t.filter(e=>e.startsWith(i+"/"));r.push(...o),n.push(e)}else r.push(e)}),[...n,...r].filter((e,t,n)=>n.indexOf(e)===t)}},24199:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(57437);n(2265);var i=n(30150),o=e=>{let{step:t=.01,style:n={width:"100%"},placeholder:o="Enter a numerical value",min:a,max:u,onChange:l,...s}=e;return(0,r.jsx)(i.Z,{onWheel:e=>e.currentTarget.blur(),step:t,style:n,placeholder:o,min:a,max:u,onChange:l,...s})}},59872:function(e,t,n){"use strict";n.d(t,{nl:function(){return i},pw:function(){return o},vQ:function(){return a}});var r=n(9114);function i(e,t){let n=structuredClone(e);for(let[e,r]of Object.entries(t))e in n&&(n[e]=r);return n}let o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let r={minimumFractionDigits:t,maximumFractionDigits:t};if(!n)return e.toLocaleString("en-US",r);let i=Math.abs(e),o=i,a="";return i>=1e6?(o=i/1e6,a="M"):i>=1e3&&(o=i/1e3,a="K"),"".concat(e<0?"-":"").concat(o.toLocaleString("en-US",r)).concat(a)},a=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return u(e,t);try{return await navigator.clipboard.writeText(e),r.Z.success(t),!0}catch(n){return console.error("Clipboard API failed: ",n),u(e,t)}},u=(e,t)=>{try{let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.left="-999999px",n.style.top="-999999px",n.setAttribute("readonly",""),document.body.appendChild(n),n.focus(),n.select();let i=document.execCommand("copy");if(document.body.removeChild(n),i)return r.Z.success(t),!0;throw Error("execCommand failed")}catch(e){return r.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,t,n){"use strict";n.d(t,{LQ:function(){return o},ZL:function(){return r},lo:function(){return i},tY:function(){return a}});let r=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],i=["Internal User","Internal Viewer"],o=["Internal User","Admin","proxy_admin"],a=e=>r.includes(e)},10900:function(e,t,n){"use strict";var r=n(2265);let i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=i},44633:function(e,t,n){"use strict";var r=n(2265);let i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=i},15731:function(e,t,n){"use strict";var r=n(2265);let i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=i},49084:function(e,t,n){"use strict";var r=n(2265);let i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=i},19616:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var r=n(2265);let i={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class o{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...i,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function a(e,t){let[n,i]=(0,r.useState)(e),a=function(e,t){let[n]=(0,r.useState)(()=>{var n;return Object.getOwnPropertyNames(Object.getPrototypeOf(n=new o(e,t))).filter(e=>"function"==typeof n[e]).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(e[t]=r.bind(n)),e},{})});return n.setOptions(t),n}(i,t);return[n,a.maybeExecute,a]}}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,3669,1264,8049,2202,7155,2971,2117,1744],function(){return e(e.s=32963)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7297],{32963:function(e,t,n){Promise.resolve().then(n.bind(n,87654))},16853:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),i=n(96398),o=n(44140),a=n(2265),u=n(97324),l=n(1153);let s=(0,l.fn)("Textarea"),c=a.forwardRef((e,t)=>{let{value:n,defaultValue:c="",placeholder:d="Type...",error:f=!1,errorMessage:m,disabled:h=!1,className:p,onChange:g,onValueChange:v}=e,_=(0,r._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[x,w]=(0,o.Z)(c,n),b=(0,a.useRef)(null),k=(0,i.Uh)(x);return a.createElement(a.Fragment,null,a.createElement("textarea",Object.assign({ref:(0,l.lq)([b,t]),value:x,placeholder:d,disabled:h,className:(0,u.q)(s("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,i.um)(k,h,f),h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",p),"data-testid":"text-area",onChange:e=>{null==g||g(e),w(e.target.value),null==v||v(e.target.value)}},_)),f&&m?a.createElement("p",{className:(0,u.q)(s("errorMessage"),"text-sm text-red-500 mt-1")},m):null)});c.displayName="Textarea"},67982:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(5853),i=n(97324),o=n(1153),a=n(2265);let u=(0,o.fn)("Divider"),l=a.forwardRef((e,t)=>{let{className:n,children:o}=e,l=(0,r._T)(e,["className","children"]);return a.createElement("div",Object.assign({ref:t,className:(0,i.q)(u("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",n)},l),o?a.createElement(a.Fragment,null,a.createElement("div",{className:(0,i.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),a.createElement("div",{className:(0,i.q)("text-inherit whitespace-nowrap")},o),a.createElement("div",{className:(0,i.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):a.createElement("div",{className:(0,i.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});l.displayName="Divider"},84717:function(e,t,n){"use strict";n.d(t,{Ct:function(){return r.Z},Dx:function(){return m.Z},OK:function(){return u.Z},Zb:function(){return o.Z},nP:function(){return d.Z},rj:function(){return a.Z},td:function(){return s.Z},v0:function(){return l.Z},x4:function(){return c.Z},xv:function(){return f.Z},zx:function(){return i.Z}});var r=n(41649),i=n(20831),o=n(12514),a=n(67101),u=n(12485),l=n(18135),s=n(35242),c=n(29706),d=n(77991),f=n(84264),m=n(96761)},16312:function(e,t,n){"use strict";n.d(t,{z:function(){return r.Z}});var r=n(20831)},58643:function(e,t,n){"use strict";n.d(t,{OK:function(){return r.Z},nP:function(){return u.Z},td:function(){return o.Z},v0:function(){return i.Z},x4:function(){return a.Z}});var r=n(12485),i=n(18135),o=n(35242),a=n(29706),u=n(77991)},80443:function(e,t,n){"use strict";var r=n(2265),i=n(99376),o=n(14474),a=n(3914);t.Z=()=>{var e,t,n,u,l,s,c;let d=(0,i.useRouter)(),f="undefined"!=typeof document?(0,a.e)("token"):null;(0,r.useEffect)(()=>{f||d.replace("/sso/key/generate")},[f,d]);let m=(0,r.useMemo)(()=>{if(!f)return null;try{return(0,o.o)(f)}catch(e){return(0,a.b)(),d.replace("/sso/key/generate"),null}},[f,d]);return{token:f,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(t=null==m?void 0:m.user_id)&&void 0!==t?t:null,userEmail:null!==(n=null==m?void 0:m.user_email)&&void 0!==n?n:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(u=null==m?void 0:m.user_role)&&void 0!==u?u:null),premiumUser:null!==(l=null==m?void 0:m.premium_user)&&void 0!==l?l:null,disabledPersonalKeyCreation:null!==(s=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==s?s:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},11318:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(2265),i=n(80443),o=n(19250);let a=async(e,t,n,r)=>"Admin"!=n&&"Admin Viewer"!=n?await (0,o.teamListCall)(e,(null==r?void 0:r.organization_id)||null,t):await (0,o.teamListCall)(e,(null==r?void 0:r.organization_id)||null);var u=()=>{let[e,t]=(0,r.useState)([]),{accessToken:n,userId:o,userRole:u}=(0,i.Z)();return(0,r.useEffect)(()=>{(async()=>{t(await a(n,o,u,null))})()},[n,o,u]),{teams:e,setTeams:t}}},87654:function(e,t,n){"use strict";n.r(t);var r=n(57437),i=n(77155),o=n(80443),a=n(11318),u=n(2265),l=n(21623),s=n(29827);t.default=()=>{let{accessToken:e,userRole:t,userId:n,token:c}=(0,o.Z)(),[d,f]=(0,u.useState)([]),{teams:m}=(0,a.Z)(),h=new l.S;return(0,r.jsx)(s.aH,{client:h,children:(0,r.jsx)(i.Z,{accessToken:e,token:c,keys:d,userRole:t,userID:n,teams:m,setKeys:f})})}},46468:function(e,t,n){"use strict";n.d(t,{K2:function(){return i},Ob:function(){return a},W0:function(){return o}});var r=n(19250);let i=async(e,t,n)=>{try{if(null===e||null===t)return;if(null!==n){let i=(await (0,r.modelAvailableCall)(n,e,t,!0,null,!0)).data.map(e=>e.id),o=[],a=[];return i.forEach(e=>{e.endsWith("/*")?o.push(e):a.push(e)}),[...o,...a]}}catch(e){console.error("Error fetching user models:",e)}},o=e=>{if(e.endsWith("/*")){let t=e.replace("/*","");return"All ".concat(t," models")}return e},a=(e,t)=>{let n=[],r=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let i=e.replace("/*",""),o=t.filter(e=>e.startsWith(i+"/"));r.push(...o),n.push(e)}else r.push(e)}),[...n,...r].filter((e,t,n)=>n.indexOf(e)===t)}},24199:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(57437);n(2265);var i=n(30150),o=e=>{let{step:t=.01,style:n={width:"100%"},placeholder:o="Enter a numerical value",min:a,max:u,onChange:l,...s}=e;return(0,r.jsx)(i.Z,{onWheel:e=>e.currentTarget.blur(),step:t,style:n,placeholder:o,min:a,max:u,onChange:l,...s})}},59872:function(e,t,n){"use strict";n.d(t,{nl:function(){return i},pw:function(){return o},vQ:function(){return a}});var r=n(9114);function i(e,t){let n=structuredClone(e);for(let[e,r]of Object.entries(t))e in n&&(n[e]=r);return n}let o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let r={minimumFractionDigits:t,maximumFractionDigits:t};if(!n)return e.toLocaleString("en-US",r);let i=Math.abs(e),o=i,a="";return i>=1e6?(o=i/1e6,a="M"):i>=1e3&&(o=i/1e3,a="K"),"".concat(e<0?"-":"").concat(o.toLocaleString("en-US",r)).concat(a)},a=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return u(e,t);try{return await navigator.clipboard.writeText(e),r.Z.success(t),!0}catch(n){return console.error("Clipboard API failed: ",n),u(e,t)}},u=(e,t)=>{try{let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.left="-999999px",n.style.top="-999999px",n.setAttribute("readonly",""),document.body.appendChild(n),n.focus(),n.select();let i=document.execCommand("copy");if(document.body.removeChild(n),i)return r.Z.success(t),!0;throw Error("execCommand failed")}catch(e){return r.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,t,n){"use strict";n.d(t,{LQ:function(){return o},ZL:function(){return r},lo:function(){return i},tY:function(){return a}});let r=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],i=["Internal User","Internal Viewer"],o=["Internal User","Admin","proxy_admin"],a=e=>r.includes(e)},10900:function(e,t,n){"use strict";var r=n(2265);let i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=i},44633:function(e,t,n){"use strict";var r=n(2265);let i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=i},15731:function(e,t,n){"use strict";var r=n(2265);let i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=i},49084:function(e,t,n){"use strict";var r=n(2265);let i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=i},19616:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var r=n(2265);let i={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class o{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...i,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function a(e,t){let[n,i]=(0,r.useState)(e),a=function(e,t){let[n]=(0,r.useState)(()=>{var n;return Object.getOwnPropertyNames(Object.getPrototypeOf(n=new o(e,t))).filter(e=>"function"==typeof n[e]).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(e[t]=r.bind(n)),e},{})});return n.setOptions(t),n}(i,t);return[n,a.maybeExecute,a]}}},function(e){e.O(0,[9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,3669,1264,8049,2202,7155,2971,2117,1744],function(){return e(e.s=32963)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-5f39dca6d04896e2.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-5f39dca6d04896e2.js deleted file mode 100644 index f31ec9cdc6..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-5f39dca6d04896e2.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7049],{4222:function(e,a,n){Promise.resolve().then(n.bind(n,2425))},16312:function(e,a,n){"use strict";n.d(a,{z:function(){return t.Z}});var t=n(20831)},10178:function(e,a,n){"use strict";n.d(a,{JO:function(){return t.Z},RM:function(){return l.Z},SC:function(){return o.Z},iA:function(){return r.Z},pj:function(){return s.Z},ss:function(){return i.Z},xs:function(){return c.Z}});var t=n(47323),r=n(21626),l=n(97214),s=n(28241),i=n(58834),c=n(69552),o=n(71876)},11318:function(e,a,n){"use strict";n.d(a,{Z:function(){return i}});var t=n(2265),r=n(39760),l=n(19250);let s=async(e,a,n,t)=>"Admin"!=n&&"Admin Viewer"!=n?await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null,a):await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null);var i=()=>{let[e,a]=(0,t.useState)([]),{accessToken:n,userId:l,userRole:i}=(0,r.Z)();return(0,t.useEffect)(()=>{(async()=>{a(await s(n,l,i,null))})()},[n,l,i]),{teams:e,setTeams:a}}},2425:function(e,a,n){"use strict";n.r(a);var t=n(57437),r=n(2265),l=n(49924),s=n(21623),i=n(29827),c=n(39760),o=n(21739),u=n(11318);a.default=()=>{let{accessToken:e,userRole:a,userId:n,premiumUser:f,userEmail:m}=(0,c.Z)(),{teams:d,setTeams:h}=(0,u.Z)(),[g,p]=(0,r.useState)(!1),[w,y]=(0,r.useState)([]),v=new s.S,{keys:S,isLoading:x,error:C,pagination:b,refresh:E,setKeys:Z}=(0,l.Z)({selectedKeyAlias:null,currentOrg:null,accessToken:e||"",createClicked:g});return(0,t.jsx)(i.aH,{client:v,children:(0,t.jsx)(o.Z,{userID:n,userRole:a,userEmail:m,teams:d,keys:S,setUserRole:()=>{},setUserEmail:()=>{},setTeams:h,setKeys:Z,premiumUser:f,organizations:w,addKey:e=>{Z(a=>a?[...a,e]:[e]),p(()=>!g)},createClicked:g})})}},12363:function(e,a,n){"use strict";n.d(a,{d:function(){return l},n:function(){return r}});var t=n(2265);let r=()=>{let[e,a]=(0,t.useState)("http://localhost:4000");return(0,t.useEffect)(()=>{{let{protocol:e,host:n}=window.location;a("".concat(e,"//").concat(n))}},[]),e},l=25},30841:function(e,a,n){"use strict";n.d(a,{IE:function(){return l},LO:function(){return r},cT:function(){return s}});var t=n(19250);let r=async e=>{if(!e)return[];try{let{aliases:a}=await (0,t.keyAliasesCall)(e);return Array.from(new Set((a||[]).filter(Boolean)))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},l=async(e,a)=>{if(!e)return[];try{let n=[],r=1,l=!0;for(;l;){let s=await (0,t.teamListCall)(e,a||null,null);n=[...n,...s],r{if(!e)return[];try{let a=[],n=1,r=!0;for(;r;){let l=await (0,t.organizationListCall)(e);a=[...a,...l],n{let{options:a,onApplyFilters:n,onResetFilters:o,initialValues:f={},buttonLabel:m="Filters"}=e,[d,h]=(0,r.useState)(!1),[g,p]=(0,r.useState)(f),[w,y]=(0,r.useState)({}),[v,S]=(0,r.useState)({}),[x,C]=(0,r.useState)({}),[b,E]=(0,r.useState)({}),Z=(0,r.useCallback)(u()(async(e,a)=>{if(a.isSearchable&&a.searchFn){S(e=>({...e,[a.name]:!0}));try{let n=await a.searchFn(e);y(e=>({...e,[a.name]:n}))}catch(e){console.error("Error searching:",e),y(e=>({...e,[a.name]:[]}))}finally{S(e=>({...e,[a.name]:!1}))}}},300),[]),j=(0,r.useCallback)(async e=>{if(e.isSearchable&&e.searchFn&&!b[e.name]){S(a=>({...a,[e.name]:!0})),E(a=>({...a,[e.name]:!0}));try{let a=await e.searchFn("");y(n=>({...n,[e.name]:a}))}catch(a){console.error("Error loading initial options:",a),y(a=>({...a,[e.name]:[]}))}finally{S(a=>({...a,[e.name]:!1}))}}},[b]);(0,r.useEffect)(()=>{d&&a.forEach(e=>{e.isSearchable&&!b[e.name]&&j(e)})},[d,a,j,b]);let N=(e,a)=>{let t={...g,[e]:a};p(t),n(t)},k=(e,a)=>{e&&a.isSearchable&&!b[a.name]&&j(a)};return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,t.jsx)(l.ZP,{icon:(0,t.jsx)(c.Z,{className:"h-4 w-4"}),onClick:()=>h(!d),className:"flex items-center gap-2",children:m}),(0,t.jsx)(l.ZP,{onClick:()=>{let e={};a.forEach(a=>{e[a.name]=""}),p(e),o()},children:"Reset Filters"})]}),d&&(0,t.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-4 mb-6",children:["Team ID","Status","Organization ID","Key Alias","User ID","End User","Key Hash","Model"].map(e=>{let n=a.find(a=>a.label===e||a.name===e);return n?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("label",{className:"text-sm text-gray-600",children:n.label||n.name}),n.isSearchable?(0,t.jsx)(s.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(n.label||n.name,"..."),value:g[n.name]||void 0,onChange:e=>N(n.name,e),onDropdownVisibleChange:e=>k(e,n),onSearch:e=>{C(a=>({...a,[n.name]:e})),n.searchFn&&Z(e,n)},filterOption:!1,loading:v[n.name],options:w[n.name]||[],allowClear:!0,notFoundContent:v[n.name]?"Loading...":"No results found"}):n.options?(0,t.jsx)(s.default,{className:"w-full",placeholder:"Select ".concat(n.label||n.name,"..."),value:g[n.name]||void 0,onChange:e=>N(n.name,e),allowClear:!0,children:n.options.map(e=>(0,t.jsx)(s.default.Option,{value:e.value,children:e.label},e.value))}):(0,t.jsx)(i.default,{className:"w-full",placeholder:"Enter ".concat(n.label||n.name,"..."),value:g[n.name]||"",onChange:e=>N(n.name,e.target.value),allowClear:!0})]},n.name):null})})]})}}},function(e){e.O(0,[3665,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,1264,17,8049,1633,2202,874,4292,1739,2971,2117,1744],function(){return e(e.s=4222)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-8518bb0fb324f811.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-a060a80d56f4f360.js similarity index 97% rename from litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-8518bb0fb324f811.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-a060a80d56f4f360.js index 1259d76d13..81dd5739a8 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-8518bb0fb324f811.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-a060a80d56f4f360.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7049],{4222:function(e,a,n){Promise.resolve().then(n.bind(n,2425))},16312:function(e,a,n){"use strict";n.d(a,{z:function(){return t.Z}});var t=n(20831)},10178:function(e,a,n){"use strict";n.d(a,{JO:function(){return t.Z},RM:function(){return l.Z},SC:function(){return o.Z},iA:function(){return r.Z},pj:function(){return s.Z},ss:function(){return i.Z},xs:function(){return c.Z}});var t=n(47323),r=n(21626),l=n(97214),s=n(28241),i=n(58834),c=n(69552),o=n(71876)},11318:function(e,a,n){"use strict";n.d(a,{Z:function(){return i}});var t=n(2265),r=n(39760),l=n(19250);let s=async(e,a,n,t)=>"Admin"!=n&&"Admin Viewer"!=n?await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null,a):await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null);var i=()=>{let[e,a]=(0,t.useState)([]),{accessToken:n,userId:l,userRole:i}=(0,r.Z)();return(0,t.useEffect)(()=>{(async()=>{a(await s(n,l,i,null))})()},[n,l,i]),{teams:e,setTeams:a}}},2425:function(e,a,n){"use strict";n.r(a);var t=n(57437),r=n(2265),l=n(49924),s=n(21623),i=n(29827),c=n(39760),o=n(21739),u=n(11318);a.default=()=>{let{accessToken:e,userRole:a,userId:n,premiumUser:f,userEmail:m}=(0,c.Z)(),{teams:d,setTeams:h}=(0,u.Z)(),[g,p]=(0,r.useState)(!1),[w,y]=(0,r.useState)([]),v=new s.S,{keys:S,isLoading:x,error:C,pagination:b,refresh:E,setKeys:Z}=(0,l.Z)({selectedKeyAlias:null,currentOrg:null,accessToken:e||"",createClicked:g});return(0,t.jsx)(i.aH,{client:v,children:(0,t.jsx)(o.Z,{userID:n,userRole:a,userEmail:m,teams:d,keys:S,setUserRole:()=>{},setUserEmail:()=>{},setTeams:h,setKeys:Z,premiumUser:f,organizations:w,addKey:e=>{Z(a=>a?[...a,e]:[e]),p(()=>!g)},createClicked:g})})}},12363:function(e,a,n){"use strict";n.d(a,{d:function(){return l},n:function(){return r}});var t=n(2265);let r=()=>{let[e,a]=(0,t.useState)("http://localhost:4000");return(0,t.useEffect)(()=>{{let{protocol:e,host:n}=window.location;a("".concat(e,"//").concat(n))}},[]),e},l=25},30841:function(e,a,n){"use strict";n.d(a,{IE:function(){return l},LO:function(){return r},cT:function(){return s}});var t=n(19250);let r=async e=>{if(!e)return[];try{let{aliases:a}=await (0,t.keyAliasesCall)(e);return Array.from(new Set((a||[]).filter(Boolean)))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},l=async(e,a)=>{if(!e)return[];try{let n=[],r=1,l=!0;for(;l;){let s=await (0,t.teamListCall)(e,a||null,null);n=[...n,...s],r{if(!e)return[];try{let a=[],n=1,r=!0;for(;r;){let l=await (0,t.organizationListCall)(e);a=[...a,...l],n{let{options:a,onApplyFilters:n,onResetFilters:o,initialValues:f={},buttonLabel:m="Filters"}=e,[d,h]=(0,r.useState)(!1),[g,p]=(0,r.useState)(f),[w,y]=(0,r.useState)({}),[v,S]=(0,r.useState)({}),[x,C]=(0,r.useState)({}),[b,E]=(0,r.useState)({}),Z=(0,r.useCallback)(u()(async(e,a)=>{if(a.isSearchable&&a.searchFn){S(e=>({...e,[a.name]:!0}));try{let n=await a.searchFn(e);y(e=>({...e,[a.name]:n}))}catch(e){console.error("Error searching:",e),y(e=>({...e,[a.name]:[]}))}finally{S(e=>({...e,[a.name]:!1}))}}},300),[]),j=(0,r.useCallback)(async e=>{if(e.isSearchable&&e.searchFn&&!b[e.name]){S(a=>({...a,[e.name]:!0})),E(a=>({...a,[e.name]:!0}));try{let a=await e.searchFn("");y(n=>({...n,[e.name]:a}))}catch(a){console.error("Error loading initial options:",a),y(a=>({...a,[e.name]:[]}))}finally{S(a=>({...a,[e.name]:!1}))}}},[b]);(0,r.useEffect)(()=>{d&&a.forEach(e=>{e.isSearchable&&!b[e.name]&&j(e)})},[d,a,j,b]);let N=(e,a)=>{let t={...g,[e]:a};p(t),n(t)},k=(e,a)=>{e&&a.isSearchable&&!b[a.name]&&j(a)};return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,t.jsx)(l.ZP,{icon:(0,t.jsx)(c.Z,{className:"h-4 w-4"}),onClick:()=>h(!d),className:"flex items-center gap-2",children:m}),(0,t.jsx)(l.ZP,{onClick:()=>{let e={};a.forEach(a=>{e[a.name]=""}),p(e),o()},children:"Reset Filters"})]}),d&&(0,t.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-4 mb-6",children:["Team ID","Status","Organization ID","Key Alias","User ID","End User","Key Hash","Model"].map(e=>{let n=a.find(a=>a.label===e||a.name===e);return n?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("label",{className:"text-sm text-gray-600",children:n.label||n.name}),n.isSearchable?(0,t.jsx)(s.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(n.label||n.name,"..."),value:g[n.name]||void 0,onChange:e=>N(n.name,e),onDropdownVisibleChange:e=>k(e,n),onSearch:e=>{C(a=>({...a,[n.name]:e})),n.searchFn&&Z(e,n)},filterOption:!1,loading:v[n.name],options:w[n.name]||[],allowClear:!0,notFoundContent:v[n.name]?"Loading...":"No results found"}):n.options?(0,t.jsx)(s.default,{className:"w-full",placeholder:"Select ".concat(n.label||n.name,"..."),value:g[n.name]||void 0,onChange:e=>N(n.name,e),allowClear:!0,children:n.options.map(e=>(0,t.jsx)(s.default.Option,{value:e.value,children:e.label},e.value))}):(0,t.jsx)(i.default,{className:"w-full",placeholder:"Enter ".concat(n.label||n.name,"..."),value:g[n.name]||"",onChange:e=>N(n.name,e.target.value),allowClear:!0})]},n.name):null})})]})}}},function(e){e.O(0,[3665,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,1264,17,8049,131,2202,874,4292,1739,2971,2117,1744],function(){return e(e.s=4222)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7049],{4222:function(e,a,n){Promise.resolve().then(n.bind(n,2425))},16312:function(e,a,n){"use strict";n.d(a,{z:function(){return t.Z}});var t=n(20831)},10178:function(e,a,n){"use strict";n.d(a,{JO:function(){return t.Z},RM:function(){return l.Z},SC:function(){return o.Z},iA:function(){return r.Z},pj:function(){return s.Z},ss:function(){return i.Z},xs:function(){return c.Z}});var t=n(47323),r=n(21626),l=n(97214),s=n(28241),i=n(58834),c=n(69552),o=n(71876)},11318:function(e,a,n){"use strict";n.d(a,{Z:function(){return i}});var t=n(2265),r=n(80443),l=n(19250);let s=async(e,a,n,t)=>"Admin"!=n&&"Admin Viewer"!=n?await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null,a):await (0,l.teamListCall)(e,(null==t?void 0:t.organization_id)||null);var i=()=>{let[e,a]=(0,t.useState)([]),{accessToken:n,userId:l,userRole:i}=(0,r.Z)();return(0,t.useEffect)(()=>{(async()=>{a(await s(n,l,i,null))})()},[n,l,i]),{teams:e,setTeams:a}}},2425:function(e,a,n){"use strict";n.r(a);var t=n(57437),r=n(2265),l=n(49924),s=n(21623),i=n(29827),c=n(80443),o=n(21739),u=n(11318);a.default=()=>{let{accessToken:e,userRole:a,userId:n,premiumUser:f,userEmail:m}=(0,c.Z)(),{teams:d,setTeams:h}=(0,u.Z)(),[g,p]=(0,r.useState)(!1),[w,y]=(0,r.useState)([]),v=new s.S,{keys:S,isLoading:x,error:C,pagination:b,refresh:E,setKeys:Z}=(0,l.Z)({selectedKeyAlias:null,currentOrg:null,accessToken:e||"",createClicked:g});return(0,t.jsx)(i.aH,{client:v,children:(0,t.jsx)(o.Z,{userID:n,userRole:a,userEmail:m,teams:d,keys:S,setUserRole:()=>{},setUserEmail:()=>{},setTeams:h,setKeys:Z,premiumUser:f,organizations:w,addKey:e=>{Z(a=>a?[...a,e]:[e]),p(()=>!g)},createClicked:g})})}},12363:function(e,a,n){"use strict";n.d(a,{d:function(){return l},n:function(){return r}});var t=n(2265);let r=()=>{let[e,a]=(0,t.useState)("http://localhost:4000");return(0,t.useEffect)(()=>{{let{protocol:e,host:n}=window.location;a("".concat(e,"//").concat(n))}},[]),e},l=25},30841:function(e,a,n){"use strict";n.d(a,{IE:function(){return l},LO:function(){return r},cT:function(){return s}});var t=n(19250);let r=async e=>{if(!e)return[];try{let{aliases:a}=await (0,t.keyAliasesCall)(e);return Array.from(new Set((a||[]).filter(Boolean)))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},l=async(e,a)=>{if(!e)return[];try{let n=[],r=1,l=!0;for(;l;){let s=await (0,t.teamListCall)(e,a||null,null);n=[...n,...s],r{if(!e)return[];try{let a=[],n=1,r=!0;for(;r;){let l=await (0,t.organizationListCall)(e);a=[...a,...l],n{let{options:a,onApplyFilters:n,onResetFilters:o,initialValues:f={},buttonLabel:m="Filters"}=e,[d,h]=(0,r.useState)(!1),[g,p]=(0,r.useState)(f),[w,y]=(0,r.useState)({}),[v,S]=(0,r.useState)({}),[x,C]=(0,r.useState)({}),[b,E]=(0,r.useState)({}),Z=(0,r.useCallback)(u()(async(e,a)=>{if(a.isSearchable&&a.searchFn){S(e=>({...e,[a.name]:!0}));try{let n=await a.searchFn(e);y(e=>({...e,[a.name]:n}))}catch(e){console.error("Error searching:",e),y(e=>({...e,[a.name]:[]}))}finally{S(e=>({...e,[a.name]:!1}))}}},300),[]),j=(0,r.useCallback)(async e=>{if(e.isSearchable&&e.searchFn&&!b[e.name]){S(a=>({...a,[e.name]:!0})),E(a=>({...a,[e.name]:!0}));try{let a=await e.searchFn("");y(n=>({...n,[e.name]:a}))}catch(a){console.error("Error loading initial options:",a),y(a=>({...a,[e.name]:[]}))}finally{S(a=>({...a,[e.name]:!1}))}}},[b]);(0,r.useEffect)(()=>{d&&a.forEach(e=>{e.isSearchable&&!b[e.name]&&j(e)})},[d,a,j,b]);let N=(e,a)=>{let t={...g,[e]:a};p(t),n(t)},k=(e,a)=>{e&&a.isSearchable&&!b[a.name]&&j(a)};return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,t.jsx)(l.ZP,{icon:(0,t.jsx)(c.Z,{className:"h-4 w-4"}),onClick:()=>h(!d),className:"flex items-center gap-2",children:m}),(0,t.jsx)(l.ZP,{onClick:()=>{let e={};a.forEach(a=>{e[a.name]=""}),p(e),o()},children:"Reset Filters"})]}),d&&(0,t.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-4 mb-6",children:["Team ID","Status","Organization ID","Key Alias","User ID","End User","Key Hash","Model"].map(e=>{let n=a.find(a=>a.label===e||a.name===e);return n?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("label",{className:"text-sm text-gray-600",children:n.label||n.name}),n.isSearchable?(0,t.jsx)(s.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(n.label||n.name,"..."),value:g[n.name]||void 0,onChange:e=>N(n.name,e),onDropdownVisibleChange:e=>k(e,n),onSearch:e=>{C(a=>({...a,[n.name]:e})),n.searchFn&&Z(e,n)},filterOption:!1,loading:v[n.name],options:w[n.name]||[],allowClear:!0,notFoundContent:v[n.name]?"Loading...":"No results found"}):n.options?(0,t.jsx)(s.default,{className:"w-full",placeholder:"Select ".concat(n.label||n.name,"..."),value:g[n.name]||void 0,onChange:e=>N(n.name,e),allowClear:!0,children:n.options.map(e=>(0,t.jsx)(s.default.Option,{value:e.value,children:e.label},e.value))}):(0,t.jsx)(i.default,{className:"w-full",placeholder:"Enter ".concat(n.label||n.name,"..."),value:g[n.name]||"",onChange:e=>N(n.name,e.target.value),allowClear:!0})]},n.name):null})})]})}}},function(e){e.O(0,[3665,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,1264,17,8049,131,2202,874,4292,1739,2971,2117,1744],function(){return e(e.s=4222)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-68c2ba55fce8629a.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-68c2ba55fce8629a.js deleted file mode 100644 index edddb673c7..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-68c2ba55fce8629a.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{97731:function(e,s,t){Promise.resolve().then(t.bind(t,50036))},23192:function(e,s,t){"use strict";t.d(s,{Z:function(){return h}});var l=t(57437);t(2265);var a=t(67101),n=t(12485),r=t(18135),i=t(35242),o=t(29706),c=t(77991),d=t(84264),m=t(25653),u=t(96362),x=e=>{let{href:s,className:t}=e;return(0,l.jsxs)("a",{href:s,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(){for(var e=arguments.length,s=Array(e),t=0;t{let{proxySettings:s}=e,t="";return(null==s?void 0:s.PROXY_BASE_URL)!==void 0&&(null==s?void 0:s.PROXY_BASE_URL)&&(t=s.PROXY_BASE_URL),(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(a.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,l.jsx)(x,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,l.jsxs)(d.Z,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,l.jsxs)(r.Z,{children:[(0,l.jsxs)(i.Z,{children:[(0,l.jsx)(n.Z,{children:"OpenAI Python SDK"}),(0,l.jsx)(n.Z,{children:"LlamaIndex"}),(0,l.jsx)(n.Z,{children:"Langchain Py"})]}),(0,l.jsxs)(c.Z,{children:[(0,l.jsx)(o.Z,{children:(0,l.jsx)(m.Z,{language:"python",code:'import openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(t,'" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)')})}),(0,l.jsx)(o.Z,{children:(0,l.jsx)(m.Z,{language:"python",code:'import os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="'.concat(t,'", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="').concat(t,'",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)')})}),(0,l.jsx)(o.Z,{children:(0,l.jsx)(m.Z,{language:"python",code:'from langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="'.concat(t,'",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)')})})]})]})]})})})}},25653:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(30401),r=t(5136),i=t(17906),o=t(1479);s.Z=e=>{let{code:s,language:t}=e,[c,d]=(0,a.useState)(!1);return(0,l.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,l.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(s),d(!0),setTimeout(()=>d(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:c?(0,l.jsx)(n.Z,{size:16}):(0,l.jsx)(r.Z,{size:16})}),(0,l.jsx)(i.Z,{language:t,style:o.Z,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:s})]})}},50036:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return sS}});var l=t(57437),a=t(2265),n=t(99376),r=t(14474),i=t(21623),o=t(29827),c=t(65373),d=t(69734),m=t(21739),u=t(37801),x=t(77155),h=t(22004),p=t(90773),g=t(6925),j=t(85809),f=t(10607),y=t(49104),b=t(33801),v=t(18160),_=t(62306),Z=t(23192),w=t(31052),N=t(18143),k=t(44696),S=t(19250),C=t(63298),T=t(30603),z=t(6674),A=t(30874),L=t(39210),D=t(21307),P=t(42273),I=t(6204),E=t(5183),O=t(20831),M=t(12485),R=t(18135),F=t(35242),B=t(29706),U=t(77991),V=t(84264),q=t(96761),K=t(13634),H=t(82680),W=t(9114),J=t(42673);let Y=e=>{let s=Object.keys(J.fK).find(s=>J.fK[s]===e);if(s){let e=J.Cl[s],t=J.cd[e];return{displayName:e,logo:t,enumKey:s}}return{displayName:e,logo:"",enumKey:null}},G=e=>J.fK[e]||null,X=(e,s)=>{let t=e.target,l=t.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=s.charAt(0),l.replaceChild(e,t)}};var $=t(47323),Q=t(49566),ee=t(82422),es=t(3837),et=t(53410),el=t(74998),ea=t(21626),en=t(97214),er=t(28241),ei=t(58834),eo=t(69552),ec=t(71876);function ed(e){let{data:s,columns:t,isLoading:a=!1,loadingMessage:n="Loading...",emptyMessage:r="No data",getRowKey:i}=e;return(0,l.jsxs)(ea.Z,{children:[(0,l.jsx)(ei.Z,{children:(0,l.jsx)(ec.Z,{children:t.map((e,s)=>(0,l.jsx)(eo.Z,{style:{width:e.width},children:e.header},s))})}),(0,l.jsx)(en.Z,{children:a?(0,l.jsx)(ec.Z,{children:(0,l.jsx)(er.Z,{colSpan:t.length,className:"text-center",children:(0,l.jsx)(V.Z,{className:"text-gray-500",children:n})})}):s.length>0?s.map((e,s)=>(0,l.jsx)(ec.Z,{children:t.map((s,t)=>{var a;return(0,l.jsx)(er.Z,{children:s.cell?s.cell(e):String(null!==(a=e[s.accessor])&&void 0!==a?a:"")},t)})},i?i(e,s):s)):(0,l.jsx)(ec.Z,{children:(0,l.jsx)(er.Z,{colSpan:t.length,className:"text-center",children:(0,l.jsx)(V.Z,{className:"text-gray-500",children:r})})})})]})}var em=e=>{let{discountConfig:s,onDiscountChange:t,onRemoveProvider:n}=e,[r,i]=(0,a.useState)(null),[o,c]=(0,a.useState)(""),d=(e,s)=>{i(e),c((100*s).toString())},m=e=>{let s=parseFloat(o);!isNaN(s)&&s>=0&&s<=100&&t(e,(s/100).toString()),i(null),c("")},u=()=>{i(null),c("")},x=(e,s)=>{"Enter"===e.key?m(s):"Escape"===e.key&&u()},h=Object.entries(s).map(e=>{let[s,t]=e;return{provider:s,discount:t}}).sort((e,s)=>{let t=Y(e.provider).displayName,l=Y(s.provider).displayName;return t.localeCompare(l)});return(0,l.jsx)(ed,{data:h,columns:[{header:"Provider",cell:e=>{let{displayName:s,logo:t}=Y(e.provider);return(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,l.jsx)("img",{src:t,alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>X(e,s)}),(0,l.jsx)("span",{className:"font-medium",children:s})]})}},{header:"Discount Percentage",cell:e=>(0,l.jsx)("div",{className:"flex items-center gap-2",children:r===e.provider?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.Z,{value:o,onValueChange:c,onKeyDown:s=>x(s,e.provider),placeholder:"5",className:"w-20",autoFocus:!0}),(0,l.jsx)("span",{className:"text-gray-600",children:"%"}),(0,l.jsx)($.Z,{icon:ee.Z,size:"sm",onClick:()=>m(e.provider),className:"cursor-pointer text-green-600 hover:text-green-700"}),(0,l.jsx)($.Z,{icon:es.Z,size:"sm",onClick:u,className:"cursor-pointer text-gray-600 hover:text-gray-700"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(V.Z,{className:"font-medium",children:[(100*e.discount).toFixed(1),"%"]}),(0,l.jsx)($.Z,{icon:et.Z,size:"sm",onClick:()=>d(e.provider,e.discount),className:"cursor-pointer text-blue-600 hover:text-blue-700"})]})}),width:"250px"},{header:"Actions",cell:e=>{let{displayName:s}=Y(e.provider);return(0,l.jsx)($.Z,{icon:el.Z,size:"sm",onClick:()=>n(e.provider,s),className:"cursor-pointer hover:text-red-600"})},width:"80px"}],getRowKey:e=>e.provider,emptyMessage:"No provider discounts configured"})},eu=t(64504),ex=t(89970),eh=t(52787),ep=t(15424),eg=t(33145),ej=e=>{let{discountConfig:s,selectedProvider:t,newDiscount:a,onProviderChange:n,onDiscountChange:r,onAddProvider:i}=e;return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Provider",(0,l.jsx)(ex.Z,{title:"Select the LLM provider you want to configure a discount for",children:(0,l.jsx)(ep.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(eh.default,{showSearch:!0,placeholder:"Select provider",value:t,onChange:n,style:{width:"100%"},size:"large",optionFilterProp:"children",filterOption:(e,s)=>{var t;return String(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},children:Object.entries(J.Cl).map(e=>{let[t,a]=e,n=J.fK[t];return n&&s[n]?null:(0,l.jsx)(eh.default.Option,{value:t,label:a,children:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(eg.default,{src:J.cd[a],alt:"".concat(t," logo"),width:20,height:20,className:"w-5 h-5",onError:e=>X(e,a)}),(0,l.jsx)("span",{children:a})]})},t)})})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Discount Percentage",(0,l.jsx)(ex.Z,{title:"Enter a percentage value (e.g., 5 for 5% discount)",children:(0,l.jsx)(ep.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),rules:[{required:!0,message:"Please enter a discount percentage"}],children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(eu.o,{placeholder:"5",value:a,onValueChange:r,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 flex-1"}),(0,l.jsx)("span",{className:"text-gray-600",children:"%"})]})}),(0,l.jsx)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:(0,l.jsx)(eu.z,{variant:"primary",onClick:i,disabled:!t||!a,children:"Add Provider Discount"})})]})},ef=t(29271),ey=t(40875),eb=t(96362);let ev=e=>{let{items:s,children:t="Docs",className:n=""}=e,[r,i]=(0,a.useState)(!1),o=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&i(!1)};return r&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[r]),(0,l.jsxs)("div",{className:"relative inline-block ".concat(n),ref:o,children:[(0,l.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"inline-flex items-center gap-1 text-gray-500 hover:text-gray-700 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded px-2 py-1","aria-expanded":r,"aria-haspopup":"true",children:[(0,l.jsx)("span",{children:t}),(0,l.jsx)(ey.Z,{className:"h-3 w-3 transition-transform ".concat(r?"rotate-180":""),"aria-hidden":"true"})]}),r&&(0,l.jsx)("div",{className:"absolute right-0 mt-1 w-56 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50",children:s.map((e,s)=>(0,l.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",onClick:()=>i(!1),children:[(0,l.jsx)("span",{children:e.label}),(0,l.jsx)(eb.Z,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0 ml-2","aria-hidden":"true"})]},s))})]})};var e_=t(56522),eZ=t(25653),ew=()=>{let[e,s]=(0,a.useState)(""),[t,n]=(0,a.useState)(""),r=(0,a.useMemo)(()=>{let s=parseFloat(e),l=parseFloat(t);if(isNaN(s)||isNaN(l)||0===s||0===l)return null;let a=s+l;return{originalCost:a.toFixed(10),finalCost:s.toFixed(10),discountAmount:l.toFixed(10),discountPercentage:(l/a*100).toFixed(2)}},[e,t]);return(0,l.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-1",children:"Cost Calculation"}),(0,l.jsxs)(e_.x,{className:"text-xs text-gray-600",children:["Discounts are applied to provider costs: ",(0,l.jsx)("code",{className:"bg-gray-100 px-1.5 py-0.5 rounded text-xs",children:"final_cost = base_cost \xd7 (1 - discount%/100)"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-1",children:"Example"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"A 5% discount on a $10.00 request results in: $10.00 \xd7 (1 - 0.05) = $9.50"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-1",children:"Valid Range"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Discount percentages must be between 0% and 100%"})]}),(0,l.jsxs)("div",{className:"pt-4 border-t border-gray-200",children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-2",children:"Validating Discounts"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600 mb-3",children:"Make a test request and check the response headers to verify discounts are applied:"}),(0,l.jsx)(eZ.Z,{language:"bash",code:'curl -X POST -i http://your-proxy:4000/chat/completions \\\n -H "Content-Type: application/json" \\\n -H "Authorization: Bearer sk-1234" \\\n -d \'{\n "model": "gemini/gemini-2.5-pro",\n "messages": [{"role": "user", "content": "Hello"}]\n }\''}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600 mt-3 mb-2",children:"Look for these headers in the response:"}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded text-xs font-mono text-gray-800 whitespace-nowrap",children:"x-litellm-response-cost"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Final cost after discount"})]}),(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded text-xs font-mono text-gray-800 whitespace-nowrap",children:"x-litellm-response-cost-original"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Original cost before discount"})]}),(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded text-xs font-mono text-gray-800 whitespace-nowrap",children:"x-litellm-response-cost-discount-amount"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Amount discounted"})]})]})]}),(0,l.jsxs)("div",{className:"pt-4 border-t border-gray-200",children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-3",children:"Discount Calculator"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600 mb-3",children:"Enter values from your response headers to verify the discount:"}),(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Response Cost (x-litellm-response-cost)"}),(0,l.jsx)(e_.o,{placeholder:"0.0171938125",value:e,onValueChange:s,className:"text-sm"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Discount Amount (x-litellm-response-cost-discount-amount)"}),(0,l.jsx)(e_.o,{placeholder:"0.0009049375",value:t,onValueChange:n,className:"text-sm"})]})]}),r&&(0,l.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,l.jsx)(e_.x,{className:"text-sm font-medium text-blue-900 mb-2",children:"Calculated Results"}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(e_.x,{className:"text-xs text-blue-800",children:"Original Cost:"}),(0,l.jsxs)("code",{className:"text-xs font-mono text-blue-900",children:["$",r.originalCost]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(e_.x,{className:"text-xs text-blue-800",children:"Final Cost:"}),(0,l.jsxs)("code",{className:"text-xs font-mono text-blue-900",children:["$",r.finalCost]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(e_.x,{className:"text-xs text-blue-800",children:"Discount Amount:"}),(0,l.jsxs)("code",{className:"text-xs font-mono text-blue-900",children:["$",r.discountAmount]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-blue-300",children:[(0,l.jsx)(e_.x,{className:"text-xs font-semibold text-blue-900",children:"Discount Applied:"}),(0,l.jsxs)(e_.x,{className:"text-sm font-bold text-blue-900",children:[r.discountPercentage,"%"]})]})]})]})]})]})};let eN=[{label:"Custom pricing for models",href:"https://docs.litellm.ai/docs/proxy/custom_pricing"},{label:"Spend tracking",href:"https://docs.litellm.ai/docs/proxy/cost_tracking"}];var ek=e=>{let{userID:s,userRole:t,accessToken:n}=e,[r,i]=(0,a.useState)({}),[o,c]=(0,a.useState)(void 0),[d,m]=(0,a.useState)(""),[u,x]=(0,a.useState)(!0),[h,p]=(0,a.useState)(!1),[g]=K.Z.useForm(),[j,f]=H.Z.useModal();(0,a.useEffect)(()=>{n&&y()},[n]);let y=async()=>{x(!0);try{let e=(0,S.getProxyBaseUrl)(),s=await fetch(e?"".concat(e,"/config/cost_discount_config"):"/config/cost_discount_config",{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(s.ok){let e=await s.json();i(e.values||{})}else console.error("Failed to fetch discount config")}catch(e){console.error("Error fetching discount config:",e),W.Z.fromBackend("Failed to fetch discount configuration")}finally{x(!1)}},b=async e=>{try{let t=(0,S.getProxyBaseUrl)(),l=await fetch(t?"".concat(t,"/config/cost_discount_config"):"/config/cost_discount_config",{method:"PATCH",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(e)});if(l.ok)W.Z.success("Discount configuration updated successfully"),await y();else{var s;let e=await l.json(),t=(null===(s=e.detail)||void 0===s?void 0:s.error)||e.detail||"Failed to update settings";W.Z.fromBackend(t)}}catch(e){console.error("Error updating discount config:",e),W.Z.fromBackend("Failed to update discount configuration")}},v=async()=>{if(!o||!d){W.Z.fromBackend("Please select a provider and enter discount percentage");return}let e=parseFloat(d);if(isNaN(e)||e<0||e>100){W.Z.fromBackend("Discount must be between 0% and 100%");return}let s=G(o);if(!s){W.Z.fromBackend("Invalid provider selected");return}if(r[s]){W.Z.fromBackend("Discount for ".concat(J.Cl[o]," already exists. Edit it in the table above."));return}let t={...r,[s]:e/100};i(t),await b(t),c(void 0),m(""),p(!1)},_=async(e,s)=>{j.confirm({title:"Remove Provider Discount",icon:(0,l.jsx)(ef.Z,{}),content:"Are you sure you want to remove the discount for ".concat(s,"?"),okText:"Remove",okType:"danger",cancelText:"Cancel",onOk:async()=>{let s={...r};delete s[e],i(s),await b(s)}})},Z=async(e,s)=>{let t=parseFloat(s);if(!isNaN(t)&&t>=0&&t<=1){let s={...r,[e]:t};i(s),await b(s)}};return n?(0,l.jsxs)("div",{className:"w-full p-8",children:[f,(0,l.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between mb-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(q.Z,{children:"Cost Tracking Settings"}),(0,l.jsx)(ev,{items:eN})]}),(0,l.jsx)(V.Z,{className:"text-gray-500 mt-1",children:"Configure cost discounts for different LLM providers. Changes are saved automatically."})]}),(0,l.jsx)(O.Z,{onClick:()=>p(!0),className:"mt-4 md:mt-0",children:"+ Add Provider Discount"})]}),(0,l.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full",children:(0,l.jsxs)(R.Z,{children:[(0,l.jsxs)(F.Z,{className:"px-6 pt-4",children:[(0,l.jsx)(M.Z,{children:"Provider Discounts"}),(0,l.jsx)(M.Z,{children:"Test It"})]}),(0,l.jsxs)(U.Z,{children:[(0,l.jsx)(B.Z,{children:u?(0,l.jsx)("div",{className:"py-12 text-center",children:(0,l.jsx)(V.Z,{className:"text-gray-500",children:"Loading configuration..."})}):Object.keys(r).length>0?(0,l.jsx)("div",{className:"p-6",children:(0,l.jsx)(em,{discountConfig:r,onDiscountChange:Z,onRemoveProvider:_})}):(0,l.jsxs)("div",{className:"py-16 px-6 text-center",children:[(0,l.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-400 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,l.jsx)(V.Z,{className:"text-gray-700 font-medium mb-2",children:"No provider discounts configured"}),(0,l.jsx)(V.Z,{className:"text-gray-500 text-sm",children:'Click "Add Provider Discount" to get started'})]})}),(0,l.jsx)(B.Z,{children:(0,l.jsx)("div",{className:"px-6 pb-4",children:(0,l.jsx)(ew,{})})})]})]})}),(0,l.jsx)(H.Z,{title:(0,l.jsx)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Provider Discount"})}),open:h,width:1e3,onCancel:()=>{p(!1),g.resetFields(),c(void 0),m("")},footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,l.jsxs)("div",{className:"mt-6",children:[(0,l.jsx)(V.Z,{className:"text-sm text-gray-600 mb-6",children:"Select a provider and set its discount percentage. Enter a value between 0% and 100% (e.g., 5 for a 5% discount)."}),(0,l.jsx)(K.Z,{form:g,onFinish:e=>{v()},layout:"vertical",className:"space-y-6",children:(0,l.jsx)(ej,{discountConfig:r,selectedProvider:o,newDiscount:d,onProviderChange:c,onDiscountChange:m,onAddProvider:v})})]})})]}):null},eS=t(91323),eC=t(10012),eT=t(31857),ez=t(19226),eA=t(45937),eL=t(92403),eD=t(28595),eP=t(68208),eI=t(9775),eE=t(41361),eO=t(37527),eM=t(15883),eR=t(12660),eF=t(88009),eB=t(48231),eU=t(57400),eV=t(58630),eq=t(44625),eK=t(41169),eH=t(38434),eW=t(71891),eJ=t(55322),eY=t(11429),eG=t(20347),eX=t(79262),e$=t(13959);let{Sider:eQ}=ez.default;var e0=e=>{let{accessToken:s,setPage:t,userRole:a,defaultSelectedKey:n,collapsed:r=!1}=e,i=[{key:"1",page:"api-keys",label:"Virtual Keys",icon:(0,l.jsx)(eL.Z,{style:{fontSize:"18px"}})},{key:"3",page:"llm-playground",label:"Test Key",icon:(0,l.jsx)(eD.Z,{style:{fontSize:"18px"}}),roles:eG.LQ},{key:"2",page:"models",label:"Models + Endpoints",icon:(0,l.jsx)(eP.Z,{style:{fontSize:"18px"}}),roles:eG.LQ},{key:"12",page:"new_usage",label:"Usage",icon:(0,l.jsx)(eI.Z,{style:{fontSize:"18px"}}),roles:[...eG.ZL,...eG.lo]},{key:"6",page:"teams",label:"Teams",icon:(0,l.jsx)(eE.Z,{style:{fontSize:"18px"}})},{key:"17",page:"organizations",label:"Organizations",icon:(0,l.jsx)(eO.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"5",page:"users",label:"Internal Users",icon:(0,l.jsx)(eM.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"14",page:"api_ref",label:"API Reference",icon:(0,l.jsx)(eR.Z,{style:{fontSize:"18px"}})},{key:"16",page:"model-hub-table",label:"Model Hub",icon:(0,l.jsx)(eF.Z,{style:{fontSize:"18px"}})},{key:"15",page:"logs",label:"Logs",icon:(0,l.jsx)(eB.Z,{style:{fontSize:"18px"}})},{key:"11",page:"guardrails",label:"Guardrails",icon:(0,l.jsx)(eU.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"26",page:"tools",label:"Tools",icon:(0,l.jsx)(eV.Z,{style:{fontSize:"18px"}}),children:[{key:"18",page:"mcp-servers",label:"MCP Servers",icon:(0,l.jsx)(eV.Z,{style:{fontSize:"18px"}})},{key:"21",page:"vector-stores",label:"Vector Stores",icon:(0,l.jsx)(eq.Z,{style:{fontSize:"18px"}}),roles:eG.ZL}]},{key:"experimental",page:"experimental",label:"Experimental",icon:(0,l.jsx)(eK.Z,{style:{fontSize:"18px"}}),children:[{key:"9",page:"caching",label:"Caching",icon:(0,l.jsx)(eq.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"25",page:"prompts",label:"Prompts",icon:(0,l.jsx)(eH.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"10",page:"budgets",label:"Budgets",icon:(0,l.jsx)(eO.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"20",page:"transform-request",label:"API Playground",icon:(0,l.jsx)(eR.Z,{style:{fontSize:"18px"}}),roles:[...eG.ZL,...eG.lo]},{key:"19",page:"tag-management",label:"Tag Management",icon:(0,l.jsx)(eW.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"4",page:"usage",label:"Old Usage",icon:(0,l.jsx)(eI.Z,{style:{fontSize:"18px"}})}]},{key:"settings",page:"settings",label:"Settings",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL,children:[{key:"11",page:"general-settings",label:"Router Settings",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"8",page:"settings",label:"Logging & Alerts",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"13",page:"admin-panel",label:"Admin Settings",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"27",page:"cost-tracking-settings",label:"Cost Tracking",icon:(0,l.jsx)(eI.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"14",page:"ui-theme",label:"UI Theme",icon:(0,l.jsx)(eY.Z,{style:{fontSize:"18px"}}),roles:eG.ZL}]}],o=(e=>{let s=i.find(s=>s.page===e);if(s)return s.key;for(let s of i)if(s.children){let t=s.children.find(s=>s.page===e);if(t)return t.key}return"1"})(n),c=i.filter(e=>{let s=!e.roles||e.roles.includes(a);return console.log("Menu item ".concat(e.label,": roles=").concat(e.roles,", userRole=").concat(a,", hasAccess=").concat(s)),!!s&&(e.children&&(e.children=e.children.filter(e=>!e.roles||e.roles.includes(a))),!0)});return(0,l.jsx)(ez.default,{style:{minHeight:"100vh"},children:(0,l.jsxs)(eQ,{theme:"light",width:220,collapsed:r,collapsedWidth:80,collapsible:!0,trigger:null,style:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative"},children:[(0,l.jsx)(e$.ZP,{theme:{components:{Menu:{iconSize:18,fontSize:14}}},children:(0,l.jsx)(eA.Z,{mode:"inline",selectedKeys:[o],defaultOpenKeys:r?[]:["llm-tools"],inlineCollapsed:r,className:"custom-sidebar-menu",style:{borderRight:0,backgroundColor:"transparent",fontSize:"14px"},items:c.map(e=>{var s;return{key:e.key,icon:e.icon,label:e.label,children:null===(s=e.children)||void 0===s?void 0:s.map(e=>({key:e.key,icon:e.icon,label:e.label,onClick:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}})),onClick:e.children?void 0:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}}})})}),(0,eG.tY)(a)&&!r&&(0,l.jsx)(eX.Z,{accessToken:s,width:220})]})})},e1=t(92019),e2=t(39760),e4=e=>{let{setPage:s,defaultSelectedKey:t,sidebarCollapsed:a}=e,{refactoredUIFlag:n}=(0,eT.Z)(),{accessToken:r,userRole:i}=(0,e2.Z)();return n?(0,l.jsx)(e1.Z,{accessToken:r,defaultSelectedKey:t,userRole:i}):(0,l.jsx)(e0,{accessToken:r,setPage:s,userRole:i,defaultSelectedKey:t,collapsed:a})},e5=t(93192),e3=t(23628),e8=t(86462),e6=t(47686),e7=t(64482),e9=t(73002),se=t(24199),ss=t(46468),st=t(25512),sl=t(33293),sa=t(88904),sn=t(87452),sr=t(88829),si=t(72208),so=t(41649),sc=t(12514),sd=t(49804),sm=t(67101),su=t(918),sx=t(97415),sh=t(2597),sp=t(59872),sg=t(32489),sj=t(76865),sf=t(95920),sy=t(68473),sb=t(51750);let sv=(e,s)=>{let t=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),t=e.models):t=s,(0,ss.Ob)(t,s)};var s_=e=>{let{teams:s,searchParams:t,accessToken:n,setTeams:r,userID:i,userRole:o,organizations:c,premiumUser:d=!1}=e,[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(null),[p,g]=(0,a.useState)(null),[j,f]=(0,a.useState)(!1),[y,b]=(0,a.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"});(0,a.useEffect)(()=>{console.log("inside useeffect - ".concat(m)),n&&(0,L.Z)(n,i,o,x,r),eB()},[m]);let[v]=K.Z.useForm(),[_]=K.Z.useForm(),{Title:Z,Paragraph:w}=e5.default,[N,k]=(0,a.useState)(""),[C,T]=(0,a.useState)(!1),[z,A]=(0,a.useState)(null),[D,P]=(0,a.useState)(null),[I,E]=(0,a.useState)(!1),[q,J]=(0,a.useState)(!1),[Y,G]=(0,a.useState)(!1),[X,ee]=(0,a.useState)(!1),[es,ed]=(0,a.useState)([]),[em,eu]=(0,a.useState)(!1),[eg,ej]=(0,a.useState)(null),[ef,ey]=(0,a.useState)([]),[eb,ev]=(0,a.useState)({}),[e_,eZ]=(0,a.useState)([]),[ew,eN]=(0,a.useState)({}),[ek,eS]=(0,a.useState)([]),[eC,eT]=(0,a.useState)([]),[ez,eA]=(0,a.useState)(!1),[eL,eD]=(0,a.useState)(""),[eP,eI]=(0,a.useState)({});(0,a.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(p));let e=sv(p,es);console.log("models: ".concat(e)),ey(e),v.setFieldValue("models",[])},[p,es]),(0,a.useEffect)(()=>{(async()=>{try{if(null==n)return;let e=(await (0,S.getGuardrailsList)(n)).guardrails.map(e=>e.guardrail_name);eZ(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[n]);let eE=async()=>{try{if(null==n)return;let e=await (0,S.fetchMCPAccessGroups)(n);eT(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,a.useEffect)(()=>{eE()},[n]),(0,a.useEffect)(()=>{s&&ev(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let eO=async e=>{ej(e),eu(!0)},eM=async()=>{if(null!=eg&&null!=s&&null!=n){try{await (0,S.teamDeleteCall)(n,eg),(0,L.Z)(n,i,o,x,r)}catch(e){console.error("Error deleting the team:",e)}eu(!1),ej(null)}},eR=()=>{eu(!1),ej(null)};(0,a.useEffect)(()=>{(async()=>{try{if(null===i||null===o||null===n)return;let e=await (0,ss.K2)(i,o,n);e&&ed(e)}catch(e){console.error("Error fetching user models:",e)}})()},[n,i,o,s]);let eF=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=n){var t,l,a;let i=null==e?void 0:e.team_alias,o=null!==(a=null==s?void 0:s.map(e=>e.team_alias))&&void 0!==a?a:[],c=(null==e?void 0:e.organization_id)||(null==x?void 0:x.organization_id);if(""===c||"string"!=typeof c?e.organization_id=null:e.organization_id=c.trim(),o.includes(i))throw Error("Team alias ".concat(i," already exists, please pick another alias"));if(W.Z.info("Creating Team"),ek.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:ek.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0||e.allowed_mcp_servers_and_groups.toolPermissions)){if(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.mcp_tool_permissions&&Object.keys(e.mcp_tool_permissions).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=e.mcp_tool_permissions,delete e.mcp_tool_permissions)}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(eP).length>0&&(e.model_aliases=eP);let d=await (0,S.teamCreateCall)(n,e);null!==s?r([...s,d]):r([d]),console.log("response for team create call: ".concat(d)),W.Z.success("Team created"),v.resetFields(),eS([]),eI({}),J(!1)}}catch(e){console.error("Error creating the team:",e),W.Z.fromBackend("Error creating the team: "+e)}},eB=()=>{u(new Date().toLocaleString())},eU=(e,s)=>{let t={...y,[e]:s};b(t),n&&(0,S.v2TeamListCall)(n,t.organization_id||null,null,t.team_id||null,t.team_alias||null).then(e=>{e&&e.teams&&r(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})};return(0,l.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,l.jsx)(sm.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,l.jsxs)(sd.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==o||"Org Admin"==o)&&(0,l.jsx)(O.Z,{className:"w-fit",onClick:()=>J(!0),children:"+ Create New Team"}),D?(0,l.jsx)(sl.Z,{teamId:D,onUpdate:e=>{r(s=>{if(null==s)return s;let t=s.map(s=>e.team_id===s.team_id?(0,sp.nl)(s,e):s);return n&&(0,L.Z)(n,i,o,x,r),t})},onClose:()=>{P(null),E(!1)},accessToken:n,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;se.team_id===D)),is_proxy_admin:"Admin"==o,userModels:es,editTeam:I}):(0,l.jsxs)(R.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,l.jsxs)(F.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(M.Z,{children:"Your Teams"}),(0,l.jsx)(M.Z,{children:"Available Teams"}),(0,eG.tY)(o||"")&&(0,l.jsx)(M.Z,{children:"Default Team Settings"})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,l.jsxs)(V.Z,{children:["Last Refreshed: ",m]}),(0,l.jsx)($.Z,{icon:e3.Z,variant:"shadow",size:"xs",className:"self-center",onClick:eB})]})]}),(0,l.jsxs)(U.Z,{children:[(0,l.jsxs)(B.Z,{children:[(0,l.jsxs)(V.Z,{children:["Click on “Team ID” to view team details ",(0,l.jsx)("b",{children:"and"})," manage team members."]}),(0,l.jsx)(sm.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,l.jsx)(sd.Z,{numColSpan:1,children:(0,l.jsxs)(sc.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,l.jsx)("div",{className:"border-b px-6 py-4",children:(0,l.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,l.jsxs)("div",{className:"relative w-64",children:[(0,l.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:y.team_alias,onChange:e=>eU("team_alias",e.target.value)}),(0,l.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,l.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(j?"bg-gray-100":""),onClick:()=>f(!j),children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(y.team_id||y.team_alias||y.organization_id)&&(0,l.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,l.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{b({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),n&&(0,S.v2TeamListCall)(n,null,i||null,null,null).then(e=>{e&&e.teams&&r(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),j&&(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,l.jsxs)("div",{className:"relative w-64",children:[(0,l.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:y.team_id,onChange:e=>eU("team_id",e.target.value)}),(0,l.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,l.jsx)("div",{className:"w-64",children:(0,l.jsx)(st.P,{value:y.organization_id||"",onValueChange:e=>eU("organization_id",e),placeholder:"Select Organization",children:null==c?void 0:c.map(e=>(0,l.jsx)(st.Q,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})}),(0,l.jsxs)(ea.Z,{children:[(0,l.jsx)(ei.Z,{children:(0,l.jsxs)(ec.Z,{children:[(0,l.jsx)(eo.Z,{children:"Team Name"}),(0,l.jsx)(eo.Z,{children:"Team ID"}),(0,l.jsx)(eo.Z,{children:"Created"}),(0,l.jsx)(eo.Z,{children:"Spend (USD)"}),(0,l.jsx)(eo.Z,{children:"Budget (USD)"}),(0,l.jsx)(eo.Z,{children:"Models"}),(0,l.jsx)(eo.Z,{children:"Organization"}),(0,l.jsx)(eo.Z,{children:"Info"})]})}),(0,l.jsx)(en.Z,{children:s&&s.length>0?s.filter(e=>!x||e.organization_id===x.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,l.jsxs)(ec.Z,{children:[(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,l.jsx)(er.Z,{children:(0,l.jsx)("div",{className:"overflow-hidden",children:(0,l.jsx)(ex.Z,{title:e.team_id,children:(0,l.jsxs)(O.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{P(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,sp.pw)(e.spend,4)}),(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,l.jsx)(er.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,l.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,l.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,l.jsx)(so.Z,{size:"xs",className:"mb-1",color:"red",children:(0,l.jsx)(V.Z,{children:"All Proxy Models"})}):(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,l.jsx)("div",{children:(0,l.jsx)($.Z,{icon:ew[e.team_id]?e8.Z:e6.Z,className:"cursor-pointer",size:"xs",onClick:()=>{eN(s=>({...s,[e.team_id]:!s[e.team_id]}))}})}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,l.jsx)(so.Z,{size:"xs",color:"red",children:(0,l.jsx)(V.Z,{children:"All Proxy Models"})},s):(0,l.jsx)(so.Z,{size:"xs",color:"blue",children:(0,l.jsx)(V.Z,{children:e.length>30?"".concat((0,ss.W0)(e).slice(0,30),"..."):(0,ss.W0)(e)})},s)),e.models.length>3&&!ew[e.team_id]&&(0,l.jsx)(so.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,l.jsxs)(V.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),ew[e.team_id]&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,l.jsx)(so.Z,{size:"xs",color:"red",children:(0,l.jsx)(V.Z,{children:"All Proxy Models"})},s+3):(0,l.jsx)(so.Z,{size:"xs",color:"blue",children:(0,l.jsx)(V.Z,{children:e.length>30?"".concat((0,ss.W0)(e).slice(0,30),"..."):(0,ss.W0)(e)})},s+3))})]})]})})}):null})}),(0,l.jsx)(er.Z,{children:e.organization_id}),(0,l.jsxs)(er.Z,{children:[(0,l.jsxs)(V.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].keys&&eb[e.team_id].keys.length," ","Keys"]}),(0,l.jsxs)(V.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].team_info&&eb[e.team_id].team_info.members_with_roles&&eb[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,l.jsx)(er.Z,{children:"Admin"==o?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)($.Z,{icon:et.Z,size:"sm",onClick:()=>{P(e.team_id),E(!0)}}),(0,l.jsx)($.Z,{onClick:()=>eO(e.team_id),icon:el.Z,size:"sm"})]}):null})]},e.team_id)):null})]}),em&&(()=>{var e;let t=null==s?void 0:s.find(e=>e.team_id===eg),a=(null==t?void 0:t.team_alias)||"",n=(null==t?void 0:null===(e=t.keys)||void 0===e?void 0:e.length)||0,r=eL===a;return(0,l.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,l.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Team"}),(0,l.jsx)("button",{onClick:()=>{eR(),eD("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,l.jsx)(sg.Z,{size:20})})]}),(0,l.jsxs)("div",{className:"px-6 py-4",children:[n>0&&(0,l.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,l.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,l.jsx)(sj.Z,{size:20})}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{className:"text-base font-medium text-red-600",children:["Warning: This team has ",n," associated key",n>1?"s":"","."]}),(0,l.jsx)("p",{className:"text-base text-red-600 mt-2",children:"Deleting the team will also delete all associated keys. This action is irreversible."})]})]}),(0,l.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to force delete this team and all its keys?"}),(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,l.jsx)("span",{className:"underline",children:a})," to confirm deletion:"]}),(0,l.jsx)("input",{type:"text",value:eL,onChange:e=>eD(e.target.value),placeholder:"Enter team name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,l.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,l.jsx)("button",{onClick:()=>{eR(),eD("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,l.jsx)("button",{onClick:eM,disabled:!r,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(r?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Force Delete"})]})]})})})()]})})})]}),(0,l.jsx)(B.Z,{children:(0,l.jsx)(su.Z,{accessToken:n,userID:i})}),(0,eG.tY)(o||"")&&(0,l.jsx)(B.Z,{children:(0,l.jsx)(sa.Z,{accessToken:n,userID:i||"",userRole:o||""})})]})]}),("Admin"==o||"Org Admin"==o)&&(0,l.jsx)(H.Z,{title:"Create Team",visible:q,width:1e3,footer:null,onOk:()=>{J(!1),v.resetFields(),eS([]),eI({})},onCancel:()=>{J(!1),v.resetFields(),eS([]),eI({})},children:(0,l.jsxs)(K.Z,{form:v,onFinish:eF,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(K.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,l.jsx)(Q.Z,{placeholder:""})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Organization"," ",(0,l.jsx)(ex.Z,{title:(0,l.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,l.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:x?x.organization_id:null,className:"mt-8",children:(0,l.jsx)(eh.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{v.setFieldValue("organization_id",e),g((null==c?void 0:c.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var t;return!!s&&((null===(t=s.children)||void 0===t?void 0:t.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==c?void 0:c.map(e=>(0,l.jsxs)(eh.default.Option,{value:e.organization_id,children:[(0,l.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,l.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Models"," ",(0,l.jsx)(ex.Z,{title:"These are the models that your selected team has access to",children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,l.jsxs)(eh.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,l.jsx)(eh.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),ef.map(e=>(0,l.jsx)(eh.default.Option,{value:e,children:(0,ss.W0)(e)},e))]})}),(0,l.jsx)(K.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(se.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(K.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(eh.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(eh.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(eh.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(eh.default.Option,{value:"30d",children:"monthly"})]})}),(0,l.jsx)(K.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsx)(K.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsxs)(sn.Z,{className:"mt-20 mb-8",onClick:()=>{ez||(eE(),eA(!0))},children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"Additional Settings"})}),(0,l.jsxs)(sr.Z,{children:[(0,l.jsx)(K.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,l.jsx)(Q.Z,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,l.jsx)(K.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,l.jsx)(se.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(K.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,l.jsx)(Q.Z,{placeholder:"e.g., 30d"})}),(0,l.jsx)(K.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsx)(K.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsx)(K.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,l.jsx)(e7.default.TextArea,{rows:4})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Guardrails"," ",(0,l.jsx)(ex.Z,{title:"Setup your first guardrail",children:(0,l.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,l.jsx)(eh.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:e_.map(e=>({value:e,label:e}))})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,l.jsx)(ex.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,l.jsx)(sx.Z,{onChange:e=>v.setFieldValue("allowed_vector_store_ids",e),value:v.getFieldValue("allowed_vector_store_ids"),accessToken:n||"",placeholder:"Select vector stores (optional)"})})]})]}),(0,l.jsxs)(sn.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"MCP Settings"})}),(0,l.jsxs)(sr.Z,{children:[(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,l.jsx)(ex.Z,{title:"Select which MCP servers or access groups this team can access",children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,l.jsx)(sf.Z,{onChange:e=>v.setFieldValue("allowed_mcp_servers_and_groups",e),value:v.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:n||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,l.jsx)(K.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,l.jsx)(e7.default,{type:"hidden"})}),(0,l.jsx)(K.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(sy.Z,{accessToken:n||"",selectedServers:(null===(e=v.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:v.getFieldValue("mcp_tool_permissions")||{},onChange:e=>v.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),(0,l.jsxs)(sn.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"Logging Settings"})}),(0,l.jsx)(sr.Z,{children:(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(sh.Z,{value:ek,onChange:eS,premiumUser:d})})})]}),(0,l.jsxs)(sn.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"Model Aliases"})}),(0,l.jsx)(sr.Z,{children:(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(V.Z,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,l.jsx)(sb.Z,{accessToken:n||"",initialModelAliases:eP,onAliasUpdate:eI,showExampleConfig:!1})]})})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(e9.ZP,{htmlType:"submit",children:"Create Team"})})]})})]})})})};function sZ(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";document.cookie="".concat(e,"=; Max-Age=0; Path=").concat(s)}function sw(e){try{let s=(0,r.o)(e);if(s&&"number"==typeof s.exp)return 1e3*s.exp<=Date.now();return!1}catch(e){return!0}}let sN=new i.S;function sk(){return(0,l.jsxs)("div",{className:(0,eC.cx)("h-screen","flex items-center justify-center gap-4"),children:[(0,l.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"\uD83D\uDE85 LiteLLM"}),(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,l.jsx)(eS.S,{className:"size-4"}),(0,l.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}function sS(){let[e,s]=(0,a.useState)(""),[t,i]=(0,a.useState)(!1),[O,M]=(0,a.useState)(!1),[R,F]=(0,a.useState)(null),[B,U]=(0,a.useState)(null),[V,q]=(0,a.useState)([]),[K,H]=(0,a.useState)([]),[W,J]=(0,a.useState)([]),[Y,G]=(0,a.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),[X,$]=(0,a.useState)(!0),Q=(0,n.useSearchParams)(),[ee,es]=(0,a.useState)({data:[]}),[et,el]=(0,a.useState)(null),[ea,en]=(0,a.useState)(!1),[er,ei]=(0,a.useState)(!0),[eo,ec]=(0,a.useState)(null),{refactoredUIFlag:ed}=(0,eT.Z)(),em=Q.get("invitation_id"),[eu,ex]=(0,a.useState)(()=>Q.get("page")||"api-keys"),[eh,ep]=(0,a.useState)(null),[eg,ej]=(0,a.useState)(!1),ef=e=>{q(s=>s?[...s,e]:[e]),en(()=>!ea)},ey=!1===er&&null===et&&null===em;return((0,a.useEffect)(()=>{let e=!1;return(async()=>{try{await (0,S.getUiConfig)()}catch(e){}if(e)return;let s=function(e){let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));if(!s)return null;let t=s.slice(e.length+1);try{return decodeURIComponent(t)}catch(e){return t}}("token"),t=s&&!sw(s)?s:null;s&&!t&&sZ("token","/"),e||(el(t),ei(!1))})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{if(ey){let e=(S.proxyBaseUrl||"")+"/sso/key/generate";window.location.replace(e)}},[ey]),(0,a.useEffect)(()=>{if(!et)return;if(sw(et)){sZ("token","/"),el(null);return}let e=null;try{e=(0,r.o)(et)}catch(e){sZ("token","/"),el(null);return}if(e){if(ep(e.key),M(e.disabled_non_admin_personal_key_creation),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);s(t),"Admin Viewer"==t&&ex("usage")}e.user_email&&F(e.user_email),e.login_method&&$("username_password"==e.login_method),e.premium_user&&i(e.premium_user),e.auth_header_name&&(0,S.setGlobalLitellmHeaderName)(e.auth_header_name),e.user_id&&ec(e.user_id)}},[et]),(0,a.useEffect)(()=>{eh&&eo&&e&&(0,A.Nr)(eo,e,eh,J),eh&&eo&&e&&(0,L.Z)(eh,eo,e,null,U),eh&&(0,h.g)(eh,H)},[eh,eo,e]),er||ey)?(0,l.jsx)(sk,{}):(0,l.jsx)(a.Suspense,{fallback:(0,l.jsx)(sk,{}),children:(0,l.jsx)(o.aH,{client:sN,children:(0,l.jsx)(d.f,{accessToken:eh,children:em?(0,l.jsx)(m.Z,{userID:eo,userRole:e,premiumUser:t,teams:B,keys:V,setUserRole:s,userEmail:R,setUserEmail:F,setTeams:U,setKeys:q,organizations:K,addKey:ef,createClicked:ea}):(0,l.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,l.jsx)(c.Z,{userID:eo,userRole:e,premiumUser:t,userEmail:R,setProxySettings:G,proxySettings:Y,accessToken:eh,isPublicPage:!1,sidebarCollapsed:eg,onToggleSidebar:()=>{ej(!eg)}}),(0,l.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(e4,{setPage:e=>{let s=new URLSearchParams(Q);s.set("page",e),window.history.pushState(null,"","?".concat(s.toString())),ex(e)},defaultSelectedKey:eu,sidebarCollapsed:eg})}),"api-keys"==eu?(0,l.jsx)(m.Z,{userID:eo,userRole:e,premiumUser:t,teams:B,keys:V,setUserRole:s,userEmail:R,setUserEmail:F,setTeams:U,setKeys:q,organizations:K,addKey:ef,createClicked:ea}):"models"==eu?(0,l.jsx)(u.Z,{userID:eo,userRole:e,token:et,keys:V,accessToken:eh,modelData:ee,setModelData:es,premiumUser:t,teams:B}):"llm-playground"==eu?(0,l.jsx)(w.Z,{userID:eo,userRole:e,token:et,accessToken:eh,disabledPersonalKeyCreation:O}):"users"==eu?(0,l.jsx)(x.Z,{userID:eo,userRole:e,token:et,keys:V,teams:B,accessToken:eh,setKeys:q}):"teams"==eu?(0,l.jsx)(s_,{teams:B,setTeams:U,accessToken:eh,userID:eo,userRole:e,organizations:K,premiumUser:t,searchParams:Q}):"organizations"==eu?(0,l.jsx)(h.Z,{organizations:K,setOrganizations:H,userModels:W,accessToken:eh,userRole:e,premiumUser:t}):"admin-panel"==eu?(0,l.jsx)(p.Z,{setTeams:U,searchParams:Q,accessToken:eh,userID:eo,showSSOBanner:X,premiumUser:t,proxySettings:Y}):"api_ref"==eu?(0,l.jsx)(Z.Z,{proxySettings:Y}):"settings"==eu?(0,l.jsx)(g.Z,{userID:eo,userRole:e,accessToken:eh,premiumUser:t}):"budgets"==eu?(0,l.jsx)(y.Z,{accessToken:eh}):"guardrails"==eu?(0,l.jsx)(C.Z,{accessToken:eh,userRole:e}):"prompts"==eu?(0,l.jsx)(T.Z,{accessToken:eh,userRole:e}):"transform-request"==eu?(0,l.jsx)(z.Z,{accessToken:eh}):"general-settings"==eu?(0,l.jsx)(j.Z,{userID:eo,userRole:e,accessToken:eh,modelData:ee}):"ui-theme"==eu?(0,l.jsx)(E.Z,{userID:eo,userRole:e,accessToken:eh}):"cost-tracking-settings"==eu?(0,l.jsx)(ek,{userID:eo,userRole:e,accessToken:eh}):"model-hub-table"==eu?(0,l.jsx)(v.Z,{accessToken:eh,publicPage:!1,premiumUser:t,userRole:e}):"caching"==eu?(0,l.jsx)(k.Z,{userID:eo,userRole:e,token:et,accessToken:eh,premiumUser:t}):"pass-through-settings"==eu?(0,l.jsx)(f.Z,{userID:eo,userRole:e,accessToken:eh,modelData:ee}):"logs"==eu?(0,l.jsx)(b.Z,{userID:eo,userRole:e,token:et,accessToken:eh,allTeams:null!=B?B:[],premiumUser:t}):"mcp-servers"==eu?(0,l.jsx)(D.d,{accessToken:eh,userRole:e,userID:eo}):"tag-management"==eu?(0,l.jsx)(P.Z,{accessToken:eh,userRole:e,userID:eo}):"vector-stores"==eu?(0,l.jsx)(I.Z,{accessToken:eh,userRole:e,userID:eo}):"new_usage"==eu?(0,l.jsx)(_.Z,{userID:eo,userRole:e,accessToken:eh,teams:null!=B?B:[],premiumUser:t}):(0,l.jsx)(N.Z,{userID:eo,userRole:e,token:et,accessToken:eh,keys:V,premiumUser:t})]})]})})})})}},88904:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(88913),r=t(93192),i=t(52787),o=t(63709),c=t(87908),d=t(19250),m=t(65925),u=t(46468),x=t(9114);s.Z=e=>{var s;let{accessToken:t,userID:h,userRole:p}=e,[g,j]=(0,a.useState)(!0),[f,y]=(0,a.useState)(null),[b,v]=(0,a.useState)(!1),[_,Z]=(0,a.useState)({}),[w,N]=(0,a.useState)(!1),[k,S]=(0,a.useState)([]),{Paragraph:C}=r.default,{Option:T}=i.default;(0,a.useEffect)(()=>{(async()=>{if(!t){j(!1);return}try{let e=await (0,d.getDefaultTeamSettings)(t);if(y(e),Z(e.values||{}),t)try{let e=await (0,d.modelAvailableCall)(t,h,p);if(e&&e.data){let s=e.data.map(e=>e.id);S(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),x.Z.fromBackend("Failed to fetch team settings")}finally{j(!1)}})()},[t]);let z=async()=>{if(t){N(!0);try{let e=await (0,d.updateDefaultTeamSettings)(t,_);y({...f,values:e.settings}),v(!1),x.Z.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),x.Z.fromBackend("Failed to update team settings")}finally{N(!1)}}},A=(e,s)=>{Z(t=>({...t,[e]:s}))},L=(e,s,t)=>{var a;let r=s.type;return"budget_duration"===e?(0,l.jsx)(m.Z,{value:_[e]||null,onChange:s=>A(e,s),className:"mt-2"}):"boolean"===r?(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(o.Z,{checked:!!_[e],onChange:s=>A(e,s)})}):"array"===r&&(null===(a=s.items)||void 0===a?void 0:a.enum)?(0,l.jsx)(i.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>A(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,l.jsx)(T,{value:e,children:e},e))}):"models"===e?(0,l.jsx)(i.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>A(e,s),className:"mt-2",children:k.map(e=>(0,l.jsx)(T,{value:e,children:(0,u.W0)(e)},e))}):"string"===r&&s.enum?(0,l.jsx)(i.default,{style:{width:"100%"},value:_[e]||"",onChange:s=>A(e,s),className:"mt-2",children:s.enum.map(e=>(0,l.jsx)(T,{value:e,children:e},e))}):(0,l.jsx)(n.oi,{value:void 0!==_[e]?String(_[e]):"",onChange:s=>A(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},D=(e,s)=>null==s?(0,l.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,l.jsx)("span",{children:(0,m.m)(s)}):"boolean"==typeof s?(0,l.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,l.jsx)("span",{className:"text-gray-400",children:"None"}):(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,u.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,l.jsx)("span",{className:"text-gray-400",children:"None"}):(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,l.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,l.jsx)("span",{children:String(s)});return g?(0,l.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,l.jsx)(c.Z,{size:"large"})}):f?(0,l.jsxs)(n.Zb,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(n.Dx,{className:"text-xl",children:"Default Team Settings"}),!g&&f&&(b?(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.zx,{variant:"secondary",onClick:()=>{v(!1),Z(f.values||{})},disabled:w,children:"Cancel"}),(0,l.jsx)(n.zx,{onClick:z,loading:w,children:"Save Changes"})]}):(0,l.jsx)(n.zx,{onClick:()=>v(!0),children:"Edit Settings"}))]}),(0,l.jsx)(n.xv,{children:"These settings will be applied by default when creating new teams."}),(null==f?void 0:null===(s=f.field_schema)||void 0===s?void 0:s.description)&&(0,l.jsx)(C,{className:"mb-4 mt-2",children:f.field_schema.description}),(0,l.jsx)(n.iz,{}),(0,l.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=f;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,a]=s,r=e[t],i=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,l.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,l.jsx)(n.xv,{className:"font-medium text-lg",children:i}),(0,l.jsx)(C,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),b?(0,l.jsx)("div",{className:"mt-2",children:L(t,a,r)}):(0,l.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:D(t,r)})]},t)}):(0,l.jsx)(n.xv,{children:"No schema information available"})})()})]}):(0,l.jsx)(n.Zb,{children:(0,l.jsx)(n.xv,{children:"No team settings available or you do not have permission to view them."})})}},49104:function(e,s,t){"use strict";t.d(s,{Z:function(){return E}});var l=t(57437),a=t(2265),n=t(87452),r=t(88829),i=t(72208),o=t(49566),c=t(13634),d=t(82680),m=t(20577),u=t(52787),x=t(73002),h=t(19250),p=t(9114),g=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:a,setBudgetList:g}=e,[j]=c.Z.useForm(),f=async e=>{if(null!=t&&void 0!=t)try{p.Z.info("Making API Call");let s=await (0,h.budgetCreateCall)(t,e);console.log("key create Response:",s),g(e=>e?[...e,s]:[s]),p.Z.success("Budget Created"),j.resetFields()}catch(e){console.error("Error creating the key:",e),p.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,l.jsx)(d.Z,{title:"Create Budget",visible:s,width:800,footer:null,onOk:()=>{a(!1),j.resetFields()},onCancel:()=>{a(!1),j.resetFields()},children:(0,l.jsxs)(c.Z,{form:j,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,l.jsx)(o.Z,{placeholder:""})}),(0,l.jsx)(c.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsxs)(n.Z,{className:"mt-20 mb-8",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)("b",{children:"Optional Settings"})}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(m.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(u.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(u.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(u.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(u.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(x.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},j=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:g,setBudgetList:j,existingBudget:f,handleUpdateCall:y}=e;console.log("existingBudget",f);let[b]=c.Z.useForm();(0,a.useEffect)(()=>{b.setFieldsValue(f)},[f,b]);let v=async e=>{if(null!=t&&void 0!=t)try{p.Z.info("Making API Call"),g(!0);let s=await (0,h.budgetUpdateCall)(t,e);j(e=>e?[...e,s]:[s]),p.Z.success("Budget Updated"),b.resetFields(),y()}catch(e){console.error("Error creating the key:",e),p.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,l.jsx)(d.Z,{title:"Edit Budget",visible:s,width:800,footer:null,onOk:()=>{g(!1),b.resetFields()},onCancel:()=>{g(!1),b.resetFields()},children:(0,l.jsxs)(c.Z,{form:b,onFinish:v,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:f,children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,l.jsx)(o.Z,{placeholder:""})}),(0,l.jsx)(c.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsxs)(n.Z,{className:"mt-20 mb-8",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)("b",{children:"Optional Settings"})}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(m.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(u.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(u.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(u.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(u.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(x.ZP,{htmlType:"submit",children:"Save"})})]})})},f=t(20831),y=t(12514),b=t(47323),v=t(12485),_=t(18135),Z=t(35242),w=t(29706),N=t(77991),k=t(21626),S=t(97214),C=t(28241),T=t(58834),z=t(69552),A=t(71876),L=t(84264),D=t(53410),P=t(74998),I=t(17906),E=e=>{let{accessToken:s}=e,[t,n]=(0,a.useState)(!1),[r,i]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),[d,m]=(0,a.useState)([]);(0,a.useEffect)(()=>{s&&(0,h.getBudgetList)(s).then(e=>{m(e)})},[s]);let u=async(e,t)=>{console.log("budget_id",e),null!=s&&(c(d.find(s=>s.budget_id===e)||null),i(!0))},x=async(e,t)=>{if(null==s)return;p.Z.info("Request made"),await (0,h.budgetDeleteCall)(s,e);let l=[...d];l.splice(t,1),m(l),p.Z.success("Budget Deleted.")},E=async()=>{null!=s&&(0,h.getBudgetList)(s).then(e=>{m(e)})};return(0,l.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,l.jsx)(f.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>n(!0),children:"+ Create Budget"}),(0,l.jsx)(g,{accessToken:s,isModalVisible:t,setIsModalVisible:n,setBudgetList:m}),o&&(0,l.jsx)(j,{accessToken:s,isModalVisible:r,setIsModalVisible:i,setBudgetList:m,existingBudget:o,handleUpdateCall:E}),(0,l.jsxs)(y.Z,{children:[(0,l.jsx)(L.Z,{children:"Create a budget to assign to customers."}),(0,l.jsxs)(k.Z,{children:[(0,l.jsx)(T.Z,{children:(0,l.jsxs)(A.Z,{children:[(0,l.jsx)(z.Z,{children:"Budget ID"}),(0,l.jsx)(z.Z,{children:"Max Budget"}),(0,l.jsx)(z.Z,{children:"TPM"}),(0,l.jsx)(z.Z,{children:"RPM"})]})}),(0,l.jsx)(S.Z,{children:d.slice().sort((e,s)=>new Date(s.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,s)=>(0,l.jsxs)(A.Z,{children:[(0,l.jsx)(C.Z,{children:e.budget_id}),(0,l.jsx)(C.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,l.jsx)(C.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,l.jsx)(C.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,l.jsx)(b.Z,{icon:D.Z,size:"sm",onClick:()=>u(e.budget_id,s)}),(0,l.jsx)(b.Z,{icon:P.Z,size:"sm",onClick:()=>x(e.budget_id,s)})]},s))})]})]}),(0,l.jsxs)("div",{className:"mt-5",children:[(0,l.jsx)(L.Z,{className:"text-base",children:"How to use budget id"}),(0,l.jsxs)(_.Z,{children:[(0,l.jsxs)(Z.Z,{children:[(0,l.jsx)(v.Z,{children:"Assign Budget to Customer"}),(0,l.jsx)(v.Z,{children:"Test it (Curl)"}),(0,l.jsx)(v.Z,{children:"Test it (OpenAI SDK)"})]}),(0,l.jsxs)(N.Z,{children:[(0,l.jsx)(w.Z,{children:(0,l.jsx)(I.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(I.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(I.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="",\n api_key=""\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})}},918:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(62490),r=t(19250),i=t(9114);s.Z=e=>{let{accessToken:s,userID:t}=e,[o,c]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{if(s&&t)try{let e=await (0,r.availableTeamListCall)(s);c(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,t]);let d=async e=>{if(s&&t)try{await (0,r.teamMemberAddCall)(s,e,{user_id:t,role:"user"}),i.Z.success("Successfully joined team"),c(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),i.Z.fromBackend("Failed to join team")}};return(0,l.jsx)(n.Zb,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,l.jsxs)(n.iA,{children:[(0,l.jsx)(n.ss,{children:(0,l.jsxs)(n.SC,{children:[(0,l.jsx)(n.xs,{children:"Team Name"}),(0,l.jsx)(n.xs,{children:"Description"}),(0,l.jsx)(n.xs,{children:"Members"}),(0,l.jsx)(n.xs,{children:"Models"}),(0,l.jsx)(n.xs,{children:"Actions"})]})}),(0,l.jsxs)(n.RM,{children:[o.map(e=>(0,l.jsxs)(n.SC,{children:[(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.xv,{children:e.team_alias})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.xv,{children:e.description||"No description available"})}),(0,l.jsx)(n.pj,{children:(0,l.jsxs)(n.xv,{children:[e.members_with_roles.length," members"]})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,l.jsx)(n.Ct,{size:"xs",className:"mb-1",color:"blue",children:(0,l.jsx)(n.xv,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,l.jsx)(n.Ct,{size:"xs",color:"red",children:(0,l.jsx)(n.xv,{children:"All Proxy Models"})})})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.zx,{size:"xs",variant:"secondary",onClick:()=>d(e.team_id),children:"Join Team"})})]},e.team_id)),0===o.length&&(0,l.jsx)(n.SC,{children:(0,l.jsx)(n.pj,{colSpan:5,className:"text-center",children:(0,l.jsx)(n.xv,{children:"No available teams to join"})})})]})]})})}},6674:function(e,s,t){"use strict";t.d(s,{Z:function(){return d}});var l=t(57437),a=t(2265),n=t(73002),r=t(23639),i=t(96761),o=t(19250),c=t(9114),d=e=>{let{accessToken:s}=e,[t,d]=(0,a.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),p=(e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")},g=async()=>{h(!0);try{let e;try{e=JSON.parse(t)}catch(e){c.Z.fromBackend("Invalid JSON in request body"),h(!1);return}let l={call_type:"completion",request_body:e};if(!s){c.Z.fromBackend("No access token found"),h(!1);return}let a=await (0,o.transformRequestCall)(s,l);if(a.raw_request_api_base&&a.raw_request_body){let e=p(a.raw_request_api_base,a.raw_request_body,a.raw_request_headers||{});u(e),c.Z.success("Request transformed successfully")}else{let e="string"==typeof a?a:JSON.stringify(a);u(e),c.Z.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),c.Z.fromBackend("Failed to transform request")}finally{h(!1)}};return(0,l.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,l.jsx)(i.Z,{children:"Playground"}),(0,l.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,l.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,l.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,l.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,l.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,l.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,l.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),g())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,l.jsxs)(n.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:g,loading:x,children:[(0,l.jsx)("span",{children:"Transform"}),(0,l.jsx)("span",{children:"→"})]})})]}),(0,l.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,l.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,l.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,l.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,l.jsx)("br",{}),(0,l.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,l.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,l.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:m||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,l.jsx)(n.ZP,{type:"text",icon:(0,l.jsx)(r.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(m||""),c.Z.success("Copied to clipboard")}})]})]})]}),(0,l.jsx)("div",{className:"mt-4 text-right w-full",children:(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue"," ",(0,l.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})}},5183:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(19046),r=t(69734),i=t(19250),o=t(9114);s.Z=e=>{let{userID:s,userRole:t,accessToken:c}=e,{logoUrl:d,setLogoUrl:m}=(0,r.F)(),[u,x]=(0,a.useState)(""),[h,p]=(0,a.useState)(!1);(0,a.useEffect)(()=>{c&&g()},[c]);let g=async()=>{try{let s=(0,i.getProxyBaseUrl)(),t=await fetch(s?"".concat(s,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"}});if(t.ok){var e;let s=await t.json(),l=(null===(e=s.values)||void 0===e?void 0:e.logo_url)||"";x(l),m(l||null)}}catch(e){console.error("Error fetching theme settings:",e)}},j=async()=>{p(!0);try{let e=(0,i.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"},body:JSON.stringify({logo_url:u||null})})).ok)o.Z.success("Logo settings updated successfully!"),m(u||null);else throw Error("Failed to update settings")}catch(e){console.error("Error updating logo settings:",e),o.Z.fromBackend("Failed to update logo settings")}finally{p(!1)}},f=async()=>{x(""),m(null),p(!0);try{let e=(0,i.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"},body:JSON.stringify({logo_url:null})})).ok)o.Z.success("Logo reset to default!");else throw Error("Failed to reset logo")}catch(e){console.error("Error resetting logo:",e),o.Z.fromBackend("Failed to reset logo")}finally{p(!1)}};return c?(0,l.jsxs)("div",{className:"w-full mx-auto max-w-4xl px-6 py-8",children:[(0,l.jsxs)("div",{className:"mb-8",children:[(0,l.jsx)(n.Dx,{className:"text-2xl font-bold mb-2",children:"Logo Customization"}),(0,l.jsx)(n.xv,{className:"text-gray-600",children:"Customize your LiteLLM admin dashboard with a custom logo."})]}),(0,l.jsx)(n.Zb,{className:"shadow-sm p-6",children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(n.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Logo URL"}),(0,l.jsx)(n.oi,{placeholder:"https://example.com/logo.png",value:u,onValueChange:e=>{x(e),m(e||null)},className:"w-full"}),(0,l.jsx)(n.xv,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom logo or leave empty to use the default LiteLLM logo"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(n.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Current Logo"}),(0,l.jsx)("div",{className:"bg-gray-50 rounded-lg p-6 flex items-center justify-center min-h-[120px]",children:u?(0,l.jsx)("img",{src:u,alt:"Custom logo",className:"max-w-full max-h-24 object-contain",onError:e=>{var s;let t=e.target;t.style.display="none";let l=document.createElement("div");l.className="text-gray-500 text-sm",l.textContent="Failed to load image",null===(s=t.parentElement)||void 0===s||s.appendChild(l)}}):(0,l.jsx)(n.xv,{className:"text-gray-500 text-sm",children:"Default LiteLLM logo will be used"})})]}),(0,l.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,l.jsx)(n.zx,{onClick:j,loading:h,disabled:h,color:"indigo",children:"Save Changes"}),(0,l.jsx)(n.zx,{onClick:f,loading:h,disabled:h,variant:"secondary",color:"gray",children:"Reset to Default"})]})]})})]}):null}}},function(e){e.O(0,[3665,6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,7906,2344,3669,9165,1264,1487,3752,5105,6433,1160,9888,3250,9429,1223,8050,8049,131,2202,874,4292,2162,2004,2012,8160,7801,2306,3801,1307,1052,7155,3298,6204,1739,773,6925,8143,2273,5809,603,2019,4696,2971,2117,1744],function(){return e(e.s=97731)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/page-8e346388fe8496be.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-92ab3a1095e26dca.js similarity index 99% rename from ui/litellm-dashboard/out/_next/static/chunks/app/page-8e346388fe8496be.js rename to litellm/proxy/_experimental/out/_next/static/chunks/app/page-92ab3a1095e26dca.js index 6c30f38a16..82b2bc5464 100644 --- a/ui/litellm-dashboard/out/_next/static/chunks/app/page-8e346388fe8496be.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-92ab3a1095e26dca.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{97731:function(e,s,t){Promise.resolve().then(t.bind(t,50036))},23192:function(e,s,t){"use strict";t.d(s,{Z:function(){return h}});var l=t(57437);t(2265);var a=t(67101),n=t(12485),r=t(18135),i=t(35242),o=t(29706),c=t(77991),d=t(84264),m=t(25653),u=t(96362),x=e=>{let{href:s,className:t}=e;return(0,l.jsxs)("a",{href:s,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(){for(var e=arguments.length,s=Array(e),t=0;t{let{proxySettings:s}=e,t="";return(null==s?void 0:s.PROXY_BASE_URL)!==void 0&&(null==s?void 0:s.PROXY_BASE_URL)&&(t=s.PROXY_BASE_URL),(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(a.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,l.jsx)(x,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,l.jsxs)(d.Z,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,l.jsxs)(r.Z,{children:[(0,l.jsxs)(i.Z,{children:[(0,l.jsx)(n.Z,{children:"OpenAI Python SDK"}),(0,l.jsx)(n.Z,{children:"LlamaIndex"}),(0,l.jsx)(n.Z,{children:"Langchain Py"})]}),(0,l.jsxs)(c.Z,{children:[(0,l.jsx)(o.Z,{children:(0,l.jsx)(m.Z,{language:"python",code:'import openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(t,'" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)')})}),(0,l.jsx)(o.Z,{children:(0,l.jsx)(m.Z,{language:"python",code:'import os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="'.concat(t,'", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="').concat(t,'",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)')})}),(0,l.jsx)(o.Z,{children:(0,l.jsx)(m.Z,{language:"python",code:'from langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="'.concat(t,'",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)')})})]})]})]})})})}},25653:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(30401),r=t(5136),i=t(17906),o=t(1479);s.Z=e=>{let{code:s,language:t}=e,[c,d]=(0,a.useState)(!1);return(0,l.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,l.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(s),d(!0),setTimeout(()=>d(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:c?(0,l.jsx)(n.Z,{size:16}):(0,l.jsx)(r.Z,{size:16})}),(0,l.jsx)(i.Z,{language:t,style:o.Z,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:s})]})}},50036:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return sS}});var l=t(57437),a=t(2265),n=t(99376),r=t(14474),i=t(21623),o=t(29827),c=t(65373),d=t(69734),m=t(21739),u=t(37801),x=t(77155),h=t(22004),p=t(90773),g=t(6925),j=t(85809),f=t(10607),y=t(49104),b=t(33801),v=t(18160),_=t(62306),Z=t(23192),w=t(31052),N=t(18143),k=t(44696),S=t(19250),C=t(63298),T=t(30603),z=t(6674),A=t(30874),L=t(39210),D=t(21307),P=t(42273),I=t(6204),E=t(5183),O=t(20831),M=t(12485),R=t(18135),F=t(35242),B=t(29706),U=t(77991),V=t(84264),q=t(96761),K=t(13634),H=t(82680),W=t(9114),J=t(42673);let Y=e=>{let s=Object.keys(J.fK).find(s=>J.fK[s]===e);if(s){let e=J.Cl[s],t=J.cd[e];return{displayName:e,logo:t,enumKey:s}}return{displayName:e,logo:"",enumKey:null}},G=e=>J.fK[e]||null,X=(e,s)=>{let t=e.target,l=t.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=s.charAt(0),l.replaceChild(e,t)}};var $=t(47323),Q=t(49566),ee=t(82422),es=t(3837),et=t(53410),el=t(74998),ea=t(21626),en=t(97214),er=t(28241),ei=t(58834),eo=t(69552),ec=t(71876);function ed(e){let{data:s,columns:t,isLoading:a=!1,loadingMessage:n="Loading...",emptyMessage:r="No data",getRowKey:i}=e;return(0,l.jsxs)(ea.Z,{children:[(0,l.jsx)(ei.Z,{children:(0,l.jsx)(ec.Z,{children:t.map((e,s)=>(0,l.jsx)(eo.Z,{style:{width:e.width},children:e.header},s))})}),(0,l.jsx)(en.Z,{children:a?(0,l.jsx)(ec.Z,{children:(0,l.jsx)(er.Z,{colSpan:t.length,className:"text-center",children:(0,l.jsx)(V.Z,{className:"text-gray-500",children:n})})}):s.length>0?s.map((e,s)=>(0,l.jsx)(ec.Z,{children:t.map((s,t)=>{var a;return(0,l.jsx)(er.Z,{children:s.cell?s.cell(e):String(null!==(a=e[s.accessor])&&void 0!==a?a:"")},t)})},i?i(e,s):s)):(0,l.jsx)(ec.Z,{children:(0,l.jsx)(er.Z,{colSpan:t.length,className:"text-center",children:(0,l.jsx)(V.Z,{className:"text-gray-500",children:r})})})})]})}var em=e=>{let{discountConfig:s,onDiscountChange:t,onRemoveProvider:n}=e,[r,i]=(0,a.useState)(null),[o,c]=(0,a.useState)(""),d=(e,s)=>{i(e),c((100*s).toString())},m=e=>{let s=parseFloat(o);!isNaN(s)&&s>=0&&s<=100&&t(e,(s/100).toString()),i(null),c("")},u=()=>{i(null),c("")},x=(e,s)=>{"Enter"===e.key?m(s):"Escape"===e.key&&u()},h=Object.entries(s).map(e=>{let[s,t]=e;return{provider:s,discount:t}}).sort((e,s)=>{let t=Y(e.provider).displayName,l=Y(s.provider).displayName;return t.localeCompare(l)});return(0,l.jsx)(ed,{data:h,columns:[{header:"Provider",cell:e=>{let{displayName:s,logo:t}=Y(e.provider);return(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,l.jsx)("img",{src:t,alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>X(e,s)}),(0,l.jsx)("span",{className:"font-medium",children:s})]})}},{header:"Discount Percentage",cell:e=>(0,l.jsx)("div",{className:"flex items-center gap-2",children:r===e.provider?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.Z,{value:o,onValueChange:c,onKeyDown:s=>x(s,e.provider),placeholder:"5",className:"w-20",autoFocus:!0}),(0,l.jsx)("span",{className:"text-gray-600",children:"%"}),(0,l.jsx)($.Z,{icon:ee.Z,size:"sm",onClick:()=>m(e.provider),className:"cursor-pointer text-green-600 hover:text-green-700"}),(0,l.jsx)($.Z,{icon:es.Z,size:"sm",onClick:u,className:"cursor-pointer text-gray-600 hover:text-gray-700"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(V.Z,{className:"font-medium",children:[(100*e.discount).toFixed(1),"%"]}),(0,l.jsx)($.Z,{icon:et.Z,size:"sm",onClick:()=>d(e.provider,e.discount),className:"cursor-pointer text-blue-600 hover:text-blue-700"})]})}),width:"250px"},{header:"Actions",cell:e=>{let{displayName:s}=Y(e.provider);return(0,l.jsx)($.Z,{icon:el.Z,size:"sm",onClick:()=>n(e.provider,s),className:"cursor-pointer hover:text-red-600"})},width:"80px"}],getRowKey:e=>e.provider,emptyMessage:"No provider discounts configured"})},eu=t(64504),ex=t(89970),eh=t(52787),ep=t(15424),eg=t(33145),ej=e=>{let{discountConfig:s,selectedProvider:t,newDiscount:a,onProviderChange:n,onDiscountChange:r,onAddProvider:i}=e;return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Provider",(0,l.jsx)(ex.Z,{title:"Select the LLM provider you want to configure a discount for",children:(0,l.jsx)(ep.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(eh.default,{showSearch:!0,placeholder:"Select provider",value:t,onChange:n,style:{width:"100%"},size:"large",optionFilterProp:"children",filterOption:(e,s)=>{var t;return String(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},children:Object.entries(J.Cl).map(e=>{let[t,a]=e,n=J.fK[t];return n&&s[n]?null:(0,l.jsx)(eh.default.Option,{value:t,label:a,children:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(eg.default,{src:J.cd[a],alt:"".concat(t," logo"),width:20,height:20,className:"w-5 h-5",onError:e=>X(e,a)}),(0,l.jsx)("span",{children:a})]})},t)})})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Discount Percentage",(0,l.jsx)(ex.Z,{title:"Enter a percentage value (e.g., 5 for 5% discount)",children:(0,l.jsx)(ep.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),rules:[{required:!0,message:"Please enter a discount percentage"}],children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(eu.o,{placeholder:"5",value:a,onValueChange:r,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 flex-1"}),(0,l.jsx)("span",{className:"text-gray-600",children:"%"})]})}),(0,l.jsx)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:(0,l.jsx)(eu.z,{variant:"primary",onClick:i,disabled:!t||!a,children:"Add Provider Discount"})})]})},ef=t(29271),ey=t(40875),eb=t(96362);let ev=e=>{let{items:s,children:t="Docs",className:n=""}=e,[r,i]=(0,a.useState)(!1),o=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&i(!1)};return r&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[r]),(0,l.jsxs)("div",{className:"relative inline-block ".concat(n),ref:o,children:[(0,l.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"inline-flex items-center gap-1 text-gray-500 hover:text-gray-700 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded px-2 py-1","aria-expanded":r,"aria-haspopup":"true",children:[(0,l.jsx)("span",{children:t}),(0,l.jsx)(ey.Z,{className:"h-3 w-3 transition-transform ".concat(r?"rotate-180":""),"aria-hidden":"true"})]}),r&&(0,l.jsx)("div",{className:"absolute right-0 mt-1 w-56 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50",children:s.map((e,s)=>(0,l.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",onClick:()=>i(!1),children:[(0,l.jsx)("span",{children:e.label}),(0,l.jsx)(eb.Z,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0 ml-2","aria-hidden":"true"})]},s))})]})};var e_=t(56522),eZ=t(25653),ew=()=>{let[e,s]=(0,a.useState)(""),[t,n]=(0,a.useState)(""),r=(0,a.useMemo)(()=>{let s=parseFloat(e),l=parseFloat(t);if(isNaN(s)||isNaN(l)||0===s||0===l)return null;let a=s+l;return{originalCost:a.toFixed(10),finalCost:s.toFixed(10),discountAmount:l.toFixed(10),discountPercentage:(l/a*100).toFixed(2)}},[e,t]);return(0,l.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-1",children:"Cost Calculation"}),(0,l.jsxs)(e_.x,{className:"text-xs text-gray-600",children:["Discounts are applied to provider costs: ",(0,l.jsx)("code",{className:"bg-gray-100 px-1.5 py-0.5 rounded text-xs",children:"final_cost = base_cost \xd7 (1 - discount%/100)"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-1",children:"Example"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"A 5% discount on a $10.00 request results in: $10.00 \xd7 (1 - 0.05) = $9.50"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-1",children:"Valid Range"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Discount percentages must be between 0% and 100%"})]}),(0,l.jsxs)("div",{className:"pt-4 border-t border-gray-200",children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-2",children:"Validating Discounts"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600 mb-3",children:"Make a test request and check the response headers to verify discounts are applied:"}),(0,l.jsx)(eZ.Z,{language:"bash",code:'curl -X POST -i http://your-proxy:4000/chat/completions \\\n -H "Content-Type: application/json" \\\n -H "Authorization: Bearer sk-1234" \\\n -d \'{\n "model": "gemini/gemini-2.5-pro",\n "messages": [{"role": "user", "content": "Hello"}]\n }\''}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600 mt-3 mb-2",children:"Look for these headers in the response:"}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded text-xs font-mono text-gray-800 whitespace-nowrap",children:"x-litellm-response-cost"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Final cost after discount"})]}),(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded text-xs font-mono text-gray-800 whitespace-nowrap",children:"x-litellm-response-cost-original"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Original cost before discount"})]}),(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded text-xs font-mono text-gray-800 whitespace-nowrap",children:"x-litellm-response-cost-discount-amount"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Amount discounted"})]})]})]}),(0,l.jsxs)("div",{className:"pt-4 border-t border-gray-200",children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-3",children:"Discount Calculator"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600 mb-3",children:"Enter values from your response headers to verify the discount:"}),(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Response Cost (x-litellm-response-cost)"}),(0,l.jsx)(e_.o,{placeholder:"0.0171938125",value:e,onValueChange:s,className:"text-sm"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Discount Amount (x-litellm-response-cost-discount-amount)"}),(0,l.jsx)(e_.o,{placeholder:"0.0009049375",value:t,onValueChange:n,className:"text-sm"})]})]}),r&&(0,l.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,l.jsx)(e_.x,{className:"text-sm font-medium text-blue-900 mb-2",children:"Calculated Results"}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(e_.x,{className:"text-xs text-blue-800",children:"Original Cost:"}),(0,l.jsxs)("code",{className:"text-xs font-mono text-blue-900",children:["$",r.originalCost]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(e_.x,{className:"text-xs text-blue-800",children:"Final Cost:"}),(0,l.jsxs)("code",{className:"text-xs font-mono text-blue-900",children:["$",r.finalCost]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(e_.x,{className:"text-xs text-blue-800",children:"Discount Amount:"}),(0,l.jsxs)("code",{className:"text-xs font-mono text-blue-900",children:["$",r.discountAmount]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-blue-300",children:[(0,l.jsx)(e_.x,{className:"text-xs font-semibold text-blue-900",children:"Discount Applied:"}),(0,l.jsxs)(e_.x,{className:"text-sm font-bold text-blue-900",children:[r.discountPercentage,"%"]})]})]})]})]})]})};let eN=[{label:"Custom pricing for models",href:"https://docs.litellm.ai/docs/proxy/custom_pricing"},{label:"Spend tracking",href:"https://docs.litellm.ai/docs/proxy/cost_tracking"}];var ek=e=>{let{userID:s,userRole:t,accessToken:n}=e,[r,i]=(0,a.useState)({}),[o,c]=(0,a.useState)(void 0),[d,m]=(0,a.useState)(""),[u,x]=(0,a.useState)(!0),[h,p]=(0,a.useState)(!1),[g]=K.Z.useForm(),[j,f]=H.Z.useModal(),y=(0,a.useCallback)(async()=>{x(!0);try{let e=(0,S.getProxyBaseUrl)(),s=await fetch(e?"".concat(e,"/config/cost_discount_config"):"/config/cost_discount_config",{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(s.ok){let e=await s.json();i(e.values||{})}else console.error("Failed to fetch discount config")}catch(e){console.error("Error fetching discount config:",e),W.Z.fromBackend("Failed to fetch discount configuration")}finally{x(!1)}},[n]);(0,a.useEffect)(()=>{n&&y()},[n,y]);let b=async e=>{try{let t=(0,S.getProxyBaseUrl)(),l=await fetch(t?"".concat(t,"/config/cost_discount_config"):"/config/cost_discount_config",{method:"PATCH",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(e)});if(l.ok)W.Z.success("Discount configuration updated successfully"),await y();else{var s;let e=await l.json(),t=(null===(s=e.detail)||void 0===s?void 0:s.error)||e.detail||"Failed to update settings";W.Z.fromBackend(t)}}catch(e){console.error("Error updating discount config:",e),W.Z.fromBackend("Failed to update discount configuration")}},v=async()=>{if(!o||!d){W.Z.fromBackend("Please select a provider and enter discount percentage");return}let e=parseFloat(d);if(isNaN(e)||e<0||e>100){W.Z.fromBackend("Discount must be between 0% and 100%");return}let s=G(o);if(!s){W.Z.fromBackend("Invalid provider selected");return}if(r[s]){W.Z.fromBackend("Discount for ".concat(J.Cl[o]," already exists. Edit it in the table above."));return}let t={...r,[s]:e/100};i(t),await b(t),c(void 0),m(""),p(!1)},_=async(e,s)=>{j.confirm({title:"Remove Provider Discount",icon:(0,l.jsx)(ef.Z,{}),content:"Are you sure you want to remove the discount for ".concat(s,"?"),okText:"Remove",okType:"danger",cancelText:"Cancel",onOk:async()=>{let s={...r};delete s[e],i(s),await b(s)}})},Z=async(e,s)=>{let t=parseFloat(s);if(!isNaN(t)&&t>=0&&t<=1){let s={...r,[e]:t};i(s),await b(s)}};return n?(0,l.jsxs)("div",{className:"w-full p-8",children:[f,(0,l.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between mb-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(q.Z,{children:"Cost Tracking Settings"}),(0,l.jsx)(ev,{items:eN})]}),(0,l.jsx)(V.Z,{className:"text-gray-500 mt-1",children:"Configure cost discounts for different LLM providers. Changes are saved automatically."})]}),(0,l.jsx)(O.Z,{onClick:()=>p(!0),className:"mt-4 md:mt-0",children:"+ Add Provider Discount"})]}),(0,l.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full",children:(0,l.jsxs)(R.Z,{children:[(0,l.jsxs)(F.Z,{className:"px-6 pt-4",children:[(0,l.jsx)(M.Z,{children:"Provider Discounts"}),(0,l.jsx)(M.Z,{children:"Test It"})]}),(0,l.jsxs)(U.Z,{children:[(0,l.jsx)(B.Z,{children:u?(0,l.jsx)("div",{className:"py-12 text-center",children:(0,l.jsx)(V.Z,{className:"text-gray-500",children:"Loading configuration..."})}):Object.keys(r).length>0?(0,l.jsx)("div",{className:"p-6",children:(0,l.jsx)(em,{discountConfig:r,onDiscountChange:Z,onRemoveProvider:_})}):(0,l.jsxs)("div",{className:"py-16 px-6 text-center",children:[(0,l.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-400 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,l.jsx)(V.Z,{className:"text-gray-700 font-medium mb-2",children:"No provider discounts configured"}),(0,l.jsx)(V.Z,{className:"text-gray-500 text-sm",children:'Click "Add Provider Discount" to get started'})]})}),(0,l.jsx)(B.Z,{children:(0,l.jsx)("div",{className:"px-6 pb-4",children:(0,l.jsx)(ew,{})})})]})]})}),(0,l.jsx)(H.Z,{title:(0,l.jsx)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Provider Discount"})}),open:h,width:1e3,onCancel:()=>{p(!1),g.resetFields(),c(void 0),m("")},footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,l.jsxs)("div",{className:"mt-6",children:[(0,l.jsx)(V.Z,{className:"text-sm text-gray-600 mb-6",children:"Select a provider and set its discount percentage. Enter a value between 0% and 100% (e.g., 5 for a 5% discount)."}),(0,l.jsx)(K.Z,{form:g,onFinish:e=>{v()},layout:"vertical",className:"space-y-6",children:(0,l.jsx)(ej,{discountConfig:r,selectedProvider:o,newDiscount:d,onProviderChange:c,onDiscountChange:m,onAddProvider:v})})]})})]}):null},eS=t(91323),eC=t(10012),eT=t(31857),ez=t(19226),eA=t(45937),eL=t(92403),eD=t(28595),eP=t(68208),eI=t(9775),eE=t(41361),eO=t(37527),eM=t(15883),eR=t(12660),eF=t(88009),eB=t(48231),eU=t(57400),eV=t(58630),eq=t(44625),eK=t(41169),eH=t(38434),eW=t(71891),eJ=t(55322),eY=t(11429),eG=t(20347),eX=t(79262),e$=t(13959);let{Sider:eQ}=ez.default;var e0=e=>{let{accessToken:s,setPage:t,userRole:a,defaultSelectedKey:n,collapsed:r=!1}=e,i=[{key:"1",page:"api-keys",label:"Virtual Keys",icon:(0,l.jsx)(eL.Z,{style:{fontSize:"18px"}})},{key:"3",page:"llm-playground",label:"Test Key",icon:(0,l.jsx)(eD.Z,{style:{fontSize:"18px"}}),roles:eG.LQ},{key:"2",page:"models",label:"Models + Endpoints",icon:(0,l.jsx)(eP.Z,{style:{fontSize:"18px"}}),roles:eG.LQ},{key:"12",page:"new_usage",label:"Usage",icon:(0,l.jsx)(eI.Z,{style:{fontSize:"18px"}}),roles:[...eG.ZL,...eG.lo]},{key:"6",page:"teams",label:"Teams",icon:(0,l.jsx)(eE.Z,{style:{fontSize:"18px"}})},{key:"17",page:"organizations",label:"Organizations",icon:(0,l.jsx)(eO.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"5",page:"users",label:"Internal Users",icon:(0,l.jsx)(eM.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"14",page:"api_ref",label:"API Reference",icon:(0,l.jsx)(eR.Z,{style:{fontSize:"18px"}})},{key:"16",page:"model-hub-table",label:"Model Hub",icon:(0,l.jsx)(eF.Z,{style:{fontSize:"18px"}})},{key:"15",page:"logs",label:"Logs",icon:(0,l.jsx)(eB.Z,{style:{fontSize:"18px"}})},{key:"11",page:"guardrails",label:"Guardrails",icon:(0,l.jsx)(eU.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"26",page:"tools",label:"Tools",icon:(0,l.jsx)(eV.Z,{style:{fontSize:"18px"}}),children:[{key:"18",page:"mcp-servers",label:"MCP Servers",icon:(0,l.jsx)(eV.Z,{style:{fontSize:"18px"}})},{key:"21",page:"vector-stores",label:"Vector Stores",icon:(0,l.jsx)(eq.Z,{style:{fontSize:"18px"}}),roles:eG.ZL}]},{key:"experimental",page:"experimental",label:"Experimental",icon:(0,l.jsx)(eK.Z,{style:{fontSize:"18px"}}),children:[{key:"9",page:"caching",label:"Caching",icon:(0,l.jsx)(eq.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"25",page:"prompts",label:"Prompts",icon:(0,l.jsx)(eH.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"10",page:"budgets",label:"Budgets",icon:(0,l.jsx)(eO.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"20",page:"transform-request",label:"API Playground",icon:(0,l.jsx)(eR.Z,{style:{fontSize:"18px"}}),roles:[...eG.ZL,...eG.lo]},{key:"19",page:"tag-management",label:"Tag Management",icon:(0,l.jsx)(eW.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"4",page:"usage",label:"Old Usage",icon:(0,l.jsx)(eI.Z,{style:{fontSize:"18px"}})}]},{key:"settings",page:"settings",label:"Settings",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL,children:[{key:"11",page:"general-settings",label:"Router Settings",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"8",page:"settings",label:"Logging & Alerts",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"13",page:"admin-panel",label:"Admin Settings",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"27",page:"cost-tracking-settings",label:"Cost Tracking",icon:(0,l.jsx)(eI.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"14",page:"ui-theme",label:"UI Theme",icon:(0,l.jsx)(eY.Z,{style:{fontSize:"18px"}}),roles:eG.ZL}]}],o=(e=>{let s=i.find(s=>s.page===e);if(s)return s.key;for(let s of i)if(s.children){let t=s.children.find(s=>s.page===e);if(t)return t.key}return"1"})(n),c=i.filter(e=>{let s=!e.roles||e.roles.includes(a);return console.log("Menu item ".concat(e.label,": roles=").concat(e.roles,", userRole=").concat(a,", hasAccess=").concat(s)),!!s&&(e.children&&(e.children=e.children.filter(e=>!e.roles||e.roles.includes(a))),!0)});return(0,l.jsx)(ez.default,{style:{minHeight:"100vh"},children:(0,l.jsxs)(eQ,{theme:"light",width:220,collapsed:r,collapsedWidth:80,collapsible:!0,trigger:null,style:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative"},children:[(0,l.jsx)(e$.ZP,{theme:{components:{Menu:{iconSize:18,fontSize:14}}},children:(0,l.jsx)(eA.Z,{mode:"inline",selectedKeys:[o],defaultOpenKeys:r?[]:["llm-tools"],inlineCollapsed:r,className:"custom-sidebar-menu",style:{borderRight:0,backgroundColor:"transparent",fontSize:"14px"},items:c.map(e=>{var s;return{key:e.key,icon:e.icon,label:e.label,children:null===(s=e.children)||void 0===s?void 0:s.map(e=>({key:e.key,icon:e.icon,label:e.label,onClick:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}})),onClick:e.children?void 0:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}}})})}),(0,eG.tY)(a)&&!r&&(0,l.jsx)(eX.Z,{accessToken:s,width:220})]})})},e1=t(92019),e2=t(39760),e4=e=>{let{setPage:s,defaultSelectedKey:t,sidebarCollapsed:a}=e,{refactoredUIFlag:n}=(0,eT.Z)(),{accessToken:r,userRole:i}=(0,e2.Z)();return n?(0,l.jsx)(e1.Z,{accessToken:r,defaultSelectedKey:t,userRole:i}):(0,l.jsx)(e0,{accessToken:r,setPage:s,userRole:i,defaultSelectedKey:t,collapsed:a})},e5=t(93192),e3=t(23628),e8=t(86462),e6=t(47686),e7=t(64482),e9=t(73002),se=t(24199),ss=t(46468),st=t(25512),sl=t(33293),sa=t(88904),sn=t(87452),sr=t(88829),si=t(72208),so=t(41649),sc=t(12514),sd=t(49804),sm=t(67101),su=t(918),sx=t(97415),sh=t(2597),sp=t(59872),sg=t(32489),sj=t(76865),sf=t(95920),sy=t(68473),sb=t(51750);let sv=(e,s)=>{let t=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),t=e.models):t=s,(0,ss.Ob)(t,s)};var s_=e=>{let{teams:s,searchParams:t,accessToken:n,setTeams:r,userID:i,userRole:o,organizations:c,premiumUser:d=!1}=e,[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(null),[p,g]=(0,a.useState)(null),[j,f]=(0,a.useState)(!1),[y,b]=(0,a.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"});(0,a.useEffect)(()=>{console.log("inside useeffect - ".concat(m)),n&&(0,L.Z)(n,i,o,x,r),eB()},[m]);let[v]=K.Z.useForm(),[_]=K.Z.useForm(),{Title:Z,Paragraph:w}=e5.default,[N,k]=(0,a.useState)(""),[C,T]=(0,a.useState)(!1),[z,A]=(0,a.useState)(null),[D,P]=(0,a.useState)(null),[I,E]=(0,a.useState)(!1),[q,J]=(0,a.useState)(!1),[Y,G]=(0,a.useState)(!1),[X,ee]=(0,a.useState)(!1),[es,ed]=(0,a.useState)([]),[em,eu]=(0,a.useState)(!1),[eg,ej]=(0,a.useState)(null),[ef,ey]=(0,a.useState)([]),[eb,ev]=(0,a.useState)({}),[e_,eZ]=(0,a.useState)([]),[ew,eN]=(0,a.useState)({}),[ek,eS]=(0,a.useState)([]),[eC,eT]=(0,a.useState)([]),[ez,eA]=(0,a.useState)(!1),[eL,eD]=(0,a.useState)(""),[eP,eI]=(0,a.useState)({});(0,a.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(p));let e=sv(p,es);console.log("models: ".concat(e)),ey(e),v.setFieldValue("models",[])},[p,es]),(0,a.useEffect)(()=>{(async()=>{try{if(null==n)return;let e=(await (0,S.getGuardrailsList)(n)).guardrails.map(e=>e.guardrail_name);eZ(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[n]);let eE=async()=>{try{if(null==n)return;let e=await (0,S.fetchMCPAccessGroups)(n);eT(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,a.useEffect)(()=>{eE()},[n]),(0,a.useEffect)(()=>{s&&ev(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let eO=async e=>{ej(e),eu(!0)},eM=async()=>{if(null!=eg&&null!=s&&null!=n){try{await (0,S.teamDeleteCall)(n,eg),(0,L.Z)(n,i,o,x,r)}catch(e){console.error("Error deleting the team:",e)}eu(!1),ej(null)}},eR=()=>{eu(!1),ej(null)};(0,a.useEffect)(()=>{(async()=>{try{if(null===i||null===o||null===n)return;let e=await (0,ss.K2)(i,o,n);e&&ed(e)}catch(e){console.error("Error fetching user models:",e)}})()},[n,i,o,s]);let eF=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=n){var t,l,a;let i=null==e?void 0:e.team_alias,o=null!==(a=null==s?void 0:s.map(e=>e.team_alias))&&void 0!==a?a:[],c=(null==e?void 0:e.organization_id)||(null==x?void 0:x.organization_id);if(""===c||"string"!=typeof c?e.organization_id=null:e.organization_id=c.trim(),o.includes(i))throw Error("Team alias ".concat(i," already exists, please pick another alias"));if(W.Z.info("Creating Team"),ek.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:ek.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0||e.allowed_mcp_servers_and_groups.toolPermissions)){if(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.mcp_tool_permissions&&Object.keys(e.mcp_tool_permissions).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=e.mcp_tool_permissions,delete e.mcp_tool_permissions)}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(eP).length>0&&(e.model_aliases=eP);let d=await (0,S.teamCreateCall)(n,e);null!==s?r([...s,d]):r([d]),console.log("response for team create call: ".concat(d)),W.Z.success("Team created"),v.resetFields(),eS([]),eI({}),J(!1)}}catch(e){console.error("Error creating the team:",e),W.Z.fromBackend("Error creating the team: "+e)}},eB=()=>{u(new Date().toLocaleString())},eU=(e,s)=>{let t={...y,[e]:s};b(t),n&&(0,S.v2TeamListCall)(n,t.organization_id||null,null,t.team_id||null,t.team_alias||null).then(e=>{e&&e.teams&&r(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})};return(0,l.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,l.jsx)(sm.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,l.jsxs)(sd.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==o||"Org Admin"==o)&&(0,l.jsx)(O.Z,{className:"w-fit",onClick:()=>J(!0),children:"+ Create New Team"}),D?(0,l.jsx)(sl.Z,{teamId:D,onUpdate:e=>{r(s=>{if(null==s)return s;let t=s.map(s=>e.team_id===s.team_id?(0,sp.nl)(s,e):s);return n&&(0,L.Z)(n,i,o,x,r),t})},onClose:()=>{P(null),E(!1)},accessToken:n,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;se.team_id===D)),is_proxy_admin:"Admin"==o,userModels:es,editTeam:I}):(0,l.jsxs)(R.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,l.jsxs)(F.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(M.Z,{children:"Your Teams"}),(0,l.jsx)(M.Z,{children:"Available Teams"}),(0,eG.tY)(o||"")&&(0,l.jsx)(M.Z,{children:"Default Team Settings"})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,l.jsxs)(V.Z,{children:["Last Refreshed: ",m]}),(0,l.jsx)($.Z,{icon:e3.Z,variant:"shadow",size:"xs",className:"self-center",onClick:eB})]})]}),(0,l.jsxs)(U.Z,{children:[(0,l.jsxs)(B.Z,{children:[(0,l.jsxs)(V.Z,{children:["Click on “Team ID” to view team details ",(0,l.jsx)("b",{children:"and"})," manage team members."]}),(0,l.jsx)(sm.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,l.jsx)(sd.Z,{numColSpan:1,children:(0,l.jsxs)(sc.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,l.jsx)("div",{className:"border-b px-6 py-4",children:(0,l.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,l.jsxs)("div",{className:"relative w-64",children:[(0,l.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:y.team_alias,onChange:e=>eU("team_alias",e.target.value)}),(0,l.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,l.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(j?"bg-gray-100":""),onClick:()=>f(!j),children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(y.team_id||y.team_alias||y.organization_id)&&(0,l.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,l.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{b({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),n&&(0,S.v2TeamListCall)(n,null,i||null,null,null).then(e=>{e&&e.teams&&r(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),j&&(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,l.jsxs)("div",{className:"relative w-64",children:[(0,l.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:y.team_id,onChange:e=>eU("team_id",e.target.value)}),(0,l.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,l.jsx)("div",{className:"w-64",children:(0,l.jsx)(st.P,{value:y.organization_id||"",onValueChange:e=>eU("organization_id",e),placeholder:"Select Organization",children:null==c?void 0:c.map(e=>(0,l.jsx)(st.Q,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})}),(0,l.jsxs)(ea.Z,{children:[(0,l.jsx)(ei.Z,{children:(0,l.jsxs)(ec.Z,{children:[(0,l.jsx)(eo.Z,{children:"Team Name"}),(0,l.jsx)(eo.Z,{children:"Team ID"}),(0,l.jsx)(eo.Z,{children:"Created"}),(0,l.jsx)(eo.Z,{children:"Spend (USD)"}),(0,l.jsx)(eo.Z,{children:"Budget (USD)"}),(0,l.jsx)(eo.Z,{children:"Models"}),(0,l.jsx)(eo.Z,{children:"Organization"}),(0,l.jsx)(eo.Z,{children:"Info"})]})}),(0,l.jsx)(en.Z,{children:s&&s.length>0?s.filter(e=>!x||e.organization_id===x.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,l.jsxs)(ec.Z,{children:[(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,l.jsx)(er.Z,{children:(0,l.jsx)("div",{className:"overflow-hidden",children:(0,l.jsx)(ex.Z,{title:e.team_id,children:(0,l.jsxs)(O.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{P(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,sp.pw)(e.spend,4)}),(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,l.jsx)(er.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,l.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,l.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,l.jsx)(so.Z,{size:"xs",className:"mb-1",color:"red",children:(0,l.jsx)(V.Z,{children:"All Proxy Models"})}):(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,l.jsx)("div",{children:(0,l.jsx)($.Z,{icon:ew[e.team_id]?e8.Z:e6.Z,className:"cursor-pointer",size:"xs",onClick:()=>{eN(s=>({...s,[e.team_id]:!s[e.team_id]}))}})}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,l.jsx)(so.Z,{size:"xs",color:"red",children:(0,l.jsx)(V.Z,{children:"All Proxy Models"})},s):(0,l.jsx)(so.Z,{size:"xs",color:"blue",children:(0,l.jsx)(V.Z,{children:e.length>30?"".concat((0,ss.W0)(e).slice(0,30),"..."):(0,ss.W0)(e)})},s)),e.models.length>3&&!ew[e.team_id]&&(0,l.jsx)(so.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,l.jsxs)(V.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),ew[e.team_id]&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,l.jsx)(so.Z,{size:"xs",color:"red",children:(0,l.jsx)(V.Z,{children:"All Proxy Models"})},s+3):(0,l.jsx)(so.Z,{size:"xs",color:"blue",children:(0,l.jsx)(V.Z,{children:e.length>30?"".concat((0,ss.W0)(e).slice(0,30),"..."):(0,ss.W0)(e)})},s+3))})]})]})})}):null})}),(0,l.jsx)(er.Z,{children:e.organization_id}),(0,l.jsxs)(er.Z,{children:[(0,l.jsxs)(V.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].keys&&eb[e.team_id].keys.length," ","Keys"]}),(0,l.jsxs)(V.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].team_info&&eb[e.team_id].team_info.members_with_roles&&eb[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,l.jsx)(er.Z,{children:"Admin"==o?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)($.Z,{icon:et.Z,size:"sm",onClick:()=>{P(e.team_id),E(!0)}}),(0,l.jsx)($.Z,{onClick:()=>eO(e.team_id),icon:el.Z,size:"sm"})]}):null})]},e.team_id)):null})]}),em&&(()=>{var e;let t=null==s?void 0:s.find(e=>e.team_id===eg),a=(null==t?void 0:t.team_alias)||"",n=(null==t?void 0:null===(e=t.keys)||void 0===e?void 0:e.length)||0,r=eL===a;return(0,l.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,l.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Team"}),(0,l.jsx)("button",{onClick:()=>{eR(),eD("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,l.jsx)(sg.Z,{size:20})})]}),(0,l.jsxs)("div",{className:"px-6 py-4",children:[n>0&&(0,l.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,l.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,l.jsx)(sj.Z,{size:20})}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{className:"text-base font-medium text-red-600",children:["Warning: This team has ",n," associated key",n>1?"s":"","."]}),(0,l.jsx)("p",{className:"text-base text-red-600 mt-2",children:"Deleting the team will also delete all associated keys. This action is irreversible."})]})]}),(0,l.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to force delete this team and all its keys?"}),(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,l.jsx)("span",{className:"underline",children:a})," to confirm deletion:"]}),(0,l.jsx)("input",{type:"text",value:eL,onChange:e=>eD(e.target.value),placeholder:"Enter team name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,l.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,l.jsx)("button",{onClick:()=>{eR(),eD("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,l.jsx)("button",{onClick:eM,disabled:!r,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(r?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Force Delete"})]})]})})})()]})})})]}),(0,l.jsx)(B.Z,{children:(0,l.jsx)(su.Z,{accessToken:n,userID:i})}),(0,eG.tY)(o||"")&&(0,l.jsx)(B.Z,{children:(0,l.jsx)(sa.Z,{accessToken:n,userID:i||"",userRole:o||""})})]})]}),("Admin"==o||"Org Admin"==o)&&(0,l.jsx)(H.Z,{title:"Create Team",visible:q,width:1e3,footer:null,onOk:()=>{J(!1),v.resetFields(),eS([]),eI({})},onCancel:()=>{J(!1),v.resetFields(),eS([]),eI({})},children:(0,l.jsxs)(K.Z,{form:v,onFinish:eF,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(K.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,l.jsx)(Q.Z,{placeholder:""})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Organization"," ",(0,l.jsx)(ex.Z,{title:(0,l.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,l.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:x?x.organization_id:null,className:"mt-8",children:(0,l.jsx)(eh.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{v.setFieldValue("organization_id",e),g((null==c?void 0:c.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var t;return!!s&&((null===(t=s.children)||void 0===t?void 0:t.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==c?void 0:c.map(e=>(0,l.jsxs)(eh.default.Option,{value:e.organization_id,children:[(0,l.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,l.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Models"," ",(0,l.jsx)(ex.Z,{title:"These are the models that your selected team has access to",children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,l.jsxs)(eh.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,l.jsx)(eh.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),ef.map(e=>(0,l.jsx)(eh.default.Option,{value:e,children:(0,ss.W0)(e)},e))]})}),(0,l.jsx)(K.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(se.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(K.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(eh.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(eh.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(eh.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(eh.default.Option,{value:"30d",children:"monthly"})]})}),(0,l.jsx)(K.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsx)(K.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsxs)(sn.Z,{className:"mt-20 mb-8",onClick:()=>{ez||(eE(),eA(!0))},children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"Additional Settings"})}),(0,l.jsxs)(sr.Z,{children:[(0,l.jsx)(K.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,l.jsx)(Q.Z,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,l.jsx)(K.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,l.jsx)(se.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(K.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,l.jsx)(Q.Z,{placeholder:"e.g., 30d"})}),(0,l.jsx)(K.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsx)(K.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsx)(K.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,l.jsx)(e7.default.TextArea,{rows:4})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Guardrails"," ",(0,l.jsx)(ex.Z,{title:"Setup your first guardrail",children:(0,l.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,l.jsx)(eh.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:e_.map(e=>({value:e,label:e}))})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,l.jsx)(ex.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,l.jsx)(sx.Z,{onChange:e=>v.setFieldValue("allowed_vector_store_ids",e),value:v.getFieldValue("allowed_vector_store_ids"),accessToken:n||"",placeholder:"Select vector stores (optional)"})})]})]}),(0,l.jsxs)(sn.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"MCP Settings"})}),(0,l.jsxs)(sr.Z,{children:[(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,l.jsx)(ex.Z,{title:"Select which MCP servers or access groups this team can access",children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,l.jsx)(sf.Z,{onChange:e=>v.setFieldValue("allowed_mcp_servers_and_groups",e),value:v.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:n||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,l.jsx)(K.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,l.jsx)(e7.default,{type:"hidden"})}),(0,l.jsx)(K.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(sy.Z,{accessToken:n||"",selectedServers:(null===(e=v.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:v.getFieldValue("mcp_tool_permissions")||{},onChange:e=>v.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),(0,l.jsxs)(sn.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"Logging Settings"})}),(0,l.jsx)(sr.Z,{children:(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(sh.Z,{value:ek,onChange:eS,premiumUser:d})})})]}),(0,l.jsxs)(sn.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"Model Aliases"})}),(0,l.jsx)(sr.Z,{children:(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(V.Z,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,l.jsx)(sb.Z,{accessToken:n||"",initialModelAliases:eP,onAliasUpdate:eI,showExampleConfig:!1})]})})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(e9.ZP,{htmlType:"submit",children:"Create Team"})})]})})]})})})};function sZ(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";document.cookie="".concat(e,"=; Max-Age=0; Path=").concat(s)}function sw(e){try{let s=(0,r.o)(e);if(s&&"number"==typeof s.exp)return 1e3*s.exp<=Date.now();return!1}catch(e){return!0}}let sN=new i.S;function sk(){return(0,l.jsxs)("div",{className:(0,eC.cx)("h-screen","flex items-center justify-center gap-4"),children:[(0,l.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"\uD83D\uDE85 LiteLLM"}),(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,l.jsx)(eS.S,{className:"size-4"}),(0,l.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}function sS(){let[e,s]=(0,a.useState)(""),[t,i]=(0,a.useState)(!1),[O,M]=(0,a.useState)(!1),[R,F]=(0,a.useState)(null),[B,U]=(0,a.useState)(null),[V,q]=(0,a.useState)([]),[K,H]=(0,a.useState)([]),[W,J]=(0,a.useState)([]),[Y,G]=(0,a.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),[X,$]=(0,a.useState)(!0),Q=(0,n.useSearchParams)(),[ee,es]=(0,a.useState)({data:[]}),[et,el]=(0,a.useState)(null),[ea,en]=(0,a.useState)(!1),[er,ei]=(0,a.useState)(!0),[eo,ec]=(0,a.useState)(null),{refactoredUIFlag:ed}=(0,eT.Z)(),em=Q.get("invitation_id"),[eu,ex]=(0,a.useState)(()=>Q.get("page")||"api-keys"),[eh,ep]=(0,a.useState)(null),[eg,ej]=(0,a.useState)(!1),ef=e=>{q(s=>s?[...s,e]:[e]),en(()=>!ea)},ey=!1===er&&null===et&&null===em;return((0,a.useEffect)(()=>{let e=!1;return(async()=>{try{await (0,S.getUiConfig)()}catch(e){}if(e)return;let s=function(e){let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));if(!s)return null;let t=s.slice(e.length+1);try{return decodeURIComponent(t)}catch(e){return t}}("token"),t=s&&!sw(s)?s:null;s&&!t&&sZ("token","/"),e||(el(t),ei(!1))})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{if(ey){let e=(S.proxyBaseUrl||"")+"/sso/key/generate";window.location.replace(e)}},[ey]),(0,a.useEffect)(()=>{if(!et)return;if(sw(et)){sZ("token","/"),el(null);return}let e=null;try{e=(0,r.o)(et)}catch(e){sZ("token","/"),el(null);return}if(e){if(ep(e.key),M(e.disabled_non_admin_personal_key_creation),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);s(t),"Admin Viewer"==t&&ex("usage")}e.user_email&&F(e.user_email),e.login_method&&$("username_password"==e.login_method),e.premium_user&&i(e.premium_user),e.auth_header_name&&(0,S.setGlobalLitellmHeaderName)(e.auth_header_name),e.user_id&&ec(e.user_id)}},[et]),(0,a.useEffect)(()=>{eh&&eo&&e&&(0,A.Nr)(eo,e,eh,J),eh&&eo&&e&&(0,L.Z)(eh,eo,e,null,U),eh&&(0,h.g)(eh,H)},[eh,eo,e]),er||ey)?(0,l.jsx)(sk,{}):(0,l.jsx)(a.Suspense,{fallback:(0,l.jsx)(sk,{}),children:(0,l.jsx)(o.aH,{client:sN,children:(0,l.jsx)(d.f,{accessToken:eh,children:em?(0,l.jsx)(m.Z,{userID:eo,userRole:e,premiumUser:t,teams:B,keys:V,setUserRole:s,userEmail:R,setUserEmail:F,setTeams:U,setKeys:q,organizations:K,addKey:ef,createClicked:ea}):(0,l.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,l.jsx)(c.Z,{userID:eo,userRole:e,premiumUser:t,userEmail:R,setProxySettings:G,proxySettings:Y,accessToken:eh,isPublicPage:!1,sidebarCollapsed:eg,onToggleSidebar:()=>{ej(!eg)}}),(0,l.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(e4,{setPage:e=>{let s=new URLSearchParams(Q);s.set("page",e),window.history.pushState(null,"","?".concat(s.toString())),ex(e)},defaultSelectedKey:eu,sidebarCollapsed:eg})}),"api-keys"==eu?(0,l.jsx)(m.Z,{userID:eo,userRole:e,premiumUser:t,teams:B,keys:V,setUserRole:s,userEmail:R,setUserEmail:F,setTeams:U,setKeys:q,organizations:K,addKey:ef,createClicked:ea}):"models"==eu?(0,l.jsx)(u.Z,{userID:eo,userRole:e,token:et,keys:V,accessToken:eh,modelData:ee,setModelData:es,premiumUser:t,teams:B}):"llm-playground"==eu?(0,l.jsx)(w.Z,{userID:eo,userRole:e,token:et,accessToken:eh,disabledPersonalKeyCreation:O}):"users"==eu?(0,l.jsx)(x.Z,{userID:eo,userRole:e,token:et,keys:V,teams:B,accessToken:eh,setKeys:q}):"teams"==eu?(0,l.jsx)(s_,{teams:B,setTeams:U,accessToken:eh,userID:eo,userRole:e,organizations:K,premiumUser:t,searchParams:Q}):"organizations"==eu?(0,l.jsx)(h.Z,{organizations:K,setOrganizations:H,userModels:W,accessToken:eh,userRole:e,premiumUser:t}):"admin-panel"==eu?(0,l.jsx)(p.Z,{setTeams:U,searchParams:Q,accessToken:eh,userID:eo,showSSOBanner:X,premiumUser:t,proxySettings:Y}):"api_ref"==eu?(0,l.jsx)(Z.Z,{proxySettings:Y}):"settings"==eu?(0,l.jsx)(g.Z,{userID:eo,userRole:e,accessToken:eh,premiumUser:t}):"budgets"==eu?(0,l.jsx)(y.Z,{accessToken:eh}):"guardrails"==eu?(0,l.jsx)(C.Z,{accessToken:eh,userRole:e}):"prompts"==eu?(0,l.jsx)(T.Z,{accessToken:eh,userRole:e}):"transform-request"==eu?(0,l.jsx)(z.Z,{accessToken:eh}):"general-settings"==eu?(0,l.jsx)(j.Z,{userID:eo,userRole:e,accessToken:eh,modelData:ee}):"ui-theme"==eu?(0,l.jsx)(E.Z,{userID:eo,userRole:e,accessToken:eh}):"cost-tracking-settings"==eu?(0,l.jsx)(ek,{userID:eo,userRole:e,accessToken:eh}):"model-hub-table"==eu?(0,l.jsx)(v.Z,{accessToken:eh,publicPage:!1,premiumUser:t,userRole:e}):"caching"==eu?(0,l.jsx)(k.Z,{userID:eo,userRole:e,token:et,accessToken:eh,premiumUser:t}):"pass-through-settings"==eu?(0,l.jsx)(f.Z,{userID:eo,userRole:e,accessToken:eh,modelData:ee}):"logs"==eu?(0,l.jsx)(b.Z,{userID:eo,userRole:e,token:et,accessToken:eh,allTeams:null!=B?B:[],premiumUser:t}):"mcp-servers"==eu?(0,l.jsx)(D.d,{accessToken:eh,userRole:e,userID:eo}):"tag-management"==eu?(0,l.jsx)(P.Z,{accessToken:eh,userRole:e,userID:eo}):"vector-stores"==eu?(0,l.jsx)(I.Z,{accessToken:eh,userRole:e,userID:eo}):"new_usage"==eu?(0,l.jsx)(_.Z,{userID:eo,userRole:e,accessToken:eh,teams:null!=B?B:[],premiumUser:t}):(0,l.jsx)(N.Z,{userID:eo,userRole:e,token:et,accessToken:eh,keys:V,premiumUser:t})]})]})})})})}},88904:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(88913),r=t(93192),i=t(52787),o=t(63709),c=t(87908),d=t(19250),m=t(65925),u=t(46468),x=t(9114);s.Z=e=>{var s;let{accessToken:t,userID:h,userRole:p}=e,[g,j]=(0,a.useState)(!0),[f,y]=(0,a.useState)(null),[b,v]=(0,a.useState)(!1),[_,Z]=(0,a.useState)({}),[w,N]=(0,a.useState)(!1),[k,S]=(0,a.useState)([]),{Paragraph:C}=r.default,{Option:T}=i.default;(0,a.useEffect)(()=>{(async()=>{if(!t){j(!1);return}try{let e=await (0,d.getDefaultTeamSettings)(t);if(y(e),Z(e.values||{}),t)try{let e=await (0,d.modelAvailableCall)(t,h,p);if(e&&e.data){let s=e.data.map(e=>e.id);S(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),x.Z.fromBackend("Failed to fetch team settings")}finally{j(!1)}})()},[t]);let z=async()=>{if(t){N(!0);try{let e=await (0,d.updateDefaultTeamSettings)(t,_);y({...f,values:e.settings}),v(!1),x.Z.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),x.Z.fromBackend("Failed to update team settings")}finally{N(!1)}}},A=(e,s)=>{Z(t=>({...t,[e]:s}))},L=(e,s,t)=>{var a;let r=s.type;return"budget_duration"===e?(0,l.jsx)(m.Z,{value:_[e]||null,onChange:s=>A(e,s),className:"mt-2"}):"boolean"===r?(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(o.Z,{checked:!!_[e],onChange:s=>A(e,s)})}):"array"===r&&(null===(a=s.items)||void 0===a?void 0:a.enum)?(0,l.jsx)(i.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>A(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,l.jsx)(T,{value:e,children:e},e))}):"models"===e?(0,l.jsx)(i.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>A(e,s),className:"mt-2",children:k.map(e=>(0,l.jsx)(T,{value:e,children:(0,u.W0)(e)},e))}):"string"===r&&s.enum?(0,l.jsx)(i.default,{style:{width:"100%"},value:_[e]||"",onChange:s=>A(e,s),className:"mt-2",children:s.enum.map(e=>(0,l.jsx)(T,{value:e,children:e},e))}):(0,l.jsx)(n.oi,{value:void 0!==_[e]?String(_[e]):"",onChange:s=>A(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},D=(e,s)=>null==s?(0,l.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,l.jsx)("span",{children:(0,m.m)(s)}):"boolean"==typeof s?(0,l.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,l.jsx)("span",{className:"text-gray-400",children:"None"}):(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,u.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,l.jsx)("span",{className:"text-gray-400",children:"None"}):(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,l.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,l.jsx)("span",{children:String(s)});return g?(0,l.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,l.jsx)(c.Z,{size:"large"})}):f?(0,l.jsxs)(n.Zb,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(n.Dx,{className:"text-xl",children:"Default Team Settings"}),!g&&f&&(b?(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.zx,{variant:"secondary",onClick:()=>{v(!1),Z(f.values||{})},disabled:w,children:"Cancel"}),(0,l.jsx)(n.zx,{onClick:z,loading:w,children:"Save Changes"})]}):(0,l.jsx)(n.zx,{onClick:()=>v(!0),children:"Edit Settings"}))]}),(0,l.jsx)(n.xv,{children:"These settings will be applied by default when creating new teams."}),(null==f?void 0:null===(s=f.field_schema)||void 0===s?void 0:s.description)&&(0,l.jsx)(C,{className:"mb-4 mt-2",children:f.field_schema.description}),(0,l.jsx)(n.iz,{}),(0,l.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=f;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,a]=s,r=e[t],i=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,l.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,l.jsx)(n.xv,{className:"font-medium text-lg",children:i}),(0,l.jsx)(C,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),b?(0,l.jsx)("div",{className:"mt-2",children:L(t,a,r)}):(0,l.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:D(t,r)})]},t)}):(0,l.jsx)(n.xv,{children:"No schema information available"})})()})]}):(0,l.jsx)(n.Zb,{children:(0,l.jsx)(n.xv,{children:"No team settings available or you do not have permission to view them."})})}},49104:function(e,s,t){"use strict";t.d(s,{Z:function(){return E}});var l=t(57437),a=t(2265),n=t(87452),r=t(88829),i=t(72208),o=t(49566),c=t(13634),d=t(82680),m=t(20577),u=t(52787),x=t(73002),h=t(19250),p=t(9114),g=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:a,setBudgetList:g}=e,[j]=c.Z.useForm(),f=async e=>{if(null!=t&&void 0!=t)try{p.Z.info("Making API Call");let s=await (0,h.budgetCreateCall)(t,e);console.log("key create Response:",s),g(e=>e?[...e,s]:[s]),p.Z.success("Budget Created"),j.resetFields()}catch(e){console.error("Error creating the key:",e),p.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,l.jsx)(d.Z,{title:"Create Budget",visible:s,width:800,footer:null,onOk:()=>{a(!1),j.resetFields()},onCancel:()=>{a(!1),j.resetFields()},children:(0,l.jsxs)(c.Z,{form:j,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,l.jsx)(o.Z,{placeholder:""})}),(0,l.jsx)(c.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsxs)(n.Z,{className:"mt-20 mb-8",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)("b",{children:"Optional Settings"})}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(m.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(u.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(u.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(u.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(u.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(x.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},j=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:g,setBudgetList:j,existingBudget:f,handleUpdateCall:y}=e;console.log("existingBudget",f);let[b]=c.Z.useForm();(0,a.useEffect)(()=>{b.setFieldsValue(f)},[f,b]);let v=async e=>{if(null!=t&&void 0!=t)try{p.Z.info("Making API Call"),g(!0);let s=await (0,h.budgetUpdateCall)(t,e);j(e=>e?[...e,s]:[s]),p.Z.success("Budget Updated"),b.resetFields(),y()}catch(e){console.error("Error creating the key:",e),p.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,l.jsx)(d.Z,{title:"Edit Budget",visible:s,width:800,footer:null,onOk:()=>{g(!1),b.resetFields()},onCancel:()=>{g(!1),b.resetFields()},children:(0,l.jsxs)(c.Z,{form:b,onFinish:v,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:f,children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,l.jsx)(o.Z,{placeholder:""})}),(0,l.jsx)(c.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsxs)(n.Z,{className:"mt-20 mb-8",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)("b",{children:"Optional Settings"})}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(m.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(u.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(u.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(u.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(u.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(x.ZP,{htmlType:"submit",children:"Save"})})]})})},f=t(20831),y=t(12514),b=t(47323),v=t(12485),_=t(18135),Z=t(35242),w=t(29706),N=t(77991),k=t(21626),S=t(97214),C=t(28241),T=t(58834),z=t(69552),A=t(71876),L=t(84264),D=t(53410),P=t(74998),I=t(17906),E=e=>{let{accessToken:s}=e,[t,n]=(0,a.useState)(!1),[r,i]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),[d,m]=(0,a.useState)([]);(0,a.useEffect)(()=>{s&&(0,h.getBudgetList)(s).then(e=>{m(e)})},[s]);let u=async(e,t)=>{console.log("budget_id",e),null!=s&&(c(d.find(s=>s.budget_id===e)||null),i(!0))},x=async(e,t)=>{if(null==s)return;p.Z.info("Request made"),await (0,h.budgetDeleteCall)(s,e);let l=[...d];l.splice(t,1),m(l),p.Z.success("Budget Deleted.")},E=async()=>{null!=s&&(0,h.getBudgetList)(s).then(e=>{m(e)})};return(0,l.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,l.jsx)(f.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>n(!0),children:"+ Create Budget"}),(0,l.jsx)(g,{accessToken:s,isModalVisible:t,setIsModalVisible:n,setBudgetList:m}),o&&(0,l.jsx)(j,{accessToken:s,isModalVisible:r,setIsModalVisible:i,setBudgetList:m,existingBudget:o,handleUpdateCall:E}),(0,l.jsxs)(y.Z,{children:[(0,l.jsx)(L.Z,{children:"Create a budget to assign to customers."}),(0,l.jsxs)(k.Z,{children:[(0,l.jsx)(T.Z,{children:(0,l.jsxs)(A.Z,{children:[(0,l.jsx)(z.Z,{children:"Budget ID"}),(0,l.jsx)(z.Z,{children:"Max Budget"}),(0,l.jsx)(z.Z,{children:"TPM"}),(0,l.jsx)(z.Z,{children:"RPM"})]})}),(0,l.jsx)(S.Z,{children:d.slice().sort((e,s)=>new Date(s.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,s)=>(0,l.jsxs)(A.Z,{children:[(0,l.jsx)(C.Z,{children:e.budget_id}),(0,l.jsx)(C.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,l.jsx)(C.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,l.jsx)(C.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,l.jsx)(b.Z,{icon:D.Z,size:"sm",onClick:()=>u(e.budget_id,s)}),(0,l.jsx)(b.Z,{icon:P.Z,size:"sm",onClick:()=>x(e.budget_id,s)})]},s))})]})]}),(0,l.jsxs)("div",{className:"mt-5",children:[(0,l.jsx)(L.Z,{className:"text-base",children:"How to use budget id"}),(0,l.jsxs)(_.Z,{children:[(0,l.jsxs)(Z.Z,{children:[(0,l.jsx)(v.Z,{children:"Assign Budget to Customer"}),(0,l.jsx)(v.Z,{children:"Test it (Curl)"}),(0,l.jsx)(v.Z,{children:"Test it (OpenAI SDK)"})]}),(0,l.jsxs)(N.Z,{children:[(0,l.jsx)(w.Z,{children:(0,l.jsx)(I.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(I.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(I.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="",\n api_key=""\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})}},918:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(62490),r=t(19250),i=t(9114);s.Z=e=>{let{accessToken:s,userID:t}=e,[o,c]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{if(s&&t)try{let e=await (0,r.availableTeamListCall)(s);c(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,t]);let d=async e=>{if(s&&t)try{await (0,r.teamMemberAddCall)(s,e,{user_id:t,role:"user"}),i.Z.success("Successfully joined team"),c(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),i.Z.fromBackend("Failed to join team")}};return(0,l.jsx)(n.Zb,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,l.jsxs)(n.iA,{children:[(0,l.jsx)(n.ss,{children:(0,l.jsxs)(n.SC,{children:[(0,l.jsx)(n.xs,{children:"Team Name"}),(0,l.jsx)(n.xs,{children:"Description"}),(0,l.jsx)(n.xs,{children:"Members"}),(0,l.jsx)(n.xs,{children:"Models"}),(0,l.jsx)(n.xs,{children:"Actions"})]})}),(0,l.jsxs)(n.RM,{children:[o.map(e=>(0,l.jsxs)(n.SC,{children:[(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.xv,{children:e.team_alias})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.xv,{children:e.description||"No description available"})}),(0,l.jsx)(n.pj,{children:(0,l.jsxs)(n.xv,{children:[e.members_with_roles.length," members"]})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,l.jsx)(n.Ct,{size:"xs",className:"mb-1",color:"blue",children:(0,l.jsx)(n.xv,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,l.jsx)(n.Ct,{size:"xs",color:"red",children:(0,l.jsx)(n.xv,{children:"All Proxy Models"})})})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.zx,{size:"xs",variant:"secondary",onClick:()=>d(e.team_id),children:"Join Team"})})]},e.team_id)),0===o.length&&(0,l.jsx)(n.SC,{children:(0,l.jsx)(n.pj,{colSpan:5,className:"text-center",children:(0,l.jsx)(n.xv,{children:"No available teams to join"})})})]})]})})}},6674:function(e,s,t){"use strict";t.d(s,{Z:function(){return d}});var l=t(57437),a=t(2265),n=t(73002),r=t(23639),i=t(96761),o=t(19250),c=t(9114),d=e=>{let{accessToken:s}=e,[t,d]=(0,a.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),p=(e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")},g=async()=>{h(!0);try{let e;try{e=JSON.parse(t)}catch(e){c.Z.fromBackend("Invalid JSON in request body"),h(!1);return}let l={call_type:"completion",request_body:e};if(!s){c.Z.fromBackend("No access token found"),h(!1);return}let a=await (0,o.transformRequestCall)(s,l);if(a.raw_request_api_base&&a.raw_request_body){let e=p(a.raw_request_api_base,a.raw_request_body,a.raw_request_headers||{});u(e),c.Z.success("Request transformed successfully")}else{let e="string"==typeof a?a:JSON.stringify(a);u(e),c.Z.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),c.Z.fromBackend("Failed to transform request")}finally{h(!1)}};return(0,l.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,l.jsx)(i.Z,{children:"Playground"}),(0,l.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,l.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,l.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,l.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,l.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,l.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,l.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),g())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,l.jsxs)(n.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:g,loading:x,children:[(0,l.jsx)("span",{children:"Transform"}),(0,l.jsx)("span",{children:"→"})]})})]}),(0,l.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,l.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,l.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,l.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,l.jsx)("br",{}),(0,l.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,l.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,l.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:m||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,l.jsx)(n.ZP,{type:"text",icon:(0,l.jsx)(r.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(m||""),c.Z.success("Copied to clipboard")}})]})]})]}),(0,l.jsx)("div",{className:"mt-4 text-right w-full",children:(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue"," ",(0,l.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})}},5183:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(19046),r=t(69734),i=t(19250),o=t(9114);s.Z=e=>{let{userID:s,userRole:t,accessToken:c}=e,{logoUrl:d,setLogoUrl:m}=(0,r.F)(),[u,x]=(0,a.useState)(""),[h,p]=(0,a.useState)(!1);(0,a.useEffect)(()=>{c&&g()},[c]);let g=async()=>{try{let s=(0,i.getProxyBaseUrl)(),t=await fetch(s?"".concat(s,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"}});if(t.ok){var e;let s=await t.json(),l=(null===(e=s.values)||void 0===e?void 0:e.logo_url)||"";x(l),m(l||null)}}catch(e){console.error("Error fetching theme settings:",e)}},j=async()=>{p(!0);try{let e=(0,i.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"},body:JSON.stringify({logo_url:u||null})})).ok)o.Z.success("Logo settings updated successfully!"),m(u||null);else throw Error("Failed to update settings")}catch(e){console.error("Error updating logo settings:",e),o.Z.fromBackend("Failed to update logo settings")}finally{p(!1)}},f=async()=>{x(""),m(null),p(!0);try{let e=(0,i.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"},body:JSON.stringify({logo_url:null})})).ok)o.Z.success("Logo reset to default!");else throw Error("Failed to reset logo")}catch(e){console.error("Error resetting logo:",e),o.Z.fromBackend("Failed to reset logo")}finally{p(!1)}};return c?(0,l.jsxs)("div",{className:"w-full mx-auto max-w-4xl px-6 py-8",children:[(0,l.jsxs)("div",{className:"mb-8",children:[(0,l.jsx)(n.Dx,{className:"text-2xl font-bold mb-2",children:"Logo Customization"}),(0,l.jsx)(n.xv,{className:"text-gray-600",children:"Customize your LiteLLM admin dashboard with a custom logo."})]}),(0,l.jsx)(n.Zb,{className:"shadow-sm p-6",children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(n.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Logo URL"}),(0,l.jsx)(n.oi,{placeholder:"https://example.com/logo.png",value:u,onValueChange:e=>{x(e),m(e||null)},className:"w-full"}),(0,l.jsx)(n.xv,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom logo or leave empty to use the default LiteLLM logo"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(n.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Current Logo"}),(0,l.jsx)("div",{className:"bg-gray-50 rounded-lg p-6 flex items-center justify-center min-h-[120px]",children:u?(0,l.jsx)("img",{src:u,alt:"Custom logo",className:"max-w-full max-h-24 object-contain",onError:e=>{var s;let t=e.target;t.style.display="none";let l=document.createElement("div");l.className="text-gray-500 text-sm",l.textContent="Failed to load image",null===(s=t.parentElement)||void 0===s||s.appendChild(l)}}):(0,l.jsx)(n.xv,{className:"text-gray-500 text-sm",children:"Default LiteLLM logo will be used"})})]}),(0,l.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,l.jsx)(n.zx,{onClick:j,loading:h,disabled:h,color:"indigo",children:"Save Changes"}),(0,l.jsx)(n.zx,{onClick:f,loading:h,disabled:h,variant:"secondary",color:"gray",children:"Reset to Default"})]})]})})]}):null}}},function(e){e.O(0,[3665,6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,7906,2344,3669,9165,1264,1487,3752,5105,6433,1160,9888,3250,9429,1223,8050,8049,131,2202,874,4292,2162,2004,2012,8160,7801,2306,3801,1307,1052,7155,3298,6204,1739,773,6925,8143,2273,5809,603,2019,4696,2971,2117,1744],function(){return e(e.s=97731)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{97731:function(e,s,t){Promise.resolve().then(t.bind(t,50036))},23192:function(e,s,t){"use strict";t.d(s,{Z:function(){return h}});var l=t(57437);t(2265);var a=t(67101),n=t(12485),r=t(18135),i=t(35242),o=t(29706),c=t(77991),d=t(84264),m=t(25653),u=t(96362),x=e=>{let{href:s,className:t}=e;return(0,l.jsxs)("a",{href:s,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(){for(var e=arguments.length,s=Array(e),t=0;t{let{proxySettings:s}=e,t="";return(null==s?void 0:s.PROXY_BASE_URL)!==void 0&&(null==s?void 0:s.PROXY_BASE_URL)&&(t=s.PROXY_BASE_URL),(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(a.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,l.jsx)(x,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,l.jsxs)(d.Z,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,l.jsxs)(r.Z,{children:[(0,l.jsxs)(i.Z,{children:[(0,l.jsx)(n.Z,{children:"OpenAI Python SDK"}),(0,l.jsx)(n.Z,{children:"LlamaIndex"}),(0,l.jsx)(n.Z,{children:"Langchain Py"})]}),(0,l.jsxs)(c.Z,{children:[(0,l.jsx)(o.Z,{children:(0,l.jsx)(m.Z,{language:"python",code:'import openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(t,'" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)')})}),(0,l.jsx)(o.Z,{children:(0,l.jsx)(m.Z,{language:"python",code:'import os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="'.concat(t,'", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="').concat(t,'",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)')})}),(0,l.jsx)(o.Z,{children:(0,l.jsx)(m.Z,{language:"python",code:'from langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="'.concat(t,'",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)')})})]})]})]})})})}},25653:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(30401),r=t(5136),i=t(17906),o=t(1479);s.Z=e=>{let{code:s,language:t}=e,[c,d]=(0,a.useState)(!1);return(0,l.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,l.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(s),d(!0),setTimeout(()=>d(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:c?(0,l.jsx)(n.Z,{size:16}):(0,l.jsx)(r.Z,{size:16})}),(0,l.jsx)(i.Z,{language:t,style:o.Z,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:s})]})}},50036:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return sS}});var l=t(57437),a=t(2265),n=t(99376),r=t(14474),i=t(21623),o=t(29827),c=t(65373),d=t(69734),m=t(21739),u=t(37801),x=t(77155),h=t(22004),p=t(90773),g=t(6925),j=t(85809),f=t(10607),y=t(49104),b=t(33801),v=t(18160),_=t(62306),Z=t(23192),w=t(39681),N=t(18143),k=t(44696),S=t(19250),C=t(63298),T=t(30603),z=t(6674),A=t(30874),L=t(39210),D=t(21307),P=t(42273),I=t(6204),E=t(5183),O=t(20831),M=t(12485),R=t(18135),F=t(35242),B=t(29706),U=t(77991),V=t(84264),q=t(96761),K=t(13634),H=t(82680),W=t(9114),J=t(42673);let Y=e=>{let s=Object.keys(J.fK).find(s=>J.fK[s]===e);if(s){let e=J.Cl[s],t=J.cd[e];return{displayName:e,logo:t,enumKey:s}}return{displayName:e,logo:"",enumKey:null}},G=e=>J.fK[e]||null,X=(e,s)=>{let t=e.target,l=t.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=s.charAt(0),l.replaceChild(e,t)}};var $=t(47323),Q=t(49566),ee=t(82422),es=t(3837),et=t(53410),el=t(74998),ea=t(21626),en=t(97214),er=t(28241),ei=t(58834),eo=t(69552),ec=t(71876);function ed(e){let{data:s,columns:t,isLoading:a=!1,loadingMessage:n="Loading...",emptyMessage:r="No data",getRowKey:i}=e;return(0,l.jsxs)(ea.Z,{children:[(0,l.jsx)(ei.Z,{children:(0,l.jsx)(ec.Z,{children:t.map((e,s)=>(0,l.jsx)(eo.Z,{style:{width:e.width},children:e.header},s))})}),(0,l.jsx)(en.Z,{children:a?(0,l.jsx)(ec.Z,{children:(0,l.jsx)(er.Z,{colSpan:t.length,className:"text-center",children:(0,l.jsx)(V.Z,{className:"text-gray-500",children:n})})}):s.length>0?s.map((e,s)=>(0,l.jsx)(ec.Z,{children:t.map((s,t)=>{var a;return(0,l.jsx)(er.Z,{children:s.cell?s.cell(e):String(null!==(a=e[s.accessor])&&void 0!==a?a:"")},t)})},i?i(e,s):s)):(0,l.jsx)(ec.Z,{children:(0,l.jsx)(er.Z,{colSpan:t.length,className:"text-center",children:(0,l.jsx)(V.Z,{className:"text-gray-500",children:r})})})})]})}var em=e=>{let{discountConfig:s,onDiscountChange:t,onRemoveProvider:n}=e,[r,i]=(0,a.useState)(null),[o,c]=(0,a.useState)(""),d=(e,s)=>{i(e),c((100*s).toString())},m=e=>{let s=parseFloat(o);!isNaN(s)&&s>=0&&s<=100&&t(e,(s/100).toString()),i(null),c("")},u=()=>{i(null),c("")},x=(e,s)=>{"Enter"===e.key?m(s):"Escape"===e.key&&u()},h=Object.entries(s).map(e=>{let[s,t]=e;return{provider:s,discount:t}}).sort((e,s)=>{let t=Y(e.provider).displayName,l=Y(s.provider).displayName;return t.localeCompare(l)});return(0,l.jsx)(ed,{data:h,columns:[{header:"Provider",cell:e=>{let{displayName:s,logo:t}=Y(e.provider);return(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,l.jsx)("img",{src:t,alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>X(e,s)}),(0,l.jsx)("span",{className:"font-medium",children:s})]})}},{header:"Discount Percentage",cell:e=>(0,l.jsx)("div",{className:"flex items-center gap-2",children:r===e.provider?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.Z,{value:o,onValueChange:c,onKeyDown:s=>x(s,e.provider),placeholder:"5",className:"w-20",autoFocus:!0}),(0,l.jsx)("span",{className:"text-gray-600",children:"%"}),(0,l.jsx)($.Z,{icon:ee.Z,size:"sm",onClick:()=>m(e.provider),className:"cursor-pointer text-green-600 hover:text-green-700"}),(0,l.jsx)($.Z,{icon:es.Z,size:"sm",onClick:u,className:"cursor-pointer text-gray-600 hover:text-gray-700"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(V.Z,{className:"font-medium",children:[(100*e.discount).toFixed(1),"%"]}),(0,l.jsx)($.Z,{icon:et.Z,size:"sm",onClick:()=>d(e.provider,e.discount),className:"cursor-pointer text-blue-600 hover:text-blue-700"})]})}),width:"250px"},{header:"Actions",cell:e=>{let{displayName:s}=Y(e.provider);return(0,l.jsx)($.Z,{icon:el.Z,size:"sm",onClick:()=>n(e.provider,s),className:"cursor-pointer hover:text-red-600"})},width:"80px"}],getRowKey:e=>e.provider,emptyMessage:"No provider discounts configured"})},eu=t(64504),ex=t(89970),eh=t(52787),ep=t(15424),eg=t(33145),ej=e=>{let{discountConfig:s,selectedProvider:t,newDiscount:a,onProviderChange:n,onDiscountChange:r,onAddProvider:i}=e;return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Provider",(0,l.jsx)(ex.Z,{title:"Select the LLM provider you want to configure a discount for",children:(0,l.jsx)(ep.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(eh.default,{showSearch:!0,placeholder:"Select provider",value:t,onChange:n,style:{width:"100%"},size:"large",optionFilterProp:"children",filterOption:(e,s)=>{var t;return String(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},children:Object.entries(J.Cl).map(e=>{let[t,a]=e,n=J.fK[t];return n&&s[n]?null:(0,l.jsx)(eh.default.Option,{value:t,label:a,children:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(eg.default,{src:J.cd[a],alt:"".concat(t," logo"),width:20,height:20,className:"w-5 h-5",onError:e=>X(e,a)}),(0,l.jsx)("span",{children:a})]})},t)})})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Discount Percentage",(0,l.jsx)(ex.Z,{title:"Enter a percentage value (e.g., 5 for 5% discount)",children:(0,l.jsx)(ep.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),rules:[{required:!0,message:"Please enter a discount percentage"}],children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(eu.o,{placeholder:"5",value:a,onValueChange:r,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 flex-1"}),(0,l.jsx)("span",{className:"text-gray-600",children:"%"})]})}),(0,l.jsx)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:(0,l.jsx)(eu.z,{variant:"primary",onClick:i,disabled:!t||!a,children:"Add Provider Discount"})})]})},ef=t(29271),ey=t(40875),eb=t(96362);let ev=e=>{let{items:s,children:t="Docs",className:n=""}=e,[r,i]=(0,a.useState)(!1),o=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&i(!1)};return r&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[r]),(0,l.jsxs)("div",{className:"relative inline-block ".concat(n),ref:o,children:[(0,l.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"inline-flex items-center gap-1 text-gray-500 hover:text-gray-700 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded px-2 py-1","aria-expanded":r,"aria-haspopup":"true",children:[(0,l.jsx)("span",{children:t}),(0,l.jsx)(ey.Z,{className:"h-3 w-3 transition-transform ".concat(r?"rotate-180":""),"aria-hidden":"true"})]}),r&&(0,l.jsx)("div",{className:"absolute right-0 mt-1 w-56 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50",children:s.map((e,s)=>(0,l.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",onClick:()=>i(!1),children:[(0,l.jsx)("span",{children:e.label}),(0,l.jsx)(eb.Z,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0 ml-2","aria-hidden":"true"})]},s))})]})};var e_=t(56522),eZ=t(25653),ew=()=>{let[e,s]=(0,a.useState)(""),[t,n]=(0,a.useState)(""),r=(0,a.useMemo)(()=>{let s=parseFloat(e),l=parseFloat(t);if(isNaN(s)||isNaN(l)||0===s||0===l)return null;let a=s+l;return{originalCost:a.toFixed(10),finalCost:s.toFixed(10),discountAmount:l.toFixed(10),discountPercentage:(l/a*100).toFixed(2)}},[e,t]);return(0,l.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-1",children:"Cost Calculation"}),(0,l.jsxs)(e_.x,{className:"text-xs text-gray-600",children:["Discounts are applied to provider costs: ",(0,l.jsx)("code",{className:"bg-gray-100 px-1.5 py-0.5 rounded text-xs",children:"final_cost = base_cost \xd7 (1 - discount%/100)"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-1",children:"Example"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"A 5% discount on a $10.00 request results in: $10.00 \xd7 (1 - 0.05) = $9.50"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-1",children:"Valid Range"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Discount percentages must be between 0% and 100%"})]}),(0,l.jsxs)("div",{className:"pt-4 border-t border-gray-200",children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-2",children:"Validating Discounts"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600 mb-3",children:"Make a test request and check the response headers to verify discounts are applied:"}),(0,l.jsx)(eZ.Z,{language:"bash",code:'curl -X POST -i http://your-proxy:4000/chat/completions \\\n -H "Content-Type: application/json" \\\n -H "Authorization: Bearer sk-1234" \\\n -d \'{\n "model": "gemini/gemini-2.5-pro",\n "messages": [{"role": "user", "content": "Hello"}]\n }\''}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600 mt-3 mb-2",children:"Look for these headers in the response:"}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded text-xs font-mono text-gray-800 whitespace-nowrap",children:"x-litellm-response-cost"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Final cost after discount"})]}),(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded text-xs font-mono text-gray-800 whitespace-nowrap",children:"x-litellm-response-cost-original"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Original cost before discount"})]}),(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded text-xs font-mono text-gray-800 whitespace-nowrap",children:"x-litellm-response-cost-discount-amount"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600",children:"Amount discounted"})]})]})]}),(0,l.jsxs)("div",{className:"pt-4 border-t border-gray-200",children:[(0,l.jsx)(e_.x,{className:"font-medium text-gray-900 text-sm mb-3",children:"Discount Calculator"}),(0,l.jsx)(e_.x,{className:"text-xs text-gray-600 mb-3",children:"Enter values from your response headers to verify the discount:"}),(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Response Cost (x-litellm-response-cost)"}),(0,l.jsx)(e_.o,{placeholder:"0.0171938125",value:e,onValueChange:s,className:"text-sm"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Discount Amount (x-litellm-response-cost-discount-amount)"}),(0,l.jsx)(e_.o,{placeholder:"0.0009049375",value:t,onValueChange:n,className:"text-sm"})]})]}),r&&(0,l.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,l.jsx)(e_.x,{className:"text-sm font-medium text-blue-900 mb-2",children:"Calculated Results"}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(e_.x,{className:"text-xs text-blue-800",children:"Original Cost:"}),(0,l.jsxs)("code",{className:"text-xs font-mono text-blue-900",children:["$",r.originalCost]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(e_.x,{className:"text-xs text-blue-800",children:"Final Cost:"}),(0,l.jsxs)("code",{className:"text-xs font-mono text-blue-900",children:["$",r.finalCost]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(e_.x,{className:"text-xs text-blue-800",children:"Discount Amount:"}),(0,l.jsxs)("code",{className:"text-xs font-mono text-blue-900",children:["$",r.discountAmount]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-blue-300",children:[(0,l.jsx)(e_.x,{className:"text-xs font-semibold text-blue-900",children:"Discount Applied:"}),(0,l.jsxs)(e_.x,{className:"text-sm font-bold text-blue-900",children:[r.discountPercentage,"%"]})]})]})]})]})]})};let eN=[{label:"Custom pricing for models",href:"https://docs.litellm.ai/docs/proxy/custom_pricing"},{label:"Spend tracking",href:"https://docs.litellm.ai/docs/proxy/cost_tracking"}];var ek=e=>{let{userID:s,userRole:t,accessToken:n}=e,[r,i]=(0,a.useState)({}),[o,c]=(0,a.useState)(void 0),[d,m]=(0,a.useState)(""),[u,x]=(0,a.useState)(!0),[h,p]=(0,a.useState)(!1),[g]=K.Z.useForm(),[j,f]=H.Z.useModal(),y=(0,a.useCallback)(async()=>{x(!0);try{let e=(0,S.getProxyBaseUrl)(),s=await fetch(e?"".concat(e,"/config/cost_discount_config"):"/config/cost_discount_config",{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(s.ok){let e=await s.json();i(e.values||{})}else console.error("Failed to fetch discount config")}catch(e){console.error("Error fetching discount config:",e),W.Z.fromBackend("Failed to fetch discount configuration")}finally{x(!1)}},[n]);(0,a.useEffect)(()=>{n&&y()},[n,y]);let b=async e=>{try{let t=(0,S.getProxyBaseUrl)(),l=await fetch(t?"".concat(t,"/config/cost_discount_config"):"/config/cost_discount_config",{method:"PATCH",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(e)});if(l.ok)W.Z.success("Discount configuration updated successfully"),await y();else{var s;let e=await l.json(),t=(null===(s=e.detail)||void 0===s?void 0:s.error)||e.detail||"Failed to update settings";W.Z.fromBackend(t)}}catch(e){console.error("Error updating discount config:",e),W.Z.fromBackend("Failed to update discount configuration")}},v=async()=>{if(!o||!d){W.Z.fromBackend("Please select a provider and enter discount percentage");return}let e=parseFloat(d);if(isNaN(e)||e<0||e>100){W.Z.fromBackend("Discount must be between 0% and 100%");return}let s=G(o);if(!s){W.Z.fromBackend("Invalid provider selected");return}if(r[s]){W.Z.fromBackend("Discount for ".concat(J.Cl[o]," already exists. Edit it in the table above."));return}let t={...r,[s]:e/100};i(t),await b(t),c(void 0),m(""),p(!1)},_=async(e,s)=>{j.confirm({title:"Remove Provider Discount",icon:(0,l.jsx)(ef.Z,{}),content:"Are you sure you want to remove the discount for ".concat(s,"?"),okText:"Remove",okType:"danger",cancelText:"Cancel",onOk:async()=>{let s={...r};delete s[e],i(s),await b(s)}})},Z=async(e,s)=>{let t=parseFloat(s);if(!isNaN(t)&&t>=0&&t<=1){let s={...r,[e]:t};i(s),await b(s)}};return n?(0,l.jsxs)("div",{className:"w-full p-8",children:[f,(0,l.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between mb-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(q.Z,{children:"Cost Tracking Settings"}),(0,l.jsx)(ev,{items:eN})]}),(0,l.jsx)(V.Z,{className:"text-gray-500 mt-1",children:"Configure cost discounts for different LLM providers. Changes are saved automatically."})]}),(0,l.jsx)(O.Z,{onClick:()=>p(!0),className:"mt-4 md:mt-0",children:"+ Add Provider Discount"})]}),(0,l.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full",children:(0,l.jsxs)(R.Z,{children:[(0,l.jsxs)(F.Z,{className:"px-6 pt-4",children:[(0,l.jsx)(M.Z,{children:"Provider Discounts"}),(0,l.jsx)(M.Z,{children:"Test It"})]}),(0,l.jsxs)(U.Z,{children:[(0,l.jsx)(B.Z,{children:u?(0,l.jsx)("div",{className:"py-12 text-center",children:(0,l.jsx)(V.Z,{className:"text-gray-500",children:"Loading configuration..."})}):Object.keys(r).length>0?(0,l.jsx)("div",{className:"p-6",children:(0,l.jsx)(em,{discountConfig:r,onDiscountChange:Z,onRemoveProvider:_})}):(0,l.jsxs)("div",{className:"py-16 px-6 text-center",children:[(0,l.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-400 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,l.jsx)(V.Z,{className:"text-gray-700 font-medium mb-2",children:"No provider discounts configured"}),(0,l.jsx)(V.Z,{className:"text-gray-500 text-sm",children:'Click "Add Provider Discount" to get started'})]})}),(0,l.jsx)(B.Z,{children:(0,l.jsx)("div",{className:"px-6 pb-4",children:(0,l.jsx)(ew,{})})})]})]})}),(0,l.jsx)(H.Z,{title:(0,l.jsx)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Provider Discount"})}),open:h,width:1e3,onCancel:()=>{p(!1),g.resetFields(),c(void 0),m("")},footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,l.jsxs)("div",{className:"mt-6",children:[(0,l.jsx)(V.Z,{className:"text-sm text-gray-600 mb-6",children:"Select a provider and set its discount percentage. Enter a value between 0% and 100% (e.g., 5 for a 5% discount)."}),(0,l.jsx)(K.Z,{form:g,onFinish:e=>{v()},layout:"vertical",className:"space-y-6",children:(0,l.jsx)(ej,{discountConfig:r,selectedProvider:o,newDiscount:d,onProviderChange:c,onDiscountChange:m,onAddProvider:v})})]})})]}):null},eS=t(91323),eC=t(10012),eT=t(31857),ez=t(19226),eA=t(45937),eL=t(92403),eD=t(28595),eP=t(68208),eI=t(9775),eE=t(41361),eO=t(37527),eM=t(15883),eR=t(12660),eF=t(88009),eB=t(48231),eU=t(57400),eV=t(58630),eq=t(44625),eK=t(41169),eH=t(38434),eW=t(71891),eJ=t(55322),eY=t(11429),eG=t(20347),eX=t(79262),e$=t(13959);let{Sider:eQ}=ez.default;var e0=e=>{let{accessToken:s,setPage:t,userRole:a,defaultSelectedKey:n,collapsed:r=!1}=e,i=[{key:"1",page:"api-keys",label:"Virtual Keys",icon:(0,l.jsx)(eL.Z,{style:{fontSize:"18px"}})},{key:"3",page:"llm-playground",label:"Test Key",icon:(0,l.jsx)(eD.Z,{style:{fontSize:"18px"}}),roles:eG.LQ},{key:"2",page:"models",label:"Models + Endpoints",icon:(0,l.jsx)(eP.Z,{style:{fontSize:"18px"}}),roles:eG.LQ},{key:"12",page:"new_usage",label:"Usage",icon:(0,l.jsx)(eI.Z,{style:{fontSize:"18px"}}),roles:[...eG.ZL,...eG.lo]},{key:"6",page:"teams",label:"Teams",icon:(0,l.jsx)(eE.Z,{style:{fontSize:"18px"}})},{key:"17",page:"organizations",label:"Organizations",icon:(0,l.jsx)(eO.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"5",page:"users",label:"Internal Users",icon:(0,l.jsx)(eM.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"14",page:"api_ref",label:"API Reference",icon:(0,l.jsx)(eR.Z,{style:{fontSize:"18px"}})},{key:"16",page:"model-hub-table",label:"Model Hub",icon:(0,l.jsx)(eF.Z,{style:{fontSize:"18px"}})},{key:"15",page:"logs",label:"Logs",icon:(0,l.jsx)(eB.Z,{style:{fontSize:"18px"}})},{key:"11",page:"guardrails",label:"Guardrails",icon:(0,l.jsx)(eU.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"26",page:"tools",label:"Tools",icon:(0,l.jsx)(eV.Z,{style:{fontSize:"18px"}}),children:[{key:"18",page:"mcp-servers",label:"MCP Servers",icon:(0,l.jsx)(eV.Z,{style:{fontSize:"18px"}})},{key:"21",page:"vector-stores",label:"Vector Stores",icon:(0,l.jsx)(eq.Z,{style:{fontSize:"18px"}}),roles:eG.ZL}]},{key:"experimental",page:"experimental",label:"Experimental",icon:(0,l.jsx)(eK.Z,{style:{fontSize:"18px"}}),children:[{key:"9",page:"caching",label:"Caching",icon:(0,l.jsx)(eq.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"25",page:"prompts",label:"Prompts",icon:(0,l.jsx)(eH.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"10",page:"budgets",label:"Budgets",icon:(0,l.jsx)(eO.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"20",page:"transform-request",label:"API Playground",icon:(0,l.jsx)(eR.Z,{style:{fontSize:"18px"}}),roles:[...eG.ZL,...eG.lo]},{key:"19",page:"tag-management",label:"Tag Management",icon:(0,l.jsx)(eW.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"4",page:"usage",label:"Old Usage",icon:(0,l.jsx)(eI.Z,{style:{fontSize:"18px"}})}]},{key:"settings",page:"settings",label:"Settings",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL,children:[{key:"11",page:"general-settings",label:"Router Settings",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"8",page:"settings",label:"Logging & Alerts",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"13",page:"admin-panel",label:"Admin Settings",icon:(0,l.jsx)(eJ.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"27",page:"cost-tracking-settings",label:"Cost Tracking",icon:(0,l.jsx)(eI.Z,{style:{fontSize:"18px"}}),roles:eG.ZL},{key:"14",page:"ui-theme",label:"UI Theme",icon:(0,l.jsx)(eY.Z,{style:{fontSize:"18px"}}),roles:eG.ZL}]}],o=(e=>{let s=i.find(s=>s.page===e);if(s)return s.key;for(let s of i)if(s.children){let t=s.children.find(s=>s.page===e);if(t)return t.key}return"1"})(n),c=i.filter(e=>{let s=!e.roles||e.roles.includes(a);return console.log("Menu item ".concat(e.label,": roles=").concat(e.roles,", userRole=").concat(a,", hasAccess=").concat(s)),!!s&&(e.children&&(e.children=e.children.filter(e=>!e.roles||e.roles.includes(a))),!0)});return(0,l.jsx)(ez.default,{style:{minHeight:"100vh"},children:(0,l.jsxs)(eQ,{theme:"light",width:220,collapsed:r,collapsedWidth:80,collapsible:!0,trigger:null,style:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative"},children:[(0,l.jsx)(e$.ZP,{theme:{components:{Menu:{iconSize:18,fontSize:14}}},children:(0,l.jsx)(eA.Z,{mode:"inline",selectedKeys:[o],defaultOpenKeys:r?[]:["llm-tools"],inlineCollapsed:r,className:"custom-sidebar-menu",style:{borderRight:0,backgroundColor:"transparent",fontSize:"14px"},items:c.map(e=>{var s;return{key:e.key,icon:e.icon,label:e.label,children:null===(s=e.children)||void 0===s?void 0:s.map(e=>({key:e.key,icon:e.icon,label:e.label,onClick:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}})),onClick:e.children?void 0:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}}})})}),(0,eG.tY)(a)&&!r&&(0,l.jsx)(eX.Z,{accessToken:s,width:220})]})})},e1=t(92019),e2=t(80443),e4=e=>{let{setPage:s,defaultSelectedKey:t,sidebarCollapsed:a}=e,{refactoredUIFlag:n}=(0,eT.Z)(),{accessToken:r,userRole:i}=(0,e2.Z)();return n?(0,l.jsx)(e1.Z,{accessToken:r,defaultSelectedKey:t,userRole:i}):(0,l.jsx)(e0,{accessToken:r,setPage:s,userRole:i,defaultSelectedKey:t,collapsed:a})},e5=t(93192),e3=t(23628),e8=t(86462),e6=t(47686),e9=t(64482),e7=t(73002),se=t(24199),ss=t(46468),st=t(25512),sl=t(33293),sa=t(88904),sn=t(87452),sr=t(88829),si=t(72208),so=t(41649),sc=t(12514),sd=t(49804),sm=t(67101),su=t(918),sx=t(97415),sh=t(2597),sp=t(59872),sg=t(32489),sj=t(76865),sf=t(95920),sy=t(68473),sb=t(51750);let sv=(e,s)=>{let t=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),t=e.models):t=s,(0,ss.Ob)(t,s)};var s_=e=>{let{teams:s,searchParams:t,accessToken:n,setTeams:r,userID:i,userRole:o,organizations:c,premiumUser:d=!1}=e,[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(null),[p,g]=(0,a.useState)(null),[j,f]=(0,a.useState)(!1),[y,b]=(0,a.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"});(0,a.useEffect)(()=>{console.log("inside useeffect - ".concat(m)),n&&(0,L.Z)(n,i,o,x,r),eB()},[m]);let[v]=K.Z.useForm(),[_]=K.Z.useForm(),{Title:Z,Paragraph:w}=e5.default,[N,k]=(0,a.useState)(""),[C,T]=(0,a.useState)(!1),[z,A]=(0,a.useState)(null),[D,P]=(0,a.useState)(null),[I,E]=(0,a.useState)(!1),[q,J]=(0,a.useState)(!1),[Y,G]=(0,a.useState)(!1),[X,ee]=(0,a.useState)(!1),[es,ed]=(0,a.useState)([]),[em,eu]=(0,a.useState)(!1),[eg,ej]=(0,a.useState)(null),[ef,ey]=(0,a.useState)([]),[eb,ev]=(0,a.useState)({}),[e_,eZ]=(0,a.useState)([]),[ew,eN]=(0,a.useState)({}),[ek,eS]=(0,a.useState)([]),[eC,eT]=(0,a.useState)([]),[ez,eA]=(0,a.useState)(!1),[eL,eD]=(0,a.useState)(""),[eP,eI]=(0,a.useState)({});(0,a.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(p));let e=sv(p,es);console.log("models: ".concat(e)),ey(e),v.setFieldValue("models",[])},[p,es]),(0,a.useEffect)(()=>{(async()=>{try{if(null==n)return;let e=(await (0,S.getGuardrailsList)(n)).guardrails.map(e=>e.guardrail_name);eZ(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[n]);let eE=async()=>{try{if(null==n)return;let e=await (0,S.fetchMCPAccessGroups)(n);eT(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,a.useEffect)(()=>{eE()},[n]),(0,a.useEffect)(()=>{s&&ev(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let eO=async e=>{ej(e),eu(!0)},eM=async()=>{if(null!=eg&&null!=s&&null!=n){try{await (0,S.teamDeleteCall)(n,eg),(0,L.Z)(n,i,o,x,r)}catch(e){console.error("Error deleting the team:",e)}eu(!1),ej(null)}},eR=()=>{eu(!1),ej(null)};(0,a.useEffect)(()=>{(async()=>{try{if(null===i||null===o||null===n)return;let e=await (0,ss.K2)(i,o,n);e&&ed(e)}catch(e){console.error("Error fetching user models:",e)}})()},[n,i,o,s]);let eF=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=n){var t,l,a;let i=null==e?void 0:e.team_alias,o=null!==(a=null==s?void 0:s.map(e=>e.team_alias))&&void 0!==a?a:[],c=(null==e?void 0:e.organization_id)||(null==x?void 0:x.organization_id);if(""===c||"string"!=typeof c?e.organization_id=null:e.organization_id=c.trim(),o.includes(i))throw Error("Team alias ".concat(i," already exists, please pick another alias"));if(W.Z.info("Creating Team"),ek.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:ek.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0||e.allowed_mcp_servers_and_groups.toolPermissions)){if(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.mcp_tool_permissions&&Object.keys(e.mcp_tool_permissions).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=e.mcp_tool_permissions,delete e.mcp_tool_permissions)}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(eP).length>0&&(e.model_aliases=eP);let d=await (0,S.teamCreateCall)(n,e);null!==s?r([...s,d]):r([d]),console.log("response for team create call: ".concat(d)),W.Z.success("Team created"),v.resetFields(),eS([]),eI({}),J(!1)}}catch(e){console.error("Error creating the team:",e),W.Z.fromBackend("Error creating the team: "+e)}},eB=()=>{u(new Date().toLocaleString())},eU=(e,s)=>{let t={...y,[e]:s};b(t),n&&(0,S.v2TeamListCall)(n,t.organization_id||null,null,t.team_id||null,t.team_alias||null).then(e=>{e&&e.teams&&r(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})};return(0,l.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,l.jsx)(sm.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,l.jsxs)(sd.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==o||"Org Admin"==o)&&(0,l.jsx)(O.Z,{className:"w-fit",onClick:()=>J(!0),children:"+ Create New Team"}),D?(0,l.jsx)(sl.Z,{teamId:D,onUpdate:e=>{r(s=>{if(null==s)return s;let t=s.map(s=>e.team_id===s.team_id?(0,sp.nl)(s,e):s);return n&&(0,L.Z)(n,i,o,x,r),t})},onClose:()=>{P(null),E(!1)},accessToken:n,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;se.team_id===D)),is_proxy_admin:"Admin"==o,userModels:es,editTeam:I}):(0,l.jsxs)(R.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,l.jsxs)(F.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(M.Z,{children:"Your Teams"}),(0,l.jsx)(M.Z,{children:"Available Teams"}),(0,eG.tY)(o||"")&&(0,l.jsx)(M.Z,{children:"Default Team Settings"})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,l.jsxs)(V.Z,{children:["Last Refreshed: ",m]}),(0,l.jsx)($.Z,{icon:e3.Z,variant:"shadow",size:"xs",className:"self-center",onClick:eB})]})]}),(0,l.jsxs)(U.Z,{children:[(0,l.jsxs)(B.Z,{children:[(0,l.jsxs)(V.Z,{children:["Click on “Team ID” to view team details ",(0,l.jsx)("b",{children:"and"})," manage team members."]}),(0,l.jsx)(sm.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,l.jsx)(sd.Z,{numColSpan:1,children:(0,l.jsxs)(sc.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,l.jsx)("div",{className:"border-b px-6 py-4",children:(0,l.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,l.jsxs)("div",{className:"relative w-64",children:[(0,l.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:y.team_alias,onChange:e=>eU("team_alias",e.target.value)}),(0,l.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,l.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(j?"bg-gray-100":""),onClick:()=>f(!j),children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(y.team_id||y.team_alias||y.organization_id)&&(0,l.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,l.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{b({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),n&&(0,S.v2TeamListCall)(n,null,i||null,null,null).then(e=>{e&&e.teams&&r(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),j&&(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,l.jsxs)("div",{className:"relative w-64",children:[(0,l.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:y.team_id,onChange:e=>eU("team_id",e.target.value)}),(0,l.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,l.jsx)("div",{className:"w-64",children:(0,l.jsx)(st.P,{value:y.organization_id||"",onValueChange:e=>eU("organization_id",e),placeholder:"Select Organization",children:null==c?void 0:c.map(e=>(0,l.jsx)(st.Q,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})}),(0,l.jsxs)(ea.Z,{children:[(0,l.jsx)(ei.Z,{children:(0,l.jsxs)(ec.Z,{children:[(0,l.jsx)(eo.Z,{children:"Team Name"}),(0,l.jsx)(eo.Z,{children:"Team ID"}),(0,l.jsx)(eo.Z,{children:"Created"}),(0,l.jsx)(eo.Z,{children:"Spend (USD)"}),(0,l.jsx)(eo.Z,{children:"Budget (USD)"}),(0,l.jsx)(eo.Z,{children:"Models"}),(0,l.jsx)(eo.Z,{children:"Organization"}),(0,l.jsx)(eo.Z,{children:"Info"})]})}),(0,l.jsx)(en.Z,{children:s&&s.length>0?s.filter(e=>!x||e.organization_id===x.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,l.jsxs)(ec.Z,{children:[(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,l.jsx)(er.Z,{children:(0,l.jsx)("div",{className:"overflow-hidden",children:(0,l.jsx)(ex.Z,{title:e.team_id,children:(0,l.jsxs)(O.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{P(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,sp.pw)(e.spend,4)}),(0,l.jsx)(er.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,l.jsx)(er.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,l.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,l.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,l.jsx)(so.Z,{size:"xs",className:"mb-1",color:"red",children:(0,l.jsx)(V.Z,{children:"All Proxy Models"})}):(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,l.jsx)("div",{children:(0,l.jsx)($.Z,{icon:ew[e.team_id]?e8.Z:e6.Z,className:"cursor-pointer",size:"xs",onClick:()=>{eN(s=>({...s,[e.team_id]:!s[e.team_id]}))}})}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,l.jsx)(so.Z,{size:"xs",color:"red",children:(0,l.jsx)(V.Z,{children:"All Proxy Models"})},s):(0,l.jsx)(so.Z,{size:"xs",color:"blue",children:(0,l.jsx)(V.Z,{children:e.length>30?"".concat((0,ss.W0)(e).slice(0,30),"..."):(0,ss.W0)(e)})},s)),e.models.length>3&&!ew[e.team_id]&&(0,l.jsx)(so.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,l.jsxs)(V.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),ew[e.team_id]&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,l.jsx)(so.Z,{size:"xs",color:"red",children:(0,l.jsx)(V.Z,{children:"All Proxy Models"})},s+3):(0,l.jsx)(so.Z,{size:"xs",color:"blue",children:(0,l.jsx)(V.Z,{children:e.length>30?"".concat((0,ss.W0)(e).slice(0,30),"..."):(0,ss.W0)(e)})},s+3))})]})]})})}):null})}),(0,l.jsx)(er.Z,{children:e.organization_id}),(0,l.jsxs)(er.Z,{children:[(0,l.jsxs)(V.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].keys&&eb[e.team_id].keys.length," ","Keys"]}),(0,l.jsxs)(V.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].team_info&&eb[e.team_id].team_info.members_with_roles&&eb[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,l.jsx)(er.Z,{children:"Admin"==o?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)($.Z,{icon:et.Z,size:"sm",onClick:()=>{P(e.team_id),E(!0)}}),(0,l.jsx)($.Z,{onClick:()=>eO(e.team_id),icon:el.Z,size:"sm"})]}):null})]},e.team_id)):null})]}),em&&(()=>{var e;let t=null==s?void 0:s.find(e=>e.team_id===eg),a=(null==t?void 0:t.team_alias)||"",n=(null==t?void 0:null===(e=t.keys)||void 0===e?void 0:e.length)||0,r=eL===a;return(0,l.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,l.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Team"}),(0,l.jsx)("button",{onClick:()=>{eR(),eD("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,l.jsx)(sg.Z,{size:20})})]}),(0,l.jsxs)("div",{className:"px-6 py-4",children:[n>0&&(0,l.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,l.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,l.jsx)(sj.Z,{size:20})}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{className:"text-base font-medium text-red-600",children:["Warning: This team has ",n," associated key",n>1?"s":"","."]}),(0,l.jsx)("p",{className:"text-base text-red-600 mt-2",children:"Deleting the team will also delete all associated keys. This action is irreversible."})]})]}),(0,l.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to force delete this team and all its keys?"}),(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,l.jsx)("span",{className:"underline",children:a})," to confirm deletion:"]}),(0,l.jsx)("input",{type:"text",value:eL,onChange:e=>eD(e.target.value),placeholder:"Enter team name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,l.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,l.jsx)("button",{onClick:()=>{eR(),eD("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,l.jsx)("button",{onClick:eM,disabled:!r,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(r?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Force Delete"})]})]})})})()]})})})]}),(0,l.jsx)(B.Z,{children:(0,l.jsx)(su.Z,{accessToken:n,userID:i})}),(0,eG.tY)(o||"")&&(0,l.jsx)(B.Z,{children:(0,l.jsx)(sa.Z,{accessToken:n,userID:i||"",userRole:o||""})})]})]}),("Admin"==o||"Org Admin"==o)&&(0,l.jsx)(H.Z,{title:"Create Team",visible:q,width:1e3,footer:null,onOk:()=>{J(!1),v.resetFields(),eS([]),eI({})},onCancel:()=>{J(!1),v.resetFields(),eS([]),eI({})},children:(0,l.jsxs)(K.Z,{form:v,onFinish:eF,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(K.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,l.jsx)(Q.Z,{placeholder:""})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Organization"," ",(0,l.jsx)(ex.Z,{title:(0,l.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,l.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:x?x.organization_id:null,className:"mt-8",children:(0,l.jsx)(eh.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{v.setFieldValue("organization_id",e),g((null==c?void 0:c.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var t;return!!s&&((null===(t=s.children)||void 0===t?void 0:t.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==c?void 0:c.map(e=>(0,l.jsxs)(eh.default.Option,{value:e.organization_id,children:[(0,l.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,l.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Models"," ",(0,l.jsx)(ex.Z,{title:"These are the models that your selected team has access to",children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,l.jsxs)(eh.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,l.jsx)(eh.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),ef.map(e=>(0,l.jsx)(eh.default.Option,{value:e,children:(0,ss.W0)(e)},e))]})}),(0,l.jsx)(K.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(se.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(K.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(eh.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(eh.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(eh.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(eh.default.Option,{value:"30d",children:"monthly"})]})}),(0,l.jsx)(K.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsx)(K.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsxs)(sn.Z,{className:"mt-20 mb-8",onClick:()=>{ez||(eE(),eA(!0))},children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"Additional Settings"})}),(0,l.jsxs)(sr.Z,{children:[(0,l.jsx)(K.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,l.jsx)(Q.Z,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,l.jsx)(K.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,l.jsx)(se.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(K.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,l.jsx)(Q.Z,{placeholder:"e.g., 30d"})}),(0,l.jsx)(K.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsx)(K.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,l.jsx)(se.Z,{step:1,width:400})}),(0,l.jsx)(K.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,l.jsx)(e9.default.TextArea,{rows:4})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Guardrails"," ",(0,l.jsx)(ex.Z,{title:"Setup your first guardrail",children:(0,l.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,l.jsx)(eh.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:e_.map(e=>({value:e,label:e}))})}),(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,l.jsx)(ex.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,l.jsx)(sx.Z,{onChange:e=>v.setFieldValue("allowed_vector_store_ids",e),value:v.getFieldValue("allowed_vector_store_ids"),accessToken:n||"",placeholder:"Select vector stores (optional)"})})]})]}),(0,l.jsxs)(sn.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"MCP Settings"})}),(0,l.jsxs)(sr.Z,{children:[(0,l.jsx)(K.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,l.jsx)(ex.Z,{title:"Select which MCP servers or access groups this team can access",children:(0,l.jsx)(ep.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,l.jsx)(sf.Z,{onChange:e=>v.setFieldValue("allowed_mcp_servers_and_groups",e),value:v.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:n||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,l.jsx)(K.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,l.jsx)(e9.default,{type:"hidden"})}),(0,l.jsx)(K.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(sy.Z,{accessToken:n||"",selectedServers:(null===(e=v.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:v.getFieldValue("mcp_tool_permissions")||{},onChange:e=>v.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),(0,l.jsxs)(sn.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"Logging Settings"})}),(0,l.jsx)(sr.Z,{children:(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(sh.Z,{value:ek,onChange:eS,premiumUser:d})})})]}),(0,l.jsxs)(sn.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(si.Z,{children:(0,l.jsx)("b",{children:"Model Aliases"})}),(0,l.jsx)(sr.Z,{children:(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(V.Z,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,l.jsx)(sb.Z,{accessToken:n||"",initialModelAliases:eP,onAliasUpdate:eI,showExampleConfig:!1})]})})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(e7.ZP,{htmlType:"submit",children:"Create Team"})})]})})]})})})};function sZ(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";document.cookie="".concat(e,"=; Max-Age=0; Path=").concat(s)}function sw(e){try{let s=(0,r.o)(e);if(s&&"number"==typeof s.exp)return 1e3*s.exp<=Date.now();return!1}catch(e){return!0}}let sN=new i.S;function sk(){return(0,l.jsxs)("div",{className:(0,eC.cx)("h-screen","flex items-center justify-center gap-4"),children:[(0,l.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"\uD83D\uDE85 LiteLLM"}),(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,l.jsx)(eS.S,{className:"size-4"}),(0,l.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}function sS(){let[e,s]=(0,a.useState)(""),[t,i]=(0,a.useState)(!1),[O,M]=(0,a.useState)(!1),[R,F]=(0,a.useState)(null),[B,U]=(0,a.useState)(null),[V,q]=(0,a.useState)([]),[K,H]=(0,a.useState)([]),[W,J]=(0,a.useState)([]),[Y,G]=(0,a.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),[X,$]=(0,a.useState)(!0),Q=(0,n.useSearchParams)(),[ee,es]=(0,a.useState)({data:[]}),[et,el]=(0,a.useState)(null),[ea,en]=(0,a.useState)(!1),[er,ei]=(0,a.useState)(!0),[eo,ec]=(0,a.useState)(null),{refactoredUIFlag:ed}=(0,eT.Z)(),em=Q.get("invitation_id"),[eu,ex]=(0,a.useState)(()=>Q.get("page")||"api-keys"),[eh,ep]=(0,a.useState)(null),[eg,ej]=(0,a.useState)(!1),ef=e=>{q(s=>s?[...s,e]:[e]),en(()=>!ea)},ey=!1===er&&null===et&&null===em;return((0,a.useEffect)(()=>{let e=!1;return(async()=>{try{await (0,S.getUiConfig)()}catch(e){}if(e)return;let s=function(e){let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));if(!s)return null;let t=s.slice(e.length+1);try{return decodeURIComponent(t)}catch(e){return t}}("token"),t=s&&!sw(s)?s:null;s&&!t&&sZ("token","/"),e||(el(t),ei(!1))})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{if(ey){let e=(S.proxyBaseUrl||"")+"/sso/key/generate";window.location.replace(e)}},[ey]),(0,a.useEffect)(()=>{if(!et)return;if(sw(et)){sZ("token","/"),el(null);return}let e=null;try{e=(0,r.o)(et)}catch(e){sZ("token","/"),el(null);return}if(e){if(ep(e.key),M(e.disabled_non_admin_personal_key_creation),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);s(t),"Admin Viewer"==t&&ex("usage")}e.user_email&&F(e.user_email),e.login_method&&$("username_password"==e.login_method),e.premium_user&&i(e.premium_user),e.auth_header_name&&(0,S.setGlobalLitellmHeaderName)(e.auth_header_name),e.user_id&&ec(e.user_id)}},[et]),(0,a.useEffect)(()=>{eh&&eo&&e&&(0,A.Nr)(eo,e,eh,J),eh&&eo&&e&&(0,L.Z)(eh,eo,e,null,U),eh&&(0,h.g)(eh,H)},[eh,eo,e]),er||ey)?(0,l.jsx)(sk,{}):(0,l.jsx)(a.Suspense,{fallback:(0,l.jsx)(sk,{}),children:(0,l.jsx)(o.aH,{client:sN,children:(0,l.jsx)(d.f,{accessToken:eh,children:em?(0,l.jsx)(m.Z,{userID:eo,userRole:e,premiumUser:t,teams:B,keys:V,setUserRole:s,userEmail:R,setUserEmail:F,setTeams:U,setKeys:q,organizations:K,addKey:ef,createClicked:ea}):(0,l.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,l.jsx)(c.Z,{userID:eo,userRole:e,premiumUser:t,userEmail:R,setProxySettings:G,proxySettings:Y,accessToken:eh,isPublicPage:!1,sidebarCollapsed:eg,onToggleSidebar:()=>{ej(!eg)}}),(0,l.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(e4,{setPage:e=>{let s=new URLSearchParams(Q);s.set("page",e),window.history.pushState(null,"","?".concat(s.toString())),ex(e)},defaultSelectedKey:eu,sidebarCollapsed:eg})}),"api-keys"==eu?(0,l.jsx)(m.Z,{userID:eo,userRole:e,premiumUser:t,teams:B,keys:V,setUserRole:s,userEmail:R,setUserEmail:F,setTeams:U,setKeys:q,organizations:K,addKey:ef,createClicked:ea}):"models"==eu?(0,l.jsx)(u.Z,{userID:eo,userRole:e,token:et,keys:V,accessToken:eh,modelData:ee,setModelData:es,premiumUser:t,teams:B}):"llm-playground"==eu?(0,l.jsx)(w.Z,{userID:eo,userRole:e,token:et,accessToken:eh,disabledPersonalKeyCreation:O}):"users"==eu?(0,l.jsx)(x.Z,{userID:eo,userRole:e,token:et,keys:V,teams:B,accessToken:eh,setKeys:q}):"teams"==eu?(0,l.jsx)(s_,{teams:B,setTeams:U,accessToken:eh,userID:eo,userRole:e,organizations:K,premiumUser:t,searchParams:Q}):"organizations"==eu?(0,l.jsx)(h.Z,{organizations:K,setOrganizations:H,userModels:W,accessToken:eh,userRole:e,premiumUser:t}):"admin-panel"==eu?(0,l.jsx)(p.Z,{setTeams:U,searchParams:Q,accessToken:eh,userID:eo,showSSOBanner:X,premiumUser:t,proxySettings:Y}):"api_ref"==eu?(0,l.jsx)(Z.Z,{proxySettings:Y}):"settings"==eu?(0,l.jsx)(g.Z,{userID:eo,userRole:e,accessToken:eh,premiumUser:t}):"budgets"==eu?(0,l.jsx)(y.Z,{accessToken:eh}):"guardrails"==eu?(0,l.jsx)(C.Z,{accessToken:eh,userRole:e}):"prompts"==eu?(0,l.jsx)(T.Z,{accessToken:eh,userRole:e}):"transform-request"==eu?(0,l.jsx)(z.Z,{accessToken:eh}):"general-settings"==eu?(0,l.jsx)(j.Z,{userID:eo,userRole:e,accessToken:eh,modelData:ee}):"ui-theme"==eu?(0,l.jsx)(E.Z,{userID:eo,userRole:e,accessToken:eh}):"cost-tracking-settings"==eu?(0,l.jsx)(ek,{userID:eo,userRole:e,accessToken:eh}):"model-hub-table"==eu?(0,l.jsx)(v.Z,{accessToken:eh,publicPage:!1,premiumUser:t,userRole:e}):"caching"==eu?(0,l.jsx)(k.Z,{userID:eo,userRole:e,token:et,accessToken:eh,premiumUser:t}):"pass-through-settings"==eu?(0,l.jsx)(f.Z,{userID:eo,userRole:e,accessToken:eh,modelData:ee}):"logs"==eu?(0,l.jsx)(b.Z,{userID:eo,userRole:e,token:et,accessToken:eh,allTeams:null!=B?B:[],premiumUser:t}):"mcp-servers"==eu?(0,l.jsx)(D.d,{accessToken:eh,userRole:e,userID:eo}):"tag-management"==eu?(0,l.jsx)(P.Z,{accessToken:eh,userRole:e,userID:eo}):"vector-stores"==eu?(0,l.jsx)(I.Z,{accessToken:eh,userRole:e,userID:eo}):"new_usage"==eu?(0,l.jsx)(_.Z,{userID:eo,userRole:e,accessToken:eh,teams:null!=B?B:[],premiumUser:t}):(0,l.jsx)(N.Z,{userID:eo,userRole:e,token:et,accessToken:eh,keys:V,premiumUser:t})]})]})})})})}},88904:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(88913),r=t(93192),i=t(52787),o=t(63709),c=t(87908),d=t(19250),m=t(65925),u=t(46468),x=t(9114);s.Z=e=>{var s;let{accessToken:t,userID:h,userRole:p}=e,[g,j]=(0,a.useState)(!0),[f,y]=(0,a.useState)(null),[b,v]=(0,a.useState)(!1),[_,Z]=(0,a.useState)({}),[w,N]=(0,a.useState)(!1),[k,S]=(0,a.useState)([]),{Paragraph:C}=r.default,{Option:T}=i.default;(0,a.useEffect)(()=>{(async()=>{if(!t){j(!1);return}try{let e=await (0,d.getDefaultTeamSettings)(t);if(y(e),Z(e.values||{}),t)try{let e=await (0,d.modelAvailableCall)(t,h,p);if(e&&e.data){let s=e.data.map(e=>e.id);S(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),x.Z.fromBackend("Failed to fetch team settings")}finally{j(!1)}})()},[t]);let z=async()=>{if(t){N(!0);try{let e=await (0,d.updateDefaultTeamSettings)(t,_);y({...f,values:e.settings}),v(!1),x.Z.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),x.Z.fromBackend("Failed to update team settings")}finally{N(!1)}}},A=(e,s)=>{Z(t=>({...t,[e]:s}))},L=(e,s,t)=>{var a;let r=s.type;return"budget_duration"===e?(0,l.jsx)(m.Z,{value:_[e]||null,onChange:s=>A(e,s),className:"mt-2"}):"boolean"===r?(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(o.Z,{checked:!!_[e],onChange:s=>A(e,s)})}):"array"===r&&(null===(a=s.items)||void 0===a?void 0:a.enum)?(0,l.jsx)(i.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>A(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,l.jsx)(T,{value:e,children:e},e))}):"models"===e?(0,l.jsx)(i.default,{mode:"multiple",style:{width:"100%"},value:_[e]||[],onChange:s=>A(e,s),className:"mt-2",children:k.map(e=>(0,l.jsx)(T,{value:e,children:(0,u.W0)(e)},e))}):"string"===r&&s.enum?(0,l.jsx)(i.default,{style:{width:"100%"},value:_[e]||"",onChange:s=>A(e,s),className:"mt-2",children:s.enum.map(e=>(0,l.jsx)(T,{value:e,children:e},e))}):(0,l.jsx)(n.oi,{value:void 0!==_[e]?String(_[e]):"",onChange:s=>A(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},D=(e,s)=>null==s?(0,l.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,l.jsx)("span",{children:(0,m.m)(s)}):"boolean"==typeof s?(0,l.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,l.jsx)("span",{className:"text-gray-400",children:"None"}):(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,u.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,l.jsx)("span",{className:"text-gray-400",children:"None"}):(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,l.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,l.jsx)("span",{children:String(s)});return g?(0,l.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,l.jsx)(c.Z,{size:"large"})}):f?(0,l.jsxs)(n.Zb,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(n.Dx,{className:"text-xl",children:"Default Team Settings"}),!g&&f&&(b?(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.zx,{variant:"secondary",onClick:()=>{v(!1),Z(f.values||{})},disabled:w,children:"Cancel"}),(0,l.jsx)(n.zx,{onClick:z,loading:w,children:"Save Changes"})]}):(0,l.jsx)(n.zx,{onClick:()=>v(!0),children:"Edit Settings"}))]}),(0,l.jsx)(n.xv,{children:"These settings will be applied by default when creating new teams."}),(null==f?void 0:null===(s=f.field_schema)||void 0===s?void 0:s.description)&&(0,l.jsx)(C,{className:"mb-4 mt-2",children:f.field_schema.description}),(0,l.jsx)(n.iz,{}),(0,l.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=f;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,a]=s,r=e[t],i=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,l.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,l.jsx)(n.xv,{className:"font-medium text-lg",children:i}),(0,l.jsx)(C,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),b?(0,l.jsx)("div",{className:"mt-2",children:L(t,a,r)}):(0,l.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:D(t,r)})]},t)}):(0,l.jsx)(n.xv,{children:"No schema information available"})})()})]}):(0,l.jsx)(n.Zb,{children:(0,l.jsx)(n.xv,{children:"No team settings available or you do not have permission to view them."})})}},49104:function(e,s,t){"use strict";t.d(s,{Z:function(){return E}});var l=t(57437),a=t(2265),n=t(87452),r=t(88829),i=t(72208),o=t(49566),c=t(13634),d=t(82680),m=t(20577),u=t(52787),x=t(73002),h=t(19250),p=t(9114),g=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:a,setBudgetList:g}=e,[j]=c.Z.useForm(),f=async e=>{if(null!=t&&void 0!=t)try{p.Z.info("Making API Call");let s=await (0,h.budgetCreateCall)(t,e);console.log("key create Response:",s),g(e=>e?[...e,s]:[s]),p.Z.success("Budget Created"),j.resetFields()}catch(e){console.error("Error creating the key:",e),p.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,l.jsx)(d.Z,{title:"Create Budget",visible:s,width:800,footer:null,onOk:()=>{a(!1),j.resetFields()},onCancel:()=>{a(!1),j.resetFields()},children:(0,l.jsxs)(c.Z,{form:j,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,l.jsx)(o.Z,{placeholder:""})}),(0,l.jsx)(c.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsxs)(n.Z,{className:"mt-20 mb-8",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)("b",{children:"Optional Settings"})}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(m.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(u.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(u.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(u.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(u.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(x.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},j=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:g,setBudgetList:j,existingBudget:f,handleUpdateCall:y}=e;console.log("existingBudget",f);let[b]=c.Z.useForm();(0,a.useEffect)(()=>{b.setFieldsValue(f)},[f,b]);let v=async e=>{if(null!=t&&void 0!=t)try{p.Z.info("Making API Call"),g(!0);let s=await (0,h.budgetUpdateCall)(t,e);j(e=>e?[...e,s]:[s]),p.Z.success("Budget Updated"),b.resetFields(),y()}catch(e){console.error("Error creating the key:",e),p.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,l.jsx)(d.Z,{title:"Edit Budget",visible:s,width:800,footer:null,onOk:()=>{g(!1),b.resetFields()},onCancel:()=>{g(!1),b.resetFields()},children:(0,l.jsxs)(c.Z,{form:b,onFinish:v,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:f,children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,l.jsx)(o.Z,{placeholder:""})}),(0,l.jsx)(c.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsxs)(n.Z,{className:"mt-20 mb-8",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)("b",{children:"Optional Settings"})}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(m.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(u.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(u.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(u.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(u.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(x.ZP,{htmlType:"submit",children:"Save"})})]})})},f=t(20831),y=t(12514),b=t(47323),v=t(12485),_=t(18135),Z=t(35242),w=t(29706),N=t(77991),k=t(21626),S=t(97214),C=t(28241),T=t(58834),z=t(69552),A=t(71876),L=t(84264),D=t(53410),P=t(74998),I=t(17906),E=e=>{let{accessToken:s}=e,[t,n]=(0,a.useState)(!1),[r,i]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),[d,m]=(0,a.useState)([]);(0,a.useEffect)(()=>{s&&(0,h.getBudgetList)(s).then(e=>{m(e)})},[s]);let u=async(e,t)=>{console.log("budget_id",e),null!=s&&(c(d.find(s=>s.budget_id===e)||null),i(!0))},x=async(e,t)=>{if(null==s)return;p.Z.info("Request made"),await (0,h.budgetDeleteCall)(s,e);let l=[...d];l.splice(t,1),m(l),p.Z.success("Budget Deleted.")},E=async()=>{null!=s&&(0,h.getBudgetList)(s).then(e=>{m(e)})};return(0,l.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,l.jsx)(f.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>n(!0),children:"+ Create Budget"}),(0,l.jsx)(g,{accessToken:s,isModalVisible:t,setIsModalVisible:n,setBudgetList:m}),o&&(0,l.jsx)(j,{accessToken:s,isModalVisible:r,setIsModalVisible:i,setBudgetList:m,existingBudget:o,handleUpdateCall:E}),(0,l.jsxs)(y.Z,{children:[(0,l.jsx)(L.Z,{children:"Create a budget to assign to customers."}),(0,l.jsxs)(k.Z,{children:[(0,l.jsx)(T.Z,{children:(0,l.jsxs)(A.Z,{children:[(0,l.jsx)(z.Z,{children:"Budget ID"}),(0,l.jsx)(z.Z,{children:"Max Budget"}),(0,l.jsx)(z.Z,{children:"TPM"}),(0,l.jsx)(z.Z,{children:"RPM"})]})}),(0,l.jsx)(S.Z,{children:d.slice().sort((e,s)=>new Date(s.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,s)=>(0,l.jsxs)(A.Z,{children:[(0,l.jsx)(C.Z,{children:e.budget_id}),(0,l.jsx)(C.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,l.jsx)(C.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,l.jsx)(C.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,l.jsx)(b.Z,{icon:D.Z,size:"sm",onClick:()=>u(e.budget_id,s)}),(0,l.jsx)(b.Z,{icon:P.Z,size:"sm",onClick:()=>x(e.budget_id,s)})]},s))})]})]}),(0,l.jsxs)("div",{className:"mt-5",children:[(0,l.jsx)(L.Z,{className:"text-base",children:"How to use budget id"}),(0,l.jsxs)(_.Z,{children:[(0,l.jsxs)(Z.Z,{children:[(0,l.jsx)(v.Z,{children:"Assign Budget to Customer"}),(0,l.jsx)(v.Z,{children:"Test it (Curl)"}),(0,l.jsx)(v.Z,{children:"Test it (OpenAI SDK)"})]}),(0,l.jsxs)(N.Z,{children:[(0,l.jsx)(w.Z,{children:(0,l.jsx)(I.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(I.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(I.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="",\n api_key=""\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})}},918:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(62490),r=t(19250),i=t(9114);s.Z=e=>{let{accessToken:s,userID:t}=e,[o,c]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{if(s&&t)try{let e=await (0,r.availableTeamListCall)(s);c(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,t]);let d=async e=>{if(s&&t)try{await (0,r.teamMemberAddCall)(s,e,{user_id:t,role:"user"}),i.Z.success("Successfully joined team"),c(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),i.Z.fromBackend("Failed to join team")}};return(0,l.jsx)(n.Zb,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,l.jsxs)(n.iA,{children:[(0,l.jsx)(n.ss,{children:(0,l.jsxs)(n.SC,{children:[(0,l.jsx)(n.xs,{children:"Team Name"}),(0,l.jsx)(n.xs,{children:"Description"}),(0,l.jsx)(n.xs,{children:"Members"}),(0,l.jsx)(n.xs,{children:"Models"}),(0,l.jsx)(n.xs,{children:"Actions"})]})}),(0,l.jsxs)(n.RM,{children:[o.map(e=>(0,l.jsxs)(n.SC,{children:[(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.xv,{children:e.team_alias})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.xv,{children:e.description||"No description available"})}),(0,l.jsx)(n.pj,{children:(0,l.jsxs)(n.xv,{children:[e.members_with_roles.length," members"]})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,l.jsx)(n.Ct,{size:"xs",className:"mb-1",color:"blue",children:(0,l.jsx)(n.xv,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,l.jsx)(n.Ct,{size:"xs",color:"red",children:(0,l.jsx)(n.xv,{children:"All Proxy Models"})})})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.zx,{size:"xs",variant:"secondary",onClick:()=>d(e.team_id),children:"Join Team"})})]},e.team_id)),0===o.length&&(0,l.jsx)(n.SC,{children:(0,l.jsx)(n.pj,{colSpan:5,className:"text-center",children:(0,l.jsx)(n.xv,{children:"No available teams to join"})})})]})]})})}},6674:function(e,s,t){"use strict";t.d(s,{Z:function(){return d}});var l=t(57437),a=t(2265),n=t(73002),r=t(23639),i=t(96761),o=t(19250),c=t(9114),d=e=>{let{accessToken:s}=e,[t,d]=(0,a.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),p=(e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")},g=async()=>{h(!0);try{let e;try{e=JSON.parse(t)}catch(e){c.Z.fromBackend("Invalid JSON in request body"),h(!1);return}let l={call_type:"completion",request_body:e};if(!s){c.Z.fromBackend("No access token found"),h(!1);return}let a=await (0,o.transformRequestCall)(s,l);if(a.raw_request_api_base&&a.raw_request_body){let e=p(a.raw_request_api_base,a.raw_request_body,a.raw_request_headers||{});u(e),c.Z.success("Request transformed successfully")}else{let e="string"==typeof a?a:JSON.stringify(a);u(e),c.Z.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),c.Z.fromBackend("Failed to transform request")}finally{h(!1)}};return(0,l.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,l.jsx)(i.Z,{children:"Playground"}),(0,l.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,l.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,l.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,l.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,l.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,l.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,l.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),g())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,l.jsxs)(n.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:g,loading:x,children:[(0,l.jsx)("span",{children:"Transform"}),(0,l.jsx)("span",{children:"→"})]})})]}),(0,l.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,l.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,l.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,l.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,l.jsx)("br",{}),(0,l.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,l.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,l.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:m||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,l.jsx)(n.ZP,{type:"text",icon:(0,l.jsx)(r.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(m||""),c.Z.success("Copied to clipboard")}})]})]})]}),(0,l.jsx)("div",{className:"mt-4 text-right w-full",children:(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue"," ",(0,l.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})}},5183:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(19046),r=t(69734),i=t(19250),o=t(9114);s.Z=e=>{let{userID:s,userRole:t,accessToken:c}=e,{logoUrl:d,setLogoUrl:m}=(0,r.F)(),[u,x]=(0,a.useState)(""),[h,p]=(0,a.useState)(!1);(0,a.useEffect)(()=>{c&&g()},[c]);let g=async()=>{try{let s=(0,i.getProxyBaseUrl)(),t=await fetch(s?"".concat(s,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"}});if(t.ok){var e;let s=await t.json(),l=(null===(e=s.values)||void 0===e?void 0:e.logo_url)||"";x(l),m(l||null)}}catch(e){console.error("Error fetching theme settings:",e)}},j=async()=>{p(!0);try{let e=(0,i.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"},body:JSON.stringify({logo_url:u||null})})).ok)o.Z.success("Logo settings updated successfully!"),m(u||null);else throw Error("Failed to update settings")}catch(e){console.error("Error updating logo settings:",e),o.Z.fromBackend("Failed to update logo settings")}finally{p(!1)}},f=async()=>{x(""),m(null),p(!0);try{let e=(0,i.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"},body:JSON.stringify({logo_url:null})})).ok)o.Z.success("Logo reset to default!");else throw Error("Failed to reset logo")}catch(e){console.error("Error resetting logo:",e),o.Z.fromBackend("Failed to reset logo")}finally{p(!1)}};return c?(0,l.jsxs)("div",{className:"w-full mx-auto max-w-4xl px-6 py-8",children:[(0,l.jsxs)("div",{className:"mb-8",children:[(0,l.jsx)(n.Dx,{className:"text-2xl font-bold mb-2",children:"Logo Customization"}),(0,l.jsx)(n.xv,{className:"text-gray-600",children:"Customize your LiteLLM admin dashboard with a custom logo."})]}),(0,l.jsx)(n.Zb,{className:"shadow-sm p-6",children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(n.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Logo URL"}),(0,l.jsx)(n.oi,{placeholder:"https://example.com/logo.png",value:u,onValueChange:e=>{x(e),m(e||null)},className:"w-full"}),(0,l.jsx)(n.xv,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom logo or leave empty to use the default LiteLLM logo"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(n.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Current Logo"}),(0,l.jsx)("div",{className:"bg-gray-50 rounded-lg p-6 flex items-center justify-center min-h-[120px]",children:u?(0,l.jsx)("img",{src:u,alt:"Custom logo",className:"max-w-full max-h-24 object-contain",onError:e=>{var s;let t=e.target;t.style.display="none";let l=document.createElement("div");l.className="text-gray-500 text-sm",l.textContent="Failed to load image",null===(s=t.parentElement)||void 0===s||s.appendChild(l)}}):(0,l.jsx)(n.xv,{className:"text-gray-500 text-sm",children:"Default LiteLLM logo will be used"})})]}),(0,l.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,l.jsx)(n.zx,{onClick:j,loading:h,disabled:h,color:"indigo",children:"Save Changes"}),(0,l.jsx)(n.zx,{onClick:f,loading:h,disabled:h,variant:"secondary",color:"gray",children:"Reset to Default"})]})]})})]}):null}}},function(e){e.O(0,[3665,6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,7906,2344,3669,9165,1264,1487,3752,5105,6433,1160,9888,3250,9429,1223,8050,8049,131,2202,874,4292,2162,2004,2012,8160,7801,2306,3801,1307,9681,7155,3298,6204,1739,773,6925,8143,2273,5809,603,2019,4696,2971,2117,1744],function(){return e(e.s=97731)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-d7c5dbe555bb16a5.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-d7c5dbe555bb16a5.js deleted file mode 100644 index 30a06cc5ea..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-d7c5dbe555bb16a5.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{97731:function(e,s,t){Promise.resolve().then(t.bind(t,7467))},80619:function(e,s,t){"use strict";t.d(s,{Z:function(){return y}});var l=t(57437),a=t(2265),n=t(67101),r=t(12485),i=t(18135),o=t(35242),c=t(29706),d=t(77991),m=t(84264),u=t(30401),x=t(5136),h=t(17906),p=t(1479),g=e=>{let{code:s,language:t}=e,[n,r]=(0,a.useState)(!1);return(0,l.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,l.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:n?(0,l.jsx)(u.Z,{size:16}):(0,l.jsx)(x.Z,{size:16})}),(0,l.jsx)(h.Z,{language:t,style:p.Z,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:s})]})},j=t(96362),f=e=>{let{href:s,className:t}=e;return(0,l.jsxs)("a",{href:s,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(){for(var e=arguments.length,s=Array(e),t=0;t{let{proxySettings:s}=e,t="";return(null==s?void 0:s.PROXY_BASE_URL)!==void 0&&(null==s?void 0:s.PROXY_BASE_URL)&&(t=s.PROXY_BASE_URL),(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(n.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,l.jsx)(f,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,l.jsxs)(m.Z,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,l.jsxs)(i.Z,{children:[(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(r.Z,{children:"OpenAI Python SDK"}),(0,l.jsx)(r.Z,{children:"LlamaIndex"}),(0,l.jsx)(r.Z,{children:"Langchain Py"})]}),(0,l.jsxs)(d.Z,{children:[(0,l.jsx)(c.Z,{children:(0,l.jsx)(g,{language:"python",code:'import openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(t,'" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys\n)\n\nresponse = client.chat.completions.create(\n model="gpt-3.5-turbo", # model to send to the proxy\n messages = [\n {\n "role": "user",\n "content": "this is a test request, write a short poem"\n }\n ]\n)\n\nprint(response)')})}),(0,l.jsx)(c.Z,{children:(0,l.jsx)(g,{language:"python",code:'import os, dotenv\n\nfrom llama_index.llms import AzureOpenAI\nfrom llama_index.embeddings import AzureOpenAIEmbedding\nfrom llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n\nllm = AzureOpenAI(\n engine="azure-gpt-3.5", # model_name on litellm proxy\n temperature=0.0,\n azure_endpoint="'.concat(t,'", # litellm proxy endpoint\n api_key="sk-1234", # litellm proxy API Key\n api_version="2023-07-01-preview",\n)\n\nembed_model = AzureOpenAIEmbedding(\n deployment_name="azure-embedding-model",\n azure_endpoint="').concat(t,'",\n api_key="sk-1234",\n api_version="2023-07-01-preview",\n)\n\ndocuments = SimpleDirectoryReader("llama_index_data").load_data()\nservice_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\nindex = VectorStoreIndex.from_documents(documents, service_context=service_context)\n\nquery_engine = index.as_query_engine()\nresponse = query_engine.query("What did the author do growing up?")\nprint(response)')})}),(0,l.jsx)(c.Z,{children:(0,l.jsx)(g,{language:"python",code:'from langchain.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n SystemMessagePromptTemplate,\n)\nfrom langchain.schema import HumanMessage, SystemMessage\n\nchat = ChatOpenAI(\n openai_api_base="'.concat(t,'",\n model = "gpt-3.5-turbo",\n temperature=0.1\n)\n\nmessages = [\n SystemMessage(\n content="You are a helpful assistant that im using to make a test request to."\n ),\n HumanMessage(\n content="test from litellm. tell me why it\'s amazing in 1 sentence"\n ),\n]\nresponse = chat(messages)\n\nprint(response)')})})]})]})]})})})}},7467:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return sr}});var l=t(57437),a=t(2265),n=t(99376),r=t(14474),i=t(21623),o=t(29827),c=t(65373),d=t(69734),m=t(21739),u=t(37801),x=t(77155),h=t(22004),p=t(90773),g=t(6925),j=t(85809),f=t(10607),y=t(49104),_=t(33801),b=t(18160),v=t(99883),Z=t(80619),w=t(31052),k=t(18143),S=t(44696),N=t(19250),C=t(63298),T=t(30603),z=t(6674),L=t(30874),I=t(39210),A=t(21307),D=t(42273),P=t(6204),O=t(5183),M=t(91323),R=t(10012),E=t(31857),B=t(19226),U=t(45937),F=t(92403),q=t(28595),V=t(68208),H=t(9775),K=t(41361),W=t(37527),J=t(15883),Y=t(12660),G=t(88009),X=t(48231),Q=t(57400),$=t(58630),ee=t(44625),es=t(41169),et=t(38434),el=t(71891),ea=t(55322),en=t(11429),er=t(20347),ei=t(79262),eo=t(13959);let{Sider:ec}=B.default;var ed=e=>{let{accessToken:s,setPage:t,userRole:a,defaultSelectedKey:n,collapsed:r=!1}=e,i=[{key:"1",page:"api-keys",label:"Virtual Keys",icon:(0,l.jsx)(F.Z,{style:{fontSize:"18px"}})},{key:"3",page:"llm-playground",label:"Test Key",icon:(0,l.jsx)(q.Z,{style:{fontSize:"18px"}}),roles:er.LQ},{key:"2",page:"models",label:"Models + Endpoints",icon:(0,l.jsx)(V.Z,{style:{fontSize:"18px"}}),roles:er.LQ},{key:"12",page:"new_usage",label:"Usage",icon:(0,l.jsx)(H.Z,{style:{fontSize:"18px"}}),roles:[...er.ZL,...er.lo]},{key:"6",page:"teams",label:"Teams",icon:(0,l.jsx)(K.Z,{style:{fontSize:"18px"}})},{key:"17",page:"organizations",label:"Organizations",icon:(0,l.jsx)(W.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"5",page:"users",label:"Internal Users",icon:(0,l.jsx)(J.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"14",page:"api_ref",label:"API Reference",icon:(0,l.jsx)(Y.Z,{style:{fontSize:"18px"}})},{key:"16",page:"model-hub-table",label:"Model Hub",icon:(0,l.jsx)(G.Z,{style:{fontSize:"18px"}})},{key:"15",page:"logs",label:"Logs",icon:(0,l.jsx)(X.Z,{style:{fontSize:"18px"}})},{key:"11",page:"guardrails",label:"Guardrails",icon:(0,l.jsx)(Q.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"26",page:"tools",label:"Tools",icon:(0,l.jsx)($.Z,{style:{fontSize:"18px"}}),children:[{key:"18",page:"mcp-servers",label:"MCP Servers",icon:(0,l.jsx)($.Z,{style:{fontSize:"18px"}})},{key:"21",page:"vector-stores",label:"Vector Stores",icon:(0,l.jsx)(ee.Z,{style:{fontSize:"18px"}}),roles:er.ZL}]},{key:"experimental",page:"experimental",label:"Experimental",icon:(0,l.jsx)(es.Z,{style:{fontSize:"18px"}}),children:[{key:"9",page:"caching",label:"Caching",icon:(0,l.jsx)(ee.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"25",page:"prompts",label:"Prompts",icon:(0,l.jsx)(et.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"10",page:"budgets",label:"Budgets",icon:(0,l.jsx)(W.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"20",page:"transform-request",label:"API Playground",icon:(0,l.jsx)(Y.Z,{style:{fontSize:"18px"}}),roles:[...er.ZL,...er.lo]},{key:"19",page:"tag-management",label:"Tag Management",icon:(0,l.jsx)(el.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"4",page:"usage",label:"Old Usage",icon:(0,l.jsx)(H.Z,{style:{fontSize:"18px"}})}]},{key:"settings",page:"settings",label:"Settings",icon:(0,l.jsx)(ea.Z,{style:{fontSize:"18px"}}),roles:er.ZL,children:[{key:"11",page:"general-settings",label:"Router Settings",icon:(0,l.jsx)(ea.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"8",page:"settings",label:"Logging & Alerts",icon:(0,l.jsx)(ea.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"13",page:"admin-panel",label:"Admin Settings",icon:(0,l.jsx)(ea.Z,{style:{fontSize:"18px"}}),roles:er.ZL},{key:"14",page:"ui-theme",label:"UI Theme",icon:(0,l.jsx)(en.Z,{style:{fontSize:"18px"}}),roles:er.ZL}]}],o=(e=>{let s=i.find(s=>s.page===e);if(s)return s.key;for(let s of i)if(s.children){let t=s.children.find(s=>s.page===e);if(t)return t.key}return"1"})(n),c=i.filter(e=>{let s=!e.roles||e.roles.includes(a);return console.log("Menu item ".concat(e.label,": roles=").concat(e.roles,", userRole=").concat(a,", hasAccess=").concat(s)),!!s&&(e.children&&(e.children=e.children.filter(e=>!e.roles||e.roles.includes(a))),!0)});return(0,l.jsx)(B.default,{style:{minHeight:"100vh"},children:(0,l.jsxs)(ec,{theme:"light",width:220,collapsed:r,collapsedWidth:80,collapsible:!0,trigger:null,style:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative"},children:[(0,l.jsx)(eo.ZP,{theme:{components:{Menu:{iconSize:18,fontSize:14}}},children:(0,l.jsx)(U.Z,{mode:"inline",selectedKeys:[o],defaultOpenKeys:r?[]:["llm-tools"],inlineCollapsed:r,className:"custom-sidebar-menu",style:{borderRight:0,backgroundColor:"transparent",fontSize:"14px"},items:c.map(e=>{var s;return{key:e.key,icon:e.icon,label:e.label,children:null===(s=e.children)||void 0===s?void 0:s.map(e=>({key:e.key,icon:e.icon,label:e.label,onClick:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}})),onClick:e.children?void 0:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}}})})}),(0,er.tY)(a)&&!r&&(0,l.jsx)(ei.Z,{accessToken:s,width:220})]})})},em=t(92019),eu=t(39760),ex=e=>{let{setPage:s,defaultSelectedKey:t,sidebarCollapsed:a}=e,{refactoredUIFlag:n}=(0,E.Z)(),{accessToken:r,userRole:i}=(0,eu.Z)();return n?(0,l.jsx)(em.Z,{accessToken:r,defaultSelectedKey:t,userRole:i}):(0,l.jsx)(ed,{accessToken:r,setPage:s,userRole:i,defaultSelectedKey:t,collapsed:a})},eh=t(93192),ep=t(23628),eg=t(86462),ej=t(47686),ef=t(53410),ey=t(74998),e_=t(13634),eb=t(89970),ev=t(82680),eZ=t(52787),ew=t(64482),ek=t(73002),eS=t(24199),eN=t(46468),eC=t(25512),eT=t(15424),ez=t(33293),eL=t(88904),eI=t(87452),eA=t(88829),eD=t(72208),eP=t(41649),eO=t(20831),eM=t(12514),eR=t(49804),eE=t(67101),eB=t(47323),eU=t(12485),eF=t(18135),eq=t(35242),eV=t(29706),eH=t(77991),eK=t(21626),eW=t(97214),eJ=t(28241),eY=t(58834),eG=t(69552),eX=t(71876),eQ=t(84264),e$=t(49566),e0=t(918),e1=t(97415),e2=t(2597),e4=t(59872),e8=t(32489),e3=t(76865),e5=t(95920),e6=t(68473),e7=t(51750),e9=t(9114);let se=(e,s)=>{let t=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),t=e.models):t=s,(0,eN.Ob)(t,s)};var ss=e=>{let{teams:s,searchParams:t,accessToken:n,setTeams:r,userID:i,userRole:o,organizations:c,premiumUser:d=!1}=e,[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(null),[p,g]=(0,a.useState)(null),[j,f]=(0,a.useState)(!1),[y,_]=(0,a.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"});(0,a.useEffect)(()=>{console.log("inside useeffect - ".concat(m)),n&&(0,I.Z)(n,i,o,x,r),sr()},[m]);let[b]=e_.Z.useForm(),[v]=e_.Z.useForm(),{Title:Z,Paragraph:w}=eh.default,[k,S]=(0,a.useState)(""),[C,T]=(0,a.useState)(!1),[z,L]=(0,a.useState)(null),[A,D]=(0,a.useState)(null),[P,O]=(0,a.useState)(!1),[M,R]=(0,a.useState)(!1),[E,B]=(0,a.useState)(!1),[U,F]=(0,a.useState)(!1),[q,V]=(0,a.useState)([]),[H,K]=(0,a.useState)(!1),[W,J]=(0,a.useState)(null),[Y,G]=(0,a.useState)([]),[X,Q]=(0,a.useState)({}),[$,ee]=(0,a.useState)([]),[es,et]=(0,a.useState)({}),[el,ea]=(0,a.useState)([]),[en,ei]=(0,a.useState)([]),[eo,ec]=(0,a.useState)(!1),[ed,em]=(0,a.useState)(""),[eu,ex]=(0,a.useState)({});(0,a.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(p));let e=se(p,q);console.log("models: ".concat(e)),G(e),b.setFieldValue("models",[])},[p,q]),(0,a.useEffect)(()=>{(async()=>{try{if(null==n)return;let e=(await (0,N.getGuardrailsList)(n)).guardrails.map(e=>e.guardrail_name);ee(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[n]);let ss=async()=>{try{if(null==n)return;let e=await (0,N.fetchMCPAccessGroups)(n);ei(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,a.useEffect)(()=>{ss()},[n]),(0,a.useEffect)(()=>{s&&Q(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let st=async e=>{J(e),K(!0)},sl=async()=>{if(null!=W&&null!=s&&null!=n){try{await (0,N.teamDeleteCall)(n,W),(0,I.Z)(n,i,o,x,r)}catch(e){console.error("Error deleting the team:",e)}K(!1),J(null)}},sa=()=>{K(!1),J(null)};(0,a.useEffect)(()=>{(async()=>{try{if(null===i||null===o||null===n)return;let e=await (0,eN.K2)(i,o,n);e&&V(e)}catch(e){console.error("Error fetching user models:",e)}})()},[n,i,o,s]);let sn=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=n){var t,l,a;let i=null==e?void 0:e.team_alias,o=null!==(a=null==s?void 0:s.map(e=>e.team_alias))&&void 0!==a?a:[],c=(null==e?void 0:e.organization_id)||(null==x?void 0:x.organization_id);if(""===c||"string"!=typeof c?e.organization_id=null:e.organization_id=c.trim(),o.includes(i))throw Error("Team alias ".concat(i," already exists, please pick another alias"));if(e9.Z.info("Creating Team"),el.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:el.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0||e.allowed_mcp_servers_and_groups.toolPermissions)){if(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.mcp_tool_permissions&&Object.keys(e.mcp_tool_permissions).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=e.mcp_tool_permissions,delete e.mcp_tool_permissions)}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),Object.keys(eu).length>0&&(e.model_aliases=eu);let d=await (0,N.teamCreateCall)(n,e);null!==s?r([...s,d]):r([d]),console.log("response for team create call: ".concat(d)),e9.Z.success("Team created"),b.resetFields(),ea([]),ex({}),R(!1)}}catch(e){console.error("Error creating the team:",e),e9.Z.fromBackend("Error creating the team: "+e)}},sr=()=>{u(new Date().toLocaleString())},si=(e,s)=>{let t={...y,[e]:s};_(t),n&&(0,N.v2TeamListCall)(n,t.organization_id||null,null,t.team_id||null,t.team_alias||null).then(e=>{e&&e.teams&&r(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})};return(0,l.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,l.jsx)(eE.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,l.jsxs)(eR.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==o||"Org Admin"==o)&&(0,l.jsx)(eO.Z,{className:"w-fit",onClick:()=>R(!0),children:"+ Create New Team"}),A?(0,l.jsx)(ez.Z,{teamId:A,onUpdate:e=>{r(s=>{if(null==s)return s;let t=s.map(s=>e.team_id===s.team_id?(0,e4.nl)(s,e):s);return n&&(0,I.Z)(n,i,o,x,r),t})},onClose:()=>{D(null),O(!1)},accessToken:n,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;se.team_id===A)),is_proxy_admin:"Admin"==o,userModels:q,editTeam:P}):(0,l.jsxs)(eF.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,l.jsxs)(eq.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(eU.Z,{children:"Your Teams"}),(0,l.jsx)(eU.Z,{children:"Available Teams"}),(0,er.tY)(o||"")&&(0,l.jsx)(eU.Z,{children:"Default Team Settings"})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,l.jsxs)(eQ.Z,{children:["Last Refreshed: ",m]}),(0,l.jsx)(eB.Z,{icon:ep.Z,variant:"shadow",size:"xs",className:"self-center",onClick:sr})]})]}),(0,l.jsxs)(eH.Z,{children:[(0,l.jsxs)(eV.Z,{children:[(0,l.jsxs)(eQ.Z,{children:["Click on “Team ID” to view team details ",(0,l.jsx)("b",{children:"and"})," manage team members."]}),(0,l.jsx)(eE.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,l.jsx)(eR.Z,{numColSpan:1,children:(0,l.jsxs)(eM.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,l.jsx)("div",{className:"border-b px-6 py-4",children:(0,l.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,l.jsxs)("div",{className:"relative w-64",children:[(0,l.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:y.team_alias,onChange:e=>si("team_alias",e.target.value)}),(0,l.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,l.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(j?"bg-gray-100":""),onClick:()=>f(!j),children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(y.team_id||y.team_alias||y.organization_id)&&(0,l.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,l.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{_({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),n&&(0,N.v2TeamListCall)(n,null,i||null,null,null).then(e=>{e&&e.teams&&r(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),j&&(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,l.jsxs)("div",{className:"relative w-64",children:[(0,l.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:y.team_id,onChange:e=>si("team_id",e.target.value)}),(0,l.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,l.jsx)("div",{className:"w-64",children:(0,l.jsx)(eC.P,{value:y.organization_id||"",onValueChange:e=>si("organization_id",e),placeholder:"Select Organization",children:null==c?void 0:c.map(e=>(0,l.jsx)(eC.Q,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})}),(0,l.jsxs)(eK.Z,{children:[(0,l.jsx)(eY.Z,{children:(0,l.jsxs)(eX.Z,{children:[(0,l.jsx)(eG.Z,{children:"Team Name"}),(0,l.jsx)(eG.Z,{children:"Team ID"}),(0,l.jsx)(eG.Z,{children:"Created"}),(0,l.jsx)(eG.Z,{children:"Spend (USD)"}),(0,l.jsx)(eG.Z,{children:"Budget (USD)"}),(0,l.jsx)(eG.Z,{children:"Models"}),(0,l.jsx)(eG.Z,{children:"Organization"}),(0,l.jsx)(eG.Z,{children:"Info"})]})}),(0,l.jsx)(eW.Z,{children:s&&s.length>0?s.filter(e=>!x||e.organization_id===x.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,l.jsxs)(eX.Z,{children:[(0,l.jsx)(eJ.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,l.jsx)(eJ.Z,{children:(0,l.jsx)("div",{className:"overflow-hidden",children:(0,l.jsx)(eb.Z,{title:e.team_id,children:(0,l.jsxs)(eO.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{D(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,l.jsx)(eJ.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,l.jsx)(eJ.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:(0,e4.pw)(e.spend,4)}),(0,l.jsx)(eJ.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,l.jsx)(eJ.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,l.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,l.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,l.jsx)(eP.Z,{size:"xs",className:"mb-1",color:"red",children:(0,l.jsx)(eQ.Z,{children:"All Proxy Models"})}):(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,l.jsx)("div",{children:(0,l.jsx)(eB.Z,{icon:es[e.team_id]?eg.Z:ej.Z,className:"cursor-pointer",size:"xs",onClick:()=>{et(s=>({...s,[e.team_id]:!s[e.team_id]}))}})}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,l.jsx)(eP.Z,{size:"xs",color:"red",children:(0,l.jsx)(eQ.Z,{children:"All Proxy Models"})},s):(0,l.jsx)(eP.Z,{size:"xs",color:"blue",children:(0,l.jsx)(eQ.Z,{children:e.length>30?"".concat((0,eN.W0)(e).slice(0,30),"..."):(0,eN.W0)(e)})},s)),e.models.length>3&&!es[e.team_id]&&(0,l.jsx)(eP.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,l.jsxs)(eQ.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),es[e.team_id]&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,l.jsx)(eP.Z,{size:"xs",color:"red",children:(0,l.jsx)(eQ.Z,{children:"All Proxy Models"})},s+3):(0,l.jsx)(eP.Z,{size:"xs",color:"blue",children:(0,l.jsx)(eQ.Z,{children:e.length>30?"".concat((0,eN.W0)(e).slice(0,30),"..."):(0,eN.W0)(e)})},s+3))})]})]})})}):null})}),(0,l.jsx)(eJ.Z,{children:e.organization_id}),(0,l.jsxs)(eJ.Z,{children:[(0,l.jsxs)(eQ.Z,{children:[X&&e.team_id&&X[e.team_id]&&X[e.team_id].keys&&X[e.team_id].keys.length," ","Keys"]}),(0,l.jsxs)(eQ.Z,{children:[X&&e.team_id&&X[e.team_id]&&X[e.team_id].team_info&&X[e.team_id].team_info.members_with_roles&&X[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,l.jsx)(eJ.Z,{children:"Admin"==o?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eB.Z,{icon:ef.Z,size:"sm",onClick:()=>{D(e.team_id),O(!0)}}),(0,l.jsx)(eB.Z,{onClick:()=>st(e.team_id),icon:ey.Z,size:"sm"})]}):null})]},e.team_id)):null})]}),H&&(()=>{var e;let t=null==s?void 0:s.find(e=>e.team_id===W),a=(null==t?void 0:t.team_alias)||"",n=(null==t?void 0:null===(e=t.keys)||void 0===e?void 0:e.length)||0,r=ed===a;return(0,l.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,l.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Team"}),(0,l.jsx)("button",{onClick:()=>{sa(),em("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,l.jsx)(e8.Z,{size:20})})]}),(0,l.jsxs)("div",{className:"px-6 py-4",children:[n>0&&(0,l.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,l.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,l.jsx)(e3.Z,{size:20})}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{className:"text-base font-medium text-red-600",children:["Warning: This team has ",n," associated key",n>1?"s":"","."]}),(0,l.jsx)("p",{className:"text-base text-red-600 mt-2",children:"Deleting the team will also delete all associated keys. This action is irreversible."})]})]}),(0,l.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to force delete this team and all its keys?"}),(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,l.jsx)("span",{className:"underline",children:a})," to confirm deletion:"]}),(0,l.jsx)("input",{type:"text",value:ed,onChange:e=>em(e.target.value),placeholder:"Enter team name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,l.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,l.jsx)("button",{onClick:()=>{sa(),em("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,l.jsx)("button",{onClick:sl,disabled:!r,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(r?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Force Delete"})]})]})})})()]})})})]}),(0,l.jsx)(eV.Z,{children:(0,l.jsx)(e0.Z,{accessToken:n,userID:i})}),(0,er.tY)(o||"")&&(0,l.jsx)(eV.Z,{children:(0,l.jsx)(eL.Z,{accessToken:n,userID:i||"",userRole:o||""})})]})]}),("Admin"==o||"Org Admin"==o)&&(0,l.jsx)(ev.Z,{title:"Create Team",visible:M,width:1e3,footer:null,onOk:()=>{R(!1),b.resetFields(),ea([]),ex({})},onCancel:()=>{R(!1),b.resetFields(),ea([]),ex({})},children:(0,l.jsxs)(e_.Z,{form:b,onFinish:sn,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e_.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,l.jsx)(e$.Z,{placeholder:""})}),(0,l.jsx)(e_.Z.Item,{label:(0,l.jsxs)("span",{children:["Organization"," ",(0,l.jsx)(eb.Z,{title:(0,l.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,l.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,l.jsx)(eT.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:x?x.organization_id:null,className:"mt-8",children:(0,l.jsx)(eZ.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{b.setFieldValue("organization_id",e),g((null==c?void 0:c.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var t;return!!s&&((null===(t=s.children)||void 0===t?void 0:t.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==c?void 0:c.map(e=>(0,l.jsxs)(eZ.default.Option,{value:e.organization_id,children:[(0,l.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,l.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,l.jsx)(e_.Z.Item,{label:(0,l.jsxs)("span",{children:["Models"," ",(0,l.jsx)(eb.Z,{title:"These are the models that your selected team has access to",children:(0,l.jsx)(eT.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,l.jsxs)(eZ.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,l.jsx)(eZ.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Y.map(e=>(0,l.jsx)(eZ.default.Option,{value:e,children:(0,eN.W0)(e)},e))]})}),(0,l.jsx)(e_.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(eS.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(e_.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(eZ.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(eZ.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(eZ.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(eZ.default.Option,{value:"30d",children:"monthly"})]})}),(0,l.jsx)(e_.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,l.jsx)(eS.Z,{step:1,width:400})}),(0,l.jsx)(e_.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,l.jsx)(eS.Z,{step:1,width:400})}),(0,l.jsxs)(eI.Z,{className:"mt-20 mb-8",onClick:()=>{eo||(ss(),ec(!0))},children:[(0,l.jsx)(eD.Z,{children:(0,l.jsx)("b",{children:"Additional Settings"})}),(0,l.jsxs)(eA.Z,{children:[(0,l.jsx)(e_.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,l.jsx)(e$.Z,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,l.jsx)(e_.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,l.jsx)(eS.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(e_.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,l.jsx)(e$.Z,{placeholder:"e.g., 30d"})}),(0,l.jsx)(e_.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,l.jsx)(eS.Z,{step:1,width:400})}),(0,l.jsx)(e_.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,l.jsx)(eS.Z,{step:1,width:400})}),(0,l.jsx)(e_.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,l.jsx)(ew.default.TextArea,{rows:4})}),(0,l.jsx)(e_.Z.Item,{label:(0,l.jsxs)("span",{children:["Guardrails"," ",(0,l.jsx)(eb.Z,{title:"Setup your first guardrail",children:(0,l.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,l.jsx)(eT.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,l.jsx)(eZ.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:$.map(e=>({value:e,label:e}))})}),(0,l.jsx)(e_.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,l.jsx)(eb.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,l.jsx)(eT.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,l.jsx)(e1.Z,{onChange:e=>b.setFieldValue("allowed_vector_store_ids",e),value:b.getFieldValue("allowed_vector_store_ids"),accessToken:n||"",placeholder:"Select vector stores (optional)"})})]})]}),(0,l.jsxs)(eI.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(eD.Z,{children:(0,l.jsx)("b",{children:"MCP Settings"})}),(0,l.jsxs)(eA.Z,{children:[(0,l.jsx)(e_.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,l.jsx)(eb.Z,{title:"Select which MCP servers or access groups this team can access",children:(0,l.jsx)(eT.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,l.jsx)(e5.Z,{onChange:e=>b.setFieldValue("allowed_mcp_servers_and_groups",e),value:b.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:n||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,l.jsx)(e_.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,l.jsx)(ew.default,{type:"hidden"})}),(0,l.jsx)(e_.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_mcp_servers_and_groups!==s.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(e6.Z,{accessToken:n||"",selectedServers:(null===(e=b.getFieldValue("allowed_mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:b.getFieldValue("mcp_tool_permissions")||{},onChange:e=>b.setFieldsValue({mcp_tool_permissions:e})})})}})]})]}),(0,l.jsxs)(eI.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(eD.Z,{children:(0,l.jsx)("b",{children:"Logging Settings"})}),(0,l.jsx)(eA.Z,{children:(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(e2.Z,{value:el,onChange:ea,premiumUser:d})})})]}),(0,l.jsxs)(eI.Z,{className:"mt-8 mb-8",children:[(0,l.jsx)(eD.Z,{children:(0,l.jsx)("b",{children:"Model Aliases"})}),(0,l.jsx)(eA.Z,{children:(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(eQ.Z,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,l.jsx)(e7.Z,{accessToken:n||"",initialModelAliases:eu,onAliasUpdate:ex,showExampleConfig:!1})]})})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(ek.ZP,{htmlType:"submit",children:"Create Team"})})]})})]})})})};function st(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";document.cookie="".concat(e,"=; Max-Age=0; Path=").concat(s)}function sl(e){try{let s=(0,r.o)(e);if(s&&"number"==typeof s.exp)return 1e3*s.exp<=Date.now();return!1}catch(e){return!0}}let sa=new i.S;function sn(){return(0,l.jsxs)("div",{className:(0,R.cx)("h-screen","flex items-center justify-center gap-4"),children:[(0,l.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"\uD83D\uDE85 LiteLLM"}),(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,l.jsx)(M.S,{className:"size-4"}),(0,l.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}function sr(){let[e,s]=(0,a.useState)(""),[t,i]=(0,a.useState)(!1),[M,R]=(0,a.useState)(!1),[B,U]=(0,a.useState)(null),[F,q]=(0,a.useState)(null),[V,H]=(0,a.useState)([]),[K,W]=(0,a.useState)([]),[J,Y]=(0,a.useState)([]),[G,X]=(0,a.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),[Q,$]=(0,a.useState)(!0),ee=(0,n.useSearchParams)(),[es,et]=(0,a.useState)({data:[]}),[el,ea]=(0,a.useState)(null),[en,er]=(0,a.useState)(!1),[ei,eo]=(0,a.useState)(!0),[ec,ed]=(0,a.useState)(null),{refactoredUIFlag:em}=(0,E.Z)(),eu=ee.get("invitation_id"),[eh,ep]=(0,a.useState)(()=>ee.get("page")||"api-keys"),[eg,ej]=(0,a.useState)(null),[ef,ey]=(0,a.useState)(!1),e_=e=>{H(s=>s?[...s,e]:[e]),er(()=>!en)},eb=!1===ei&&null===el&&null===eu;return((0,a.useEffect)(()=>{let e=!1;return(async()=>{try{await (0,N.getUiConfig)()}catch(e){}if(e)return;let s=function(e){let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));if(!s)return null;let t=s.slice(e.length+1);try{return decodeURIComponent(t)}catch(e){return t}}("token"),t=s&&!sl(s)?s:null;s&&!t&&st("token","/"),e||(ea(t),eo(!1))})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{if(eb){let e=(N.proxyBaseUrl||"")+"/sso/key/generate";window.location.replace(e)}},[eb]),(0,a.useEffect)(()=>{if(!el)return;if(sl(el)){st("token","/"),ea(null);return}let e=null;try{e=(0,r.o)(el)}catch(e){st("token","/"),ea(null);return}if(e){if(ej(e.key),R(e.disabled_non_admin_personal_key_creation),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);s(t),"Admin Viewer"==t&&ep("usage")}e.user_email&&U(e.user_email),e.login_method&&$("username_password"==e.login_method),e.premium_user&&i(e.premium_user),e.auth_header_name&&(0,N.setGlobalLitellmHeaderName)(e.auth_header_name),e.user_id&&ed(e.user_id)}},[el]),(0,a.useEffect)(()=>{eg&&ec&&e&&(0,L.Nr)(ec,e,eg,Y),eg&&ec&&e&&(0,I.Z)(eg,ec,e,null,q),eg&&(0,h.g)(eg,W)},[eg,ec,e]),ei||eb)?(0,l.jsx)(sn,{}):(0,l.jsx)(a.Suspense,{fallback:(0,l.jsx)(sn,{}),children:(0,l.jsx)(o.aH,{client:sa,children:(0,l.jsx)(d.f,{accessToken:eg,children:eu?(0,l.jsx)(m.Z,{userID:ec,userRole:e,premiumUser:t,teams:F,keys:V,setUserRole:s,userEmail:B,setUserEmail:U,setTeams:q,setKeys:H,organizations:K,addKey:e_,createClicked:en}):(0,l.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,l.jsx)(c.Z,{userID:ec,userRole:e,premiumUser:t,userEmail:B,setProxySettings:X,proxySettings:G,accessToken:eg,isPublicPage:!1,sidebarCollapsed:ef,onToggleSidebar:()=>{ey(!ef)}}),(0,l.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(ex,{setPage:e=>{let s=new URLSearchParams(ee);s.set("page",e),window.history.pushState(null,"","?".concat(s.toString())),ep(e)},defaultSelectedKey:eh,sidebarCollapsed:ef})}),"api-keys"==eh?(0,l.jsx)(m.Z,{userID:ec,userRole:e,premiumUser:t,teams:F,keys:V,setUserRole:s,userEmail:B,setUserEmail:U,setTeams:q,setKeys:H,organizations:K,addKey:e_,createClicked:en}):"models"==eh?(0,l.jsx)(u.Z,{userID:ec,userRole:e,token:el,keys:V,accessToken:eg,modelData:es,setModelData:et,premiumUser:t,teams:F}):"llm-playground"==eh?(0,l.jsx)(w.Z,{userID:ec,userRole:e,token:el,accessToken:eg,disabledPersonalKeyCreation:M}):"users"==eh?(0,l.jsx)(x.Z,{userID:ec,userRole:e,token:el,keys:V,teams:F,accessToken:eg,setKeys:H}):"teams"==eh?(0,l.jsx)(ss,{teams:F,setTeams:q,accessToken:eg,userID:ec,userRole:e,organizations:K,premiumUser:t,searchParams:ee}):"organizations"==eh?(0,l.jsx)(h.Z,{organizations:K,setOrganizations:W,userModels:J,accessToken:eg,userRole:e,premiumUser:t}):"admin-panel"==eh?(0,l.jsx)(p.Z,{setTeams:q,searchParams:ee,accessToken:eg,userID:ec,showSSOBanner:Q,premiumUser:t,proxySettings:G}):"api_ref"==eh?(0,l.jsx)(Z.Z,{proxySettings:G}):"settings"==eh?(0,l.jsx)(g.Z,{userID:ec,userRole:e,accessToken:eg,premiumUser:t}):"budgets"==eh?(0,l.jsx)(y.Z,{accessToken:eg}):"guardrails"==eh?(0,l.jsx)(C.Z,{accessToken:eg,userRole:e}):"prompts"==eh?(0,l.jsx)(T.Z,{accessToken:eg,userRole:e}):"transform-request"==eh?(0,l.jsx)(z.Z,{accessToken:eg}):"general-settings"==eh?(0,l.jsx)(j.Z,{userID:ec,userRole:e,accessToken:eg,modelData:es}):"ui-theme"==eh?(0,l.jsx)(O.Z,{userID:ec,userRole:e,accessToken:eg}):"model-hub-table"==eh?(0,l.jsx)(b.Z,{accessToken:eg,publicPage:!1,premiumUser:t,userRole:e}):"caching"==eh?(0,l.jsx)(S.Z,{userID:ec,userRole:e,token:el,accessToken:eg,premiumUser:t}):"pass-through-settings"==eh?(0,l.jsx)(f.Z,{userID:ec,userRole:e,accessToken:eg,modelData:es}):"logs"==eh?(0,l.jsx)(_.Z,{userID:ec,userRole:e,token:el,accessToken:eg,allTeams:null!=F?F:[],premiumUser:t}):"mcp-servers"==eh?(0,l.jsx)(A.d,{accessToken:eg,userRole:e,userID:ec}):"tag-management"==eh?(0,l.jsx)(D.Z,{accessToken:eg,userRole:e,userID:ec}):"vector-stores"==eh?(0,l.jsx)(P.Z,{accessToken:eg,userRole:e,userID:ec}):"new_usage"==eh?(0,l.jsx)(v.Z,{userID:ec,userRole:e,accessToken:eg,teams:null!=F?F:[],premiumUser:t}):(0,l.jsx)(k.Z,{userID:ec,userRole:e,token:el,accessToken:eg,keys:V,premiumUser:t})]})]})})})})}},88904:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(88913),r=t(93192),i=t(52787),o=t(63709),c=t(87908),d=t(19250),m=t(65925),u=t(46468),x=t(9114);s.Z=e=>{var s;let{accessToken:t,userID:h,userRole:p}=e,[g,j]=(0,a.useState)(!0),[f,y]=(0,a.useState)(null),[_,b]=(0,a.useState)(!1),[v,Z]=(0,a.useState)({}),[w,k]=(0,a.useState)(!1),[S,N]=(0,a.useState)([]),{Paragraph:C}=r.default,{Option:T}=i.default;(0,a.useEffect)(()=>{(async()=>{if(!t){j(!1);return}try{let e=await (0,d.getDefaultTeamSettings)(t);if(y(e),Z(e.values||{}),t)try{let e=await (0,d.modelAvailableCall)(t,h,p);if(e&&e.data){let s=e.data.map(e=>e.id);N(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),x.Z.fromBackend("Failed to fetch team settings")}finally{j(!1)}})()},[t]);let z=async()=>{if(t){k(!0);try{let e=await (0,d.updateDefaultTeamSettings)(t,v);y({...f,values:e.settings}),b(!1),x.Z.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),x.Z.fromBackend("Failed to update team settings")}finally{k(!1)}}},L=(e,s)=>{Z(t=>({...t,[e]:s}))},I=(e,s,t)=>{var a;let r=s.type;return"budget_duration"===e?(0,l.jsx)(m.Z,{value:v[e]||null,onChange:s=>L(e,s),className:"mt-2"}):"boolean"===r?(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(o.Z,{checked:!!v[e],onChange:s=>L(e,s)})}):"array"===r&&(null===(a=s.items)||void 0===a?void 0:a.enum)?(0,l.jsx)(i.default,{mode:"multiple",style:{width:"100%"},value:v[e]||[],onChange:s=>L(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,l.jsx)(T,{value:e,children:e},e))}):"models"===e?(0,l.jsx)(i.default,{mode:"multiple",style:{width:"100%"},value:v[e]||[],onChange:s=>L(e,s),className:"mt-2",children:S.map(e=>(0,l.jsx)(T,{value:e,children:(0,u.W0)(e)},e))}):"string"===r&&s.enum?(0,l.jsx)(i.default,{style:{width:"100%"},value:v[e]||"",onChange:s=>L(e,s),className:"mt-2",children:s.enum.map(e=>(0,l.jsx)(T,{value:e,children:e},e))}):(0,l.jsx)(n.oi,{value:void 0!==v[e]?String(v[e]):"",onChange:s=>L(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},A=(e,s)=>null==s?(0,l.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,l.jsx)("span",{children:(0,m.m)(s)}):"boolean"==typeof s?(0,l.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,l.jsx)("span",{className:"text-gray-400",children:"None"}):(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,u.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,l.jsx)("span",{className:"text-gray-400",children:"None"}):(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,l.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,l.jsx)("span",{children:String(s)});return g?(0,l.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,l.jsx)(c.Z,{size:"large"})}):f?(0,l.jsxs)(n.Zb,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(n.Dx,{className:"text-xl",children:"Default Team Settings"}),!g&&f&&(_?(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(n.zx,{variant:"secondary",onClick:()=>{b(!1),Z(f.values||{})},disabled:w,children:"Cancel"}),(0,l.jsx)(n.zx,{onClick:z,loading:w,children:"Save Changes"})]}):(0,l.jsx)(n.zx,{onClick:()=>b(!0),children:"Edit Settings"}))]}),(0,l.jsx)(n.xv,{children:"These settings will be applied by default when creating new teams."}),(null==f?void 0:null===(s=f.field_schema)||void 0===s?void 0:s.description)&&(0,l.jsx)(C,{className:"mb-4 mt-2",children:f.field_schema.description}),(0,l.jsx)(n.iz,{}),(0,l.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=f;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,a]=s,r=e[t],i=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,l.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,l.jsx)(n.xv,{className:"font-medium text-lg",children:i}),(0,l.jsx)(C,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),_?(0,l.jsx)("div",{className:"mt-2",children:I(t,a,r)}):(0,l.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:A(t,r)})]},t)}):(0,l.jsx)(n.xv,{children:"No schema information available"})})()})]}):(0,l.jsx)(n.Zb,{children:(0,l.jsx)(n.xv,{children:"No team settings available or you do not have permission to view them."})})}},49104:function(e,s,t){"use strict";t.d(s,{Z:function(){return O}});var l=t(57437),a=t(2265),n=t(87452),r=t(88829),i=t(72208),o=t(49566),c=t(13634),d=t(82680),m=t(20577),u=t(52787),x=t(73002),h=t(19250),p=t(9114),g=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:a,setBudgetList:g}=e,[j]=c.Z.useForm(),f=async e=>{if(null!=t&&void 0!=t)try{p.Z.info("Making API Call");let s=await (0,h.budgetCreateCall)(t,e);console.log("key create Response:",s),g(e=>e?[...e,s]:[s]),p.Z.success("Budget Created"),j.resetFields()}catch(e){console.error("Error creating the key:",e),p.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,l.jsx)(d.Z,{title:"Create Budget",visible:s,width:800,footer:null,onOk:()=>{a(!1),j.resetFields()},onCancel:()=>{a(!1),j.resetFields()},children:(0,l.jsxs)(c.Z,{form:j,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,l.jsx)(o.Z,{placeholder:""})}),(0,l.jsx)(c.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsxs)(n.Z,{className:"mt-20 mb-8",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)("b",{children:"Optional Settings"})}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(m.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(u.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(u.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(u.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(u.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(x.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},j=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:g,setBudgetList:j,existingBudget:f,handleUpdateCall:y}=e;console.log("existingBudget",f);let[_]=c.Z.useForm();(0,a.useEffect)(()=>{_.setFieldsValue(f)},[f,_]);let b=async e=>{if(null!=t&&void 0!=t)try{p.Z.info("Making API Call"),g(!0);let s=await (0,h.budgetUpdateCall)(t,e);j(e=>e?[...e,s]:[s]),p.Z.success("Budget Updated"),_.resetFields(),y()}catch(e){console.error("Error creating the key:",e),p.Z.fromBackend("Error creating the key: ".concat(e))}};return(0,l.jsx)(d.Z,{title:"Edit Budget",visible:s,width:800,footer:null,onOk:()=>{g(!1),_.resetFields()},onCancel:()=>{g(!1),_.resetFields()},children:(0,l.jsxs)(c.Z,{form:_,onFinish:b,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:f,children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Z.Item,{label:"Budget ID",name:"budget_id",rules:[{required:!0,message:"Please input a human-friendly name for the budget"}],help:"A human-friendly name for the budget",children:(0,l.jsx)(o.Z,{placeholder:""})}),(0,l.jsx)(c.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,l.jsx)(m.Z,{step:1,precision:2,width:200})}),(0,l.jsxs)(n.Z,{className:"mt-20 mb-8",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)("b",{children:"Optional Settings"})}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(m.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(c.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,l.jsxs)(u.default,{defaultValue:null,placeholder:"n/a",children:[(0,l.jsx)(u.default.Option,{value:"24h",children:"daily"}),(0,l.jsx)(u.default.Option,{value:"7d",children:"weekly"}),(0,l.jsx)(u.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(x.ZP,{htmlType:"submit",children:"Save"})})]})})},f=t(20831),y=t(12514),_=t(47323),b=t(12485),v=t(18135),Z=t(35242),w=t(29706),k=t(77991),S=t(21626),N=t(97214),C=t(28241),T=t(58834),z=t(69552),L=t(71876),I=t(84264),A=t(53410),D=t(74998),P=t(17906),O=e=>{let{accessToken:s}=e,[t,n]=(0,a.useState)(!1),[r,i]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),[d,m]=(0,a.useState)([]);(0,a.useEffect)(()=>{s&&(0,h.getBudgetList)(s).then(e=>{m(e)})},[s]);let u=async(e,t)=>{console.log("budget_id",e),null!=s&&(c(d.find(s=>s.budget_id===e)||null),i(!0))},x=async(e,t)=>{if(null==s)return;p.Z.info("Request made"),await (0,h.budgetDeleteCall)(s,e);let l=[...d];l.splice(t,1),m(l),p.Z.success("Budget Deleted.")},O=async()=>{null!=s&&(0,h.getBudgetList)(s).then(e=>{m(e)})};return(0,l.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,l.jsx)(f.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>n(!0),children:"+ Create Budget"}),(0,l.jsx)(g,{accessToken:s,isModalVisible:t,setIsModalVisible:n,setBudgetList:m}),o&&(0,l.jsx)(j,{accessToken:s,isModalVisible:r,setIsModalVisible:i,setBudgetList:m,existingBudget:o,handleUpdateCall:O}),(0,l.jsxs)(y.Z,{children:[(0,l.jsx)(I.Z,{children:"Create a budget to assign to customers."}),(0,l.jsxs)(S.Z,{children:[(0,l.jsx)(T.Z,{children:(0,l.jsxs)(L.Z,{children:[(0,l.jsx)(z.Z,{children:"Budget ID"}),(0,l.jsx)(z.Z,{children:"Max Budget"}),(0,l.jsx)(z.Z,{children:"TPM"}),(0,l.jsx)(z.Z,{children:"RPM"})]})}),(0,l.jsx)(N.Z,{children:d.slice().sort((e,s)=>new Date(s.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,s)=>(0,l.jsxs)(L.Z,{children:[(0,l.jsx)(C.Z,{children:e.budget_id}),(0,l.jsx)(C.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,l.jsx)(C.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,l.jsx)(C.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,l.jsx)(_.Z,{icon:A.Z,size:"sm",onClick:()=>u(e.budget_id,s)}),(0,l.jsx)(_.Z,{icon:D.Z,size:"sm",onClick:()=>x(e.budget_id,s)})]},s))})]})]}),(0,l.jsxs)("div",{className:"mt-5",children:[(0,l.jsx)(I.Z,{className:"text-base",children:"How to use budget id"}),(0,l.jsxs)(v.Z,{children:[(0,l.jsxs)(Z.Z,{children:[(0,l.jsx)(b.Z,{children:"Assign Budget to Customer"}),(0,l.jsx)(b.Z,{children:"Test it (Curl)"}),(0,l.jsx)(b.Z,{children:"Test it (OpenAI SDK)"})]}),(0,l.jsxs)(k.Z,{children:[(0,l.jsx)(w.Z,{children:(0,l.jsx)(P.Z,{language:"bash",children:"\ncurl -X POST --location '/end_user/new' \n-H 'Authorization: Bearer ' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(P.Z,{language:"bash",children:'\ncurl -X POST --location \'/chat/completions\' \n-H \'Authorization: Bearer \' \n-H \'Content-Type: application/json\' \n-d \'{\n "model": "gpt-3.5-turbo\', \n "messages":[{"role": "user", "content": "Hey, how\'s it going?"}],\n "user": "my-customer-id"\n}\' # \uD83D\uDC48 KEY CHANGE\n\n '})}),(0,l.jsx)(w.Z,{children:(0,l.jsx)(P.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="",\n api_key=""\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})}},918:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(62490),r=t(19250),i=t(9114);s.Z=e=>{let{accessToken:s,userID:t}=e,[o,c]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{if(s&&t)try{let e=await (0,r.availableTeamListCall)(s);c(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,t]);let d=async e=>{if(s&&t)try{await (0,r.teamMemberAddCall)(s,e,{user_id:t,role:"user"}),i.Z.success("Successfully joined team"),c(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),i.Z.fromBackend("Failed to join team")}};return(0,l.jsx)(n.Zb,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,l.jsxs)(n.iA,{children:[(0,l.jsx)(n.ss,{children:(0,l.jsxs)(n.SC,{children:[(0,l.jsx)(n.xs,{children:"Team Name"}),(0,l.jsx)(n.xs,{children:"Description"}),(0,l.jsx)(n.xs,{children:"Members"}),(0,l.jsx)(n.xs,{children:"Models"}),(0,l.jsx)(n.xs,{children:"Actions"})]})}),(0,l.jsxs)(n.RM,{children:[o.map(e=>(0,l.jsxs)(n.SC,{children:[(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.xv,{children:e.team_alias})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.xv,{children:e.description||"No description available"})}),(0,l.jsx)(n.pj,{children:(0,l.jsxs)(n.xv,{children:[e.members_with_roles.length," members"]})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,l.jsx)(n.Ct,{size:"xs",className:"mb-1",color:"blue",children:(0,l.jsx)(n.xv,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,l.jsx)(n.Ct,{size:"xs",color:"red",children:(0,l.jsx)(n.xv,{children:"All Proxy Models"})})})}),(0,l.jsx)(n.pj,{children:(0,l.jsx)(n.zx,{size:"xs",variant:"secondary",onClick:()=>d(e.team_id),children:"Join Team"})})]},e.team_id)),0===o.length&&(0,l.jsx)(n.SC,{children:(0,l.jsx)(n.pj,{colSpan:5,className:"text-center",children:(0,l.jsx)(n.xv,{children:"No available teams to join"})})})]})]})})}},6674:function(e,s,t){"use strict";t.d(s,{Z:function(){return d}});var l=t(57437),a=t(2265),n=t(73002),r=t(23639),i=t(96761),o=t(19250),c=t(9114),d=e=>{let{accessToken:s}=e,[t,d]=(0,a.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),p=(e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")},g=async()=>{h(!0);try{let e;try{e=JSON.parse(t)}catch(e){c.Z.fromBackend("Invalid JSON in request body"),h(!1);return}let l={call_type:"completion",request_body:e};if(!s){c.Z.fromBackend("No access token found"),h(!1);return}let a=await (0,o.transformRequestCall)(s,l);if(a.raw_request_api_base&&a.raw_request_body){let e=p(a.raw_request_api_base,a.raw_request_body,a.raw_request_headers||{});u(e),c.Z.success("Request transformed successfully")}else{let e="string"==typeof a?a:JSON.stringify(a);u(e),c.Z.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),c.Z.fromBackend("Failed to transform request")}finally{h(!1)}};return(0,l.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,l.jsx)(i.Z,{children:"Playground"}),(0,l.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,l.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,l.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,l.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,l.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,l.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,l.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),g())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,l.jsxs)(n.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:g,loading:x,children:[(0,l.jsx)("span",{children:"Transform"}),(0,l.jsx)("span",{children:"→"})]})})]}),(0,l.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,l.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,l.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,l.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,l.jsx)("br",{}),(0,l.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,l.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,l.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:m||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,l.jsx)(n.ZP,{type:"text",icon:(0,l.jsx)(r.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(m||""),c.Z.success("Copied to clipboard")}})]})]})]}),(0,l.jsx)("div",{className:"mt-4 text-right w-full",children:(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue"," ",(0,l.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})}},5183:function(e,s,t){"use strict";var l=t(57437),a=t(2265),n=t(19046),r=t(69734),i=t(19250),o=t(9114);s.Z=e=>{let{userID:s,userRole:t,accessToken:c}=e,{logoUrl:d,setLogoUrl:m}=(0,r.F)(),[u,x]=(0,a.useState)(""),[h,p]=(0,a.useState)(!1);(0,a.useEffect)(()=>{c&&g()},[c]);let g=async()=>{try{let s=(0,i.getProxyBaseUrl)(),t=await fetch(s?"".concat(s,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"}});if(t.ok){var e;let s=await t.json(),l=(null===(e=s.values)||void 0===e?void 0:e.logo_url)||"";x(l),m(l||null)}}catch(e){console.error("Error fetching theme settings:",e)}},j=async()=>{p(!0);try{let e=(0,i.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"},body:JSON.stringify({logo_url:u||null})})).ok)o.Z.success("Logo settings updated successfully!"),m(u||null);else throw Error("Failed to update settings")}catch(e){console.error("Error updating logo settings:",e),o.Z.fromBackend("Failed to update logo settings")}finally{p(!1)}},f=async()=>{x(""),m(null),p(!0);try{let e=(0,i.getProxyBaseUrl)();if((await fetch(e?"".concat(e,"/update/ui_theme_settings"):"/update/ui_theme_settings",{method:"PATCH",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"},body:JSON.stringify({logo_url:null})})).ok)o.Z.success("Logo reset to default!");else throw Error("Failed to reset logo")}catch(e){console.error("Error resetting logo:",e),o.Z.fromBackend("Failed to reset logo")}finally{p(!1)}};return c?(0,l.jsxs)("div",{className:"w-full mx-auto max-w-4xl px-6 py-8",children:[(0,l.jsxs)("div",{className:"mb-8",children:[(0,l.jsx)(n.Dx,{className:"text-2xl font-bold mb-2",children:"Logo Customization"}),(0,l.jsx)(n.xv,{className:"text-gray-600",children:"Customize your LiteLLM admin dashboard with a custom logo."})]}),(0,l.jsx)(n.Zb,{className:"shadow-sm p-6",children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(n.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Logo URL"}),(0,l.jsx)(n.oi,{placeholder:"https://example.com/logo.png",value:u,onValueChange:e=>{x(e),m(e||null)},className:"w-full"}),(0,l.jsx)(n.xv,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom logo or leave empty to use the default LiteLLM logo"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(n.xv,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Current Logo"}),(0,l.jsx)("div",{className:"bg-gray-50 rounded-lg p-6 flex items-center justify-center min-h-[120px]",children:u?(0,l.jsx)("img",{src:u,alt:"Custom logo",className:"max-w-full max-h-24 object-contain",onError:e=>{var s;let t=e.target;t.style.display="none";let l=document.createElement("div");l.className="text-gray-500 text-sm",l.textContent="Failed to load image",null===(s=t.parentElement)||void 0===s||s.appendChild(l)}}):(0,l.jsx)(n.xv,{className:"text-gray-500 text-sm",children:"Default LiteLLM logo will be used"})})]}),(0,l.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,l.jsx)(n.zx,{onClick:j,loading:h,disabled:h,color:"indigo",children:"Save Changes"}),(0,l.jsx)(n.zx,{onClick:f,loading:h,disabled:h,variant:"secondary",color:"gray",children:"Reset to Default"})]})]})})]}):null}}},function(e){e.O(0,[3665,6990,9820,1491,1526,2417,2926,3709,9775,2525,1529,2284,7908,9011,9678,3603,5319,1853,7281,6494,5188,6202,7906,2344,3669,9165,1264,1487,3752,5105,6433,1160,9888,3250,9429,1223,3352,8049,1633,2202,874,4292,2162,2004,2012,8160,7801,9883,3801,1307,1052,7155,3298,6204,1739,773,6925,8143,2273,5809,603,2019,4696,2971,2117,1744],function(){return e(e.s=97731)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/api-reference.html b/litellm/proxy/_experimental/out/api-reference.html index cfd0aa5272..92d5e15658 100644 --- a/litellm/proxy/_experimental/out/api-reference.html +++ b/litellm/proxy/_experimental/out/api-reference.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/api-reference.txt b/litellm/proxy/_experimental/out/api-reference.txt index 7a3ee9a897..3db6d8377f 100644 --- a/litellm/proxy/_experimental/out/api-reference.txt +++ b/litellm/proxy/_experimental/out/api-reference.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[81300,["9820","static/chunks/9820-b0722f821c1af1ee.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","7906","static/chunks/7906-11071e9e2e7b8318.js","4303","static/chunks/app/(dashboard)/api-reference/page-c04f26edd6161f83.js"],"default",1] +3:I[81300,["9820","static/chunks/9820-b0722f821c1af1ee.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","7906","static/chunks/7906-11071e9e2e7b8318.js","4303","static/chunks/app/(dashboard)/api-reference/page-e1b30f2f59900b67.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["api-reference",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["api-reference",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","api-reference","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["api-reference",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["api-reference",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","api-reference","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/experimental/api-playground.html b/litellm/proxy/_experimental/out/experimental/api-playground.html index da0acc4f54..f794d03090 100644 --- a/litellm/proxy/_experimental/out/experimental/api-playground.html +++ b/litellm/proxy/_experimental/out/experimental/api-playground.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/experimental/api-playground.txt b/litellm/proxy/_experimental/out/experimental/api-playground.txt index a9716cdc49..c198088726 100644 --- a/litellm/proxy/_experimental/out/experimental/api-playground.txt +++ b/litellm/proxy/_experimental/out/experimental/api-playground.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[16643,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","3425","static/chunks/app/(dashboard)/experimental/api-playground/page-2e10f494907c6a63.js"],"default",1] +3:I[16643,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","8049","static/chunks/8049-26a565b2b753c5e8.js","3425","static/chunks/app/(dashboard)/experimental/api-playground/page-9890fc550d55b49b.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["api-playground",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["api-playground",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","api-playground","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["api-playground",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["api-playground",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","api-playground","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/experimental/budgets.html b/litellm/proxy/_experimental/out/experimental/budgets.html index 6cdcae0781..ad2c4ad457 100644 --- a/litellm/proxy/_experimental/out/experimental/budgets.html +++ b/litellm/proxy/_experimental/out/experimental/budgets.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/experimental/budgets.txt b/litellm/proxy/_experimental/out/experimental/budgets.txt index e2564d5463..f8a86c5461 100644 --- a/litellm/proxy/_experimental/out/experimental/budgets.txt +++ b/litellm/proxy/_experimental/out/experimental/budgets.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[78858,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","7906","static/chunks/7906-11071e9e2e7b8318.js","527","static/chunks/527-d9b7316e990a0539.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","5649","static/chunks/app/(dashboard)/experimental/budgets/page-b913787fbd844fd3.js"],"default",1] +3:I[78858,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","7906","static/chunks/7906-11071e9e2e7b8318.js","527","static/chunks/527-d9b7316e990a0539.js","8049","static/chunks/8049-26a565b2b753c5e8.js","5649","static/chunks/app/(dashboard)/experimental/budgets/page-712ccbc9bd44a5ae.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["budgets",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["budgets",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","budgets","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["budgets",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["budgets",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","budgets","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/experimental/caching.html b/litellm/proxy/_experimental/out/experimental/caching.html index 7a6b51243c..cb398e4d63 100644 --- a/litellm/proxy/_experimental/out/experimental/caching.html +++ b/litellm/proxy/_experimental/out/experimental/caching.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/experimental/caching.txt b/litellm/proxy/_experimental/out/experimental/caching.txt index e394b3e1a6..b599b09a68 100644 --- a/litellm/proxy/_experimental/out/experimental/caching.txt +++ b/litellm/proxy/_experimental/out/experimental/caching.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[37492,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9678","static/chunks/9678-c633432ec1f8c65a.js","7281","static/chunks/7281-41cef56aa2b3df92.js","2344","static/chunks/2344-169e12738d6439ab.js","1487","static/chunks/1487-ada9ecf7dd9bca97.js","2662","static/chunks/2662-51eb8b1bec576f6d.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","4696","static/chunks/4696-2b10d95edaaa6de3.js","1979","static/chunks/app/(dashboard)/experimental/caching/page-c24bfd9a9fd51fe8.js"],"default",1] +3:I[37492,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9678","static/chunks/9678-c633432ec1f8c65a.js","7281","static/chunks/7281-41cef56aa2b3df92.js","2344","static/chunks/2344-17c84cab77fa632a.js","1487","static/chunks/1487-ada9ecf7dd9bca97.js","2662","static/chunks/2662-51eb8b1bec576f6d.js","8049","static/chunks/8049-26a565b2b753c5e8.js","4696","static/chunks/4696-2b10d95edaaa6de3.js","1979","static/chunks/app/(dashboard)/experimental/caching/page-34cb1817eb6914a2.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["caching",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["caching",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","caching","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["caching",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["caching",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","caching","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/experimental/old-usage.html b/litellm/proxy/_experimental/out/experimental/old-usage.html index ac544d6734..ce340da555 100644 --- a/litellm/proxy/_experimental/out/experimental/old-usage.html +++ b/litellm/proxy/_experimental/out/experimental/old-usage.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/experimental/old-usage.txt b/litellm/proxy/_experimental/out/experimental/old-usage.txt index 88fa2c5d2b..803d336338 100644 --- a/litellm/proxy/_experimental/out/experimental/old-usage.txt +++ b/litellm/proxy/_experimental/out/experimental/old-usage.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[42954,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-b101c17ea3d68f19.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-7124dea6b90175e7.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","2344","static/chunks/2344-169e12738d6439ab.js","1487","static/chunks/1487-ada9ecf7dd9bca97.js","5105","static/chunks/5105-eb18802ec448789d.js","1160","static/chunks/1160-3efb81c958413447.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1633","static/chunks/1633-34aaac4ed5258716.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-43934c5780447b84.js","4292","static/chunks/4292-3e30cf0761abb900.js","8143","static/chunks/8143-ff425046805ff3d9.js","813","static/chunks/app/(dashboard)/experimental/old-usage/page-f16a8ef298a13ef7.js"],"default",1] +3:I[42954,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-938b4af798279e4a.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","2344","static/chunks/2344-17c84cab77fa632a.js","1487","static/chunks/1487-ada9ecf7dd9bca97.js","5105","static/chunks/5105-e9f08a6b3a1f2881.js","1160","static/chunks/1160-08491effeedbaae3.js","8049","static/chunks/8049-26a565b2b753c5e8.js","131","static/chunks/131-8304bcbbae03bc10.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-e84ea35ec9a8042c.js","4292","static/chunks/4292-a1bc4327d9a3d829.js","8143","static/chunks/8143-ff425046805ff3d9.js","813","static/chunks/app/(dashboard)/experimental/old-usage/page-dc75946e58de809e.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["old-usage",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["old-usage",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","old-usage","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["old-usage",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["old-usage",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","old-usage","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/experimental/prompts.html b/litellm/proxy/_experimental/out/experimental/prompts.html index 1d599f5b47..327f13ae25 100644 --- a/litellm/proxy/_experimental/out/experimental/prompts.html +++ b/litellm/proxy/_experimental/out/experimental/prompts.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/experimental/prompts.txt b/litellm/proxy/_experimental/out/experimental/prompts.txt index dae4854822..bda45e7d3c 100644 --- a/litellm/proxy/_experimental/out/experimental/prompts.txt +++ b/litellm/proxy/_experimental/out/experimental/prompts.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[51599,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","2525","static/chunks/2525-13b137f40949dcf1.js","9011","static/chunks/9011-0769cb78a6e5f233.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","8347","static/chunks/8347-0845abae9a2a5d9e.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","603","static/chunks/603-41b69f9ab68da547.js","2099","static/chunks/app/(dashboard)/experimental/prompts/page-61feb7e98f982bcc.js"],"default",1] +3:I[51599,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","2525","static/chunks/2525-13b137f40949dcf1.js","9011","static/chunks/9011-0769cb78a6e5f233.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","8347","static/chunks/8347-0845abae9a2a5d9e.js","8049","static/chunks/8049-26a565b2b753c5e8.js","603","static/chunks/603-41b69f9ab68da547.js","2099","static/chunks/app/(dashboard)/experimental/prompts/page-2608594fa934affa.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["prompts",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["prompts",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","prompts","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["prompts",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["prompts",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","prompts","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/experimental/tag-management.html b/litellm/proxy/_experimental/out/experimental/tag-management.html index d692a54649..0c5022e9c9 100644 --- a/litellm/proxy/_experimental/out/experimental/tag-management.html +++ b/litellm/proxy/_experimental/out/experimental/tag-management.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/experimental/tag-management.txt b/litellm/proxy/_experimental/out/experimental/tag-management.txt index 61c9de4c6b..4df1d686c0 100644 --- a/litellm/proxy/_experimental/out/experimental/tag-management.txt +++ b/litellm/proxy/_experimental/out/experimental/tag-management.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[21933,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-b101c17ea3d68f19.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","6494","static/chunks/6494-7124dea6b90175e7.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","4924","static/chunks/4924-e47559a81a4aa31c.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1633","static/chunks/1633-34aaac4ed5258716.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-43934c5780447b84.js","2273","static/chunks/2273-0d0a74964599a0e2.js","6061","static/chunks/app/(dashboard)/experimental/tag-management/page-1da0c9dcc6fabf28.js"],"default",1] +3:I[21933,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","6494","static/chunks/6494-938b4af798279e4a.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","4924","static/chunks/4924-e47559a81a4aa31c.js","8049","static/chunks/8049-26a565b2b753c5e8.js","131","static/chunks/131-8304bcbbae03bc10.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-e84ea35ec9a8042c.js","2273","static/chunks/2273-0d0a74964599a0e2.js","6061","static/chunks/app/(dashboard)/experimental/tag-management/page-30215d565ccd90ac.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["tag-management",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["tag-management",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","tag-management","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["experimental",{"children":["tag-management",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["experimental",{"children":["tag-management",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children","tag-management","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","experimental","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/guardrails.html b/litellm/proxy/_experimental/out/guardrails.html index 764c80cbec..8b1aeab565 100644 --- a/litellm/proxy/_experimental/out/guardrails.html +++ b/litellm/proxy/_experimental/out/guardrails.html @@ -1,5 +1 @@ -<<<<<<<< HEAD:ui/litellm-dashboard/out/api-reference.html -LiteLLM Dashboard -======== -LiteLLM Dashboard ->>>>>>>> ef0d6f0207 (Resolve conflicts in generated HTML files):litellm/proxy/_experimental/out/guardrails.html +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/guardrails.txt b/litellm/proxy/_experimental/out/guardrails.txt index 2bb4394d9e..3abe2605f4 100644 --- a/litellm/proxy/_experimental/out/guardrails.txt +++ b/litellm/proxy/_experimental/out/guardrails.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[49514,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","3752","static/chunks/3752-53808701995a5f10.js","3866","static/chunks/3866-e3419825a249263f.js","5830","static/chunks/5830-47ce1a4897188f14.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","3298","static/chunks/3298-ad776747b5eff3ae.js","6607","static/chunks/app/(dashboard)/guardrails/page-cba2ae1139d5678e.js"],"default",1] +3:I[49514,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","3752","static/chunks/3752-53808701995a5f10.js","3866","static/chunks/3866-e3419825a249263f.js","5830","static/chunks/5830-47ce1a4897188f14.js","8049","static/chunks/8049-26a565b2b753c5e8.js","3298","static/chunks/3298-0debe247d04c451b.js","6607","static/chunks/app/(dashboard)/guardrails/page-229122aa339dc574.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["guardrails",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["guardrails",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","guardrails","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["guardrails",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["guardrails",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","guardrails","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/index.html b/litellm/proxy/_experimental/out/index.html index 9f1be54640..ef418116b5 100644 --- a/litellm/proxy/_experimental/out/index.html +++ b/litellm/proxy/_experimental/out/index.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/index.txt b/litellm/proxy/_experimental/out/index.txt index f9a71af972..8c12a7ace5 100644 --- a/litellm/proxy/_experimental/out/index.txt +++ b/litellm/proxy/_experimental/out/index.txt @@ -1,8 +1,8 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[7467,["3665","static/chunks/3014691f-702e24806fe9cec4.js","6990","static/chunks/13b76428-e1bf383848c17260.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-b101c17ea3d68f19.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-7124dea6b90175e7.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","7906","static/chunks/7906-11071e9e2e7b8318.js","2344","static/chunks/2344-169e12738d6439ab.js","3669","static/chunks/3669-cbf664b1e9c58f8a.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","1264","static/chunks/1264-2979d95e0b56a75c.js","1487","static/chunks/1487-ada9ecf7dd9bca97.js","3752","static/chunks/3752-53808701995a5f10.js","5105","static/chunks/5105-eb18802ec448789d.js","6433","static/chunks/6433-c9b3a95c5de0b59f.js","1160","static/chunks/1160-3efb81c958413447.js","9888","static/chunks/9888-a0a2120c93674b5e.js","3250","static/chunks/3250-3256164511237d25.js","9429","static/chunks/9429-2cac017dd355dcd2.js","1223","static/chunks/1223-de5e7e4f043a5233.js","3352","static/chunks/3352-d74c8ad48994cc5b.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1633","static/chunks/1633-34aaac4ed5258716.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-43934c5780447b84.js","4292","static/chunks/4292-3e30cf0761abb900.js","2162","static/chunks/2162-70a154301fc81d42.js","2004","static/chunks/2004-2c0ea663e63e0a2f.js","2012","static/chunks/2012-90188715a5858c8c.js","8160","static/chunks/8160-978f9adc46a12a56.js","7801","static/chunks/7801-631ca879181868d8.js","9883","static/chunks/9883-85b2991f131b4416.js","3801","static/chunks/3801-f50239dd6dee5df7.js","1307","static/chunks/1307-6bc3bb770f5b2b05.js","1052","static/chunks/1052-bdb89c881be4619e.js","7155","static/chunks/7155-95101d73b2137e92.js","3298","static/chunks/3298-ad776747b5eff3ae.js","6204","static/chunks/6204-0d389019484112ee.js","1739","static/chunks/1739-f276f8d8fca7b189.js","773","static/chunks/773-91425983f811b156.js","6925","static/chunks/6925-9e2db5c132fe9053.js","8143","static/chunks/8143-ff425046805ff3d9.js","2273","static/chunks/2273-0d0a74964599a0e2.js","5809","static/chunks/5809-1eb0022e0f1e4ee3.js","603","static/chunks/603-41b69f9ab68da547.js","2019","static/chunks/2019-f91b853dc598350e.js","4696","static/chunks/4696-2b10d95edaaa6de3.js","1931","static/chunks/app/page-d7c5dbe555bb16a5.js"],"default",1] +3:I[50036,["3665","static/chunks/3014691f-702e24806fe9cec4.js","6990","static/chunks/13b76428-e1bf383848c17260.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-938b4af798279e4a.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","7906","static/chunks/7906-11071e9e2e7b8318.js","2344","static/chunks/2344-17c84cab77fa632a.js","3669","static/chunks/3669-6e17d59477ade8ac.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","1264","static/chunks/1264-2979d95e0b56a75c.js","1487","static/chunks/1487-ada9ecf7dd9bca97.js","3752","static/chunks/3752-53808701995a5f10.js","5105","static/chunks/5105-e9f08a6b3a1f2881.js","6433","static/chunks/6433-c9b3a95c5de0b59f.js","1160","static/chunks/1160-08491effeedbaae3.js","9888","static/chunks/9888-a0a2120c93674b5e.js","3250","static/chunks/3250-f8c476289792167a.js","9429","static/chunks/9429-2cac017dd355dcd2.js","1223","static/chunks/1223-de5e7e4f043a5233.js","8050","static/chunks/8050-901c2a1bce9028ed.js","8049","static/chunks/8049-26a565b2b753c5e8.js","131","static/chunks/131-8304bcbbae03bc10.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-e84ea35ec9a8042c.js","4292","static/chunks/4292-a1bc4327d9a3d829.js","2162","static/chunks/2162-70a154301fc81d42.js","2004","static/chunks/2004-2c0ea663e63e0a2f.js","2012","static/chunks/2012-8ba1526768e30ef5.js","8160","static/chunks/8160-292eaad6e0da51a9.js","7801","static/chunks/7801-2b5492cdeacaedc4.js","2306","static/chunks/2306-c9a553b697103491.js","3801","static/chunks/3801-f50239dd6dee5df7.js","1307","static/chunks/1307-3d9ef20b529a0edc.js","9681","static/chunks/9681-49ea01accf85cac1.js","7155","static/chunks/7155-56eb798322f1faf7.js","3298","static/chunks/3298-0debe247d04c451b.js","6204","static/chunks/6204-0d389019484112ee.js","1739","static/chunks/1739-f276f8d8fca7b189.js","773","static/chunks/773-91425983f811b156.js","6925","static/chunks/6925-b4f07277f285ca48.js","8143","static/chunks/8143-ff425046805ff3d9.js","2273","static/chunks/2273-0d0a74964599a0e2.js","5809","static/chunks/5809-1eb0022e0f1e4ee3.js","603","static/chunks/603-41b69f9ab68da547.js","2019","static/chunks/2019-f91b853dc598350e.js","4696","static/chunks/4696-2b10d95edaaa6de3.js","1931","static/chunks/app/page-92ab3a1095e26dca.js"],"default",1] 4:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 5:I[4707,[],""] 6:I[36423,[],""] -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/logs.html b/litellm/proxy/_experimental/out/logs.html index 3abe5057e7..d9aff82c94 100644 --- a/litellm/proxy/_experimental/out/logs.html +++ b/litellm/proxy/_experimental/out/logs.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/logs.txt b/litellm/proxy/_experimental/out/logs.txt index eace34cdf3..46d40356ee 100644 --- a/litellm/proxy/_experimental/out/logs.txt +++ b/litellm/proxy/_experimental/out/logs.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[19056,["6990","static/chunks/13b76428-e1bf383848c17260.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-b101c17ea3d68f19.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","6494","static/chunks/6494-7124dea6b90175e7.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","1264","static/chunks/1264-2979d95e0b56a75c.js","5079","static/chunks/5079-a43d5cc0d7429256.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1633","static/chunks/1633-34aaac4ed5258716.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-43934c5780447b84.js","4292","static/chunks/4292-3e30cf0761abb900.js","3801","static/chunks/3801-f50239dd6dee5df7.js","2100","static/chunks/app/(dashboard)/logs/page-009011bc6f8bc171.js"],"default",1] +3:I[19056,["6990","static/chunks/13b76428-e1bf383848c17260.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","6494","static/chunks/6494-938b4af798279e4a.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","1264","static/chunks/1264-2979d95e0b56a75c.js","5079","static/chunks/5079-a43d5cc0d7429256.js","8049","static/chunks/8049-26a565b2b753c5e8.js","131","static/chunks/131-8304bcbbae03bc10.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-e84ea35ec9a8042c.js","4292","static/chunks/4292-a1bc4327d9a3d829.js","3801","static/chunks/3801-f50239dd6dee5df7.js","2100","static/chunks/app/(dashboard)/logs/page-5019bcc8a011ed8c.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["logs",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["logs",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","logs","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["logs",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["logs",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","logs","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/model-hub.html b/litellm/proxy/_experimental/out/model-hub.html index f2856d201f..11230e073e 100644 --- a/litellm/proxy/_experimental/out/model-hub.html +++ b/litellm/proxy/_experimental/out/model-hub.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/model-hub.txt b/litellm/proxy/_experimental/out/model-hub.txt index f41ff54bca..9eb8e6512a 100644 --- a/litellm/proxy/_experimental/out/model-hub.txt +++ b/litellm/proxy/_experimental/out/model-hub.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[30615,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","9011","static/chunks/9011-0769cb78a6e5f233.js","3603","static/chunks/3603-b101c17ea3d68f19.js","7906","static/chunks/7906-11071e9e2e7b8318.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","3752","static/chunks/3752-53808701995a5f10.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2162","static/chunks/2162-70a154301fc81d42.js","8160","static/chunks/8160-978f9adc46a12a56.js","2678","static/chunks/app/(dashboard)/model-hub/page-f38983c7e128e2f2.js"],"default",1] +3:I[30615,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","9011","static/chunks/9011-0769cb78a6e5f233.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","7906","static/chunks/7906-11071e9e2e7b8318.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","3752","static/chunks/3752-53808701995a5f10.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2162","static/chunks/2162-70a154301fc81d42.js","8160","static/chunks/8160-292eaad6e0da51a9.js","2678","static/chunks/app/(dashboard)/model-hub/page-28a4881b81368e36.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["model-hub",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["model-hub",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","model-hub","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["model-hub",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["model-hub",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","model-hub","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/model_hub.txt b/litellm/proxy/_experimental/out/model_hub.txt index b05d8d7736..7f2b7cd475 100644 --- a/litellm/proxy/_experimental/out/model_hub.txt +++ b/litellm/proxy/_experimental/out/model_hub.txt @@ -1,8 +1,8 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[52829,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2162","static/chunks/2162-70a154301fc81d42.js","1418","static/chunks/app/model_hub/page-72f15aece1cca2fe.js"],"default",1] +3:I[52829,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2162","static/chunks/2162-70a154301fc81d42.js","1418","static/chunks/app/model_hub/page-72f15aece1cca2fe.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] 6:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/model_hub_table.html b/litellm/proxy/_experimental/out/model_hub_table.html index abb76d4ea7..3897ddb9f6 100644 --- a/litellm/proxy/_experimental/out/model_hub_table.html +++ b/litellm/proxy/_experimental/out/model_hub_table.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/model_hub_table.txt b/litellm/proxy/_experimental/out/model_hub_table.txt index 4bc22eb01e..d7ad391eb4 100644 --- a/litellm/proxy/_experimental/out/model_hub_table.txt +++ b/litellm/proxy/_experimental/out/model_hub_table.txt @@ -1,8 +1,8 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[22775,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","9011","static/chunks/9011-0769cb78a6e5f233.js","3603","static/chunks/3603-b101c17ea3d68f19.js","7906","static/chunks/7906-11071e9e2e7b8318.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","3752","static/chunks/3752-53808701995a5f10.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2162","static/chunks/2162-70a154301fc81d42.js","8160","static/chunks/8160-978f9adc46a12a56.js","9025","static/chunks/app/model_hub_table/page-6f26e4d3c0a2deb0.js"],"default",1] +3:I[22775,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","9011","static/chunks/9011-0769cb78a6e5f233.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","7906","static/chunks/7906-11071e9e2e7b8318.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","3752","static/chunks/3752-53808701995a5f10.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2162","static/chunks/2162-70a154301fc81d42.js","8160","static/chunks/8160-292eaad6e0da51a9.js","9025","static/chunks/app/model_hub_table/page-6f26e4d3c0a2deb0.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] 6:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub_table",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub_table","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub_table",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub_table","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/models-and-endpoints.html b/litellm/proxy/_experimental/out/models-and-endpoints.html index 0d9d4bf723..d9fb33ecda 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints.html +++ b/litellm/proxy/_experimental/out/models-and-endpoints.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/models-and-endpoints.txt b/litellm/proxy/_experimental/out/models-and-endpoints.txt index 3682beb1fb..1ba95ac118 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints.txt +++ b/litellm/proxy/_experimental/out/models-and-endpoints.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[6121,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-b101c17ea3d68f19.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-7124dea6b90175e7.js","6202","static/chunks/6202-e6c424fe04dff54a.js","2344","static/chunks/2344-169e12738d6439ab.js","3669","static/chunks/3669-cbf664b1e9c58f8a.js","1487","static/chunks/1487-ada9ecf7dd9bca97.js","5105","static/chunks/5105-eb18802ec448789d.js","4851","static/chunks/4851-fbdd7aec2937c09d.js","9429","static/chunks/9429-2cac017dd355dcd2.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1633","static/chunks/1633-34aaac4ed5258716.js","2012","static/chunks/2012-90188715a5858c8c.js","7801","static/chunks/7801-631ca879181868d8.js","1664","static/chunks/app/(dashboard)/models-and-endpoints/page-50ce8c6bb2821738.js"],"default",1] +3:I[6121,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-938b4af798279e4a.js","6202","static/chunks/6202-e6c424fe04dff54a.js","2344","static/chunks/2344-17c84cab77fa632a.js","3669","static/chunks/3669-6e17d59477ade8ac.js","1487","static/chunks/1487-ada9ecf7dd9bca97.js","5105","static/chunks/5105-e9f08a6b3a1f2881.js","4851","static/chunks/4851-fbdd7aec2937c09d.js","9429","static/chunks/9429-2cac017dd355dcd2.js","8049","static/chunks/8049-26a565b2b753c5e8.js","131","static/chunks/131-8304bcbbae03bc10.js","2012","static/chunks/2012-8ba1526768e30ef5.js","7801","static/chunks/7801-2b5492cdeacaedc4.js","1664","static/chunks/app/(dashboard)/models-and-endpoints/page-5b4a740f9549ae1e.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["models-and-endpoints",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["models-and-endpoints",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","models-and-endpoints","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["models-and-endpoints",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["models-and-endpoints",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","models-and-endpoints","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/onboarding.html b/litellm/proxy/_experimental/out/onboarding.html index fb3dca57a4..2341fc9f02 100644 --- a/litellm/proxy/_experimental/out/onboarding.html +++ b/litellm/proxy/_experimental/out/onboarding.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/onboarding.txt b/litellm/proxy/_experimental/out/onboarding.txt index f9286b2878..88f61ba855 100644 --- a/litellm/proxy/_experimental/out/onboarding.txt +++ b/litellm/proxy/_experimental/out/onboarding.txt @@ -1,8 +1,8 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[12011,["3665","static/chunks/3014691f-702e24806fe9cec4.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","8806","static/chunks/8806-85c2bcba4ca300e2.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","8461","static/chunks/app/onboarding/page-4aa59d8eb6dfee88.js"],"default",1] +3:I[12011,["3665","static/chunks/3014691f-702e24806fe9cec4.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","8806","static/chunks/8806-85c2bcba4ca300e2.js","8049","static/chunks/8049-26a565b2b753c5e8.js","8461","static/chunks/app/onboarding/page-4aa59d8eb6dfee88.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] 6:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["onboarding",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","onboarding","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["onboarding",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","onboarding","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/organizations.html b/litellm/proxy/_experimental/out/organizations.html index 6ee456c527..b0cd82b1a4 100644 --- a/litellm/proxy/_experimental/out/organizations.html +++ b/litellm/proxy/_experimental/out/organizations.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/organizations.txt b/litellm/proxy/_experimental/out/organizations.txt index 06a3533598..124385246a 100644 --- a/litellm/proxy/_experimental/out/organizations.txt +++ b/litellm/proxy/_experimental/out/organizations.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[57616,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-b101c17ea3d68f19.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-7124dea6b90175e7.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1633","static/chunks/1633-34aaac4ed5258716.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-43934c5780447b84.js","2004","static/chunks/2004-2c0ea663e63e0a2f.js","6459","static/chunks/app/(dashboard)/organizations/page-3f42c10932338e71.js"],"default",1] +3:I[57616,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-938b4af798279e4a.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","8049","static/chunks/8049-26a565b2b753c5e8.js","131","static/chunks/131-8304bcbbae03bc10.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-e84ea35ec9a8042c.js","2004","static/chunks/2004-2c0ea663e63e0a2f.js","6459","static/chunks/app/(dashboard)/organizations/page-388c7d5731acf363.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["organizations",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["organizations",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","organizations","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["organizations",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["organizations",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","organizations","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/settings/admin-settings.html b/litellm/proxy/_experimental/out/settings/admin-settings.html index 072ccecffa..af5817fe75 100644 --- a/litellm/proxy/_experimental/out/settings/admin-settings.html +++ b/litellm/proxy/_experimental/out/settings/admin-settings.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/settings/admin-settings.txt b/litellm/proxy/_experimental/out/settings/admin-settings.txt index d6711d7b13..bd28502e44 100644 --- a/litellm/proxy/_experimental/out/settings/admin-settings.txt +++ b/litellm/proxy/_experimental/out/settings/admin-settings.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[8786,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9775","static/chunks/9775-ac7313139c5f089d.js","9678","static/chunks/9678-c633432ec1f8c65a.js","7281","static/chunks/7281-41cef56aa2b3df92.js","2052","static/chunks/2052-68db39dea49a676f.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","773","static/chunks/773-91425983f811b156.js","8958","static/chunks/app/(dashboard)/settings/admin-settings/page-e4fd0d8bc569d74f.js"],"default",1] +3:I[8786,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9775","static/chunks/9775-ac7313139c5f089d.js","9678","static/chunks/9678-c633432ec1f8c65a.js","7281","static/chunks/7281-41cef56aa2b3df92.js","2052","static/chunks/2052-68db39dea49a676f.js","8049","static/chunks/8049-26a565b2b753c5e8.js","773","static/chunks/773-91425983f811b156.js","8958","static/chunks/app/(dashboard)/settings/admin-settings/page-bf35b8b5ac73a485.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["settings",{"children":["admin-settings",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["settings",{"children":["admin-settings",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children","admin-settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["settings",{"children":["admin-settings",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["settings",{"children":["admin-settings",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children","admin-settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/settings/logging-and-alerts.html b/litellm/proxy/_experimental/out/settings/logging-and-alerts.html index 40163597ce..3411c1cca1 100644 --- a/litellm/proxy/_experimental/out/settings/logging-and-alerts.html +++ b/litellm/proxy/_experimental/out/settings/logging-and-alerts.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/settings/logging-and-alerts.txt b/litellm/proxy/_experimental/out/settings/logging-and-alerts.txt index 7616cb276b..da1cddae0a 100644 --- a/litellm/proxy/_experimental/out/settings/logging-and-alerts.txt +++ b/litellm/proxy/_experimental/out/settings/logging-and-alerts.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[72719,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9775","static/chunks/9775-ac7313139c5f089d.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9678","static/chunks/9678-c633432ec1f8c65a.js","226","static/chunks/226-81daaf8cff08ccfe.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","6925","static/chunks/6925-9e2db5c132fe9053.js","2445","static/chunks/app/(dashboard)/settings/logging-and-alerts/page-985e0bf863f7d9e2.js"],"default",1] +3:I[72719,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9775","static/chunks/9775-ac7313139c5f089d.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9678","static/chunks/9678-c633432ec1f8c65a.js","226","static/chunks/226-81daaf8cff08ccfe.js","8049","static/chunks/8049-26a565b2b753c5e8.js","6925","static/chunks/6925-b4f07277f285ca48.js","2445","static/chunks/app/(dashboard)/settings/logging-and-alerts/page-4bba68ba957e2904.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["settings",{"children":["logging-and-alerts",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["settings",{"children":["logging-and-alerts",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children","logging-and-alerts","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["settings",{"children":["logging-and-alerts",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["settings",{"children":["logging-and-alerts",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children","logging-and-alerts","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/settings/router-settings.html b/litellm/proxy/_experimental/out/settings/router-settings.html index e996ed95d1..67b1aae86b 100644 --- a/litellm/proxy/_experimental/out/settings/router-settings.html +++ b/litellm/proxy/_experimental/out/settings/router-settings.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/settings/router-settings.txt b/litellm/proxy/_experimental/out/settings/router-settings.txt index f0dff22e41..e17e22a9b8 100644 --- a/litellm/proxy/_experimental/out/settings/router-settings.txt +++ b/litellm/proxy/_experimental/out/settings/router-settings.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[14809,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9678","static/chunks/9678-c633432ec1f8c65a.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6433","static/chunks/6433-c9b3a95c5de0b59f.js","1223","static/chunks/1223-de5e7e4f043a5233.js","901","static/chunks/901-34706ce91c6b582c.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","5809","static/chunks/5809-1eb0022e0f1e4ee3.js","8021","static/chunks/app/(dashboard)/settings/router-settings/page-1fc70b97618b643c.js"],"default",1] +3:I[14809,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9678","static/chunks/9678-c633432ec1f8c65a.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6433","static/chunks/6433-c9b3a95c5de0b59f.js","1223","static/chunks/1223-de5e7e4f043a5233.js","901","static/chunks/901-34706ce91c6b582c.js","8049","static/chunks/8049-26a565b2b753c5e8.js","5809","static/chunks/5809-1eb0022e0f1e4ee3.js","8021","static/chunks/app/(dashboard)/settings/router-settings/page-bb2dff1be677bb71.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["settings",{"children":["router-settings",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["settings",{"children":["router-settings",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children","router-settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["settings",{"children":["router-settings",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["settings",{"children":["router-settings",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children","router-settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/settings/ui-theme.html b/litellm/proxy/_experimental/out/settings/ui-theme.html index 9d97e68538..b28c1de2a0 100644 --- a/litellm/proxy/_experimental/out/settings/ui-theme.html +++ b/litellm/proxy/_experimental/out/settings/ui-theme.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/settings/ui-theme.txt b/litellm/proxy/_experimental/out/settings/ui-theme.txt index 8116fe8ede..52e32b1d60 100644 --- a/litellm/proxy/_experimental/out/settings/ui-theme.txt +++ b/litellm/proxy/_experimental/out/settings/ui-theme.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[8719,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","3117","static/chunks/app/(dashboard)/settings/ui-theme/page-f379dd301189ad65.js"],"default",1] +3:I[8719,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","8049","static/chunks/8049-26a565b2b753c5e8.js","3117","static/chunks/app/(dashboard)/settings/ui-theme/page-74e4c4e7aa9329ea.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["settings",{"children":["ui-theme",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["settings",{"children":["ui-theme",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children","ui-theme","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["settings",{"children":["ui-theme",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["settings",{"children":["ui-theme",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children","ui-theme","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","settings","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/teams.html b/litellm/proxy/_experimental/out/teams.html index f9bb672c04..7404bfc18a 100644 --- a/litellm/proxy/_experimental/out/teams.html +++ b/litellm/proxy/_experimental/out/teams.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/teams.txt b/litellm/proxy/_experimental/out/teams.txt index dd7b48413e..6895cd7f95 100644 --- a/litellm/proxy/_experimental/out/teams.txt +++ b/litellm/proxy/_experimental/out/teams.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[67578,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9678","static/chunks/9678-c633432ec1f8c65a.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6202","static/chunks/6202-e6c424fe04dff54a.js","7640","static/chunks/7640-0474293166ede97c.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1633","static/chunks/1633-34aaac4ed5258716.js","2004","static/chunks/2004-2c0ea663e63e0a2f.js","2012","static/chunks/2012-90188715a5858c8c.js","9483","static/chunks/app/(dashboard)/teams/page-7a73148e728ec98a.js"],"default",1] +3:I[67578,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9678","static/chunks/9678-c633432ec1f8c65a.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6202","static/chunks/6202-e6c424fe04dff54a.js","7640","static/chunks/7640-0474293166ede97c.js","8049","static/chunks/8049-26a565b2b753c5e8.js","131","static/chunks/131-8304bcbbae03bc10.js","2004","static/chunks/2004-2c0ea663e63e0a2f.js","2012","static/chunks/2012-8ba1526768e30ef5.js","9483","static/chunks/app/(dashboard)/teams/page-e8dfff543471e450.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["teams",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["teams",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","teams","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["teams",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["teams",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","teams","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/test-key.html b/litellm/proxy/_experimental/out/test-key.html index e5b293b26f..5cfa5b7059 100644 --- a/litellm/proxy/_experimental/out/test-key.html +++ b/litellm/proxy/_experimental/out/test-key.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/test-key.txt b/litellm/proxy/_experimental/out/test-key.txt index f63822318c..c5b6d45e44 100644 --- a/litellm/proxy/_experimental/out/test-key.txt +++ b/litellm/proxy/_experimental/out/test-key.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[38511,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","7906","static/chunks/7906-11071e9e2e7b8318.js","4851","static/chunks/4851-fbdd7aec2937c09d.js","6433","static/chunks/6433-c9b3a95c5de0b59f.js","9888","static/chunks/9888-a0a2120c93674b5e.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1052","static/chunks/1052-bdb89c881be4619e.js","2322","static/chunks/app/(dashboard)/test-key/page-a89ea5aaed337567.js"],"default",1] +3:I[38511,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","7906","static/chunks/7906-11071e9e2e7b8318.js","4851","static/chunks/4851-fbdd7aec2937c09d.js","6433","static/chunks/6433-c9b3a95c5de0b59f.js","9888","static/chunks/9888-a0a2120c93674b5e.js","8049","static/chunks/8049-26a565b2b753c5e8.js","9681","static/chunks/9681-49ea01accf85cac1.js","2322","static/chunks/app/(dashboard)/test-key/page-1870641393210367.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["test-key",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["test-key",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","test-key","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["test-key",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["test-key",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","test-key","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/tools/mcp-servers.html b/litellm/proxy/_experimental/out/tools/mcp-servers.html index deaba90e88..c9b8f5c90c 100644 --- a/litellm/proxy/_experimental/out/tools/mcp-servers.html +++ b/litellm/proxy/_experimental/out/tools/mcp-servers.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/tools/mcp-servers.txt b/litellm/proxy/_experimental/out/tools/mcp-servers.txt index dbe0625704..ea74382a49 100644 --- a/litellm/proxy/_experimental/out/tools/mcp-servers.txt +++ b/litellm/proxy/_experimental/out/tools/mcp-servers.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[45045,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","3669","static/chunks/3669-cbf664b1e9c58f8a.js","1264","static/chunks/1264-2979d95e0b56a75c.js","4851","static/chunks/4851-fbdd7aec2937c09d.js","3866","static/chunks/3866-e3419825a249263f.js","6836","static/chunks/6836-e30124a71aafae62.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1307","static/chunks/1307-6bc3bb770f5b2b05.js","6940","static/chunks/app/(dashboard)/tools/mcp-servers/page-91876f4e21ac7596.js"],"default",1] +3:I[45045,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","3669","static/chunks/3669-6e17d59477ade8ac.js","1264","static/chunks/1264-2979d95e0b56a75c.js","4851","static/chunks/4851-fbdd7aec2937c09d.js","3866","static/chunks/3866-e3419825a249263f.js","6836","static/chunks/6836-e30124a71aafae62.js","8049","static/chunks/8049-26a565b2b753c5e8.js","1307","static/chunks/1307-3d9ef20b529a0edc.js","6940","static/chunks/app/(dashboard)/tools/mcp-servers/page-2fd597d070592ae4.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["tools",{"children":["mcp-servers",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["tools",{"children":["mcp-servers",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","tools","children","mcp-servers","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","tools","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["tools",{"children":["mcp-servers",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["tools",{"children":["mcp-servers",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","tools","children","mcp-servers","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","tools","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/tools/vector-stores.html b/litellm/proxy/_experimental/out/tools/vector-stores.html index b66b05be45..9b0956961f 100644 --- a/litellm/proxy/_experimental/out/tools/vector-stores.html +++ b/litellm/proxy/_experimental/out/tools/vector-stores.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/tools/vector-stores.txt b/litellm/proxy/_experimental/out/tools/vector-stores.txt index 5d2b5233cb..0b3478f8dd 100644 --- a/litellm/proxy/_experimental/out/tools/vector-stores.txt +++ b/litellm/proxy/_experimental/out/tools/vector-stores.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[77438,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","7908","static/chunks/7908-07a76cfe29c543c9.js","3669","static/chunks/3669-cbf664b1e9c58f8a.js","8791","static/chunks/8791-b95bd7fdd710a85d.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","6204","static/chunks/6204-0d389019484112ee.js","6248","static/chunks/app/(dashboard)/tools/vector-stores/page-6a747c73e6811499.js"],"default",1] +3:I[77438,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","7908","static/chunks/7908-07a76cfe29c543c9.js","3669","static/chunks/3669-6e17d59477ade8ac.js","8791","static/chunks/8791-b95bd7fdd710a85d.js","8049","static/chunks/8049-26a565b2b753c5e8.js","6204","static/chunks/6204-0d389019484112ee.js","6248","static/chunks/app/(dashboard)/tools/vector-stores/page-2c5e185717ef32c7.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["tools",{"children":["vector-stores",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["tools",{"children":["vector-stores",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","tools","children","vector-stores","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","tools","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["tools",{"children":["vector-stores",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["tools",{"children":["vector-stores",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","tools","children","vector-stores","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","tools","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/usage.html b/litellm/proxy/_experimental/out/usage.html index 1eef2848e5..9ab691314a 100644 --- a/litellm/proxy/_experimental/out/usage.html +++ b/litellm/proxy/_experimental/out/usage.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/usage.txt b/litellm/proxy/_experimental/out/usage.txt index 61e64b4501..38fbed8cb4 100644 --- a/litellm/proxy/_experimental/out/usage.txt +++ b/litellm/proxy/_experimental/out/usage.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[26661,["6990","static/chunks/13b76428-e1bf383848c17260.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-b101c17ea3d68f19.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","6494","static/chunks/6494-7124dea6b90175e7.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","2344","static/chunks/2344-169e12738d6439ab.js","5105","static/chunks/5105-eb18802ec448789d.js","4851","static/chunks/4851-fbdd7aec2937c09d.js","1160","static/chunks/1160-3efb81c958413447.js","3250","static/chunks/3250-3256164511237d25.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1633","static/chunks/1633-34aaac4ed5258716.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-43934c5780447b84.js","4292","static/chunks/4292-3e30cf0761abb900.js","9883","static/chunks/9883-85b2991f131b4416.js","4746","static/chunks/app/(dashboard)/usage/page-0087e951a6403a40.js"],"default",1] +3:I[26661,["6990","static/chunks/13b76428-e1bf383848c17260.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","6494","static/chunks/6494-938b4af798279e4a.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","2344","static/chunks/2344-17c84cab77fa632a.js","5105","static/chunks/5105-e9f08a6b3a1f2881.js","4851","static/chunks/4851-fbdd7aec2937c09d.js","1160","static/chunks/1160-08491effeedbaae3.js","3250","static/chunks/3250-f8c476289792167a.js","8049","static/chunks/8049-26a565b2b753c5e8.js","131","static/chunks/131-8304bcbbae03bc10.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-e84ea35ec9a8042c.js","4292","static/chunks/4292-a1bc4327d9a3d829.js","2306","static/chunks/2306-c9a553b697103491.js","4746","static/chunks/app/(dashboard)/usage/page-af5d7ad6e47d0b01.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["usage",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["usage",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","usage","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["usage",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["usage",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","usage","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/users.html b/litellm/proxy/_experimental/out/users.html index 193e2bf211..40a74bc29a 100644 --- a/litellm/proxy/_experimental/out/users.html +++ b/litellm/proxy/_experimental/out/users.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/users.txt b/litellm/proxy/_experimental/out/users.txt index 855e958828..30bcdb59c6 100644 --- a/litellm/proxy/_experimental/out/users.txt +++ b/litellm/proxy/_experimental/out/users.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[87654,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-b101c17ea3d68f19.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-7124dea6b90175e7.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","3669","static/chunks/3669-cbf664b1e9c58f8a.js","1264","static/chunks/1264-2979d95e0b56a75c.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2202","static/chunks/2202-e8124587d6b0e623.js","7155","static/chunks/7155-95101d73b2137e92.js","7297","static/chunks/app/(dashboard)/users/page-5350004f9323e706.js"],"default",1] +3:I[87654,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-938b4af798279e4a.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","3669","static/chunks/3669-6e17d59477ade8ac.js","1264","static/chunks/1264-2979d95e0b56a75c.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2202","static/chunks/2202-e8124587d6b0e623.js","7155","static/chunks/7155-56eb798322f1faf7.js","7297","static/chunks/app/(dashboard)/users/page-c5cc93238455fee0.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["users",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["users",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","users","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["users",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["users",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","users","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/litellm/proxy/_experimental/out/virtual-keys.html b/litellm/proxy/_experimental/out/virtual-keys.html index 2ec3a2eff3..805f0a25e1 100644 --- a/litellm/proxy/_experimental/out/virtual-keys.html +++ b/litellm/proxy/_experimental/out/virtual-keys.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/virtual-keys.txt b/litellm/proxy/_experimental/out/virtual-keys.txt index fafaea414e..8ffce11dbe 100644 --- a/litellm/proxy/_experimental/out/virtual-keys.txt +++ b/litellm/proxy/_experimental/out/virtual-keys.txt @@ -1,14 +1,14 @@ 2:I[19107,[],"ClientPageRoot"] -3:I[2425,["3665","static/chunks/3014691f-702e24806fe9cec4.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-e0933e3af843b646.js","2284","static/chunks/2284-4cbc9a7f33eb7c89.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-b101c17ea3d68f19.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-7124dea6b90175e7.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","1264","static/chunks/1264-2979d95e0b56a75c.js","17","static/chunks/17-782feb91c41095ca.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","1633","static/chunks/1633-34aaac4ed5258716.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-43934c5780447b84.js","4292","static/chunks/4292-3e30cf0761abb900.js","1739","static/chunks/1739-f276f8d8fca7b189.js","7049","static/chunks/app/(dashboard)/virtual-keys/page-5f39dca6d04896e2.js"],"default",1] +3:I[2425,["3665","static/chunks/3014691f-702e24806fe9cec4.js","9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","2417","static/chunks/2417-b28f330f82bf4a82.js","2926","static/chunks/2926-b5dcad9f62f5e2b1.js","3709","static/chunks/3709-b17db86e0ab325d2.js","9775","static/chunks/9775-ac7313139c5f089d.js","2525","static/chunks/2525-13b137f40949dcf1.js","1529","static/chunks/1529-130888c02463f3dd.js","2284","static/chunks/2284-6840f6cabd9dbd7e.js","7908","static/chunks/7908-07a76cfe29c543c9.js","9011","static/chunks/9011-0769cb78a6e5f233.js","9678","static/chunks/9678-c633432ec1f8c65a.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","5319","static/chunks/5319-43bd4ee5bb7e50d1.js","1853","static/chunks/1853-fa2eb7102429db88.js","7281","static/chunks/7281-41cef56aa2b3df92.js","6494","static/chunks/6494-938b4af798279e4a.js","5188","static/chunks/5188-0e9d5e6db19ac9e6.js","6202","static/chunks/6202-e6c424fe04dff54a.js","1264","static/chunks/1264-2979d95e0b56a75c.js","17","static/chunks/17-782feb91c41095ca.js","8049","static/chunks/8049-26a565b2b753c5e8.js","131","static/chunks/131-8304bcbbae03bc10.js","2202","static/chunks/2202-e8124587d6b0e623.js","874","static/chunks/874-e84ea35ec9a8042c.js","4292","static/chunks/4292-a1bc4327d9a3d829.js","1739","static/chunks/1739-f276f8d8fca7b189.js","7049","static/chunks/app/(dashboard)/virtual-keys/page-a060a80d56f4f360.js"],"default",1] 4:I[4707,[],""] 5:I[36423,[],""] -6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-e0933e3af843b646.js","3603","static/chunks/3603-b101c17ea3d68f19.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-f268e4c9d6244ca6.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-0374fe6c07ff896f.js"],"default",1] +6:I[89219,["9820","static/chunks/9820-b0722f821c1af1ee.js","1491","static/chunks/1491-8280340b5391aa11.js","1526","static/chunks/1526-8e2976ed10cb2fa0.js","3709","static/chunks/3709-b17db86e0ab325d2.js","1529","static/chunks/1529-130888c02463f3dd.js","3603","static/chunks/3603-dd19ac8e31e4bc25.js","9165","static/chunks/9165-2a738a73d0d5f1d1.js","8098","static/chunks/8098-3da3212991542668.js","8049","static/chunks/8049-26a565b2b753c5e8.js","2019","static/chunks/2019-f91b853dc598350e.js","5642","static/chunks/app/(dashboard)/layout-5326607dcd905fe4.js"],"default",1] 8:I[31857,["3185","static/chunks/app/layout-b4b61d636c5d2baf.js"],"FeatureFlagsProvider"] 7:{} 9:{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"} a:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"} b:{"display":"inline-block"} c:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0} -0:["xJpMbkw-PrXOjhVmfa1qv",[[["",{"children":["(dashboard)",{"children":["virtual-keys",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["virtual-keys",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","virtual-keys","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/646842864d761e6f.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] +0:["WgTo48b9igIhFqIpxzvPv",[[["",{"children":["(dashboard)",{"children":["virtual-keys",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["(dashboard)",{"children":["virtual-keys",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children","virtual-keys","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":"$7"}]],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/349654da14372cd9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/39bc5c75b4e5b054.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_1c856b","children":["$","$L8",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$9","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$a","children":"404"}],["$","div",null,{"style":"$b","children":["$","h2",null,{"style":"$c","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$Ld",null]]]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"LiteLLM Dashboard"}],["$","meta","3",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]] 1:null diff --git a/ui/litellm-dashboard/out/404.html b/ui/litellm-dashboard/out/404.html deleted file mode 100644 index de6c12aed1..0000000000 --- a/ui/litellm-dashboard/out/404.html +++ /dev/null @@ -1 +0,0 @@ -404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/ZQ8CnOaEkWoWBRYVxXOow/_buildManifest.js b/ui/litellm-dashboard/out/_next/static/ZQ8CnOaEkWoWBRYVxXOow/_buildManifest.js deleted file mode 100644 index 1b732be87b..0000000000 --- a/ui/litellm-dashboard/out/_next/static/ZQ8CnOaEkWoWBRYVxXOow/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-cf5ca766ac8f493f.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/ZQ8CnOaEkWoWBRYVxXOow/_ssgManifest.js b/ui/litellm-dashboard/out/_next/static/ZQ8CnOaEkWoWBRYVxXOow/_ssgManifest.js deleted file mode 100644 index 5b3ff592fd..0000000000 --- a/ui/litellm-dashboard/out/_next/static/ZQ8CnOaEkWoWBRYVxXOow/_ssgManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/1052-bdb89c881be4619e.js b/ui/litellm-dashboard/out/_next/static/chunks/1052-bdb89c881be4619e.js deleted file mode 100644 index d760fa17b6..0000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/1052-bdb89c881be4619e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1052],{19046:function(e,t,s){s.d(t,{Dx:function(){return r.Z},Zb:function(){return a.Z},oi:function(){return l.Z},xv:function(){return n.Z},zx:function(){return o.Z}});var o=s(20831),a=s(12514),n=s(84264),l=s(49566),r=s(96761)},31052:function(e,t,s){s.d(t,{Z:function(){return eA}});var o=s(57437),a=s(2265),n=s(243),l=s(19046),r=s(93837),i=s(64482),c=s(65319),d=s(93192),m=s(52787),g=s(89970),p=s(87908),u=s(82680),x=s(73002),h=s(26433),f=s(19250);async function b(e,t,s,o,a,n,l,r,i,c,d,m,g,p){console.log=function(){},console.log("isLocal:",!1);let u=(0,f.getProxyBaseUrl)(),x={};a&&a.length>0&&(x["x-litellm-tags"]=a.join(","));let b=new h.ZP.OpenAI({apiKey:o,baseURL:u,dangerouslyAllowBrowser:!0,defaultHeaders:x});try{let a;let x=Date.now(),h=!1,f=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(u,"/mcp"),require_approval:"never",allowed_tools:g,headers:{"x-litellm-api-key":"Bearer ".concat(o)}}]:void 0;for await(let o of(await b.chat.completions.create({model:s,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:c,messages:e,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...f?{tools:f,tool_choice:"auto"}:{}},{signal:n}))){var v,y,j,w,S,N,k,P;console.log("Stream chunk:",o);let e=null===(v=o.choices[0])||void 0===v?void 0:v.delta;if(console.log("Delta content:",null===(j=o.choices[0])||void 0===j?void 0:null===(y=j.delta)||void 0===y?void 0:y.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!h&&((null===(S=o.choices[0])||void 0===S?void 0:null===(w=S.delta)||void 0===w?void 0:w.content)||e&&e.reasoning_content)&&(h=!0,a=Date.now()-x,console.log("First token received! Time:",a,"ms"),r?(console.log("Calling onTimingData with:",a),r(a)):console.log("onTimingData callback is not defined!")),null===(k=o.choices[0])||void 0===k?void 0:null===(N=k.delta)||void 0===N?void 0:N.content){let e=o.choices[0].delta.content;t(e,o.model)}if(e&&e.image&&p&&(console.log("Image generated:",e.image),p(e.image.url,o.model)),e&&e.reasoning_content){let t=e.reasoning_content;l&&l(t)}if(o.usage&&i){console.log("Usage data found:",o.usage);let e={completionTokens:o.usage.completion_tokens,promptTokens:o.usage.prompt_tokens,totalTokens:o.usage.total_tokens};(null===(P=o.usage.completion_tokens_details)||void 0===P?void 0:P.reasoning_tokens)&&(e.reasoningTokens=o.usage.completion_tokens_details.reasoning_tokens),i(e)}}}catch(e){throw(null==n?void 0:n.aborted)&&console.log("Chat completion request was cancelled"),e}}var v=s(9114);async function y(e,t,s,o,a,n){console.log=function(){},console.log("isLocal:",!1);let l=(0,f.getProxyBaseUrl)(),r=new h.ZP.OpenAI({apiKey:o,baseURL:l,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{let o=await r.images.generate({model:s,prompt:e},{signal:n});if(console.log(o.data),o.data&&o.data[0]){if(o.data[0].url)t(o.data[0].url,s);else if(o.data[0].b64_json){let e=o.data[0].b64_json;t("data:image/png;base64,".concat(e),s)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==n?void 0:n.aborted)?console.log("Image generation request was cancelled"):v.Z.fromBackend("Error occurred while generating image. Please try again. Error: ".concat(e)),e}}async function j(e,t,s,o,a,n,l){console.log=function(){},console.log("isLocal:",!1);let r=(0,f.getProxyBaseUrl)(),i=new h.ZP.OpenAI({apiKey:a,baseURL:r,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let a=Array.isArray(e)?e:[e],n=[];for(let e=0;e1&&v.Z.success("Successfully processed ".concat(n.length," images"))}catch(e){if(console.error("Error making image edit request:",e),null==l?void 0:l.aborted)console.log("Image edits request was cancelled");else{var c;let t="Failed to edit image(s)";(null==e?void 0:null===(c=e.error)||void 0===c?void 0:c.message)?t=e.error.message:(null==e?void 0:e.message)&&(t=e.message),v.Z.fromBackend("Image edit failed: ".concat(t))}throw e}}async function w(e,t,s,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,r=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,g=arguments.length>12?arguments[12]:void 0,p=arguments.length>13?arguments[13]:void 0,u=arguments.length>14?arguments[14]:void 0,x=arguments.length>15?arguments[15]:void 0;if(!o)throw Error("API key is required");console.log=function(){};let b=(0,f.getProxyBaseUrl)(),y={};a&&a.length>0&&(y["x-litellm-tags"]=a.join(","));let j=new h.ZP.OpenAI({apiKey:o,baseURL:b,dangerouslyAllowBrowser:!0,defaultHeaders:y});try{let o=Date.now(),a=!1,h=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),f=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never",allowed_tools:g}]:void 0,b=await j.responses.create({model:s,input:h,stream:!0,litellm_trace_id:c,...p?{previous_response_id:p}:{},...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...f?{tools:f,tool_choice:"required"}:{}},{signal:n}),v="";for await(let e of b)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var w,S,N,k,P,C,I;if(((null===(w=e.type)||void 0===w?void 0:w.startsWith("response.mcp_"))||"response.output_item.done"===e.type&&((null===(S=e.item)||void 0===S?void 0:S.type)==="mcp_list_tools"||(null===(N=e.item)||void 0===N?void 0:N.type)==="mcp_call"))&&(console.log("MCP event received:",e),x)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||(null===(C=e.item)||void 0===C?void 0:C.id),item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};x(t)}if("response.output_item.done"===e.type&&(null===(k=e.item)||void 0===k?void 0:k.type)==="mcp_call"&&(null===(P=e.item)||void 0===P?void 0:P.name)&&(v=e.item.name,console.log("MCP tool used:",v)),"response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let n=e.delta;if(console.log("Text delta",n),n.trim().length>0&&(t("assistant",n,s),!a)){a=!0;let e=Date.now()-o;console.log("First token received! Time:",e,"ms"),r&&r(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&l&&l(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,s=t.usage;if(console.log("Usage data:",s),console.log("Response completed event:",t),t.id&&u&&(console.log("Response ID for session management:",t.id),u(t.id)),s&&i){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(I=s.completion_tokens_details)||void 0===I?void 0:I.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),i(e,v)}}}return b}catch(e){throw(null==n?void 0:n.aborted)?console.log("Responses API request was cancelled"):v.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var S=s(85498);async function N(e,t,s,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,r=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,g=arguments.length>12?arguments[12]:void 0;if(!o)throw Error("API key is required");console.log=function(){};let p=(0,f.getProxyBaseUrl)(),u={};a&&a.length>0&&(u["x-litellm-tags"]=a.join(","));let x=new S.ZP({apiKey:o,baseURL:p,dangerouslyAllowBrowser:!0,defaultHeaders:u});try{let a=Date.now(),u=!1,h=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(p,"/mcp"),require_approval:"never",allowed_tools:g,headers:{"x-litellm-api-key":"Bearer ".concat(o)}}]:void 0,f={model:s,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(f.vector_store_ids=d),m&&(f.guardrails=m),h&&(f.tools=h,f.tool_choice="auto"),x.messages.stream(f,{signal:n}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let o=e.delta;if(!u){u=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),r&&r(e)}"text_delta"===o.type?t("assistant",o.text,s):"reasoning_delta"===o.type&&l&&l(o.text)}if("message_delta"===e.type&&e.usage&&i){let t=e.usage;console.log("Usage data found:",t);let s={completionTokens:t.output_tokens,promptTokens:t.input_tokens,totalTokens:t.input_tokens+t.output_tokens};i(s)}}}catch(e){throw(null==n?void 0:n.aborted)?console.log("Anthropic messages request was cancelled"):v.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var k=s(51601);async function P(e){try{return(await (0,f.mcpToolsCall)(e)).tools||[]}catch(e){return console.error("Error fetching MCP tools:",e),[]}}var C=s(49817),I=s(17906),_=s(94263),T=s(92280),Z=e=>{let{endpointType:t,onEndpointChange:s,className:a}=e,n=[{value:C.KP.CHAT,label:"/v1/chat/completions"},{value:C.KP.RESPONSES,label:"/v1/responses"},{value:C.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:C.KP.IMAGE,label:"/v1/images/generations"},{value:C.KP.IMAGE_EDITS,label:"/v1/images/edits"}];return(0,o.jsxs)("div",{className:a,children:[(0,o.jsx)(T.x,{children:"Endpoint Type:"}),(0,o.jsx)(m.default,{showSearch:!0,value:t,style:{width:"100%"},onChange:s,options:n,className:"rounded-md"})]})},E=e=>{let{onChange:t,value:s,className:n,accessToken:l}=e,[r,i]=(0,a.useState)([]),[c,d]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{(async()=>{if(l)try{let e=await (0,f.tagListCall)(l);console.log("List tags response:",e),i(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}})()},[]),(0,o.jsx)(m.default,{mode:"multiple",placeholder:"Select tags",onChange:t,value:s,loading:c,className:n,options:r.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})},A=s(97415),U=s(67479),R=s(88658),L=s(83322),M=s(70464),D=s(77565),K=e=>{let{reasoningContent:t}=e,[s,l]=(0,a.useState)(!0);return t?(0,o.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,o.jsxs)(x.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>l(!s),icon:(0,o.jsx)(L.Z,{}),children:[s?"Hide reasoning":"Show reasoning",s?(0,o.jsx)(M.Z,{className:"ml-1"}):(0,o.jsx)(D.Z,{className:"ml-1"})]}),s&&(0,o.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,o.jsx)(n.U,{components:{code(e){let{node:t,inline:s,className:a,children:n,...l}=e,r=/language-(\w+)/.exec(a||"");return!s&&r?(0,o.jsx)(I.Z,{style:_.Z,language:r[1],PreTag:"div",className:"rounded-md my-2",...l,children:String(n).replace(/\n$/,"")}):(0,o.jsx)("code",{className:"".concat(a," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...l,children:n})}},children:t})})]}):null},z=s(5540),O=s(71282),F=s(11741),H=s(16601),B=s(58630),G=e=>{let{timeToFirstToken:t,usage:s,toolName:a}=e;return t||s?(0,o.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==t&&(0,o.jsx)(g.Z,{title:"Time to first token",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(z.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:[(t/1e3).toFixed(2),"s"]})]})}),(null==s?void 0:s.promptTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Prompt tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(O.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["In: ",s.promptTokens]})]})}),(null==s?void 0:s.completionTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Completion tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(F.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Out: ",s.completionTokens]})]})}),(null==s?void 0:s.reasoningTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Reasoning tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(L.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Reasoning: ",s.reasoningTokens]})]})}),(null==s?void 0:s.totalTokens)!==void 0&&(0,o.jsx)(g.Z,{title:"Total tokens",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(H.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Total: ",s.totalTokens]})]})}),a&&(0,o.jsx)(g.Z,{title:"Tool used",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)(B.Z,{className:"mr-1"}),(0,o.jsxs)("span",{children:["Tool: ",a]})]})})]}):null},q=s(53508);let{Dragger:J}=c.default;var W=e=>{let{responsesUploadedImage:t,responsesImagePreviewUrl:s,onImageUpload:a,onRemoveImage:n}=e;return(0,o.jsx)(o.Fragment,{children:!t&&(0,o.jsx)(J,{beforeUpload:a,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,o.jsx)(g.Z,{title:"Attach image or PDF",children:(0,o.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,o.jsx)(q.Z,{style:{fontSize:"16px"}})})})})})};let V=e=>new Promise((t,s)=>{let o=new FileReader;o.onload=()=>{t(o.result.split(",")[1])},o.onerror=s,o.readAsDataURL(e)}),Y=async(e,t)=>{let s=await V(t),o=t.type||(t.name.toLowerCase().endsWith(".pdf")?"application/pdf":"image/jpeg");return{role:"user",content:[{type:"input_text",text:e},{type:"input_image",image_url:"data:".concat(o,";base64,").concat(s)}]}},X=(e,t,s,o)=>{let a="";t&&o&&(a=o.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(a):e};return t&&s&&(n.imagePreviewUrl=s),n},$=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;var Q=s(50010),ee=e=>{let{message:t}=e;if(!$(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,o.jsx)("div",{className:"mb-2",children:s?(0,o.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,o.jsx)("img",{src:t.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})};let{Dragger:et}=c.default;var es=e=>{let{chatUploadedImage:t,chatImagePreviewUrl:s,onImageUpload:a,onRemoveImage:n}=e;return(0,o.jsx)(o.Fragment,{children:!t&&(0,o.jsx)(et,{beforeUpload:a,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,o.jsx)(g.Z,{title:"Attach image or PDF",children:(0,o.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,o.jsx)(q.Z,{style:{fontSize:"16px"}})})})})})};let eo=e=>new Promise((t,s)=>{let o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=s,o.readAsDataURL(e)}),ea=async(e,t)=>({role:"user",content:[{type:"text",text:e},{type:"image_url",image_url:{url:await eo(t)}}]}),en=(e,t,s,o)=>{let a="";t&&o&&(a=o.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(a):e};return t&&s&&(n.imagePreviewUrl=s),n},el=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;var er=e=>{let{message:t}=e;if(!el(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,o.jsx)("div",{className:"mb-2",children:s?(0,o.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,o.jsx)("img",{src:t.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})},ei=s(63709),ec=s(15424),ed=s(23639),em=e=>{let{endpointType:t,responsesSessionId:s,useApiSessionManagement:a,onToggleSessionManagement:n}=e;return t!==C.KP.RESPONSES?null:(0,o.jsxs)("div",{className:"mb-4",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Session Management"}),(0,o.jsx)(g.Z,{title:"Choose between LiteLLM API session management (using previous_response_id) or UI-based session management (using chat history)",children:(0,o.jsx)(ec.Z,{className:"text-gray-400",style:{fontSize:"12px"}})})]}),(0,o.jsx)(ei.Z,{checked:a,onChange:n,checkedChildren:"API",unCheckedChildren:"UI",size:"small"})]}),(0,o.jsxs)("div",{className:"text-xs p-2 rounded-md ".concat(s?"bg-green-50 text-green-700 border border-green-200":"bg-blue-50 text-blue-700 border border-blue-200"),children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)(ec.Z,{style:{fontSize:"12px"}}),(()=>{if(!s)return a?"API Session: Ready":"UI Session: Ready";let e=a?"Response ID":"UI Session",t=s.slice(0,10);return"".concat(e,": ").concat(t,"...")})()]}),s&&(0,o.jsx)(g.Z,{title:(0,o.jsxs)("div",{className:"text-xs",children:[(0,o.jsx)("div",{className:"mb-1",children:"Copy response ID to continue session:"}),(0,o.jsx)("div",{className:"bg-gray-800 text-gray-100 p-2 rounded font-mono text-xs whitespace-pre-wrap",children:'curl -X POST "your-proxy-url/v1/responses" \\\n -H "Authorization: Bearer your-api-key" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "model": "your-model",\n "input": [{"role": "user", "content": "your message", "type": "message"}],\n "previous_response_id": "'.concat(s,'",\n "stream": true\n }\'')})]}),overlayStyle:{maxWidth:"500px"},children:(0,o.jsx)("button",{onClick:()=>{s&&(navigator.clipboard.writeText(s),v.Z.success("Response ID copied to clipboard!"))},className:"ml-2 p-1 hover:bg-green-100 rounded transition-colors",children:(0,o.jsx)(ed.Z,{style:{fontSize:"12px"}})})})]}),(0,o.jsx)("div",{className:"text-xs opacity-75 mt-1",children:s?a?"LiteLLM API session active - context maintained server-side":"UI session active - context maintained client-side":a?"LiteLLM will manage session using previous_response_id":"UI will manage session using chat history"})]})]})},eg=s(29),ep=s.n(eg),eu=s(44851);let{Text:ex}=d.default,{Panel:eh}=eu.default;var ef=e=>{var t,s;let{events:a,className:n}=e;if(console.log("MCPEventsDisplay: Received events:",a),!a||0===a.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let l=a.find(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0}),r=a.filter(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_call"});return(console.log("MCPEventsDisplay: toolsEvent:",l),console.log("MCPEventsDisplay: mcpCallEvents:",r),l||0!==r.length)?(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac "+"mcp-events-display ".concat(n||""),children:[(0,o.jsx)(ep(),{id:"32b14b04f420f3ac",children:'.openai-mcp-tools.jsx-32b14b04f420f3ac{position:relative;margin:0;padding:0}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac{background:transparent!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{padding:0 0 0 20px!important;background:transparent!important;border:none!important;font-size:14px!important;color:#9ca3af!important;font-weight:400!important;line-height:20px!important;min-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{background:transparent!important;color:#6b7280!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{position:absolute!important;left:2px!important;top:2px!important;color:#9ca3af!important;font-size:10px!important;width:16px!important;height:16px!important;display:-webkit-box!important;display:-webkit-flex!important;display:-moz-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-webkit-align-items:center!important;-moz-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:center!important;-webkit-justify-content:center!important;-moz-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{position:absolute;left:9px;top:18px;bottom:0;width:.5px;background-color:#f3f4f6;opacity:.8}.tool-item.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:13px;color:#4b5563;line-height:18px;padding:0;margin:0;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac{margin-bottom:12px;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{font-size:13px;color:#6b7280;font-weight:500;margin-bottom:4px}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid#f3f4f6;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;color:#374151;margin:0;white-space:pre-wrap;word-wrap:break-word}.mcp-approved.jsx-32b14b04f420f3ac{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;color:#6b7280}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:bold}.mcp-response-content.jsx-32b14b04f420f3ac{font-size:13px;color:#374151;line-height:1.5;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace}'}),(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,o.jsxs)(eu.default,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:l?["list-tools"]:r.map((e,t)=>"mcp-call-".concat(t)),children:[l&&(0,o.jsx)(eh,{header:"List tools",children:(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:null===(s=l.item)||void 0===s?void 0:null===(t=s.tools)||void 0===t?void 0:t.map((e,t)=>(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},t))})},"list-tools"),r.map((e,t)=>{var s,a,n;return(0,o.jsx)(eh,{header:(null===(s=e.item)||void 0===s?void 0:s.name)||"Tool call",children:(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:(null===(a=e.item)||void 0===a?void 0:a.arguments)&&(0,o.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,o.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),(null===(n=e.item)||void 0===n?void 0:n.output)&&(0,o.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,o.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},"mcp-call-".concat(t))})]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)},eb=s(61935),ev=s(92403),ey=s(69993),ej=s(12660),ew=s(71891),eS=s(44625),eN=s(57400),ek=s(26430),eP=s(11894),eC=s(15883),eI=s(99890),e_=s(26349),eT=s(79276);let{TextArea:eZ}=i.default,{Dragger:eE}=c.default;var eA=e=>{let{accessToken:t,token:s,userRole:i,userID:c,disabledPersonalKeyCreation:h}=e,[f,S]=(0,a.useState)(!1),[T,L]=(0,a.useState)([]),[M,D]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedMCPTools");try{let t=e?JSON.parse(e):[];return Array.isArray(t)?t:t?[t]:[]}catch(e){return console.error("Error parsing selectedMCPTools from sessionStorage",e),[]}}),[z,O]=(0,a.useState)(!1),[F,H]=(0,a.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return h?"custom":"session"}),[q,J]=(0,a.useState)(()=>sessionStorage.getItem("apiKey")||""),[V,$]=(0,a.useState)(""),[et,eo]=(0,a.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[el,ei]=(0,a.useState)(()=>sessionStorage.getItem("selectedModel")||void 0),[ed,eg]=(0,a.useState)(!1),[ep,eu]=(0,a.useState)([]),ex=(0,a.useRef)(null),[eh,eA]=(0,a.useState)(()=>sessionStorage.getItem("endpointType")||C.KP.CHAT),[eU,eR]=(0,a.useState)(!1),eL=(0,a.useRef)(null),[eM,eD]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[eK,ez]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[eO,eF]=(0,a.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[eH,eB]=(0,a.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[eG,eq]=(0,a.useState)(()=>sessionStorage.getItem("responsesSessionId")||null),[eJ,eW]=(0,a.useState)(()=>{let e=sessionStorage.getItem("useApiSessionManagement");return!e||JSON.parse(e)}),[eV,eY]=(0,a.useState)([]),[eX,e$]=(0,a.useState)([]),[eQ,e0]=(0,a.useState)(null),[e1,e4]=(0,a.useState)(null),[e2,e3]=(0,a.useState)(null),[e6,e5]=(0,a.useState)(null),[e8,e7]=(0,a.useState)(!1),[e9,te]=(0,a.useState)(""),[tt,ts]=(0,a.useState)("openai"),[to,ta]=(0,a.useState)([]),tn=(0,a.useRef)(null),tl=async()=>{let e="session"===F?t:q;if(e){O(!0);try{let t=await P(e);L(t)}catch(e){console.error("Error fetching MCP tools:",e)}finally{O(!1)}}};(0,a.useEffect)(()=>{f&&tl()},[f,t,q,F]),(0,a.useEffect)(()=>{e8&&te((0,R.L)({apiKeySource:F,accessToken:t,apiKey:q,inputMessage:V,chatHistory:et,selectedTags:eM,selectedVectorStores:eK,selectedGuardrails:eO,selectedMCPTools:M,endpointType:eh,selectedModel:el,selectedSdk:tt}))},[e8,tt,F,t,q,V,et,eM,eK,eO,M,eh,el]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(et))},500);return()=>{clearTimeout(e)}},[et]),(0,a.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(F)),sessionStorage.setItem("apiKey",q),sessionStorage.setItem("endpointType",eh),sessionStorage.setItem("selectedTags",JSON.stringify(eM)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(eK)),sessionStorage.setItem("selectedGuardrails",JSON.stringify(eO)),sessionStorage.setItem("selectedMCPTools",JSON.stringify(M)),el?sessionStorage.setItem("selectedModel",el):sessionStorage.removeItem("selectedModel"),eH?sessionStorage.setItem("messageTraceId",eH):sessionStorage.removeItem("messageTraceId"),eG?sessionStorage.setItem("responsesSessionId",eG):sessionStorage.removeItem("responsesSessionId"),sessionStorage.setItem("useApiSessionManagement",JSON.stringify(eJ))},[F,q,el,eh,eM,eK,eO,eH,eG,eJ,M]),(0,a.useEffect)(()=>{let e="session"===F?t:q;if(!e||!s||!i||!c){console.log("userApiKey or token or userRole or userID is missing = ",e,s,i,c);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let t=await (0,k.p)(e);console.log("Fetched models:",t),eu(t);let s=t.some(e=>e.model_group===el);t.length?s||ei(t[0].model_group):ei(void 0)}catch(e){console.error("Error fetching model info:",e)}})(),tl()},[t,c,i,F,q,s]),(0,a.useEffect)(()=>{tn.current&&setTimeout(()=>{var e;null===(e=tn.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[et]);let tr=(e,t,s)=>{console.log("updateTextUI called with:",e,t,s),eo(o=>{let a=o[o.length-1];if(!a||a.role!==e||a.isImage)return[...o,{role:e,content:t,model:s}];{var n;let e={...a,content:a.content+t,model:null!==(n=a.model)&&void 0!==n?n:s};return[...o.slice(0,-1),e]}})},ti=e=>{eo(t=>{let s=t[t.length-1];return s&&"assistant"===s.role&&!s.isImage?[...t.slice(0,t.length-1),{...s,reasoningContent:(s.reasoningContent||"")+e}]:t.length>0&&"user"===t[t.length-1].role?[...t,{role:"assistant",content:"",reasoningContent:e}]:t})},tc=e=>{console.log("updateTimingData called with:",e),eo(t=>{let s=t[t.length-1];if(console.log("Current last message:",s),s&&"assistant"===s.role){console.log("Updating assistant message with timeToFirstToken:",e);let o=[...t.slice(0,t.length-1),{...s,timeToFirstToken:e}];return console.log("Updated chat history:",o),o}return s&&"user"===s.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...t,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),t)})},td=(e,t)=>{console.log("Received usage data:",e),eo(s=>{let o=s[s.length-1];if(o&&"assistant"===o.role){console.log("Updating message with usage data:",e);let a={...o,usage:e,toolName:t};return console.log("Updated message:",a),[...s.slice(0,s.length-1),a]}return s})},tm=e=>{console.log("Received response ID for session management:",e),eJ&&eq(e)},tg=e=>{console.log("ChatUI: Received MCP event:",e),ta(t=>{if(t.some(t=>t.item_id===e.item_id&&t.type===e.type&&t.sequence_number===e.sequence_number))return console.log("ChatUI: Duplicate MCP event, skipping"),t;let s=[...t,e];return console.log("ChatUI: Updated MCP events:",s),s})},tp=(e,t)=>{eo(s=>[...s,{role:"assistant",content:e,model:t,isImage:!0}])},tu=(e,t)=>{eo(s=>{let o=s[s.length-1];if(!o||"assistant"!==o.role||o.isImage)return[...s,{role:"assistant",content:"",model:t,image:{url:e,detail:"auto"}}];{var a;let n={...o,image:{url:e,detail:"auto"},model:null!==(a=o.model)&&void 0!==a?a:t};return[...s.slice(0,-1),n]}})},tx=e=>{eY(t=>[...t,e]);let t=URL.createObjectURL(e);return e$(e=>[...e,t]),!1},th=e=>{eX[e]&&URL.revokeObjectURL(eX[e]),eY(t=>t.filter((t,s)=>s!==e)),e$(t=>t.filter((t,s)=>s!==e))},tf=()=>{eX.forEach(e=>{URL.revokeObjectURL(e)}),eY([]),e$([])},tb=()=>{e1&&URL.revokeObjectURL(e1),e0(null),e4(null)},tv=()=>{e6&&URL.revokeObjectURL(e6),e3(null),e5(null)},ty=async()=>{let e;if(""===V.trim())return;if(eh===C.KP.IMAGE_EDITS&&0===eV.length){v.Z.fromBackend("Please upload at least one image for editing");return}if(!s||!i||!c)return;let o="session"===F?t:q;if(!o){v.Z.fromBackend("Please provide an API key or select Current UI Session");return}eL.current=new AbortController;let a=eL.current.signal;if(eh===C.KP.RESPONSES&&eQ)try{e=await Y(V,eQ)}catch(e){v.Z.fromBackend("Failed to process image. Please try again.");return}else if(eh===C.KP.CHAT&&e2)try{e=await ea(V,e2)}catch(e){v.Z.fromBackend("Failed to process image. Please try again.");return}else e={role:"user",content:V};let n=eH||(0,r.Z)();eH||eB(n),eo([...et,eh===C.KP.RESPONSES&&eQ?X(V,!0,e1||void 0,eQ.name):eh===C.KP.CHAT&&e2?en(V,!0,e6||void 0,e2.name):X(V,!1)]),ta([]),eR(!0);try{if(el){if(eh===C.KP.CHAT){let t=[...et.filter(e=>!e.isImage).map(e=>{let{role:t,content:s}=e;return{role:t,content:"string"==typeof s?s:""}}),e];await b(t,(e,t)=>tr("assistant",e,t),el,o,eM,a,ti,tc,td,n,eK.length>0?eK:void 0,eO.length>0?eO:void 0,M,tu)}else if(eh===C.KP.IMAGE)await y(V,(e,t)=>tp(e,t),el,o,eM,a);else if(eh===C.KP.IMAGE_EDITS)eV.length>0&&await j(1===eV.length?eV[0]:eV,V,(e,t)=>tp(e,t),el,o,eM,a);else if(eh===C.KP.RESPONSES){let t;t=eJ&&eG?[e]:[...et.filter(e=>!e.isImage).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e],await w(t,(e,t,s)=>tr(e,t,s),el,o,eM,a,ti,tc,td,n,eK.length>0?eK:void 0,eO.length>0?eO:void 0,M,eJ?eG:null,tm,tg)}else if(eh===C.KP.ANTHROPIC_MESSAGES){let t=[...et.filter(e=>!e.isImage).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e];await N(t,(e,t,s)=>tr(e,t,s),el,o,eM,a,ti,tc,td,n,eK.length>0?eK:void 0,eO.length>0?eO:void 0,M)}}}catch(e){a.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),tr("assistant","Error fetching response:"+e))}finally{eR(!1),eL.current=null,eh===C.KP.IMAGE_EDITS&&tf(),eh===C.KP.RESPONSES&&eQ&&tb(),eh===C.KP.CHAT&&e2&&tv()}$("")};if(i&&"Admin Viewer"===i){let{Title:e,Paragraph:t}=d.default;return(0,o.jsxs)("div",{children:[(0,o.jsx)(e,{level:1,children:"Access Denied"}),(0,o.jsx)(t,{children:"Ask your proxy admin for access to test models"})]})}let tj=(0,o.jsx)(eb.Z,{style:{fontSize:24},spin:!0});return(0,o.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,o.jsx)(l.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,o.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,o.jsx)(l.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ev.Z,{className:"mr-2"})," API Key Source"]}),(0,o.jsx)(m.default,{disabled:h,value:F,style:{width:"100%"},onChange:e=>{H(e)},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===F&&(0,o.jsx)(l.oi,{className:"mt-2",placeholder:"Enter custom API key",type:"password",onValueChange:J,value:q,icon:ev.Z})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ey.Z,{className:"mr-2"})," Select Model"]}),(0,o.jsx)(m.default,{value:el,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),ei(e),eg("custom"===e)},options:[...Array.from(new Set(ep.map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%"},showSearch:!0,className:"rounded-md"}),ed&&(0,o.jsx)(l.oi,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{ex.current&&clearTimeout(ex.current),ex.current=setTimeout(()=>{ei(e)},500)}})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ej.Z,{className:"mr-2"})," Endpoint Type"]}),(0,o.jsx)(Z,{endpointType:eh,onEndpointChange:e=>{eA(e)},className:"mb-4"}),(0,o.jsx)(em,{endpointType:eh,responsesSessionId:eG,useApiSessionManagement:eJ,onToggleSessionManagement:e=>{eW(e),e||eq(null)}})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(ew.Z,{className:"mr-2"})," Tags"]}),(0,o.jsx)(E,{value:eM,onChange:eD,className:"mb-4",accessToken:t||""})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(B.Z,{className:"mr-2"})," MCP Tool",(0,o.jsx)(g.Z,{className:"ml-1",title:"Select MCP tools to use in your conversation, only available for /v1/responses endpoint",children:(0,o.jsx)(ec.Z,{})})]}),(0,o.jsx)(m.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:M,onChange:e=>D(e),loading:z,className:"mb-4",allowClear:!0,optionLabelProp:"label",disabled:eh!==C.KP.RESPONSES,maxTagCount:"responsive",children:Array.isArray(T)&&T.map(e=>(0,o.jsx)(m.default.Option,{value:e.name,label:(0,o.jsx)("div",{className:"font-medium",children:e.name}),children:(0,o.jsxs)("div",{className:"flex flex-col py-1",children:[(0,o.jsx)("span",{className:"font-medium",children:e.name}),(0,o.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(eS.Z,{className:"mr-2"})," Vector Store",(0,o.jsx)(g.Z,{className:"ml-1",title:(0,o.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store"," ",(0,o.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,o.jsx)(ec.Z,{})})]}),(0,o.jsx)(A.Z,{value:eK,onChange:ez,className:"mb-4",accessToken:t||""})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(l.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,o.jsx)(eN.Z,{className:"mr-2"})," Guardrails",(0,o.jsx)(g.Z,{className:"ml-1",title:(0,o.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails"," ",(0,o.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,o.jsx)(ec.Z,{})})]}),(0,o.jsx)(U.Z,{value:eO,onChange:eF,className:"mb-4",accessToken:t||""})]})]})]}),(0,o.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,o.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,o.jsx)(l.Dx,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsx)(l.zx,{onClick:()=>{eo([]),eB(null),eq(null),ta([]),tf(),tb(),tv(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),sessionStorage.removeItem("responsesSessionId"),v.Z.success("Chat history cleared.")},className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:ek.Z,children:"Clear Chat"}),(0,o.jsx)(l.zx,{onClick:()=>e7(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:eP.Z,children:"Get Code"})]})]}),(0,o.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===et.length&&(0,o.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,o.jsx)(ey.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,o.jsx)(l.xv,{children:"Start a conversation or generate an image"})]}),et.map((e,t)=>(0,o.jsx)("div",{children:(0,o.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,o.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,o.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,o.jsx)(eC.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,o.jsx)(ey.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,o.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,o.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,o.jsx)(K,{reasoningContent:e.reasoningContent}),"assistant"===e.role&&t===et.length-1&&to.length>0&&eh===C.KP.RESPONSES&&(0,o.jsx)("div",{className:"mb-3",children:(0,o.jsx)(ef,{events:to})}),(0,o.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,o.jsx)("img",{src:"string"==typeof e.content?e.content:"",alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):(0,o.jsxs)(o.Fragment,{children:[eh===C.KP.RESPONSES&&(0,o.jsx)(ee,{message:e}),eh===C.KP.CHAT&&(0,o.jsx)(er,{message:e}),(0,o.jsx)(n.U,{components:{code(e){let{node:t,inline:s,className:a,children:n,...l}=e,r=/language-(\w+)/.exec(a||"");return!s&&r?(0,o.jsx)(I.Z,{style:_.Z,language:r[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...l,children:String(n).replace(/\n$/,"")}):(0,o.jsx)("code",{className:"".concat(a," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...l,children:n})},pre:e=>{let{node:t,...s}=e;return(0,o.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})}},children:"string"==typeof e.content?e.content:""}),e.image&&(0,o.jsx)("div",{className:"mt-3",children:(0,o.jsx)("img",{src:e.image.url,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}})})]}),"assistant"===e.role&&(e.timeToFirstToken||e.usage)&&(0,o.jsx)(G,{timeToFirstToken:e.timeToFirstToken,usage:e.usage,toolName:e.toolName})]})]})})},t)),eU&&to.length>0&&eh===C.KP.RESPONSES&&et.length>0&&"user"===et[et.length-1].role&&(0,o.jsx)("div",{className:"text-left mb-4",children:(0,o.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"#ffffff",border:"1px solid #f0f0f0",textAlign:"left"},children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,o.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"#f5f5f5"},children:(0,o.jsx)(ey.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,o.jsx)("strong",{className:"text-sm capitalize",children:"Assistant"})]}),(0,o.jsx)(ef,{events:to})]})}),eU&&(0,o.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,o.jsx)(p.Z,{indicator:tj})}),(0,o.jsx)("div",{ref:tn,style:{height:"1px"}})]}),(0,o.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[eh===C.KP.IMAGE_EDITS&&(0,o.jsx)("div",{className:"mb-4",children:0===eV.length?(0,o.jsxs)(eE,{beforeUpload:tx,accept:"image/*",showUploadList:!1,className:"border-dashed border-2 border-gray-300 rounded-lg p-4",children:[(0,o.jsx)("p",{className:"ant-upload-drag-icon",children:(0,o.jsx)(eI.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,o.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag images to upload"}),(0,o.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats. Multiple images supported."})]}):(0,o.jsxs)("div",{className:"flex flex-wrap gap-2",children:[eV.map((e,t)=>(0,o.jsxs)("div",{className:"relative inline-block",children:[(0,o.jsx)("img",{src:eX[t]||"",alt:"Upload preview ".concat(t+1),className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,o.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:()=>th(t),children:(0,o.jsx)(e_.Z,{})})]},t)),(0,o.jsxs)("div",{className:"flex items-center justify-center w-32 h-32 border-2 border-dashed border-gray-300 rounded-md hover:border-gray-400 cursor-pointer",onClick:()=>{var e;return null===(e=document.getElementById("additional-image-upload"))||void 0===e?void 0:e.click()},children:[(0,o.jsxs)("div",{className:"text-center",children:[(0,o.jsx)(eI.Z,{style:{fontSize:"24px",color:"#666"}}),(0,o.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Add more"})]}),(0,o.jsx)("input",{id:"additional-image-upload",type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:e=>{Array.from(e.target.files||[]).forEach(e=>tx(e))}})]})]})}),eh===C.KP.RESPONSES&&eQ&&(0,o.jsx)("div",{className:"mb-2",children:(0,o.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,o.jsx)("div",{className:"relative inline-block",children:eQ.name.toLowerCase().endsWith(".pdf")?(0,o.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"16px",color:"white"}})}):(0,o.jsx)("img",{src:e1||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:eQ.name}),(0,o.jsx)("div",{className:"text-xs text-gray-500",children:eQ.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,o.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:tb,children:(0,o.jsx)(e_.Z,{style:{fontSize:"12px"}})})]})}),eh===C.KP.CHAT&&e2&&(0,o.jsx)("div",{className:"mb-2",children:(0,o.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,o.jsx)("div",{className:"relative inline-block",children:e2.name.toLowerCase().endsWith(".pdf")?(0,o.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,o.jsx)(Q.Z,{style:{fontSize:"16px",color:"white"}})}):(0,o.jsx)("img",{src:e6||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:e2.name}),(0,o.jsx)("div",{className:"text-xs text-gray-500",children:e2.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,o.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:tv,children:(0,o.jsx)(e_.Z,{style:{fontSize:"12px"}})})]})}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,o.jsxs)("div",{className:"flex-shrink-0 mr-2",children:[eh===C.KP.RESPONSES&&!eQ&&(0,o.jsx)(W,{responsesUploadedImage:eQ,responsesImagePreviewUrl:e1,onImageUpload:e=>(e0(e),e4(URL.createObjectURL(e)),!1),onRemoveImage:tb}),eh===C.KP.CHAT&&!e2&&(0,o.jsx)(es,{chatUploadedImage:e2,chatImagePreviewUrl:e6,onImageUpload:e=>(e3(e),e5(URL.createObjectURL(e)),!1),onRemoveImage:tv})]}),(0,o.jsx)(eZ,{value:V,onChange:e=>$(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),ty())},placeholder:eh===C.KP.CHAT||eh===C.KP.RESPONSES||eh===C.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":eh===C.KP.IMAGE_EDITS?"Describe how you want to edit the image...":"Describe the image you want to generate...",disabled:eU,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,o.jsx)(l.zx,{onClick:ty,disabled:eU||!V.trim(),className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,o.jsx)(eT.Z,{style:{fontSize:"14px"}})})]}),eU&&(0,o.jsx)(l.zx,{onClick:()=>{eL.current&&(eL.current.abort(),eL.current=null,eR(!1),v.Z.info("Request cancelled"))},className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:e_.Z,children:"Cancel"})]})]})]})]})}),(0,o.jsxs)(u.Z,{title:"Generated Code",visible:e8,onCancel:()=>e7(!1),footer:null,width:800,children:[(0,o.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(l.xv,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,o.jsx)(m.default,{value:tt,onChange:e=>ts(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,o.jsx)(x.ZP,{onClick:()=>{navigator.clipboard.writeText(e9),v.Z.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,o.jsx)(I.Z,{language:"python",style:_.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:e9})]}),"custom"===F&&(0,o.jsx)(u.Z,{title:"Select MCP Tool",visible:f,onCancel:()=>S(!1),onOk:()=>{S(!1),v.Z.success("MCP tool selection updated")},width:800,children:z?(0,o.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,o.jsx)(p.Z,{indicator:(0,o.jsx)(eb.Z,{style:{fontSize:24},spin:!0})})}):(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsx)(l.xv,{className:"text-gray-600 block mb-4",children:"Select the MCP tools you want to use in your conversation."}),(0,o.jsx)(m.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:M,onChange:e=>D(e),optionLabelProp:"label",allowClear:!0,maxTagCount:"responsive",children:T.map(e=>(0,o.jsx)(m.default.Option,{value:e.name,label:(0,o.jsx)("div",{className:"font-medium",children:e.name}),children:(0,o.jsxs)("div",{className:"flex flex-col py-1",children:[(0,o.jsx)("span",{className:"font-medium",children:e.name}),(0,o.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]})})]})}}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/1223-de5e7e4f043a5233.js b/ui/litellm-dashboard/out/_next/static/chunks/1223-de5e7e4f043a5233.js deleted file mode 100644 index b7e8c2b8f9..0000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/1223-de5e7e4f043a5233.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1223],{54250:function(e,t,n){n.d(t,{Z:function(){return v}});var o=n(5853),r=n(2265),i=n(44140),l=n(34237),a=n(33044),u=n(58747),s=n(4537),c=n(97324),d=n(1153),f=n(96398);let p=(0,d.fn)("SearchSelect"),m=(0,d.fn)("SearchSelect"),v=r.forwardRef((e,t)=>{let{defaultValue:n,value:d,onValueChange:v,placeholder:b="Select...",disabled:g=!1,icon:h,enableClear:x=!0,children:O,className:I}=e,y=(0,o._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","children","className"]),[S,R]=(0,r.useState)(""),[T,E]=(0,i.Z)(n,d),{reactElementChildren:C,valueToNameMapping:k}=(0,r.useMemo)(()=>{let e=r.Children.toArray(O).filter(r.isValidElement);return{reactElementChildren:e,valueToNameMapping:(0,f.sl)(e)}},[O]),M=(0,r.useMemo)(()=>(0,f.n0)(S,C),[S,C]);return r.createElement(l.h,Object.assign({as:"div",ref:t,defaultValue:T,value:T,onChange:e=>{null==v||v(e),E(e)},disabled:g,className:(0,c.q)("w-full min-w-[10rem] relative text-tremor-default",I)},y),e=>{let{value:t}=e;return r.createElement(r.Fragment,null,r.createElement(l.h.Button,{className:"w-full"},h&&r.createElement("span",{className:(0,c.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},r.createElement(h,{className:(0,c.q)(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),r.createElement(l.h.Input,{className:(0,c.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 text-tremor-default pr-14 border py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",h?"pl-10":"pl-3",g?"placeholder:text-tremor-content-subtle dark:placeholder:text-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-tremor-content",(0,f.um)((0,f.Uh)(t),g)),placeholder:b,onChange:e=>R(e.target.value),displayValue:e=>{var t;return null!==(t=k.get(e))&&void 0!==t?t:""}}),r.createElement("div",{className:(0,c.q)("absolute inset-y-0 right-0 flex items-center pr-2.5")},r.createElement(u.Z,{className:(0,c.q)(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),x&&T?r.createElement("button",{type:"button",className:(0,c.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),E(""),R(""),null==v||v("")}},r.createElement(s.Z,{className:(0,c.q)(m("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,M.length>0&&r.createElement(a.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},r.createElement(l.h.Options,{className:(0,c.q)("divide-y overflow-y-auto outline-none rounded-tremor-default text-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},M)))})});v.displayName="SearchSelect"},70450:function(e,t,n){n.d(t,{Z:function(){return s}});var o=n(5853),r=n(2265),i=n(97324),l=n(1153),a=n(34237);let u=(0,l.fn)("SearchSelectItem"),s=r.forwardRef((e,t)=>{let{value:n,icon:l,className:s,children:c}=e,d=(0,o._T)(e,["value","icon","className","children"]);return r.createElement(a.h.Option,Object.assign({className:(0,i.q)(u("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",s),ref:t,key:n,value:n},d),l&&r.createElement(l,{className:(0,i.q)(u("icon"),"flex-none h-5 w-5 mr-3","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),r.createElement("span",{className:"whitespace-nowrap truncate"},null!=c?c:n))});s.displayName="SearchSelectItem"},34237:function(e,t,n){let o,r,i,l;function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0;i--){var l=e[i];if(!n.has(l.lane)){var a=r.get(l.lane);if(null==a||l.end>a.end?r.set(l.lane,l):l.end0?Math.min.apply(Math,o.pendingMeasuredCacheIndexes):0;o.pendingMeasuredCacheIndexes=[];for(var u=o.measurementsCache.slice(0,a),s=a;s0&&t>0?function(e){for(var t=e.measurements,n=e.outerSize,o=e.scrollOffset,r=t.length-1,i=O(0,r,function(e){return t[e].start},o),l=i;l=o.scrollOffset+n?"end":"start"),"start"===t||("end"===t?e-=n:"center"===t&&(e-=n/2));var r=o.options.horizontal?"scrollWidth":"scrollHeight";return Math.max(Math.min((o.scrollElement?"document"in o.scrollElement?o.scrollElement.document.documentElement[r]:o.scrollElement[r]:0)-o.getSize(),e),0)},this.getOffsetForIndex=function(e,t){void 0===t&&(t="auto"),e=Math.max(0,Math.min(e,o.options.count-1));var n=f(o.getMeasurements()[e]);if("auto"===t){if(n.end>=o.scrollOffset+o.getSize()-o.options.scrollPaddingEnd)t="end";else{if(!(n.start<=o.scrollOffset+o.options.scrollPaddingStart))return[o.scrollOffset,t];t="start"}}var r="end"===t?n.end+o.options.scrollPaddingEnd:n.start-o.options.scrollPaddingStart;return[o.getOffsetForAlignment(r,t),t]},this.isDynamicMode=function(){return o.measureElementCache.size>0},this.cancelScrollToIndex=function(){null!==o.scrollToIndexTimeoutId&&(clearTimeout(o.scrollToIndexTimeoutId),o.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(e,t){var n=void 0===t?{}:t,r=n.align,i=n.behavior;o.cancelScrollToIndex(),"smooth"===i&&o.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),o._scrollToOffset(o.getOffsetForAlignment(e,void 0===r?"start":r),{adjustments:void 0,behavior:i})},this.scrollToIndex=function(e,t){var n=void 0===t?{}:t,r=n.align,i=n.behavior;e=Math.max(0,Math.min(e,o.options.count-1)),o.cancelScrollToIndex(),"smooth"===i&&o.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var l=o.getOffsetForIndex(e,void 0===r?"auto":r),a=l[0],u=l[1];o._scrollToOffset(a,{adjustments:void 0,behavior:i}),"smooth"!==i&&o.isDynamicMode()&&(o.scrollToIndexTimeoutId=setTimeout(function(){o.scrollToIndexTimeoutId=null,o.measureElementCache.has(o.options.getItemKey(e))&&1>Math.abs(o.getOffsetForIndex(e,u)[0]-o.scrollOffset)||o.scrollToIndex(e,{align:u,behavior:i})}))},this.scrollBy=function(e,t){var n=(void 0===t?{}:t).behavior;o.cancelScrollToIndex(),"smooth"===n&&o.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),o._scrollToOffset(o.scrollOffset+e,{adjustments:void 0,behavior:n})},this.getTotalSize=function(){var e;return((null==(e=o.getMeasurements()[o.options.count-1])?void 0:e.end)||o.options.paddingStart)-o.options.scrollMargin+o.options.paddingEnd},this._scrollToOffset=function(e,t){var n=t.adjustments,r=t.behavior;o.options.scrollToFn(e,{behavior:r,adjustments:n},o)},this.measure=function(){o.itemSizeCache=new Map,o.notify(!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(e){o.itemSizeCache.set(e.key,e.size)}),this.maybeNotify()},O=function(e,t,n,o){for(;e<=t;){var r=(e+t)/2|0,i=n(r);if(io))return r;t=r-1}}return e>0?e-1:0},I="undefined"!=typeof document?u.useLayoutEffect:u.useEffect,y=n(78138),S=n(62963),R=n(90945),T=n(13323),E=n(17684),C=n(64518),k=n(31948),M=n(32539),w=n(40048),z=n(80004),P=n(93689),F=n(15518),D=n(40293);function N(e,t){let n=(0,u.useRef)([]),o=(0,T.z)(e);(0,u.useEffect)(()=>{let e=[...n.current];for(let[r,i]of t.entries())if(n.current[r]!==i){let r=o(t,e);return n.current=t,r}},[o,...t])}var A=n(38198),_=n(37863);let L=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){e.target instanceof HTMLElement&&e.target!==document.body&&L[0]!==e.target&&(L.unshift(e.target),(L=L.filter(e=>null!=e&&e.isConnected)).splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var V=n(47634),j=n(34778),q=n(16015),B=n(37105),K=n(56314),U=n(24536),Z=n(52108),Y=n(27847),G=n(37388),H=n(40257),W=((o=W||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),J=((r=J||{})[r.Single=0]="Single",r[r.Multi=1]="Multi",r),Q=((i=Q||{})[i.Pointer=0]="Pointer",i[i.Focus=1]="Focus",i[i.Other=2]="Other",i),X=((l=X||{})[l.OpenCombobox=0]="OpenCombobox",l[l.CloseCombobox=1]="CloseCombobox",l[l.GoToOption=2]="GoToOption",l[l.RegisterOption=3]="RegisterOption",l[l.UnregisterOption=4]="UnregisterOption",l[l.RegisterLabel=5]="RegisterLabel",l[l.SetActivationTrigger=6]="SetActivationTrigger",l[l.UpdateVirtualOptions=7]="UpdateVirtualOptions",l);function $(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e,n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,o=t(e.options.slice()),r=o.length>0&&null!==o[0].dataRef.current.order?o.sort((e,t)=>e.dataRef.current.order-t.dataRef.current.order):(0,B.z2)(o,e=>e.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return -1===i&&(i=null),{options:r,activeOptionIndex:i}}let ee={1(e){var t;return null!=(t=e.dataRef.current)&&t.disabled||1===e.comboboxState?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if(null!=(t=e.dataRef.current)&&t.disabled||0===e.comboboxState)return e;if(null!=(n=e.dataRef.current)&&n.value){let t=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(-1!==t)return{...e,activeOptionIndex:t,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,o,r,i,l;if(null!=(n=e.dataRef.current)&&n.disabled||null!=(o=e.dataRef.current)&&o.optionsRef.current&&!(null!=(r=e.dataRef.current)&&r.optionsPropsRef.current.static)&&1===e.comboboxState)return e;if(e.virtual){let n=t.focus===j.T.Specific?t.idx:(0,j.d)(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var t,n;return null!=(n=null!=(t=e.activeOptionIndex)?t:e.virtual.options.findIndex(t=>!e.virtual.disabled(t)))?n:null},resolveDisabled:e.virtual.disabled,resolveId(){throw Error("Function not implemented.")}}),o=null!=(i=t.trigger)?i:2;return e.activeOptionIndex===n&&e.activationTrigger===o?e:{...e,activeOptionIndex:n,activationTrigger:o}}let a=$(e);if(null===a.activeOptionIndex){let e=a.options.findIndex(e=>!e.dataRef.current.disabled);-1!==e&&(a.activeOptionIndex=e)}let u=t.focus===j.T.Specific?t.idx:(0,j.d)(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled}),s=null!=(l=t.trigger)?l:2;return e.activeOptionIndex===u&&e.activationTrigger===s?e:{...e,...a,activeOptionIndex:u,activationTrigger:s}},3:(e,t)=>{var n,o,r;if(null!=(n=e.dataRef.current)&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,l=$(e,e=>(e.push(i),e));null===e.activeOptionIndex&&null!=(o=e.dataRef.current)&&o.isSelected(t.payload.dataRef.current.value)&&(l.activeOptionIndex=l.options.indexOf(i));let a={...e,...l,activationTrigger:2};return null!=(r=e.dataRef.current)&&r.__demoMode&&void 0===e.dataRef.current.value&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if(null!=(n=e.dataRef.current)&&n.virtual)return{...e,options:e.options.filter(e=>e.id!==t.id)};let o=$(e,e=>{let n=e.findIndex(e=>e.id===t.id);return -1!==n&&e.splice(n,1),e});return{...e,...o,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if((null==(n=e.virtual)?void 0:n.options)===t.options)return e;let o=e.activeOptionIndex;if(null!==e.activeOptionIndex){let n=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o=-1!==n?n:null}return{...e,activeOptionIndex:o,virtual:Object.assign({},e.virtual,{options:t.options})}}},et=(0,u.createContext)(null);function en(e){let t=(0,u.useContext)(et);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,en),t}return t}et.displayName="ComboboxActionsContext";let eo=(0,u.createContext)(null);function er(e){var t,n,o,r,i,l;let c=el("VirtualProvider"),[d,f]=(0,u.useMemo)(()=>{let e=c.optionsRef.current;if(!e)return[0,0];let t=window.getComputedStyle(e);return[parseFloat(t.paddingBlockStart||t.paddingTop),parseFloat(t.paddingBlockEnd||t.paddingBottom)]},[c.optionsRef.current]),p=(n={scrollPaddingStart:d,scrollPaddingEnd:f,count:c.virtual.options.length,estimateSize:()=>40,getScrollElement(){var e;return null!=(e=c.optionsRef.current)?e:null},overscan:12},o=a({observeElementRect:v,observeElementOffset:b,scrollToFn:h},n),r=u.useReducer(function(){return{}},{})[1],i=a({},o,{onChange:function(e,t){t?(0,s.flushSync)(r):r(),null==o.onChange||o.onChange(e,t)}}),(l=u.useState(function(){return new x(i)})[0]).setOptions(i),u.useEffect(function(){return l._didMount()},[]),I(function(){return l._willUpdate()}),l),[m,g]=(0,u.useState)(0);return(0,C.e)(()=>{g(e=>e+1)},[null==(t=c.virtual)?void 0:t.options]),u.createElement(eo.Provider,{value:p},u.createElement("div",{style:{position:"relative",width:"100%",height:"".concat(p.getTotalSize(),"px")},ref:e=>{e&&(void 0===H||void 0===H.env.JEST_WORKER_ID)&&0!==c.activationTrigger&&null!==c.activeOptionIndex&&c.virtual.options.length>c.activeOptionIndex&&p.scrollToIndex(c.activeOptionIndex)}},p.getVirtualItems().map(t=>{var n;return u.createElement(u.Fragment,{key:t.key},u.cloneElement(null==(n=e.children)?void 0:n.call(e,{option:c.virtual.options[t.index],open:0===c.comboboxState}),{key:"".concat(m,"-").concat(t.key),"data-index":t.index,"aria-setsize":c.virtual.options.length,"aria-posinset":t.index+1,style:{position:"absolute",top:0,left:0,transform:"translateY(".concat(t.start,"px)"),overflowAnchor:"none"}}))})))}let ei=(0,u.createContext)(null);function el(e){let t=(0,u.useContext)(ei);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,el),t}return t}function ea(e,t){return(0,U.E)(t.type,ee,e,t)}ei.displayName="ComboboxDataContext";let eu=u.Fragment,es=Y.AN.RenderStrategy|Y.AN.Static,ec=(0,Y.yV)(function(e,t){let{value:n,defaultValue:o,onChange:r,form:i,name:l,by:a=null,disabled:s=!1,__demoMode:c=!1,nullable:d=!1,multiple:f=!1,immediate:p=!1,virtual:m=null,...v}=e,[b=f?[]:void 0,g]=(0,S.q)(n,r,o),[h,x]=(0,u.useReducer)(ea,{dataRef:(0,u.createRef)(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),O=(0,u.useRef)(!1),I=(0,u.useRef)({static:!1,hold:!1}),y=(0,u.useRef)(null),E=(0,u.useRef)(null),k=(0,u.useRef)(null),w=(0,u.useRef)(null),z=(0,T.z)("string"==typeof a?(e,t)=>(null==e?void 0:e[a])===(null==t?void 0:t[a]):null!=a?a:(e,t)=>e===t),P=(0,T.z)(e=>h.options.findIndex(t=>z(t.dataRef.current.value,e))),F=(0,u.useCallback)(e=>(0,U.E)(N.mode,{1:()=>b.some(t=>z(t,e)),0:()=>z(b,e)}),[b]),D=(0,T.z)(e=>h.activeOptionIndex===P(e)),N=(0,u.useMemo)(()=>({...h,immediate:!1,optionsPropsRef:I,labelRef:y,inputRef:E,buttonRef:k,optionsRef:w,value:b,defaultValue:o,disabled:s,mode:f?1:0,virtual:h.virtual,get activeOptionIndex(){if(O.current&&null===h.activeOptionIndex&&h.options.length>0){let e=h.options.findIndex(e=>!e.dataRef.current.disabled);if(-1!==e)return e}return h.activeOptionIndex},calculateIndex:P,compare:z,isSelected:F,isActive:D,nullable:d,__demoMode:c}),[b,o,s,f,d,c,h,null]);(0,C.e)(()=>{},[null,void 0]),(0,C.e)(()=>{h.dataRef.current=N},[N]),(0,M.O)([N.buttonRef,N.inputRef,N.optionsRef],()=>Q.closeCombobox(),0===N.comboboxState);let L=(0,u.useMemo)(()=>{var e,t,n;return{open:0===N.comboboxState,disabled:s,activeIndex:N.activeOptionIndex,activeOption:null===N.activeOptionIndex?null:N.virtual?N.virtual.options[null!=(e=N.activeOptionIndex)?e:0]:null!=(n=null==(t=N.options[N.activeOptionIndex])?void 0:t.dataRef.current.value)?n:null,value:b}},[N,s,b]),V=(0,T.z)(()=>{if(null!==N.activeOptionIndex){if(N.virtual)W(N.virtual.options[N.activeOptionIndex]);else{let{dataRef:e}=N.options[N.activeOptionIndex];W(e.current.value)}Q.goToOption(j.T.Specific,N.activeOptionIndex)}}),q=(0,T.z)(()=>{x({type:0}),O.current=!0}),B=(0,T.z)(()=>{x({type:1}),O.current=!1}),Z=(0,T.z)((e,t,n)=>(O.current=!1,e===j.T.Specific?x({type:2,focus:j.T.Specific,idx:t,trigger:n}):x({type:2,focus:e,trigger:n}))),G=(0,T.z)((e,t)=>(x({type:3,payload:{id:e,dataRef:t}}),()=>{N.isActive(t.current.value)&&(O.current=!0),x({type:4,id:e})})),H=(0,T.z)(e=>(x({type:5,id:e}),()=>x({type:5,id:null}))),W=(0,T.z)(e=>(0,U.E)(N.mode,{0:()=>null==g?void 0:g(e),1(){let t=N.value.slice(),n=t.findIndex(t=>z(t,e));return -1===n?t.push(e):t.splice(n,1),null==g?void 0:g(t)}})),J=(0,T.z)(e=>{x({type:6,trigger:e})}),Q=(0,u.useMemo)(()=>({onChange:W,registerOption:G,registerLabel:H,goToOption:Z,closeCombobox:B,openCombobox:q,setActivationTrigger:J,selectActiveOption:V}),[]),X=(0,u.useRef)(null),$=(0,R.G)();return(0,u.useEffect)(()=>{X.current&&void 0!==o&&$.addEventListener(X.current,"reset",()=>{null==g||g(o)})},[X,g]),u.createElement(et.Provider,{value:Q},u.createElement(ei.Provider,{value:N},u.createElement(_.up,{value:(0,U.E)(N.comboboxState,{0:_.ZM.Open,1:_.ZM.Closed})},null!=l&&null!=b&&(0,K.t)({[l]:b}).map((e,t)=>{let[n,o]=e;return u.createElement(A._,{features:A.A.Hidden,ref:0===t?e=>{var t;X.current=null!=(t=null==e?void 0:e.closest("form"))?t:null}:void 0,...(0,Y.oA)({key:n,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:n,value:o})})}),(0,Y.sY)({ourProps:null===t?{}:{ref:t},theirProps:v,slot:L,defaultTag:eu,name:"Combobox"}))))}),ed=(0,Y.yV)(function(e,t){var n;let o=el("Combobox.Button"),r=en("Combobox.Button"),i=(0,P.T)(o.buttonRef,t),l=(0,E.M)(),{id:a="headlessui-combobox-button-".concat(l),...s}=e,c=(0,R.G)(),d=(0,T.z)(e=>{switch(e.key){case G.R.ArrowDown:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&r.openCombobox(),c.nextFrame(()=>{var e;return null==(e=o.inputRef.current)?void 0:e.focus({preventScroll:!0})});case G.R.ArrowUp:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&(r.openCombobox(),c.nextFrame(()=>{o.value||r.goToOption(j.T.Last)})),c.nextFrame(()=>{var e;return null==(e=o.inputRef.current)?void 0:e.focus({preventScroll:!0})});case G.R.Escape:return 0!==o.comboboxState?void 0:(e.preventDefault(),o.optionsRef.current&&!o.optionsPropsRef.current.static&&e.stopPropagation(),r.closeCombobox(),c.nextFrame(()=>{var e;return null==(e=o.inputRef.current)?void 0:e.focus({preventScroll:!0})}));default:return}}),f=(0,T.z)(e=>{if((0,V.P)(e.currentTarget))return e.preventDefault();0===o.comboboxState?r.closeCombobox():(e.preventDefault(),r.openCombobox()),c.nextFrame(()=>{var e;return null==(e=o.inputRef.current)?void 0:e.focus({preventScroll:!0})})}),p=(0,y.v)(()=>{if(o.labelId)return[o.labelId,a].join(" ")},[o.labelId,a]),m=(0,u.useMemo)(()=>({open:0===o.comboboxState,disabled:o.disabled,value:o.value}),[o]),v={ref:i,id:a,type:(0,z.f)(e,o.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":null==(n=o.optionsRef.current)?void 0:n.id,"aria-expanded":0===o.comboboxState,"aria-labelledby":p,disabled:o.disabled,onClick:f,onKeyDown:d};return(0,Y.sY)({ourProps:v,theirProps:s,slot:m,defaultTag:"button",name:"Combobox.Button"})}),ef=Object.assign(ec,{Input:(0,Y.yV)(function(e,t){var n,o,r,i,l,a;let s=(0,E.M)(),{id:c="headlessui-combobox-input-".concat(s),onChange:d,displayValue:f,type:p="text",...m}=e,v=el("Combobox.Input"),b=en("Combobox.Input"),g=(0,P.T)(v.inputRef,t),h=(0,w.i)(v.inputRef),x=(0,u.useRef)(!1),O=(0,R.G)(),I=(0,T.z)(()=>{b.onChange(null),v.optionsRef.current&&(v.optionsRef.current.scrollTop=0),b.goToOption(j.T.Nothing)});N((e,t)=>{let[n,o]=e,[r,i]=t;if(x.current)return;let l=v.inputRef.current;l&&((0===i&&1===o||n!==r)&&(l.value=n),requestAnimationFrame(()=>{if(x.current||!l||(null==h?void 0:h.activeElement)!==l)return;let{selectionStart:e,selectionEnd:t}=l;0===Math.abs((null!=t?t:0)-(null!=e?e:0))&&0===e&&l.setSelectionRange(l.value.length,l.value.length)}))},["function"==typeof f&&void 0!==v.value?null!=(a=f(v.value))?a:"":"string"==typeof v.value?v.value:"",v.comboboxState,h]),N((e,t)=>{let[n]=e,[o]=t;if(0===n&&1===o){if(x.current)return;let e=v.inputRef.current;if(!e)return;let t=e.value,{selectionStart:n,selectionEnd:o,selectionDirection:r}=e;e.value="",e.value=t,null!==r?e.setSelectionRange(n,o,r):e.setSelectionRange(n,o)}},[v.comboboxState]);let S=(0,u.useRef)(!1),C=(0,T.z)(()=>{S.current=!0}),k=(0,T.z)(()=>{O.nextFrame(()=>{S.current=!1})}),M=(0,T.z)(e=>{switch(x.current=!0,e.key){case G.R.Enter:if(x.current=!1,0!==v.comboboxState||S.current)return;if(e.preventDefault(),e.stopPropagation(),null===v.activeOptionIndex){b.closeCombobox();return}b.selectActiveOption(),0===v.mode&&b.closeCombobox();break;case G.R.ArrowDown:return x.current=!1,e.preventDefault(),e.stopPropagation(),(0,U.E)(v.comboboxState,{0:()=>b.goToOption(j.T.Next),1:()=>b.openCombobox()});case G.R.ArrowUp:return x.current=!1,e.preventDefault(),e.stopPropagation(),(0,U.E)(v.comboboxState,{0:()=>b.goToOption(j.T.Previous),1:()=>{b.openCombobox(),O.nextFrame(()=>{v.value||b.goToOption(j.T.Last)})}});case G.R.Home:if(e.shiftKey)break;return x.current=!1,e.preventDefault(),e.stopPropagation(),b.goToOption(j.T.First);case G.R.PageUp:return x.current=!1,e.preventDefault(),e.stopPropagation(),b.goToOption(j.T.First);case G.R.End:if(e.shiftKey)break;return x.current=!1,e.preventDefault(),e.stopPropagation(),b.goToOption(j.T.Last);case G.R.PageDown:return x.current=!1,e.preventDefault(),e.stopPropagation(),b.goToOption(j.T.Last);case G.R.Escape:return x.current=!1,0!==v.comboboxState?void 0:(e.preventDefault(),v.optionsRef.current&&!v.optionsPropsRef.current.static&&e.stopPropagation(),v.nullable&&0===v.mode&&null===v.value&&I(),b.closeCombobox());case G.R.Tab:if(x.current=!1,0!==v.comboboxState)return;0===v.mode&&1!==v.activationTrigger&&b.selectActiveOption(),b.closeCombobox()}}),z=(0,T.z)(e=>{null==d||d(e),v.nullable&&0===v.mode&&""===e.target.value&&I(),b.openCombobox()}),F=(0,T.z)(e=>{var t,n,o;let r=null!=(t=e.relatedTarget)?t:L.find(t=>t!==e.currentTarget);if(x.current=!1,!(null!=(n=v.optionsRef.current)&&n.contains(r))&&!(null!=(o=v.buttonRef.current)&&o.contains(r))&&0===v.comboboxState)return e.preventDefault(),0===v.mode&&(v.nullable&&null===v.value?I():1!==v.activationTrigger&&b.selectActiveOption()),b.closeCombobox()}),D=(0,T.z)(e=>{var t,n,o;let r=null!=(t=e.relatedTarget)?t:L.find(t=>t!==e.currentTarget);null!=(n=v.buttonRef.current)&&n.contains(r)||null!=(o=v.optionsRef.current)&&o.contains(r)||v.disabled||v.immediate&&0!==v.comboboxState&&(b.openCombobox(),O.nextFrame(()=>{b.setActivationTrigger(1)}))}),A=(0,y.v)(()=>{if(v.labelId)return[v.labelId].join(" ")},[v.labelId]),_=(0,u.useMemo)(()=>({open:0===v.comboboxState,disabled:v.disabled}),[v]),V={ref:g,id:c,role:"combobox",type:p,"aria-controls":null==(n=v.optionsRef.current)?void 0:n.id,"aria-expanded":0===v.comboboxState,"aria-activedescendant":null===v.activeOptionIndex?void 0:v.virtual?null==(o=v.options.find(e=>{var t;return!(null!=(t=v.virtual)&&t.disabled(e.dataRef.current.value))&&v.compare(e.dataRef.current.value,v.virtual.options[v.activeOptionIndex])}))?void 0:o.id:null==(r=v.options[v.activeOptionIndex])?void 0:r.id,"aria-labelledby":A,"aria-autocomplete":"list",defaultValue:null!=(l=null!=(i=e.defaultValue)?i:void 0!==v.defaultValue?null==f?void 0:f(v.defaultValue):null)?l:v.defaultValue,disabled:v.disabled,onCompositionStart:C,onCompositionEnd:k,onKeyDown:M,onChange:z,onFocus:D,onBlur:F};return(0,Y.sY)({ourProps:V,theirProps:m,slot:_,defaultTag:"input",name:"Combobox.Input"})}),Button:ed,Label:(0,Y.yV)(function(e,t){let n=(0,E.M)(),{id:o="headlessui-combobox-label-".concat(n),...r}=e,i=el("Combobox.Label"),l=en("Combobox.Label"),a=(0,P.T)(i.labelRef,t);(0,C.e)(()=>l.registerLabel(o),[o]);let s=(0,T.z)(()=>{var e;return null==(e=i.inputRef.current)?void 0:e.focus({preventScroll:!0})}),c=(0,u.useMemo)(()=>({open:0===i.comboboxState,disabled:i.disabled}),[i]);return(0,Y.sY)({ourProps:{ref:a,id:o,onClick:s},theirProps:r,slot:c,defaultTag:"label",name:"Combobox.Label"})}),Options:(0,Y.yV)(function(e,t){let n=(0,E.M)(),{id:o="headlessui-combobox-options-".concat(n),hold:r=!1,...i}=e,l=el("Combobox.Options"),a=(0,P.T)(l.optionsRef,t),s=(0,_.oJ)(),c=null!==s?(s&_.ZM.Open)===_.ZM.Open:0===l.comboboxState;(0,C.e)(()=>{var t;l.optionsPropsRef.current.static=null!=(t=e.static)&&t},[l.optionsPropsRef,e.static]),(0,C.e)(()=>{l.optionsPropsRef.current.hold=r},[l.optionsPropsRef,r]),function(e){let{container:t,accept:n,walk:o,enabled:r=!0}=e,i=(0,u.useRef)(n),l=(0,u.useRef)(o);(0,u.useEffect)(()=>{i.current=n,l.current=o},[n,o]),(0,C.e)(()=>{if(!t||!r)return;let e=(0,D.r)(t);if(!e)return;let n=i.current,o=l.current,a=Object.assign(e=>n(e),{acceptNode:n}),u=e.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,a,!1);for(;u.nextNode();)o(u.currentNode)},[t,r,i,l])}({container:l.optionsRef.current,enabled:0===l.comboboxState,accept:e=>"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let d=(0,y.v)(()=>{var e,t;return null!=(t=l.labelId)?t:null==(e=l.buttonRef.current)?void 0:e.id},[l.labelId,l.buttonRef.current]),f=(0,u.useMemo)(()=>({open:0===l.comboboxState,option:void 0}),[l]),p={"aria-labelledby":d,role:"listbox","aria-multiselectable":1===l.mode||void 0,id:o,ref:a};return l.virtual&&0===l.comboboxState&&Object.assign(i,{children:u.createElement(er,null,i.children)}),(0,Y.sY)({ourProps:p,theirProps:i,slot:f,defaultTag:"ul",features:es,visible:c,name:"Combobox.Options"})}),Option:(0,Y.yV)(function(e,t){var n;let o=(0,E.M)(),{id:r="headlessui-combobox-option-".concat(o),disabled:i=!1,value:l,order:a=null,...s}=e,c=el("Combobox.Option"),d=en("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(l):null!==c.activeOptionIndex&&(null==(n=c.options[c.activeOptionIndex])?void 0:n.id)===r,p=c.isSelected(l),m=(0,u.useRef)(null),v=(0,k.E)({disabled:i,value:l,domRef:m,order:a}),b=(0,u.useContext)(eo),g=(0,P.T)(t,m,b?b.measureElement:null),h=(0,T.z)(()=>d.onChange(l));(0,C.e)(()=>d.registerOption(r,v),[v,r]);let x=(0,u.useRef)(!(c.virtual||c.__demoMode));(0,C.e)(()=>{if(!c.virtual||!c.__demoMode)return;let e=(0,q.k)();return e.requestAnimationFrame(()=>{x.current=!0}),e.dispose},[c.virtual,c.__demoMode]),(0,C.e)(()=>{if(!x.current||0!==c.comboboxState||!f||0===c.activationTrigger)return;let e=(0,q.k)();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=m.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[m,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let O=(0,T.z)(e=>{var t;if(i||null!=(t=c.virtual)&&t.disabled(l))return e.preventDefault();h(),(0,Z.tq)()||requestAnimationFrame(()=>{var e;return null==(e=c.inputRef.current)?void 0:e.focus({preventScroll:!0})}),0===c.mode&&requestAnimationFrame(()=>d.closeCombobox())}),I=(0,T.z)(()=>{var e;if(i||null!=(e=c.virtual)&&e.disabled(l))return d.goToOption(j.T.Nothing);let t=c.calculateIndex(l);d.goToOption(j.T.Specific,t)}),y=(0,F.g)(),S=(0,T.z)(e=>y.update(e)),R=(0,T.z)(e=>{var t;if(!y.wasMoved(e)||i||null!=(t=c.virtual)&&t.disabled(l)||f)return;let n=c.calculateIndex(l);d.goToOption(j.T.Specific,n,0)}),M=(0,T.z)(e=>{var t;y.wasMoved(e)&&(i||null!=(t=c.virtual)&&t.disabled(l)||f&&(c.optionsPropsRef.current.hold||d.goToOption(j.T.Nothing)))}),w=(0,u.useMemo)(()=>({active:f,selected:p,disabled:i}),[f,p,i]);return(0,Y.sY)({ourProps:{id:r,ref:g,role:"option",tabIndex:!0===i?void 0:-1,"aria-disabled":!0===i||void 0,"aria-selected":p,disabled:void 0,onClick:O,onFocus:I,onPointerEnter:S,onMouseEnter:S,onPointerMove:R,onMouseMove:R,onPointerLeave:M,onMouseLeave:M},theirProps:s,slot:w,defaultTag:"li",name:"Combobox.Option"})})})}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/1264-2979d95e0b56a75c.js b/ui/litellm-dashboard/out/_next/static/chunks/1264-2979d95e0b56a75c.js deleted file mode 100644 index fd249f9de9..0000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/1264-2979d95e0b56a75c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1264],{87045:function(t,e,s){s.d(e,{j:function(){return n}});var i=s(24112),r=s(45345),n=new class extends i.l{#t;#e;#s;constructor(){super(),this.#s=t=>{if(!r.sk&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#t?this.#t:globalThis.document?.visibilityState!=="hidden"}}},2894:function(t,e,s){s.d(e,{R:function(){return u},m:function(){return a}});var i=s(18238),r=s(7989),n=s(11255),a=class extends r.F{#i;#r;#n;constructor(t){super(),this.mutationId=t.mutationId,this.#r=t.mutationCache,this.#i=[],this.state=t.state||u(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#i.includes(t)||(this.#i.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#i=this.#i.filter(e=>e!==t),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#i.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){this.#n=(0,n.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let e="pending"===this.state.status,s=!this.#n.canStart();try{if(!e){this.#a({type:"pending",variables:t,isPaused:s}),await this.#r.config.onMutate?.(t,this);let e=await this.options.onMutate?.(t);e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:s})}let i=await this.#n.start();return await this.#r.config.onSuccess?.(i,t,this.state.context,this),await this.options.onSuccess?.(i,t,this.state.context),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,t,this.state.context),this.#a({type:"success",data:i}),i}catch(e){try{throw await this.#r.config.onError?.(e,t,this.state.context,this),await this.options.onError?.(e,t,this.state.context),await this.#r.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,e,t,this.state.context),e}finally{this.#a({type:"error",error:e})}}finally{this.#r.runNext(this)}}#a(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.V.batch(()=>{this.#i.forEach(e=>{e.onMutationUpdate(t)}),this.#r.notify({mutation:this,type:"updated",action:t})})}};function u(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},18238:function(t,e,s){s.d(e,{V:function(){return i}});var i=function(){let t=[],e=0,s=t=>{t()},i=t=>{t()},r=t=>setTimeout(t,0),n=i=>{e?t.push(i):r(()=>{s(i)})},a=()=>{let e=t;t=[],e.length&&r(()=>{i(()=>{e.forEach(t=>{s(t)})})})};return{batch:t=>{let s;e++;try{s=t()}finally{--e||a()}return s},batchCalls:t=>(...e)=>{n(()=>{t(...e)})},schedule:n,setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{r=t}}}()},57853:function(t,e,s){s.d(e,{N:function(){return n}});var i=s(24112),r=s(45345),n=new class extends i.l{#u=!0;#e;#s;constructor(){super(),this.#s=t=>{if(!r.sk&&window.addEventListener){let e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#u!==t&&(this.#u=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#u}}},21733:function(t,e,s){s.d(e,{A:function(){return u},z:function(){return o}});var i=s(45345),r=s(18238),n=s(11255),a=s(7989),u=class extends a.F{#o;#h;#c;#n;#l;#d;constructor(t){super(),this.#d=!1,this.#l=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#c=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#o=function(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,i=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=t.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(t){this.options={...this.#l,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(t,e){let s=(0,i.oE)(this.state.data,t,this.options);return this.#a({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#a({type:"setState",state:t,setStateOptions:e})}cancel(t){let e=this.#n?.promise;return this.#n?.cancel(t),e?e.then(i.ZT).catch(i.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(t=>!1!==(0,i.Nc)(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===i.CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(t=0){return this.state.isInvalidated||void 0===this.state.data||!(0,i.Kp)(this.state.dataUpdatedAt,t)}onFocus(){let t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){let t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#n&&(this.#d?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}fetch(t,e){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let s=new AbortController,r=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#d=!0,s.signal)})},a={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{let t=(0,i.cG)(this.options,e),s={queryKey:this.queryKey,meta:this.meta};return(r(s),this.#d=!1,this.options.persister)?this.options.persister(t,s,this):t(s)}};r(a),this.options.behavior?.onFetch(a,this),this.#h=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#a({type:"fetch",meta:a.fetchOptions?.meta});let u=t=>{(0,n.DV)(t)&&t.silent||this.#a({type:"error",error:t}),(0,n.DV)(t)||(this.#c.config.onError?.(t,this),this.#c.config.onSettled?.(this.state.data,t,this)),this.scheduleGc()};return this.#n=(0,n.Mz)({initialPromise:e?.initialPromise,fn:a.fetchFn,abort:s.abort.bind(s),onSuccess:t=>{if(void 0===t){u(Error(`${this.queryHash} data is undefined`));return}try{this.setData(t)}catch(t){u(t);return}this.#c.config.onSuccess?.(t,this),this.#c.config.onSettled?.(t,this.state.error,this),this.scheduleGc()},onError:u,onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#n.start()}#a(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...o(e.data,this.options),fetchMeta:t.meta??null};case"success":return{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let s=t.error;if((0,n.DV)(s)&&s.revert&&this.#h)return{...this.#h,fetchStatus:"idle"};return{...e,error:s,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),r.V.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:t})})}};function o(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,n.Kw)(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}},21623:function(t,e,s){s.d(e,{S:function(){return y}});var i=s(45345),r=s(21733),n=s(18238),a=s(24112),u=class extends a.l{constructor(t={}){super(),this.config=t,this.#f=new Map}#f;build(t,e,s){let n=e.queryKey,a=e.queryHash??(0,i.Rm)(n,e),u=this.get(a);return u||(u=new r.A({cache:this,queryKey:n,queryHash:a,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(n)}),this.add(u)),u}add(t){this.#f.has(t.queryHash)||(this.#f.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#f.get(t.queryHash);e&&(t.destroy(),e===t&&this.#f.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){n.V.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#f.get(t)}getAll(){return[...this.#f.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i._x)(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>(0,i._x)(t,e)):e}notify(t){n.V.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){n.V.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){n.V.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},o=s(2894),h=class extends a.l{constructor(t={}){super(),this.config=t,this.#p=new Set,this.#y=new Map,this.#m=0}#p;#y;#m;build(t,e,s){let i=new o.m({mutationCache:this,mutationId:++this.#m,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#p.add(t);let e=c(t);if("string"==typeof e){let s=this.#y.get(e);s?s.push(t):this.#y.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#p.delete(t)){let e=c(t);if("string"==typeof e){let s=this.#y.get(e);if(s){if(s.length>1){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#y.delete(e)}}}this.notify({type:"removed",mutation:t})}canRun(t){let e=c(t);if("string"!=typeof e)return!0;{let s=this.#y.get(e),i=s?.find(t=>"pending"===t.state.status);return!i||i===t}}runNext(t){let e=c(t);if("string"!=typeof e)return Promise.resolve();{let s=this.#y.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){n.V.batch(()=>{this.#p.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#p.clear(),this.#y.clear()})}getAll(){return Array.from(this.#p)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i.X7)(e,t))}findAll(t={}){return this.getAll().filter(e=>(0,i.X7)(t,e))}notify(t){n.V.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return n.V.batch(()=>Promise.all(t.map(t=>t.continue().catch(i.ZT))))}};function c(t){return t.options.scope?.id}var l=s(87045),d=s(57853);function f(t){return{onFetch:(e,s)=>{let r=e.options,n=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],u=e.state.data?.pageParams||[],o={pages:[],pageParams:[]},h=0,c=async()=>{let s=!1,c=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?s=!0:e.signal.addEventListener("abort",()=>{s=!0}),e.signal)})},l=(0,i.cG)(e.options,e.fetchOptions),d=async(t,r,n)=>{if(s)return Promise.reject();if(null==r&&t.pages.length)return Promise.resolve(t);let a={queryKey:e.queryKey,pageParam:r,direction:n?"backward":"forward",meta:e.options.meta};c(a);let u=await l(a),{maxPages:o}=e.options,h=n?i.Ht:i.VX;return{pages:h(t.pages,u,o),pageParams:h(t.pageParams,r,o)}};if(n&&a.length){let t="backward"===n,e={pages:a,pageParams:u},s=(t?function(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}:p)(r,e);o=await d(e,s,t)}else{let e=t??a.length;do{let t=0===h?u[0]??r.initialPageParam:p(r,o);if(h>0&&null==t)break;o=await d(o,t),h++}while(he.options.persister?.(c,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=c}}}function p(t,{pages:e,pageParams:s}){let i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}var y=class{#v;#r;#l;#b;#g;#C;#O;#R;constructor(t={}){this.#v=t.queryCache||new u,this.#r=t.mutationCache||new h,this.#l=t.defaultOptions||{},this.#b=new Map,this.#g=new Map,this.#C=0}mount(){this.#C++,1===this.#C&&(this.#O=l.j.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#v.onFocus())}),this.#R=d.N.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#v.onOnline())}))}unmount(){this.#C--,0===this.#C&&(this.#O?.(),this.#O=void 0,this.#R?.(),this.#R=void 0)}isFetching(t){return this.#v.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#r.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#v.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),s=this.#v.build(this,e),r=s.state.data;return void 0===r?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime((0,i.KC)(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#v.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let r=this.defaultQueryOptions({queryKey:t}),n=this.#v.get(r.queryHash),a=n?.state.data,u=(0,i.SE)(e,a);if(void 0!==u)return this.#v.build(this,r).setData(u,{...s,manual:!0})}setQueriesData(t,e,s){return n.V.batch(()=>this.#v.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#v.get(e.queryHash)?.state}removeQueries(t){let e=this.#v;n.V.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let s=this.#v,i={type:"active",...t};return n.V.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries(i,e)))}cancelQueries(t,e={}){let s={revert:!0,...e};return Promise.all(n.V.batch(()=>this.#v.findAll(t).map(t=>t.cancel(s)))).then(i.ZT).catch(i.ZT)}invalidateQueries(t,e={}){return n.V.batch(()=>{if(this.#v.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")return Promise.resolve();let s={...t,type:t?.refetchType??t?.type??"active"};return this.refetchQueries(s,e)})}refetchQueries(t,e={}){let s={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(n.V.batch(()=>this.#v.findAll(t).filter(t=>!t.isDisabled()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(i.ZT)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(i.ZT)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let s=this.#v.build(this,e);return s.isStaleByTime((0,i.KC)(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(i.ZT).catch(i.ZT)}fetchInfiniteQuery(t){return t.behavior=f(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(i.ZT).catch(i.ZT)}ensureInfiniteQueryData(t){return t.behavior=f(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return d.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#v}getMutationCache(){return this.#r}getDefaultOptions(){return this.#l}setDefaultOptions(t){this.#l=t}setQueryDefaults(t,e){this.#b.set((0,i.Ym)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#b.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#g.set((0,i.Ym)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#g.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.mutationKey)&&(s={...s,...e.defaultOptions})}),s}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#l.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=(0,i.Rm)(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===i.CN&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#l.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#v.clear(),this.#r.clear()}}},7989:function(t,e,s){s.d(e,{F:function(){return r}});var i=s(45345),r=class{#w;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.PN)(this.gcTime)&&(this.#w=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(i.sk?1/0:3e5))}clearGcTimeout(){this.#w&&(clearTimeout(this.#w),this.#w=void 0)}}},11255:function(t,e,s){s.d(e,{DV:function(){return c},Kw:function(){return o},Mz:function(){return l}});var i=s(87045),r=s(57853),n=s(16803),a=s(45345);function u(t){return Math.min(1e3*2**t,3e4)}function o(t){return(t??"online")!=="online"||r.N.isOnline()}var h=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function c(t){return t instanceof h}function l(t){let e,s=!1,c=0,l=!1,d=(0,n.O)(),f=()=>i.j.isFocused()&&("always"===t.networkMode||r.N.isOnline())&&t.canRun(),p=()=>o(t.networkMode)&&t.canRun(),y=s=>{l||(l=!0,t.onSuccess?.(s),e?.(),d.resolve(s))},m=s=>{l||(l=!0,t.onError?.(s),e?.(),d.reject(s))},v=()=>new Promise(s=>{e=t=>{(l||f())&&s(t)},t.onPause?.()}).then(()=>{e=void 0,l||t.onContinue?.()}),b=()=>{let e;if(l)return;let i=0===c?t.initialPromise:void 0;try{e=i??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(y).catch(e=>{if(l)return;let i=t.retry??(a.sk?0:3),r=t.retryDelay??u,n="function"==typeof r?r(c,e):r,o=!0===i||"number"==typeof i&&cf()?void 0:v()).then(()=>{s?m(e):b()})})};return{promise:d,cancel:e=>{l||(m(new h(e)),t.abort?.())},continue:()=>(e?.(),d),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:p,start:()=>(p()?b():v().then(b),d)}}},24112:function(t,e,s){s.d(e,{l:function(){return i}});var i=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},16803:function(t,e,s){s.d(e,{O:function(){return i}});function i(){let t,e;let s=new Promise((s,i)=>{t=s,e=i});function i(t){Object.assign(s,t),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},s.reject=t=>{i({status:"rejected",reason:t}),e(t)},s}},45345:function(t,e,s){s.d(e,{CN:function(){return w},Ht:function(){return R},KC:function(){return o},Kp:function(){return u},Nc:function(){return h},PN:function(){return a},Rm:function(){return d},SE:function(){return n},VS:function(){return y},VX:function(){return O},X7:function(){return l},Ym:function(){return f},ZT:function(){return r},_v:function(){return g},_x:function(){return c},cG:function(){return S},oE:function(){return C},sk:function(){return i},to:function(){return p}});var i="undefined"==typeof window||"Deno"in globalThis;function r(){}function n(t,e){return"function"==typeof t?t(e):t}function a(t){return"number"==typeof t&&t>=0&&t!==1/0}function u(t,e){return Math.max(t+(e||0)-Date.now(),0)}function o(t,e){return"function"==typeof t?t(e):t}function h(t,e){return"function"==typeof t?t(e):t}function c(t,e){let{type:s="all",exact:i,fetchStatus:r,predicate:n,queryKey:a,stale:u}=t;if(a){if(i){if(e.queryHash!==d(a,e.options))return!1}else if(!p(e.queryKey,a))return!1}if("all"!==s){let t=e.isActive();if("active"===s&&!t||"inactive"===s&&t)return!1}return("boolean"!=typeof u||e.isStale()===u)&&(!r||r===e.state.fetchStatus)&&(!n||!!n(e))}function l(t,e){let{exact:s,status:i,predicate:r,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(s){if(f(e.options.mutationKey)!==f(n))return!1}else if(!p(e.options.mutationKey,n))return!1}return(!i||e.state.status===i)&&(!r||!!r(e))}function d(t,e){return(e?.queryKeyHashFn||f)(t)}function f(t){return JSON.stringify(t,(t,e)=>v(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function p(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&!Object.keys(e).some(s=>!p(t[s],e[s]))}function y(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let s in t)if(t[s]!==e[s])return!1;return!0}function m(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function v(t){if(!b(t))return!1;let e=t.constructor;if(void 0===e)return!0;let s=e.prototype;return!!(b(s)&&s.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(t)===Object.prototype}function b(t){return"[object Object]"===Object.prototype.toString.call(t)}function g(t){return new Promise(e=>{setTimeout(e,t)})}function C(t,e,s){return"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?function t(e,s){if(e===s)return e;let i=m(e)&&m(s);if(i||v(e)&&v(s)){let r=i?e:Object.keys(e),n=r.length,a=i?s:Object.keys(s),u=a.length,o=i?[]:{},h=0;for(let n=0;ns?i.slice(1):i}function R(t,e,s=0){let i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var w=Symbol();function S(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==w?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}},16593:function(t,e,s){let i;s.d(e,{a:function(){return E}});var r=s(87045),n=s(18238),a=s(21733),u=s(24112),o=s(16803),h=s(45345),c=class extends u.l{constructor(t,e){super(),this.options=e,this.#S=t,this.#Q=null,this.#q=(0,o.O)(),this.options.experimental_prefetchInRender||this.#q.reject(Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#S;#F=void 0;#P=void 0;#E=void 0;#T;#D;#q;#Q;#I;#x;#A;#M;#k;#U;#j=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#F.addObserver(this),l(this.#F,this.options)?this.#K():this.updateResult(),this.#N())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#F,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#F,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#V(),this.#L(),this.#F.removeObserver(this)}setOptions(t,e){let s=this.options,i=this.#F;if(this.options=this.#S.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,h.Nc)(this.options.enabled,this.#F))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#F.setOptions(this.options),s._defaulted&&!(0,h.VS)(this.options,s)&&this.#S.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#F,observer:this});let r=this.hasListeners();r&&f(this.#F,i,this.options,s)&&this.#K(),this.updateResult(e),r&&(this.#F!==i||(0,h.Nc)(this.options.enabled,this.#F)!==(0,h.Nc)(s.enabled,this.#F)||(0,h.KC)(this.options.staleTime,this.#F)!==(0,h.KC)(s.staleTime,this.#F))&&this.#H();let n=this.#G();r&&(this.#F!==i||(0,h.Nc)(this.options.enabled,this.#F)!==(0,h.Nc)(s.enabled,this.#F)||n!==this.#U)&&this.#Z(n)}getOptimisticResult(t){let e=this.#S.getQueryCache().build(this.#S,t),s=this.createResult(e,t);return(0,h.VS)(this.getCurrentResult(),s)||(this.#E=s,this.#D=this.options,this.#T=this.#F.state),s}getCurrentResult(){return this.#E}trackResult(t,e){let s={};return Object.keys(t).forEach(i=>{Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),e?.(i),t[i])})}),s}trackProp(t){this.#j.add(t)}getCurrentQuery(){return this.#F}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#S.defaultQueryOptions(t),s=this.#S.getQueryCache().build(this.#S,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#K({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#E))}#K(t){this.#_();let e=this.#F.fetch(this.options,t);return t?.throwOnError||(e=e.catch(h.ZT)),e}#H(){this.#V();let t=(0,h.KC)(this.options.staleTime,this.#F);if(h.sk||this.#E.isStale||!(0,h.PN)(t))return;let e=(0,h.Kp)(this.#E.dataUpdatedAt,t);this.#M=setTimeout(()=>{this.#E.isStale||this.updateResult()},e+1)}#G(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#F):this.options.refetchInterval)??!1}#Z(t){this.#L(),this.#U=t,!h.sk&&!1!==(0,h.Nc)(this.options.enabled,this.#F)&&(0,h.PN)(this.#U)&&0!==this.#U&&(this.#k=setInterval(()=>{(this.options.refetchIntervalInBackground||r.j.isFocused())&&this.#K()},this.#U))}#N(){this.#H(),this.#Z(this.#G())}#V(){this.#M&&(clearTimeout(this.#M),this.#M=void 0)}#L(){this.#k&&(clearInterval(this.#k),this.#k=void 0)}createResult(t,e){let s;let i=this.#F,r=this.options,n=this.#E,u=this.#T,c=this.#D,d=t!==i?t.state:this.#P,{state:y}=t,m={...y},v=!1;if(e._optimisticResults){let s=this.hasListeners(),n=!s&&l(t,e),u=s&&f(t,i,e,r);(n||u)&&(m={...m,...(0,a.z)(y.data,t.options)}),"isRestoring"===e._optimisticResults&&(m.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:C}=m;if(e.select&&void 0!==m.data){if(n&&m.data===u?.data&&e.select===this.#I)s=this.#x;else try{this.#I=e.select,s=e.select(m.data),s=(0,h.oE)(n?.data,s,e),this.#x=s,this.#Q=null}catch(t){this.#Q=t}}else s=m.data;if(void 0!==e.placeholderData&&void 0===s&&"pending"===C){let t;if(n?.isPlaceholderData&&e.placeholderData===c?.placeholderData)t=n.data;else if(t="function"==typeof e.placeholderData?e.placeholderData(this.#A?.state.data,this.#A):e.placeholderData,e.select&&void 0!==t)try{t=e.select(t),this.#Q=null}catch(t){this.#Q=t}void 0!==t&&(C="success",s=(0,h.oE)(n?.data,t,e),v=!0)}this.#Q&&(b=this.#Q,s=this.#x,g=Date.now(),C="error");let O="fetching"===m.fetchStatus,R="pending"===C,w="error"===C,S=R&&O,Q=void 0!==s,q={status:C,fetchStatus:m.fetchStatus,isPending:R,isSuccess:"success"===C,isError:w,isInitialLoading:S,isLoading:S,data:s,dataUpdatedAt:m.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:O,isRefetching:O&&!R,isLoadingError:w&&!Q,isPaused:"paused"===m.fetchStatus,isPlaceholderData:v,isRefetchError:w&&Q,isStale:p(t,e),refetch:this.refetch,promise:this.#q};if(this.options.experimental_prefetchInRender){let e=t=>{"error"===q.status?t.reject(q.error):void 0!==q.data&&t.resolve(q.data)},s=()=>{e(this.#q=q.promise=(0,o.O)())},r=this.#q;switch(r.status){case"pending":t.queryHash===i.queryHash&&e(r);break;case"fulfilled":("error"===q.status||q.data!==r.value)&&s();break;case"rejected":("error"!==q.status||q.error!==r.reason)&&s()}}return q}updateResult(t){let e=this.#E,s=this.createResult(this.#F,this.options);if(this.#T=this.#F.state,this.#D=this.options,void 0!==this.#T.data&&(this.#A=this.#F),(0,h.VS)(s,e))return;this.#E=s;let i={};t?.listeners!==!1&&(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#j.size)return!0;let i=new Set(s??this.#j);return this.options.throwOnError&&i.add("error"),Object.keys(this.#E).some(t=>this.#E[t]!==e[t]&&i.has(t))})()&&(i.listeners=!0),this.#z({...i,...t})}#_(){let t=this.#S.getQueryCache().build(this.#S,this.options);if(t===this.#F)return;let e=this.#F;this.#F=t,this.#P=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#N()}#z(t){n.V.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#E)}),this.#S.getQueryCache().notify({query:this.#F,type:"observerResultsUpdated"})})}};function l(t,e){return!1!==(0,h.Nc)(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)||void 0!==t.state.data&&d(t,e,e.refetchOnMount)}function d(t,e,s){if(!1!==(0,h.Nc)(e.enabled,t)){let i="function"==typeof s?s(t):s;return"always"===i||!1!==i&&p(t,e)}return!1}function f(t,e,s,i){return(t!==e||!1===(0,h.Nc)(i.enabled,t))&&(!s.suspense||"error"!==t.state.status)&&p(t,s)}function p(t,e){return!1!==(0,h.Nc)(e.enabled,t)&&t.isStaleByTime((0,h.KC)(e.staleTime,t))}var y=s(2265),m=s(29827);s(57437);var v=y.createContext((i=!1,{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i})),b=()=>y.useContext(v),g=s(51172),C=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&!e.isReset()&&(t.retryOnMount=!1)},O=t=>{y.useEffect(()=>{t.clearReset()},[t])},R=t=>{let{result:e,errorResetBoundary:s,throwOnError:i,query:r}=t;return e.isError&&!s.isReset()&&!e.isFetching&&r&&(0,g.L)(i,[e.error,r])},w=y.createContext(!1),S=()=>y.useContext(w);w.Provider;var Q=t=>{let e=t.staleTime;t.suspense&&(t.staleTime="function"==typeof e?(...t)=>Math.max(e(...t),1e3):Math.max(e??1e3,1e3),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,1e3)))},q=(t,e)=>t.isLoading&&t.isFetching&&!e,F=(t,e)=>t?.suspense&&e.isPending,P=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function E(t,e){return function(t,e,s){var i,r,a,u,o;let c=(0,m.NL)(s),l=S(),d=b(),f=c.defaultQueryOptions(t);null===(r=c.getDefaultOptions().queries)||void 0===r||null===(i=r._experimental_beforeQuery)||void 0===i||i.call(r,f),f._optimisticResults=l?"isRestoring":"optimistic",Q(f),C(f,d),O(d);let p=!c.getQueryCache().get(f.queryHash),[v]=y.useState(()=>new e(c,f)),w=v.getOptimisticResult(f),E=!l&&!1!==t.subscribed;if(y.useSyncExternalStore(y.useCallback(t=>{let e=E?v.subscribe(n.V.batchCalls(t)):g.Z;return v.updateResult(),e},[v,E]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),y.useEffect(()=>{v.setOptions(f,{listeners:!1})},[f,v]),F(f,w))throw P(f,v,d);if(R({result:w,errorResetBoundary:d,throwOnError:f.throwOnError,query:c.getQueryCache().get(f.queryHash)}))throw w.error;if(null===(u=c.getDefaultOptions().queries)||void 0===u||null===(a=u._experimental_afterQuery)||void 0===a||a.call(u,f,w),f.experimental_prefetchInRender&&!h.sk&&q(w,l)){let t=p?P(f,v,d):null===(o=c.getQueryCache().get(f.queryHash))||void 0===o?void 0:o.promise;null==t||t.catch(g.Z).finally(()=>{v.updateResult()})}return f.notifyOnChangeProps?w:v.trackResult(w)}(t,c,e)}},51172:function(t,e,s){function i(t,e){return"function"==typeof t?t(...e):!!t}function r(){}s.d(e,{L:function(){return i},Z:function(){return r}})}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/1307-6bc3bb770f5b2b05.js b/ui/litellm-dashboard/out/_next/static/chunks/1307-6bc3bb770f5b2b05.js deleted file mode 100644 index 40149428ca..0000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/1307-6bc3bb770f5b2b05.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1307],{21307:function(e,s,r){r.d(s,{d:function(){return eR},o:function(){return eY}});var l=r(57437),t=r(2265),a=r(16593),n=r(52787),i=r(82680),o=r(89970),c=r(20831),d=r(12485),m=r(18135),x=r(35242),u=r(29706),h=r(77991),p=r(49804),j=r(67101),g=r(84264),v=r(96761),f=r(12322),b=r(47323),y=r(53410),N=r(74998);let _=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let r=e.split("/mcp/");if(2!==r.length)return{token:null,baseUrl:e};let l=r[0]+"/mcp/",t=r[1];if(!t)return{token:null,baseUrl:e};return{token:t,baseUrl:l}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},Z=e=>{let{token:s,baseUrl:r}=_(e);return s?r+"...":e},w=e=>{let{token:s}=_(e);return{maskedUrl:Z(e),hasToken:!!s}},C=e=>e?/^https?:\/\/[^\s/$.?#].[^\s]*$/i.test(e)?Promise.resolve():Promise.reject("Please enter a valid URL (e.g., http://service-name.domain:1234/path or https://example.com)"):Promise.resolve(),S=e=>e&&e.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve(),k=(e,s,r,t)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:r}=e;return(0,l.jsxs)("button",{onClick:()=>s(r.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[r.original.server_id.slice(0,7),"..."]})}},{accessorKey:"server_name",header:"Name"},{accessorKey:"alias",header:"Alias"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:r}=w(s.original.url);return(0,l.jsx)("span",{className:"font-mono text-sm",children:r})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,l.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,l.jsx)("span",{children:s()||"none"})}},{id:"health_status",header:"Health Status",cell:e=>{let{row:s}=e,r=s.original,t=r.status||"unknown",a=r.last_health_check,n=r.health_check_error,i=(0,l.jsxs)("div",{className:"max-w-xs",children:[(0,l.jsxs)("div",{className:"font-semibold mb-1",children:["Health Status: ",t]}),a&&(0,l.jsxs)("div",{className:"text-xs mb-1",children:["Last Check: ",new Date(a).toLocaleString()]}),n&&(0,l.jsxs)("div",{className:"text-xs",children:[(0,l.jsx)("div",{className:"font-medium text-red-400 mb-1",children:"Error:"}),(0,l.jsx)("div",{className:"break-words",children:n})]}),!a&&!n&&(0,l.jsx)("div",{className:"text-xs text-gray-400",children:"No health check data available"})]});return(0,l.jsx)(o.Z,{title:i,placement:"top",children:(0,l.jsxs)("button",{className:"font-mono text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[10ch] ".concat((e=>{switch(e){case"healthy":return"text-green-500 bg-green-50 hover:bg-green-100";case"unhealthy":return"text-red-500 bg-red-50 hover:bg-red-100";default:return"text-gray-500 bg-gray-50 hover:bg-gray-100"}})(t)),children:[(0,l.jsx)("span",{className:"mr-1",children:"●"}),t.charAt(0).toUpperCase()+t.slice(1)]})})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,r=s.original.mcp_access_groups;if(Array.isArray(r)&&r.length>0&&"string"==typeof r[0]){let e=r.join(", ");return(0,l.jsx)(o.Z,{title:e,children:(0,l.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,l.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,l.jsx)("span",{className:"text-xs",children:r.created_at?new Date(r.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,l.jsx)("span",{className:"text-xs",children:r.updated_at?new Date(r.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(b.Z,{icon:y.Z,size:"sm",onClick:()=>r(s.original.server_id),className:"cursor-pointer"}),(0,l.jsx)(b.Z,{icon:N.Z,size:"sm",onClick:()=>t(s.original.server_id),className:"cursor-pointer"})]})}}];var P=r(19250),A=r(20347),L=r(10900),M=r(82376),T=r(71437),I=r(12514);let E={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic"},z={SSE:"sse"},q=e=>(console.log(e),null==e)?z.SSE:e,O=e=>null==e?E.NONE:e,R=e=>O(e)!==E.NONE;var U=r(13634),F=r(73002),B=r(49566),K=r(20577),V=r(44851),D=r(33866),H=r(62670),G=r(15424),Y=r(58630),J=e=>{let{value:s={},onChange:r,tools:t=[],disabled:a=!1}=e,n=(e,l)=>{let t={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:l}};null==r||r(t)};return(0,l.jsx)(I.Z,{children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,l.jsx)(H.Z,{className:"text-green-600"}),(0,l.jsx)(v.Z,{children:"Cost Configuration"}),(0,l.jsx)(o.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,l.jsx)(G.Z,{className:"text-gray-400"})})]}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,l.jsx)(o.Z,{title:"Default cost charged for each tool call to this server.",children:(0,l.jsx)(G.Z,{className:"ml-1 text-gray-400"})})]}),(0,l.jsx)(K.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let l={...s,default_cost_per_query:e};null==r||r(l)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,l.jsx)(g.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),t.length>0&&(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,l.jsx)(o.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,l.jsx)(G.Z,{className:"ml-1 text-gray-400"})})]}),(0,l.jsx)(V.default,{items:[{key:"1",label:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(Y.Z,{className:"mr-2 text-blue-500"}),(0,l.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,l.jsx)(D.Z,{count:t.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,l.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:t.map((e,r)=>{var t;return(0,l.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)(g.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,l.jsx)(g.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,l.jsx)("div",{className:"ml-4",children:(0,l.jsx)(K.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(t=s.tool_name_to_cost_per_query)||void 0===t?void 0:t[e.name],onChange:s=>n(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},r)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,l.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,l.jsx)(g.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,l.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,l.jsxs)(g.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,l.jsxs)(g.Z,{className:"text-blue-700",children:["• ",s,": $",r.toFixed(4)," per query"]},s)})]})]})]})})};let{Panel:$}=V.default;var W=e=>{let{availableAccessGroups:s,mcpServer:r,searchValue:a,setSearchValue:i,getAccessGroupOptions:c}=e,d=U.Z.useFormInstance();return(0,t.useEffect)(()=>{r&&r.extra_headers&&d.setFieldValue("extra_headers",r.extra_headers)},[r,d]),(0,l.jsx)(V.default,{className:"bg-gray-50 border border-gray-200 rounded-lg",expandIconPosition:"end",ghost:!1,children:(0,l.jsx)($,{header:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Permission Management / Access Control"})]}),(0,l.jsx)("p",{className:"text-sm text-gray-600 ml-4",children:"Configure access permissions and security settings (Optional)"})]}),className:"border-0",children:(0,l.jsxs)("div",{className:"space-y-6 pt-4",children:[(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,l.jsx)(o.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,l.jsx)(n.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var r;return(null!==(r=null==s?void 0:s.value)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>i(e),tokenSeparators:[","],options:c(),maxTagCount:"responsive",allowClear:!0})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Extra Headers",(0,l.jsx)(o.Z,{title:"Forward custom headers from incoming requests to this MCP server (e.g., Authorization, X-Custom-Header, User-Agent)",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})}),(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0&&(0,l.jsxs)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:[r.extra_headers.length," configured"]})]}),name:"extra_headers",children:(0,l.jsx)(n.default,{mode:"tags",placeholder:(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0?"Currently: ".concat(r.extra_headers.join(", ")):"Enter header names (e.g., Authorization, X-Custom-Header)",className:"rounded-lg",size:"large",tokenSeparators:[","],allowClear:!0})})]})},"permissions")})},Q=r(83669),X=r(87908),ee=r(61994);let es=e=>{let{accessToken:s,formValues:r,enabled:l=!0}=e,[a,n]=(0,t.useState)([]),[i,o]=(0,t.useState)(!1),[c,d]=(0,t.useState)(null),[m,x]=(0,t.useState)(!1),u=!!(r.url&&r.transport&&r.auth_type&&s),h=async()=>{if(s&&r.url){o(!0),d(null);try{let e={server_id:r.server_id||"",server_name:r.server_name||"",url:r.url,transport:r.transport,auth_type:r.auth_type,mcp_info:r.mcp_info},l=await (0,P.testMCPToolsListRequest)(s,e);if(l.tools&&!l.error)n(l.tools),d(null),l.tools.length>0&&!m&&x(!0);else{let e=l.message||"Failed to retrieve tools list";d(e),n([]),x(!1)}}catch(e){console.error("Tools fetch error:",e),d(e instanceof Error?e.message:String(e)),n([]),x(!1)}finally{o(!1)}}},p=()=>{n([]),d(null),x(!1)};return(0,t.useEffect)(()=>{l&&(u?h():p())},[r.url,r.transport,r.auth_type,s,l,u]),{tools:a,isLoadingTools:i,toolsError:c,hasShownSuccessMessage:m,canFetchTools:u,fetchTools:h,clearTools:p}};var er=e=>{let{accessToken:s,formValues:r,allowedTools:a,existingAllowedTools:n,onAllowedToolsChange:i}=e,o=(0,t.useRef)(0),{tools:c,isLoadingTools:d,toolsError:m,canFetchTools:x}=es({accessToken:s,formValues:r,enabled:!0});(0,t.useEffect)(()=>{if(c.length>0&&c.length!==o.current&&0===a.length){if(n&&n.length>0){let e=c.map(e=>e.name);i(n.filter(s=>e.includes(s)))}else i(c.map(e=>e.name))}o.current=c.length},[c,a.length,n,i]);let u=e=>{a.includes(e)?i(a.filter(s=>s!==e)):i([...a,e])};return x||r.url?(0,l.jsx)(I.Z,{children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("div",{className:"flex items-center justify-between",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Y.Z,{className:"text-blue-600"}),(0,l.jsx)(v.Z,{children:"Tool Configuration"}),c.length>0&&(0,l.jsx)(D.Z,{count:c.length,style:{backgroundColor:"#52c41a"}})]})}),(0,l.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,l.jsxs)(g.Z,{className:"text-blue-800 text-sm",children:[(0,l.jsx)("strong",{children:"Select which tools users can call:"})," Only checked tools will be available for users to invoke. Unchecked tools will be blocked from execution."]})}),d&&(0,l.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,l.jsx)(X.Z,{size:"large"}),(0,l.jsx)(g.Z,{className:"ml-3",children:"Loading tools..."})]}),m&&!d&&(0,l.jsxs)("div",{className:"text-center py-6 text-red-500 border rounded-lg border-dashed border-red-300 bg-red-50",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm text-red-500",children:m})]}),!d&&!m&&0===c.length&&x&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{children:"No tools available for configuration"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm",children:"Connect to an MCP server with tools to configure them"})]}),!x&&r.url&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{children:"Complete required fields to configure tools"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to load available tools"})]}),!d&&!m&&c.length>0&&(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-50 rounded-lg border border-green-200 flex-1",children:[(0,l.jsx)(Q.Z,{className:"text-green-600"}),(0,l.jsxs)(g.Z,{className:"text-green-700 font-medium",children:[a.length," of ",c.length," ",1===c.length?"tool":"tools"," enabled for user access"]})]}),(0,l.jsxs)("div",{className:"flex gap-2 ml-3",children:[(0,l.jsx)("button",{type:"button",onClick:()=>{i(c.map(e=>e.name))},className:"px-3 py-1.5 text-sm text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-md transition-colors",children:"Enable All"}),(0,l.jsx)("button",{type:"button",onClick:()=>{i([])},className:"px-3 py-1.5 text-sm text-gray-600 hover:text-gray-700 hover:bg-gray-100 rounded-md transition-colors",children:"Disable All"})]})]}),(0,l.jsx)("div",{className:"space-y-2",children:c.map((e,s)=>(0,l.jsx)("div",{className:"p-4 rounded-lg border transition-colors cursor-pointer ".concat(a.includes(e.name)?"bg-blue-50 border-blue-300 hover:border-blue-400":"bg-gray-50 border-gray-200 hover:border-gray-300"),onClick:()=>u(e.name),children:(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)(ee.Z,{checked:a.includes(e.name),onChange:()=>u(e.name)}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(g.Z,{className:"font-medium text-gray-900",children:e.name}),(0,l.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full font-medium ".concat(a.includes(e.name)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:a.includes(e.name)?"Enabled":"Disabled"})]}),e.description&&(0,l.jsx)(g.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description}),(0,l.jsx)(g.Z,{className:"text-gray-400 text-xs block mt-1",children:a.includes(e.name)?"✓ Users can call this tool":"✗ Users cannot call this tool"})]})]})},s))})]})]})}):null},el=r(9114),et=e=>{let{mcpServer:s,accessToken:r,onCancel:a,onSuccess:i,availableAccessGroups:o}=e,[p]=U.Z.useForm(),[j,g]=(0,t.useState)({}),[v,f]=(0,t.useState)([]),[b,y]=(0,t.useState)(!1),[N,_]=(0,t.useState)(""),[Z,w]=(0,t.useState)(!1),[k,A]=(0,t.useState)([]);(0,t.useEffect)(()=>{var e;(null===(e=s.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&g(s.mcp_info.mcp_server_cost_info)},[s]),(0,t.useEffect)(()=>{s.allowed_tools&&A(s.allowed_tools)},[s]),(0,t.useEffect)(()=>{if(s.mcp_access_groups){let e=s.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));p.setFieldValue("mcp_access_groups",e)}},[s]),(0,t.useEffect)(()=>{L()},[s,r]);let L=async()=>{if(r&&s.url){y(!0);try{let e={server_id:s.server_id,server_name:s.server_name,url:s.url,transport:s.transport,auth_type:s.auth_type,mcp_info:s.mcp_info},l=await (0,P.testMCPToolsListRequest)(r,e);l.tools&&!l.error?f(l.tools):(console.error("Failed to fetch tools:",l.message),f([]))}catch(e){console.error("Tools fetch error:",e),f([])}finally{y(!1)}}},M=async e=>{if(r)try{let l=(e.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),t={...e,server_id:s.server_id,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(j).length>0?j:null},mcp_access_groups:l,alias:e.alias,extra_headers:e.extra_headers||[],allowed_tools:k.length>0?k:null,disallowed_tools:e.disallowed_tools||[]},a=await (0,P.updateMCPServer)(r,t);el.Z.success("MCP Server updated successfully"),i(a)}catch(e){el.Z.fromBackend("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,l.jsxs)(m.Z,{children:[(0,l.jsxs)(x.Z,{className:"grid w-full grid-cols-2",children:[(0,l.jsx)(d.Z,{children:"Server Configuration"}),(0,l.jsx)(d.Z,{children:"Cost Configuration"})]}),(0,l.jsxs)(h.Z,{className:"mt-6",children:[(0,l.jsx)(u.Z,{children:(0,l.jsxs)(U.Z,{form:p,onFinish:M,initialValues:s,layout:"vertical",children:[(0,l.jsx)(U.Z.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,s)=>S(s)}],children:(0,l.jsx)(B.Z,{})}),(0,l.jsx)(U.Z.Item,{label:"Alias",name:"alias",rules:[{validator:(e,s)=>S(s)}],children:(0,l.jsx)(B.Z,{onChange:()=>w(!0)})}),(0,l.jsx)(U.Z.Item,{label:"Description",name:"description",children:(0,l.jsx)(B.Z,{})}),(0,l.jsx)(U.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>C(s)}],children:(0,l.jsx)(B.Z,{})}),(0,l.jsx)(U.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,l.jsxs)(n.default,{children:[(0,l.jsx)(n.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,l.jsx)(n.default.Option,{value:"http",children:"HTTP"})]})}),(0,l.jsx)(U.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,l.jsxs)(n.default,{children:[(0,l.jsx)(n.default.Option,{value:"none",children:"None"}),(0,l.jsx)(n.default.Option,{value:"api_key",children:"API Key"}),(0,l.jsx)(n.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,l.jsx)(n.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(W,{availableAccessGroups:o,mcpServer:s,searchValue:N,setSearchValue:_,getAccessGroupOptions:()=>{let e=o.map(e=>({value:e,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e})]})}));return N&&!o.some(e=>e.toLowerCase().includes(N.toLowerCase()))&&e.push({value:N,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:N}),(0,l.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(er,{accessToken:r,formValues:{server_id:s.server_id,server_name:s.server_name,url:s.url,transport:s.transport,auth_type:s.auth_type,mcp_info:s.mcp_info},allowedTools:k,existingAllowedTools:s.allowed_tools||null,onAllowedToolsChange:A})}),(0,l.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,l.jsx)(F.ZP,{onClick:a,children:"Cancel"}),(0,l.jsx)(c.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,l.jsx)(u.Z,{children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(J,{value:j,onChange:g,tools:v,disabled:b}),(0,l.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,l.jsx)(F.ZP,{onClick:a,children:"Cancel"}),(0,l.jsx)(c.Z,{onClick:()=>p.submit(),children:"Save Changes"})]})]})})]})]})},ea=r(92280),en=e=>{let{costConfig:s}=e,r=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,t=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return r||t?(0,l.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,l.jsxs)("div",{className:"space-y-4",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,l.jsxs)("div",{children:[(0,l.jsx)(ea.x,{className:"font-medium",children:"Default Cost per Query"}),(0,l.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),t&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,l.jsxs)("div",{children:[(0,l.jsx)(ea.x,{className:"font-medium",children:"Tool-Specific Costs"}),(0,l.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,l.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,l.jsx)(ea.x,{className:"font-medium",children:s}),(0,l.jsxs)(ea.x,{className:"text-green-600 font-mono",children:["$",r.toFixed(4)," per query"]})]},s)})})]}),(0,l.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,l.jsx)(ea.x,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,l.jsxs)("div",{className:"mt-2 space-y-1",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,l.jsxs)(ea.x,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),t&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,l.jsxs)(ea.x,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,l.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,l.jsx)("div",{className:"space-y-4",children:(0,l.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,l.jsx)(ea.x,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})},ei=r(59872),eo=r(30401),ec=r(78867);let ed=e=>{var s,r,a,n,i;let{mcpServer:o,onBack:p,isEditing:f,isProxyAdmin:y,accessToken:N,userRole:_,userID:Z,availableAccessGroups:C}=e,[S,k]=(0,t.useState)(f),[P,A]=(0,t.useState)(!1),[E,z]=(0,t.useState)({}),{maskedUrl:R,hasToken:U}=w(o.url),B=(e,s)=>U?s?e:R:e,K=async(e,s)=>{await (0,ei.vQ)(e)&&(z(e=>({...e,[s]:!0})),setTimeout(()=>{z(e=>({...e,[s]:!1}))},2e3))};return(0,l.jsxs)("div",{className:"p-4 max-w-full",children:[(0,l.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Z,{icon:L.Z,variant:"light",className:"mb-4",onClick:p,children:"Back to All Servers"}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(v.Z,{children:o.server_name}),(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:E["mcp-server_name"]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>K(o.server_name,"mcp-server_name"),className:"left-2 z-10 transition-all duration-200 ".concat(E["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),o.alias&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"ml-4 text-gray-500",children:"Alias:"}),(0,l.jsx)("span",{className:"ml-1 font-mono text-blue-600",children:o.alias}),(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:E["mcp-alias"]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>K(o.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(E["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(g.Z,{className:"text-gray-500 font-mono",children:o.server_id}),(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:E["mcp-server-id"]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>K(o.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(E["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,l.jsxs)(m.Z,{defaultIndex:S?2:0,children:[(0,l.jsx)(x.Z,{className:"mb-4",children:[(0,l.jsx)(d.Z,{children:"Overview"},"overview"),(0,l.jsx)(d.Z,{children:"MCP Tools"},"tools"),...y?[(0,l.jsx)(d.Z,{children:"Settings"},"settings")]:[]]}),(0,l.jsxs)(h.Z,{children:[(0,l.jsxs)(u.Z,{children:[(0,l.jsxs)(j.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,l.jsxs)(I.Z,{children:[(0,l.jsx)(g.Z,{children:"Transport"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(v.Z,{children:q(null!==(n=o.transport)&&void 0!==n?n:void 0)})})]}),(0,l.jsxs)(I.Z,{children:[(0,l.jsx)(g.Z,{children:"Auth Type"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(g.Z,{children:O(null!==(i=o.auth_type)&&void 0!==i?i:void 0)})})]}),(0,l.jsxs)(I.Z,{children:[(0,l.jsx)(g.Z,{children:"Host Url"}),(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,l.jsx)(g.Z,{className:"break-all overflow-wrap-anywhere",children:B(o.url,P)}),U&&(0,l.jsx)("button",{onClick:()=>A(!P),className:"p-1 hover:bg-gray-100 rounded",children:(0,l.jsx)(b.Z,{icon:P?M.Z:T.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,l.jsxs)(I.Z,{className:"mt-2",children:[(0,l.jsx)(v.Z,{children:"Cost Configuration"}),(0,l.jsx)(en,{costConfig:null===(s=o.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,l.jsx)(u.Z,{children:(0,l.jsx)(eY,{serverId:o.server_id,accessToken:N,auth_type:o.auth_type,userRole:_,userID:Z,serverAlias:o.alias})}),(0,l.jsx)(u.Z,{children:(0,l.jsxs)(I.Z,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(v.Z,{children:"MCP Server Settings"}),S?null:(0,l.jsx)(c.Z,{variant:"light",onClick:()=>k(!0),children:"Edit Settings"})]}),S?(0,l.jsx)(et,{mcpServer:o,accessToken:N,onCancel:()=>k(!1),onSuccess:e=>{k(!1),p()},availableAccessGroups:C}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Server Name"}),(0,l.jsx)("div",{children:o.server_name})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Alias"}),(0,l.jsx)("div",{children:o.alias})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Description"}),(0,l.jsx)("div",{children:o.description})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"URL"}),(0,l.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[B(o.url,P),U&&(0,l.jsx)("button",{onClick:()=>A(!P),className:"p-1 hover:bg-gray-100 rounded",children:(0,l.jsx)(b.Z,{icon:P?M.Z:T.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Transport"}),(0,l.jsx)("div",{children:q(o.transport)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Extra Headers"}),(0,l.jsx)("div",{children:null===(r=o.extra_headers)||void 0===r?void 0:r.join(", ")})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Auth Type"}),(0,l.jsx)("div",{children:O(o.auth_type)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Access Groups"}),(0,l.jsx)("div",{children:o.mcp_access_groups&&o.mcp_access_groups.length>0?(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:o.mcp_access_groups.map((e,s)=>{var r;return(0,l.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(r=null==e?void 0:e.name)&&void 0!==r?r:""},s)})}):(0,l.jsx)(g.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Allowed Tools"}),(0,l.jsx)("div",{children:o.allowed_tools&&o.allowed_tools.length>0?(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:o.allowed_tools.map((e,s)=>(0,l.jsx)("span",{className:"px-2 py-1 bg-blue-50 border border-blue-200 rounded-md text-sm",children:e},s))}):(0,l.jsx)(g.Z,{className:"text-gray-500",children:"All tools enabled"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"font-medium",children:"Cost Configuration"}),(0,l.jsx)(en,{costConfig:null===(a=o.mcp_info)||void 0===a?void 0:a.mcp_server_cost_info})]})]})]})})]})]})]})};var em=r(64504),ex=r(61778),eu=r(29271),eh=r(89245),ep=e=>{let{accessToken:s,formValues:r,onToolsLoaded:a}=e,{tools:n,isLoadingTools:i,toolsError:o,canFetchTools:c,fetchTools:d}=es({accessToken:s,formValues:r,enabled:!0});return((0,t.useEffect)(()=>{null==a||a(n)},[n,a]),c||r.url)?(0,l.jsx)(I.Z,{children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Q.Z,{className:"text-blue-600"}),(0,l.jsx)(v.Z,{children:"Connection Status"})]}),!c&&r.url&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,l.jsx)(Y.Z,{className:"text-2xl mb-2"}),(0,l.jsx)(g.Z,{children:"Complete required fields to test connection"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),c&&(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(g.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":n.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,l.jsx)("br",{}),(0,l.jsxs)(g.Z,{className:"text-gray-500 text-sm",children:["Server: ",r.url]})]}),i&&(0,l.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,l.jsx)(X.Z,{size:"small",className:"mr-2"}),(0,l.jsx)(g.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&n.length>0&&(0,l.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,l.jsx)(Q.Z,{className:"mr-1"}),(0,l.jsx)(g.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,l.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,l.jsx)(eu.Z,{className:"mr-1"}),(0,l.jsx)(g.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,l.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,l.jsx)(X.Z,{size:"large"}),(0,l.jsx)(g.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,l.jsx)(ex.Z,{message:"Connection Failed",description:o,type:"error",showIcon:!0,action:(0,l.jsx)(F.ZP,{icon:(0,l.jsx)(eh.Z,{}),onClick:d,size:"small",children:"Retry"})}),!i&&0===n.length&&!o&&(0,l.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,l.jsx)(Q.Z,{className:"text-2xl mb-2 text-green-500"}),(0,l.jsx)(g.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,l.jsx)("br",{}),(0,l.jsx)(g.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},ej=r(64482),eg=e=>{let{isVisible:s}=e;return s?(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,l.jsx)(o.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,l.jsx)(ej.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null};let ev="".concat("../ui/assets/logos/","mcp_logo.png");var ef=e=>{let{userRole:s,accessToken:r,onCreateSuccess:a,isModalVisible:c,setModalVisible:d,availableAccessGroups:m}=e,[x]=U.Z.useForm(),[u,h]=(0,t.useState)(!1),[p,j]=(0,t.useState)({}),[g,v]=(0,t.useState)({}),[f,b]=(0,t.useState)(!1),[y,N]=(0,t.useState)([]),[_,Z]=(0,t.useState)([]),[w,k]=(0,t.useState)(""),[L,M]=(0,t.useState)(""),[T,I]=(0,t.useState)(""),E=(e,s)=>{if(!e){I("");return}"sse"!==s||e.endsWith("/sse")?"http"!==s||e.endsWith("/mcp")?I(""):I("Typically MCP HTTP URLs end with /mcp. You can add this url but this is a warning."):I("Typically MCP SSE URLs end with /sse. You can add this url but this is a warning.")},z=async e=>{h(!0);try{let s=e.mcp_access_groups,l={};if(e.stdio_config&&"stdio"===w)try{let s=JSON.parse(e.stdio_config),r=s;if(s.mcpServers&&"object"==typeof s.mcpServers){let l=Object.keys(s.mcpServers);if(l.length>0){let t=l[0];r=s.mcpServers[t],e.server_name||(e.server_name=t.replace(/-/g,"_"))}}l={command:r.command,args:r.args,env:r.env},console.log("Parsed stdio config:",l)}catch(e){el.Z.fromBackend("Invalid JSON in stdio configuration");return}let t={...e,...l,stdio_config:void 0,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(p).length>0?p:null},mcp_access_groups:s,alias:e.alias,allowed_tools:_.length>0?_:null};if(console.log("Payload: ".concat(JSON.stringify(t))),null!=r){let e=await (0,P.createMCPServer)(r,t);el.Z.success("MCP Server created successfully"),x.resetFields(),j({}),N([]),Z([]),I(""),b(!1),d(!1),a(e)}}catch(e){el.Z.fromBackend("Error creating MCP Server: "+e)}finally{h(!1)}},q=()=>{x.resetFields(),j({}),N([]),Z([]),I(""),b(!1),d(!1)};return(t.useEffect(()=>{if(!f&&g.server_name){let e=g.server_name.replace(/\s+/g,"_");x.setFieldsValue({alias:e}),v(s=>({...s,alias:e}))}},[g.server_name]),t.useEffect(()=>{c||v({})},[c]),(0,A.tY)(s))?(0,l.jsx)(i.Z,{title:(0,l.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,l.jsx)("img",{src:ev,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:c,width:1e3,onCancel:q,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsxs)(U.Z,{form:x,onFinish:z,onValuesChange:(e,s)=>v(s),layout:"vertical",className:"space-y-6",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,l.jsx)(o.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>S(s)}],children:(0,l.jsx)(em.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,l.jsx)(o.Z,{title:"A short, unique identifier for this server. Defaults to the server name with spaces replaced by underscores.",children:(0,l.jsx)(G.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,l.jsx)(em.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>b(!0)})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description!!!!!!!!!"}],children:(0,l.jsx)(em.o,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,l.jsxs)(n.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{if(k(e),"stdio"===e)x.setFieldsValue({url:void 0,auth_type:void 0}),I("");else{x.setFieldsValue({command:void 0,args:void 0,env:void 0});let s=x.getFieldValue("url");s&&E(s,e)}},value:w,children:[(0,l.jsx)(n.default.Option,{value:"http",children:"HTTP"}),(0,l.jsx)(n.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,l.jsx)(n.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==w&&(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>C(s)}],children:(0,l.jsxs)("div",{children:[(0,l.jsx)(em.o,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:e=>E(e.target.value,w)}),T&&(0,l.jsx)("div",{className:"mt-1 text-red-500 text-sm font-medium",children:T})]})}),"stdio"!==w&&(0,l.jsx)(U.Z.Item,{label:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,l.jsxs)(n.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,l.jsx)(n.default.Option,{value:"none",children:"None"}),(0,l.jsx)(n.default.Option,{value:"api_key",children:"API Key"}),(0,l.jsx)(n.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,l.jsx)(n.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,l.jsx)(eg,{isVisible:"stdio"===w})]}),(0,l.jsx)("div",{className:"mt-8",children:(0,l.jsx)(W,{availableAccessGroups:m,mcpServer:null,searchValue:L,setSearchValue:M,getAccessGroupOptions:()=>{let e=m.map(e=>({value:e,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e})]})}));return L&&!m.some(e=>e.toLowerCase().includes(L.toLowerCase()))&&e.push({value:L,label:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:L}),(0,l.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,l.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,l.jsx)(ep,{accessToken:r,formValues:g,onToolsLoaded:N})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(er,{accessToken:r,formValues:g,allowedTools:_,existingAllowedTools:null,onAllowedToolsChange:Z})}),(0,l.jsx)("div",{className:"mt-6",children:(0,l.jsx)(J,{value:p,onChange:j,tools:y.filter(e=>_.includes(e.name)),disabled:!1})}),(0,l.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,l.jsx)(em.z,{variant:"secondary",onClick:q,children:"Cancel"}),(0,l.jsx)(em.z,{variant:"primary",loading:u,children:u?"Creating...":"Add MCP Server"})]})]})})}):null},eb=r(93192),ey=r(67960),eN=r(63709),e_=r(93142),eZ=r(64935),ew=r(11239),eC=r(54001),eS=r(96137),ek=r(96362),eP=r(80221),eA=r(29202);let{Title:eL,Text:eM}=eb.default,{Panel:eT}=V.default,eI=e=>{let{icon:s,title:r,description:a,children:n,serverName:i,accessGroups:o=["dev"]}=e,[c,d]=(0,t.useState)(!1),m=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(c&&i){let s=[i.replace(/\s+/g,"_"),...o].join(",");e["x-mcp-servers"]=[s]}return e};return(0,l.jsxs)(ey.Z,{className:"border border-gray-200",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eL,{level:5,className:"mb-0",children:r}),(0,l.jsx)(eM,{className:"text-gray-600",children:a})]})]}),i&&("Implementation Example"===r||"Configuration"===r)&&(0,l.jsxs)(U.Z.Item,{className:"mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,l.jsx)(eN.Z,{size:"small",checked:c,onChange:d}),(0,l.jsxs)(eM,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,l.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),c&&(0,l.jsx)(ex.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{children:[(0,l.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,l.jsxs)("code",{children:['["',i.replace(/\s+/g,"_"),'"]']})]}),(0,l.jsxs)("p",{children:[(0,l.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,l.jsx)("code",{children:'["dev-group"]'})]}),(0,l.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,l.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),t.Children.map(n,e=>{if(t.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return t.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(m(),null,8)))})}return e})]})};var eE=e=>{let{currentServerAccessGroups:s=[]}=e,r=(0,P.getProxyBaseUrl)(),[a,n]=(0,t.useState)({}),[i,o]=(0,t.useState)({openai:[],litellm:[],cursor:[],http:[]}),[c]=(0,t.useState)("Zapier_MCP"),p=async(e,s)=>{await (0,ei.vQ)(e)&&(n(e=>({...e,[s]:!0})),setTimeout(()=>{n(e=>({...e,[s]:!1}))},2e3))},j=e=>{let{code:s,copyKey:r,title:t,className:n=""}=e;return(0,l.jsxs)("div",{className:"relative group",children:[t&&(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,l.jsx)(eZ.Z,{size:16,className:"text-blue-600"}),(0,l.jsx)(eM,{strong:!0,className:"text-gray-700",children:t})]}),(0,l.jsxs)(ey.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(n),children:[(0,l.jsx)(F.ZP,{type:"text",size:"small",icon:a[r]?(0,l.jsx)(eo.Z,{size:12}):(0,l.jsx)(ec.Z,{size:12}),onClick:()=>p(s,r),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(a[r]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,l.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},f=e=>{let{step:s,title:r,children:t}=e;return(0,l.jsxs)("div",{className:"flex gap-4",children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)(eM,{strong:!0,className:"text-gray-800 block mb-2",children:r}),t]})]})};return(0,l.jsx)("div",{children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(v.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,l.jsx)(g.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,l.jsxs)(m.Z,{className:"w-full",children:[(0,l.jsx)(x.Z,{className:"flex justify-start mt-8 mb-6",children:(0,l.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(eZ.Z,{size:18}),"OpenAI API"]})}),(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(ew.Z,{size:18}),"LiteLLM Proxy"]})}),(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(eP.Z,{size:18}),"Cursor"]})}),(0,l.jsx)(d.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(eA.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,l.jsxs)(h.Z,{children:[(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(eZ.Z,{className:"text-blue-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,l.jsx)(eM,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsx)(eI,{icon:(0,l.jsx)(eC.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,l.jsx)("div",{children:(0,l.jsxs)(eM,{children:["Get your API key from the"," ",(0,l.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,l.jsx)(ek.Z,{size:12})]})]})}),(0,l.jsx)(j,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eS.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,l.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"openai-server-url"})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eZ.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,l.jsx)(j,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(ew.Z,{className:"text-emerald-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,l.jsx)(eM,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsx)(eI,{icon:(0,l.jsx)(eC.Z,{className:"text-emerald-600",size:16}),title:"API Key Setup",description:"Configure your LiteLLM Proxy API key for authentication",children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,l.jsx)("div",{children:(0,l.jsx)(eM,{children:"Get your API key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,l.jsx)(j,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eS.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,l.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"litellm-server-url"})}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eZ.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:c,accessGroups:["dev"],children:(0,l.jsx)(j,{code:"curl --location '".concat(r,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_API_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(eP.Z,{className:"text-purple-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,l.jsx)(eM,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,l.jsxs)(ey.Z,{className:"border border-gray-200",children:[(0,l.jsx)(eL,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsx)(f,{step:1,title:"Open Cursor Settings",children:(0,l.jsxs)(eM,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or"," ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,l.jsx)(f,{step:2,title:"Navigate to MCP Tools",children:(0,l.jsx)(eM,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,l.jsxs)(f,{step:3,title:"Add Configuration",children:[(0,l.jsxs)(eM,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with"," ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or"," ",(0,l.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eZ.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,l.jsx)(j,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "server_url": "'.concat(r,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,l.jsx)(u.Z,{className:"mt-6",children:(0,l.jsx)(()=>(0,l.jsxs)(e_.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,l.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,l.jsx)(eA.Z,{className:"text-green-600",size:24}),(0,l.jsx)(eL,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,l.jsx)(eM,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,l.jsx)(eI,{icon:(0,l.jsx)(eA.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,l.jsxs)(e_.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,l.jsx)("div",{children:(0,l.jsx)(eM,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,l.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"http-server-url"}),(0,l.jsx)(j,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(F.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,l.jsx)(ek.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},ez=r(67187);let{Option:eq}=n.default,eO=e=>{let{isModalOpen:s,title:r,confirmDelete:t,cancelDelete:a}=e;return s?(0,l.jsx)(i.Z,{open:s,onOk:t,okType:"danger",onCancel:a,children:(0,l.jsxs)(j.Z,{numItems:1,className:"gap-2 w-full",children:[(0,l.jsx)(v.Z,{children:r}),(0,l.jsx)(p.Z,{numColSpan:1,children:(0,l.jsx)("p",{children:"Are you sure you want to delete this MCP Server?"})})]})}):null};var eR=e=>{let{accessToken:s,userRole:r,userID:i}=e,{data:p,isLoading:j,refetch:b,dataUpdatedAt:y}=(0,a.a)({queryKey:["mcpServers"],queryFn:()=>{if(!s)throw Error("Access Token required");return(0,P.fetchMCPServers)(s)},enabled:!!s});t.useEffect(()=>{p&&(console.log("MCP Servers fetched:",p),p.forEach(e=>{console.log("Server: ".concat(e.server_name||e.server_id)),console.log(" allowed_tools:",e.allowed_tools)}))},[p]);let[N,_]=(0,t.useState)(null),[Z,w]=(0,t.useState)(!1),[C,S]=(0,t.useState)(null),[L,M]=(0,t.useState)(!1),[T,I]=(0,t.useState)("all"),[E,z]=(0,t.useState)("all"),[q,O]=(0,t.useState)([]),[R,U]=(0,t.useState)(!1),F="Internal User"===r,B=t.useMemo(()=>{if(!p)return[];let e=new Set,s=[];return p.forEach(r=>{r.teams&&r.teams.forEach(r=>{let l=r.team_id;e.has(l)||(e.add(l),s.push(r))})}),s},[p]),K=t.useMemo(()=>p?Array.from(new Set(p.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[p]),V=e=>{I(e),H(e,E)},D=e=>{z(e),H(T,e)},H=(e,s)=>{if(!p)return O([]);let r=p;if("personal"===e){O([]);return}"all"!==e&&(r=r.filter(s=>{var r;return null===(r=s.teams)||void 0===r?void 0:r.some(s=>s.team_id===e)})),"all"!==s&&(r=r.filter(e=>{var r;return null===(r=e.mcp_access_groups)||void 0===r?void 0:r.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),O(r)};(0,t.useEffect)(()=>{H(T,E)},[y]);let G=t.useMemo(()=>k(null!=r?r:"",e=>{S(e),M(!1)},e=>{S(e),M(!0)},Y),[r]);function Y(e){_(e),w(!0)}let J=async()=>{if(null!=N&&null!=s){try{await (0,P.deleteMCPServer)(s,N),el.Z.success("Deleted MCP Server successfully"),b()}catch(e){console.error("Error deleting the mcp server:",e)}w(!1),_(null)}};return s&&r&&i?(0,l.jsxs)("div",{className:"w-full h-full p-6",children:[(0,l.jsx)(eO,{isModalOpen:Z,title:"Delete MCP Server",confirmDelete:J,cancelDelete:()=>{w(!1),_(null)}}),(0,l.jsx)(ef,{userRole:r,accessToken:s,onCreateSuccess:e=>{O(s=>[...s,e]),U(!1)},isModalVisible:R,setModalVisible:U,availableAccessGroups:K}),(0,l.jsx)(v.Z,{children:"MCP Servers"}),(0,l.jsx)(g.Z,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,A.tY)(r)&&(0,l.jsx)(c.Z,{className:"mt-4 mb-4",onClick:()=>U(!0),children:"+ Add New MCP Server"}),(0,l.jsxs)(m.Z,{className:"w-full h-full",children:[(0,l.jsx)(x.Z,{className:"flex justify-between mt-2 w-full items-center",children:(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(d.Z,{children:"All Servers"}),(0,l.jsx)(d.Z,{children:"Connect"})]})}),(0,l.jsxs)(h.Z,{children:[(0,l.jsx)(u.Z,{children:(0,l.jsx)(()=>C?(0,l.jsx)(ed,{mcpServer:q.find(e=>e.server_id===C)||{server_id:"",server_name:"",alias:"",url:"",transport:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{M(!1),S(null),b()},isProxyAdmin:(0,A.tY)(r),isEditing:L,accessToken:s,userID:i,userRole:r,availableAccessGroups:K}):(0,l.jsxs)("div",{className:"w-full h-full",children:[(0,l.jsx)("div",{className:"w-full px-6",children:(0,l.jsx)("div",{className:"flex flex-col space-y-4",children:(0,l.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)(g.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,l.jsxs)(n.default,{value:T,onChange:V,style:{width:300},children:[(0,l.jsx)(eq,{value:"all",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:F?"All Available Servers":"All Servers"})]})}),(0,l.jsx)(eq,{value:"personal",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:"Personal"})]})}),B.map(e=>(0,l.jsx)(eq,{value:e.team_id,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,l.jsxs)(g.Z,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,l.jsx)(o.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,l.jsx)(ez.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,l.jsxs)(n.default,{value:E,onChange:D,style:{width:300},children:[(0,l.jsx)(eq,{value:"all",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),K.map(e=>(0,l.jsx)(eq,{value:e,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,l.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,l.jsx)("div",{className:"w-full px-6 mt-6",children:(0,l.jsx)(f.w,{data:q,columns:G,renderSubComponent:()=>(0,l.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:j,noDataMessage:"No MCP servers configured"})})]}),{})}),(0,l.jsx)(u.Z,{children:(0,l.jsx)(eE,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:r,userID:i}),(0,l.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},eU=r(21770);function eF(e){let{tool:s,needsAuth:r,authValue:a,onSubmit:n,isLoading:i,result:c,error:d,onClose:m}=e,[x]=U.Z.useForm(),[u,h]=t.useState("formatted"),[p,j]=t.useState(null),[g,v]=t.useState(null),f=t.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),b=t.useMemo(()=>f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{type:"object",properties:f.properties.params.properties,required:f.properties.params.required||[]}:f,[f]);t.useEffect(()=>{p&&(c||d)&&v(Date.now()-p)},[c,d,p]);let y=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let r=document.execCommand("copy");if(document.body.removeChild(s),!r)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},N=async()=>{await y(JSON.stringify(c,null,2))?el.Z.success("Result copied to clipboard"):el.Z.fromBackend("Failed to copy result")},_=async()=>{await y(s.name)?el.Z.success("Tool name copied to clipboard"):el.Z.fromBackend("Failed to copy tool name")};return(0,l.jsxs)("div",{className:"space-y-4 h-full",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,l.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,l.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:_,title:"Click to copy tool name",children:[(0,l.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,l.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,l.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,l.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,l.jsx)(em.z,{onClick:m,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,l.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,l.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,l.jsx)(o.Z,{title:"Configure the input parameters for this tool call",children:(0,l.jsx)(G.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,l.jsx)("div",{className:"p-4",children:(0,l.jsxs)(U.Z,{form:x,onFinish:e=>{j(Date.now()),v(null);let s={};Object.entries(e).forEach(e=>{var r;let[l,t]=e,a=null===(r=b.properties)||void 0===r?void 0:r[l];if(a&&null!=t&&""!==t)switch(a.type){case"boolean":s[l]="true"===t||!0===t;break;case"number":s[l]=Number(t);break;case"string":s[l]=String(t);break;default:s[l]=t}else null!=t&&""!==t&&(s[l]=t)}),n(f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,l.jsx)("div",{className:"space-y-3",children:(0,l.jsx)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,l.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,l.jsx)(em.o,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===b.properties?(0,l.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,l.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,l.jsx)("div",{className:"space-y-3",children:Object.entries(b.properties).map(e=>{var s,r,t,a,n;let[i,c]=e;return(0,l.jsxs)(U.Z.Item,{label:(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(s=b.required)||void 0===s?void 0:s.includes(i))&&(0,l.jsx)("span",{className:"text-red-500",children:"*"}),c.description&&(0,l.jsx)(o.Z,{title:c.description,children:(0,l.jsx)(G.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,rules:[{required:null===(r=b.required)||void 0===r?void 0:r.includes(i),message:"Please enter ".concat(i)}],className:"mb-3",children:["string"===c.type&&c.enum&&(0,l.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:c.default,children:[!(null===(t=b.required)||void 0===t?void 0:t.includes(i))&&(0,l.jsxs)("option",{value:"",children:["Select ",i]}),c.enum.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]}),"string"===c.type&&!c.enum&&(0,l.jsx)(em.o,{placeholder:c.description||"Enter ".concat(i),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),"number"===c.type&&(0,l.jsx)("input",{type:"number",placeholder:c.description||"Enter ".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===c.type&&(0,l.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null===(a=c.default)||void 0===a?void 0:a.toString())||"",children:[!(null===(n=b.required)||void 0===n?void 0:n.includes(i))&&(0,l.jsxs)("option",{value:"",children:["Select ",i]}),(0,l.jsx)("option",{value:"true",children:"True"}),(0,l.jsx)("option",{value:"false",children:"False"})]})]},i)})}),(0,l.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,l.jsx)(em.z,{onClick:()=>x.submit(),disabled:i,variant:"primary",className:"w-full",loading:i,children:i?"Calling Tool...":c||d?"Call Again":"Call Tool"})})]})})]}),(0,l.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,l.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,l.jsx)("div",{className:"p-4",children:c||d||i?(0,l.jsxs)("div",{className:"space-y-3",children:[c&&!i&&!d&&(0,l.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,l.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==g&&(0,l.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,l.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,l.jsx)("button",{onClick:()=>h("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,l.jsx)("button",{onClick:()=>h("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,l.jsx)("button",{onClick:N,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,l.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,l.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[i&&(0,l.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,l.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,l.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),d&&(0,l.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==g&&(0,l.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,l.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,l.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:d.message})})]})]})}),c&&!i&&!d&&(0,l.jsx)("div",{className:"space-y-3",children:"formatted"===u?c.map((e,s)=>(0,l.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,l.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,l.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let r=e.replace(/^#+\s/,"");return(0,l.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:r})},s)}let r=/(https?:\/\/[^\s\)]+)/g;if(r.test(e)){let t=e.split(r);return(0,l.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,l.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:t.map((e,s)=>r.test(e)?(0,l.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,l.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,l.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,l.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,l.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,l.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,l.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,l.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,l.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,l.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,l.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,l.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,l.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,l.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,l.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(c,null,2)})})})})]})]}):(0,l.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,l.jsxs)("div",{className:"text-center max-w-sm",children:[(0,l.jsx)("div",{className:"mb-3",children:(0,l.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,l.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var eB=r(29488),eK=r(36724),eV=r(57400),eD=r(69993);let eH=e=>{let s,{visible:r,onOk:t,onCancel:a,authType:n}=e,[o]=U.Z.useForm();if(n===E.API_KEY||n===E.BEARER_TOKEN){let e=n===E.API_KEY?"API Key":"Bearer Token";s=(0,l.jsx)(U.Z.Item,{name:"authValue",label:e,rules:[{required:!0,message:"Please input your ".concat(e)}],children:(0,l.jsx)(ej.default.Password,{})})}else n===E.BASIC&&(s=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(U.Z.Item,{name:"username",label:"Username",rules:[{required:!0,message:"Please input your username"}],children:(0,l.jsx)(ej.default,{})}),(0,l.jsx)(U.Z.Item,{name:"password",label:"Password",rules:[{required:!0,message:"Please input your password"}],children:(0,l.jsx)(ej.default.Password,{})})]}));return(0,l.jsx)(i.Z,{open:r,title:"Authentication",onOk:()=>{o.validateFields().then(e=>{n===E.BASIC?t("".concat(e.username.trim(),":").concat(e.password.trim())):t(e.authValue.trim())})},onCancel:a,destroyOnClose:!0,children:(0,l.jsx)(U.Z,{form:o,layout:"vertical",children:s})})},eG=e=>{let{authType:s,onAuthSubmit:r,onClearAuth:a,hasAuth:n}=e,[i,o]=(0,t.useState)(!1);return(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)(eK.xv,{className:"text-sm font-medium text-gray-700",children:["Authentication ",n?"✓":""]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[n&&(0,l.jsx)(eK.zx,{onClick:()=>{a()},size:"sm",variant:"secondary",className:"text-xs text-red-600 hover:text-red-700",children:"Clear"}),(0,l.jsx)(eK.zx,{onClick:()=>o(!0),size:"sm",variant:"secondary",className:"text-xs",children:n?"Update":"Add Auth"})]})]}),(0,l.jsx)(eK.xv,{className:"text-xs text-gray-500",children:n?"Authentication configured and saved locally":"Some tools may require authentication"}),(0,l.jsx)(eH,{visible:i,onOk:e=>{r(e),o(!1)},onCancel:()=>o(!1),authType:s})]})};var eY=e=>{let{serverId:s,accessToken:r,auth_type:n,userRole:i,userID:o,serverAlias:c}=e,[d,m]=(0,t.useState)(""),[x,u]=(0,t.useState)(null),[h,p]=(0,t.useState)(null),[j,g]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(R(n)){let e=(0,eB.Ui)(s,c||void 0);e&&m(e)}},[s,c,n]);let v=e=>{m(e),e&&R(n)&&((0,eB.Hc)(s,e,n||"none",c||void 0),el.Z.success("Authentication token saved locally"))},f=()=>{m(""),(0,eB.e4)(s),el.Z.info("Authentication token cleared")},{data:b,isLoading:y,error:N}=(0,a.a)({queryKey:["mcpTools",s,d,c],queryFn:()=>{if(!r)throw Error("Access Token required");return(0,P.listMCPTools)(r,s,d,c||void 0)},enabled:!!r,staleTime:3e4}),{mutate:_,isPending:Z}=(0,eU.D)({mutationFn:async e=>{if(!r)throw Error("Access Token required");try{return await (0,P.callMCPTool)(r,e.tool.name,e.arguments,e.authValue,c||void 0)}catch(e){throw e}},onSuccess:e=>{p(e),g(null)},onError:e=>{g(e),p(null)}}),w=(null==b?void 0:b.tools)||[],C=""!==d;return(0,l.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,l.jsx)(eK.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,l.jsxs)("div",{className:"flex h-auto w-full gap-4",children:[(0,l.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,l.jsx)(eK.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,l.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,l.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,l.jsxs)(eK.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,l.jsx)(Y.Z,{className:"mr-2"})," Available Tools",w.length>0&&(0,l.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:w.length})]}),y&&(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,l.jsxs)("div",{className:"relative mb-3",children:[(0,l.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,l.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,l.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==b?void 0:b.error)&&!y&&!w.length&&(0,l.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,l.jsxs)("p",{className:"font-medium",children:["Error: ",b.message]})}),!y&&!(null==b?void 0:b.error)&&(!w||0===w.length)&&(0,l.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,l.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,l.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!y&&!(null==b?void 0:b.error)&&w.length>0&&(0,l.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto min-h-0 mcp-tools-scrollable",style:{maxHeight:"400px",scrollbarWidth:"auto",scrollbarColor:"#cbd5e0 #f7fafc"},children:w.map(e=>(0,l.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==x?void 0:x.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{u(e),p(null),g(null)},children:[(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,l.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,l.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,l.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==x?void 0:x.name)===e.name&&(0,l.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,l.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,l.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]}),R(n)&&(0,l.jsx)("div",{className:"pt-4 border-t border-gray-200 flex-shrink-0 mt-6",children:C?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(eK.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,l.jsx)(eV.Z,{className:"mr-2"})," Authentication"]}),(0,l.jsx)(eG,{authType:n,onAuthSubmit:v,onClearAuth:f,hasAuth:C})]}):(0,l.jsxs)("div",{className:"p-4 bg-gradient-to-r from-orange-50 to-red-50 border border-orange-200 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-center mb-3",children:[(0,l.jsx)(eV.Z,{className:"mr-2 text-orange-600 text-lg"}),(0,l.jsx)(eK.xv,{className:"font-semibold text-orange-800",children:"Authentication Required"})]}),(0,l.jsx)(eK.xv,{className:"text-sm text-orange-700 mb-4",children:"This MCP server requires authentication. You must add your credentials below to access the tools."}),(0,l.jsx)(eG,{authType:n,onAuthSubmit:v,onClearAuth:f,hasAuth:C})]})})]})]}),(0,l.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,l.jsx)(eK.Dx,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto p-4",children:x?(0,l.jsx)("div",{className:"h-full",children:(0,l.jsx)(eF,{tool:x,needsAuth:R(n),authValue:d,onSubmit:e=>{_({tool:x,arguments:e,authValue:d})},result:h,error:j,isLoading:Z,onClose:()=>u(null)})}):(0,l.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsx)(eD.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,l.jsx)(eK.xv,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,l.jsx)(eK.xv,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})}}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/131-79aa7086799152a2.js b/ui/litellm-dashboard/out/_next/static/chunks/131-79aa7086799152a2.js deleted file mode 100644 index 950eb17f93..0000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/131-79aa7086799152a2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[131],{95704:function(e,t,r){r.d(t,{Dx:function(){return u.Z},RM:function(){return n.Z},SC:function(){return c.Z},Zb:function(){return a.Z},iA:function(){return s.Z},pj:function(){return l.Z},ss:function(){return i.Z},xs:function(){return o.Z},xv:function(){return d.Z}});var a=r(12514),s=r(21626),n=r(97214),l=r(28241),i=r(58834),o=r(69552),c=r(71876),d=r(84264),u=r(96761)},92280:function(e,t,r){r.d(t,{x:function(){return a.Z}});var a=r(84264)},56522:function(e,t,r){r.d(t,{o:function(){return s.Z},x:function(){return a.Z}});var a=r(84264),s=r(49566)},39760:function(e,t,r){var a=r(2265),s=r(99376),n=r(14474),l=r(3914);t.Z=()=>{var e,t,r,i,o,c,d;let u=(0,s.useRouter)(),m="undefined"!=typeof document?(0,l.e)("token"):null;(0,a.useEffect)(()=>{m||u.replace("/sso/key/generate")},[m,u]);let g=(0,a.useMemo)(()=>{if(!m)return null;try{return(0,n.o)(m)}catch(e){return(0,l.b)(),u.replace("/sso/key/generate"),null}},[m,u]);return{token:m,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(t=null==g?void 0:g.user_id)&&void 0!==t?t:null,userEmail:null!==(r=null==g?void 0:g.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(i=null==g?void 0:g.user_role)&&void 0!==i?i:null),premiumUser:null!==(o=null==g?void 0:g.premium_user)&&void 0!==o?o:null,disabledPersonalKeyCreation:null!==(c=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},97434:function(e,t,r){var a,s;r.d(t,{Dg:function(){return d},Lo:function(){return n},PA:function(){return i},RD:function(){return l},Y5:function(){return a},Z3:function(){return o}}),(s=a||(a={})).Braintrust="Braintrust",s.CustomCallbackAPI="Custom Callback API",s.Datadog="Datadog",s.Langfuse="Langfuse",s.LangfuseOtel="LangfuseOtel",s.LangSmith="LangSmith",s.Lago="Lago",s.OpenMeter="OpenMeter",s.OTel="Open Telemetry",s.S3="S3",s.Arize="Arize";let n={Braintrust:"braintrust",CustomCallbackAPI:"custom_callback_api",Datadog:"datadog",Langfuse:"langfuse",LangfuseOtel:"langfuse_otel",LangSmith:"langsmith",Lago:"lago",OpenMeter:"openmeter",OTel:"otel",S3:"s3",Arize:"arize"},l=Object.fromEntries(Object.entries(n).map(e=>{let[t,r]=e;return[r,t]})),i=e=>e.map(e=>l[e]||e),o=e=>e.map(e=>n[e]||e),c="/ui/assets/logos/",d={Langfuse:{logo:"".concat(c,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v2 Logging Integration"},LangfuseOtel:{logo:"".concat(c,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v3 OTEL Logging Integration"},Arize:{logo:"".concat(c,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"text"},description:"Arize Logging Integration"},LangSmith:{logo:"".concat(c,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text",langsmith_sampling_rate:"number"},description:"Langsmith Logging Integration"},Braintrust:{logo:"".concat(c,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{},description:"Braintrust Logging Integration"},"Custom Callback API":{logo:"".concat(c,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{},description:"Custom Callback API Logging Integration"},Datadog:{logo:"".concat(c,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{},description:"Datadog Logging Integration"},Lago:{logo:"".concat(c,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{},description:"Lago Billing Logging Integration"},OpenMeter:{logo:"".concat(c,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{},description:"OpenMeter Logging Integration"},"Open Telemetry":{logo:"".concat(c,"otel.png"),supports_key_team_logging:!1,dynamic_params:{},description:"OpenTelemetry Logging Integration"},S3:{logo:"".concat(c,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{},description:"S3 Bucket (AWS) Logging Integration"}}},51601:function(e,t,r){r.d(t,{p:function(){return s}});var a=r(19250);let s=async e=>{try{let t=await (0,a.modelHubCall)(e);if(console.log("model_info:",t),(null==t?void 0:t.data.length)>0){let e=t.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}}},95096:function(e,t,r){var a=r(57437),s=r(2265),n=r(52787),l=r(19250);t.Z=e=>{let{onChange:t,value:r,className:i,accessToken:o,placeholder:c="Select pass through routes",disabled:d=!1,teamId:u}=e,[m,g]=(0,s.useState)([]),[p,x]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(o){x(!0);try{let e=await (0,l.getPassThroughEndpointsCall)(o,u);if(e.endpoints){let t=e.endpoints.map(e=>e.path);g(t)}}catch(e){console.error("Error fetching pass through routes:",e)}finally{x(!1)}}})()},[o,u]),(0,a.jsx)(n.default,{mode:"tags",placeholder:c,onChange:t,value:r,loading:p,className:i,options:m.map(e=>({label:e,value:e})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})}},46468:function(e,t,r){r.d(t,{K2:function(){return s},Ob:function(){return l},W0:function(){return n}});var a=r(19250);let s=async(e,t,r)=>{try{if(null===e||null===t)return;if(null!==r){let s=(await (0,a.modelAvailableCall)(r,e,t,!0,null,!0)).data.map(e=>e.id),n=[],l=[];return s.forEach(e=>{e.endsWith("/*")?n.push(e):l.push(e)}),[...n,...l]}}catch(e){console.error("Error fetching user models:",e)}},n=e=>{if(e.endsWith("/*")){let t=e.replace("/*","");return"All ".concat(t," models")}return e},l=(e,t)=>{let r=[],a=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let s=e.replace("/*",""),n=t.filter(e=>e.startsWith(s+"/"));a.push(...n),r.push(e)}else a.push(e)}),[...r,...a].filter((e,t,r)=>r.indexOf(e)===t)}},95920:function(e,t,r){var a=r(57437),s=r(2265),n=r(52787),l=r(19250);t.Z=e=>{let{onChange:t,value:r,className:i,accessToken:o,placeholder:c="Select MCP servers",disabled:d=!1}=e,[u,m]=(0,s.useState)([]),[g,p]=(0,s.useState)([]),[x,h]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(async()=>{if(o){h(!0);try{let[e,t]=await Promise.all([(0,l.fetchMCPServers)(o),(0,l.fetchMCPAccessGroups)(o)]),r=Array.isArray(e)?e:e.data||[],a=Array.isArray(t)?t:t.data||[];m(r),p(a)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[o]);let f=[...g.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...u.map(e=>({label:"".concat(e.server_name||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.server_name||e.server_id," ").concat(e.server_id," MCP Server")}))],v=[...(null==r?void 0:r.servers)||[],...(null==r?void 0:r.accessGroups)||[]];return(0,a.jsx)("div",{children:(0,a.jsx)(n.default,{mode:"multiple",placeholder:c,onChange:e=>{t({servers:e.filter(e=>!g.includes(e)),accessGroups:e.filter(e=>g.includes(e))})},value:v,loading:x,className:i,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>{var r;return((null===(r=f.find(e=>e.value===(null==t?void 0:t.value)))||void 0===r?void 0:r.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:f.map(e=>(0,a.jsx)(n.default.Option,{value:e.value,label:e.label,children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,a.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,a.jsx)("span",{style:{flex:1},children:e.label}),(0,a.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})}},68473:function(e,t,r){var a=r(57437),s=r(2265),n=r(19250),l=r(92280),i=r(87908),o=r(61994),c=r(32489);t.Z=e=>{let{accessToken:t,selectedServers:r,toolPermissions:d,onChange:u,disabled:m=!1}=e,[g,p]=(0,s.useState)([]),[x,h]=(0,s.useState)({}),[f,v]=(0,s.useState)({}),[b,y]=(0,s.useState)({});(0,s.useEffect)(()=>{(async()=>{if(0===r.length){p([]);return}try{let e=await (0,n.fetchMCPServers)(t),a=(Array.isArray(e)?e:e.data||[]).filter(e=>r.includes(e.server_id));p(a)}catch(e){console.error("Error fetching MCP servers:",e),p([])}})()},[r,t]);let _=async e=>{v(t=>({...t,[e]:!0})),y(t=>({...t,[e]:""}));try{let r=await (0,n.listMCPTools)(t,e);r.error?(y(t=>({...t,[e]:r.message||"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))):h(t=>({...t,[e]:r.tools||[]}))}catch(t){console.error("Error fetching tools for server ".concat(e,":"),t),y(t=>({...t,[e]:"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))}finally{v(t=>({...t,[e]:!1}))}};(0,s.useEffect)(()=>{g.forEach(e=>{x[e.server_id]||f[e.server_id]||_(e.server_id)})},[g]);let j=(e,t)=>{let r=d[e]||[],a=r.includes(t)?r.filter(e=>e!==t):[...r,t];u({...d,[e]:a})},N=e=>{let t=x[e]||[];u({...d,[e]:t.map(e=>e.name)})},w=e=>{u({...d,[e]:[]})};return 0===r.length?null:(0,a.jsx)("div",{className:"space-y-4",children:g.map(e=>{let t=e.server_name||e.alias||e.server_id,r=x[e.server_id]||[],s=d[e.server_id]||[],n=f[e.server_id],u=b[e.server_id];return(0,a.jsxs)("div",{className:"border rounded-lg bg-gray-50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 border-b bg-white rounded-t-lg",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:t}),e.description&&(0,a.jsx)(l.x,{className:"text-sm text-gray-500",children:e.description})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>N(e.server_id),disabled:m||n,children:"Select All"}),(0,a.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>w(e.server_id),disabled:m||n,children:"Deselect All"}),(0,a.jsx)("button",{className:"text-gray-400 hover:text-gray-600",onClick:()=>{},children:(0,a.jsx)(c.Z,{className:"w-4 h-4"})})]})]}),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(l.x,{className:"text-sm font-medium text-gray-700 mb-3",children:"Available Tools"}),n&&(0,a.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,a.jsx)(i.Z,{size:"large"}),(0,a.jsx)(l.x,{className:"ml-3 text-gray-500",children:"Loading tools..."})]}),u&&!n&&(0,a.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-center",children:[(0,a.jsx)(l.x,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,a.jsx)(l.x,{className:"text-sm text-red-500 mt-1",children:u})]}),!n&&!u&&r.length>0&&(0,a.jsx)("div",{className:"space-y-2",children:r.map(t=>{let r=s.includes(t.name);return(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(o.Z,{checked:r,onChange:()=>j(e.server_id,t.name),disabled:m}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.x,{className:"font-medium text-gray-900",children:t.name}),(0,a.jsxs)(l.x,{className:"text-sm text-gray-500",children:["- ",t.description||"No description"]})]})})]},t.name)})}),!n&&!u&&0===r.length&&(0,a.jsx)("div",{className:"text-center py-6",children:(0,a.jsx)(l.x,{className:"text-gray-500",children:"No tools available"})})]})]},e.server_id)})})}},24199:function(e,t,r){r.d(t,{Z:function(){return n}});var a=r(57437);r(2265);var s=r(30150),n=e=>{let{step:t=.01,style:r={width:"100%"},placeholder:n="Enter a numerical value",min:l,max:i,onChange:o,...c}=e;return(0,a.jsx)(s.Z,{onWheel:e=>e.currentTarget.blur(),step:t,style:r,placeholder:n,min:l,max:i,onChange:o,...c})}},54507:function(e,t,r){r.d(t,{Z:function(){return v}});var a=r(57437);r(2265);var s=r(52787),n=r(89970),l=r(23496),i=r(15424),o=r(20831),c=r(12514),d=r(49566),u=r(91777),m=r(82182),g=r(22452),p=r(74998),x=r(97434),h=r(24199);let{Option:f}=s.default;var v=e=>{let{value:t=[],onChange:r,disabledCallbacks:v=[],onDisabledCallbacksChange:b}=e,y=Object.entries(x.Dg).filter(e=>{let[t,r]=e;return r.supports_key_team_logging}).map(e=>{let[t,r]=e;return t}),_=Object.keys(x.Dg),j=e=>{null==r||r(e)},N=e=>{j(t.filter((t,r)=>r!==e))},w=(e,r,a)=>{let s=[...t];if("callback_name"===r){let t=x.Lo[a]||a;s[e]={...s[e],[r]:t,callback_vars:{}}}else s[e]={...s[e],[r]:a};j(s)},k=(e,r,a)=>{let s=[...t];s[e]={...s[e],callback_vars:{...s[e].callback_vars,[r]:a}},j(s)},C=(e,t)=>{var r,s;if(!e.callback_name)return null;let l=null===(r=Object.entries(x.Lo).find(t=>{let[r,a]=t;return a===e.callback_name}))||void 0===r?void 0:r[0];if(!l)return null;let o=(null===(s=x.Dg[l])||void 0===s?void 0:s.dynamic_params)||{};return 0===Object.keys(o).length?null:(0,a.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,a.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(o).map(r=>{let[s,l]=r;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,a.jsx)("span",{children:s.replace(/_/g," ")}),(0,a.jsx)(n.Z,{title:"Environment variable reference recommended: os.environ/".concat(s.toUpperCase()),children:(0,a.jsx)(i.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===l&&(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"}),"number"===l&&(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Number"})]}),"number"===l&&(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"Value must be between 0 and 1"}),"number"===l?(0,a.jsx)(h.Z,{step:.01,width:400,placeholder:"os.environ/".concat(s.toUpperCase()),value:e.callback_vars[s]||"",onChange:e=>k(t,s,e.target.value)}):(0,a.jsx)(d.Z,{type:"password"===l?"password":"text",placeholder:"os.environ/".concat(s.toUpperCase()),value:e.callback_vars[s]||"",onChange:e=>k(t,s,e.target.value)})]},s)})})]})};return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"w-5 h-5 text-red-500"}),(0,a.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,a.jsx)(n.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,a.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,a.jsx)(s.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:v,onChange:e=>{let t=(0,x.Z3)(e);null==b||b(t)},style:{width:"100%"},optionLabelProp:"label",children:_.map(e=>{var t,r;let s=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,l=null===(r=x.Dg[e])||void 0===r?void 0:r.description;return(0,a.jsx)(f,{value:e,label:e,children:(0,a.jsx)(n.Z,{title:l,placement:"right",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,a.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let r=t.target,a=r.parentElement;if(a){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),a.replaceChild(t,r)}}}),(0,a.jsx)("span",{children:e})]})})},e)})}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,a.jsx)(l.Z,{}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(m.Z,{className:"w-5 h-5 text-blue-500"}),(0,a.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,a.jsx)(n.Z,{title:"Configure callback logging integrations for this team.",children:(0,a.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,a.jsx)(o.Z,{variant:"secondary",onClick:()=>{j([...t,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:g.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,a.jsx)("div",{className:"space-y-4",children:t.map((e,t)=>{var r,l;let i=e.callback_name?null===(r=Object.entries(x.Lo).find(t=>{let[r,a]=t;return a===e.callback_name}))||void 0===r?void 0:r[0]:void 0,d=i?null===(l=x.Dg[i])||void 0===l?void 0:l.logo:null;return(0,a.jsxs)(c.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[d&&(0,a.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}),(0,a.jsxs)("span",{className:"text-sm font-medium",children:[i||"New Integration"," Configuration"]})]}),(0,a.jsx)(o.Z,{variant:"light",onClick:()=>N(t),icon:p.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,a.jsx)(s.default,{value:i,placeholder:"Select integration",onChange:e=>w(t,"callback_name",e),className:"w-full",optionLabelProp:"label",children:y.map(e=>{var t,r;let s=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,l=null===(r=x.Dg[e])||void 0===r?void 0:r.description;return(0,a.jsx)(f,{value:e,label:e,children:(0,a.jsx)(n.Z,{title:l,placement:"right",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,a.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let r=t.target,a=r.parentElement;if(a){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),a.replaceChild(t,r)}}}),(0,a.jsx)("span",{children:e})]})})},e)})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,a.jsxs)(s.default,{value:e.callback_type,onChange:e=>w(t,"callback_type",e),className:"w-full",children:[(0,a.jsx)(f,{value:"success",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,a.jsx)("span",{children:"Success Only"})]})}),(0,a.jsx)(f,{value:"failure",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,a.jsx)("span",{children:"Failure Only"})]})}),(0,a.jsx)(f,{value:"success_and_failure",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,a.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),C(e,t)]})]},t)})}),0===t.length&&(0,a.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,a.jsx)(m.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,a.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,a.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})}},97415:function(e,t,r){var a=r(57437),s=r(2265),n=r(52787),l=r(19250);t.Z=e=>{let{onChange:t,value:r,className:i,accessToken:o,placeholder:c="Select vector stores",disabled:d=!1}=e,[u,m]=(0,s.useState)([]),[g,p]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(o){p(!0);try{let e=await (0,l.vectorStoreListCall)(o);e.data&&m(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{p(!1)}}})()},[o]),(0,a.jsx)("div",{children:(0,a.jsx)(n.default,{mode:"multiple",placeholder:c,onChange:t,value:r,loading:g,className:i,options:u.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})})}},59872:function(e,t,r){r.d(t,{nl:function(){return s},pw:function(){return n},vQ:function(){return l}});var a=r(9114);function s(e,t){let r=structuredClone(e);for(let[e,a]of Object.entries(t))e in r&&(r[e]=a);return r}let n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let a={minimumFractionDigits:t,maximumFractionDigits:t};if(!r)return e.toLocaleString("en-US",a);let s=Math.abs(e),n=s,l="";return s>=1e6?(n=s/1e6,l="M"):s>=1e3&&(n=s/1e3,l="K"),"".concat(e<0?"-":"").concat(n.toLocaleString("en-US",a)).concat(l)},l=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return i(e,t);try{return await navigator.clipboard.writeText(e),a.Z.success(t),!0}catch(r){return console.error("Clipboard API failed: ",r),i(e,t)}},i=(e,t)=>{try{let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.left="-999999px",r.style.top="-999999px",r.setAttribute("readonly",""),document.body.appendChild(r),r.focus(),r.select();let s=document.execCommand("copy");if(document.body.removeChild(r),s)return a.Z.success(t),!0;throw Error("execCommand failed")}catch(e){return a.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,t,r){r.d(t,{LQ:function(){return n},ZL:function(){return a},lo:function(){return s},tY:function(){return l}});let a=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],s=["Internal User","Internal Viewer"],n=["Internal User","Admin","proxy_admin"],l=e=>a.includes(e)}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/13b76428-e1bf383848c17260.js b/ui/litellm-dashboard/out/_next/static/chunks/13b76428-e1bf383848c17260.js deleted file mode 100644 index 76cea35732..0000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/13b76428-e1bf383848c17260.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6990],{77398:function(e,t,n){var s;e=n.nmd(e),s=function(){"use strict";function t(){return V.apply(null,arguments)}function n(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function r(e){var t;if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(t in e)if(i(e,t))return!1;return!0}function a(e){return void 0===e}function o(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function l(e,t){var n,s=[],i=e.length;for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}t.suppressDeprecationWarnings=!1,t.deprecationHandler=null,A=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)i(e,t)&&n.push(t);return n};var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,W=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,P={},R={};function C(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(R[e]=i),t&&(R[t[0]]=function(){return x(i.apply(this,arguments),t[1],t[2])}),n&&(R[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function U(e,t){return e.isValid()?(P[t=H(t,e.localeData())]=P[t]||function(e){var t,n,s,i=e.match(N);for(n=0,s=i.length;n=0&&W.test(e);)e=e.replace(W,s),W.lastIndex=0,n-=1;return e}var F={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function L(e){return"string"==typeof e?F[e]||F[e.toLowerCase()]:void 0}function E(e){var t,n,s={};for(n in e)i(e,n)&&(t=L(n))&&(s[t]=e[n]);return s}var V,G,A,I,j={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,B=/[+-]?\d{6}/,J=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,et=/[+-]?\d{1,6}/,en=/\d+/,es=/[+-]?\d+/,ei=/Z|[+-]\d\d:?\d\d/gi,er=/Z|[+-]\d\d(?::?\d\d)?/gi,ea=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,eo=/^[1-9]\d?/,eu=/^([1-9]\d|\d)/;function el(e,t,n){I[e]=O(t)?t:function(e,s){return e&&n?n:t}}function eh(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ed(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ec(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=ed(t)),n}I={};var ef={};function em(e,t){var n,s,i=t;for("string"==typeof e&&(e=[e]),o(t)&&(i=function(e,n){n[t]=ec(e)}),s=e.length,n=0;n68?1900:2e3)};var ew=ep("FullYear",!0);function ep(e,n){return function(s){return null!=s?(ek(this,e,s),t.updateOffset(this,n),this):ev(this,e)}}function ev(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function ek(e,t,n){var s,i,r,a;if(!(!e.isValid()||isNaN(n))){switch(s=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?s.setUTCMilliseconds(n):s.setMilliseconds(n));case"Seconds":return void(i?s.setUTCSeconds(n):s.setSeconds(n));case"Minutes":return void(i?s.setUTCMinutes(n):s.setMinutes(n));case"Hours":return void(i?s.setUTCHours(n):s.setHours(n));case"Date":return void(i?s.setUTCDate(n):s.setDate(n));case"FullYear":break;default:return}r=e.month(),a=29!==(a=e.date())||1!==r||ey(n)?a:28,i?s.setUTCFullYear(n,r,a):s.setFullYear(n,r,a)}}function eM(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=(t%12+12)%12;return e+=(t-n)/12,1===n?ey(e)?29:28:31-n%7%2}eA=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t=0?isFinite((o=new Date(e+400,t,n,s,i,r,a)).getFullYear())&&o.setFullYear(e):o=new Date(e,t,n,s,i,r,a),o}function eN(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,isFinite((t=new Date(Date.UTC.apply(null,n))).getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function eW(e,t,n){var s=7+t-n;return-((7+eN(e,0,s).getUTCDay()-t)%7)+s-1}function eP(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+eW(e,s,i);return o<=0?a=eg(r=e-1)+o:o>eg(e)?(r=e+1,a=o-eg(e)):(r=e,a=o),{year:r,dayOfYear:a}}function eR(e,t,n){var s,i,r=eW(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+eC(i=e.year()-1,t,n):a>eC(e.year(),t,n)?(s=a-eC(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function eC(e,t,n){var s=eW(e,t,n),i=eW(e+1,t,n);return(eg(e)-s+i)/7}function eU(e,t){return e.slice(t,7).concat(e.slice(0,t))}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),el("w",J,eo),el("ww",J,z),el("W",J,eo),el("WW",J,z),e_(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=ec(e)}),C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),el("d",J),el("e",J),el("E",J),el("dd",function(e,t){return t.weekdaysMinRegex(e)}),el("ddd",function(e,t){return t.weekdaysShortRegex(e)}),el("dddd",function(e,t){return t.weekdaysRegex(e)}),e_(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:c(n).invalidWeekday=e}),e_(["d","e","E"],function(e,t,n,s){t[s]=ec(e)});var eH="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");function eF(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(s=0,this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[];s<7;++s)r=d([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=eA.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=eA.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=eA.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=eA.call(this._weekdaysParse,a))||-1!==(i=eA.call(this._shortWeekdaysParse,a))?i:-1!==(i=eA.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=eA.call(this._shortWeekdaysParse,a))||-1!==(i=eA.call(this._weekdaysParse,a))?i:-1!==(i=eA.call(this._minWeekdaysParse,a))?i:null:-1!==(i=eA.call(this._minWeekdaysParse,a))||-1!==(i=eA.call(this._weekdaysParse,a))?i:-1!==(i=eA.call(this._shortWeekdaysParse,a))?i:null}function eL(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=d([2e3,1]).day(t),s=eh(this.weekdaysMin(n,"")),i=eh(this.weekdaysShort(n,"")),r=eh(this.weekdays(n,"")),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);a.sort(e),o.sort(e),u.sort(e),l.sort(e),this._weekdaysRegex=RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=RegExp("^("+a.join("|")+")","i")}function eE(){return this.hours()%12||12}function eV(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function eG(e,t){return t._meridiemParse}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,eE),C("k",["kk",2],0,function(){return this.hours()||24}),C("hmm",0,0,function(){return""+eE.apply(this)+x(this.minutes(),2)}),C("hmmss",0,0,function(){return""+eE.apply(this)+x(this.minutes(),2)+x(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+x(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+x(this.minutes(),2)+x(this.seconds(),2)}),eV("a",!0),eV("A",!1),el("a",eG),el("A",eG),el("H",J,eu),el("h",J,eo),el("k",J,eo),el("HH",J,z),el("hh",J,z),el("kk",J,z),el("hmm",Q),el("hmmss",X),el("Hmm",Q),el("Hmmss",X),em(["H","HH"],3),em(["k","kk"],function(e,t,n){var s=ec(e);t[3]=24===s?0:s}),em(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),em(["h","hh"],function(e,t,n){t[3]=ec(e),c(n).bigHour=!0}),em("hmm",function(e,t,n){var s=e.length-2;t[3]=ec(e.substr(0,s)),t[4]=ec(e.substr(s)),c(n).bigHour=!0}),em("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[3]=ec(e.substr(0,s)),t[4]=ec(e.substr(s,2)),t[5]=ec(e.substr(i)),c(n).bigHour=!0}),em("Hmm",function(e,t,n){var s=e.length-2;t[3]=ec(e.substr(0,s)),t[4]=ec(e.substr(s))}),em("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[3]=ec(e.substr(0,s)),t[4]=ec(e.substr(s,2)),t[5]=ec(e.substr(i))});var eA,eI,ej=ep("Hours",!0),eZ={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:eD,week:{dow:0,doy:6},weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysShort:eH,meridiemParse:/[ap]\.?m?\.?/i},ez={},e$={};function eq(e){return e?e.toLowerCase().replace("_","-"):e}function eB(t){var n=null;if(void 0===ez[t]&&e&&e.exports&&t&&t.match("^[^/\\\\]*$"))try{n=eI._abbr,function(){var e=Error("Cannot find module 'undefined'");throw e.code="MODULE_NOT_FOUND",e}(),eJ(n)}catch(e){ez[t]=null}return ez[t]}function eJ(e,t){var n;return e&&((n=a(t)?eX(e):eQ(e,t))?eI=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),eI._abbr}function eQ(e,t){if(null===t)return delete ez[e],null;var n,s=eZ;if(t.abbr=e,null!=ez[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=ez[e]._config;else if(null!=t.parentLocale){if(null!=ez[t.parentLocale])s=ez[t.parentLocale]._config;else{if(null==(n=eB(t.parentLocale)))return e$[t.parentLocale]||(e$[t.parentLocale]=[]),e$[t.parentLocale].push({name:e,config:t}),null;s=n._config}}return ez[e]=new T(b(s,t)),e$[e]&&e$[e].forEach(function(e){eQ(e.name,e.config)}),eJ(e),ez[e]}function eX(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return eI;if(!n(e)){if(t=eB(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r0;){if(s=eB(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&function(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n=t-1)break;t--}r++}return eI}(e)}function eK(e){var t,n=e._a;return n&&-2===c(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>eM(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,c(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),c(e)._overflowWeeks&&-1===t&&(t=7),c(e)._overflowWeekday&&-1===t&&(t=8),c(e).overflow=t),e}var e0=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,e1=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,e2=/Z|[+-]\d\d(?::?\d\d)?/,e4=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],e6=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],e3=/^\/?Date\((-?\d+)/i,e5=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,e7={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function e9(e){var t,n,s,i,r,a,o=e._i,u=e0.exec(o)||e1.exec(o),l=e4.length,h=e6.length;if(u){for(t=0,c(e).iso=!0,n=l;t7)&&(l=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,h=eR(tr(),a,o),s=te(n.gg,e._a[0],h.year),i=te(n.w,h.week),null!=n.d?((r=n.d)<0||r>6)&&(l=!0):null!=n.e?(r=n.e+a,(n.e<0||n.e>6)&&(l=!0)):r=a),i<1||i>eC(s,a,o)?c(e)._overflowWeeks=!0:null!=l?c(e)._overflowWeekday=!0:(u=eP(s,i,r,a,o),e._a[0]=u.year,e._dayOfYear=u.dayOfYear)),null!=e._dayOfYear&&(g=te(e._a[0],_[0]),(e._dayOfYear>eg(g)||0===e._dayOfYear)&&(c(e)._overflowDayOfYear=!0),m=eN(g,0,e._dayOfYear),e._a[1]=m.getUTCMonth(),e._a[2]=m.getUTCDate()),f=0;f<3&&null==e._a[f];++f)e._a[f]=w[f]=_[f];for(;f<7;f++)e._a[f]=w[f]=null==e._a[f]?2===f?1:0:e._a[f];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?eN:ex).apply(null,w),y=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==y&&(c(e).weekdayMismatch=!0)}}function tn(e){if(e._f===t.ISO_8601){e9(e);return}if(e._f===t.RFC_2822){e8(e);return}e._a=[],c(e).empty=!0;var n,s,r,a,o,u,l,h,d,f,m,_=""+e._i,y=_.length,g=0;for(o=0,m=(l=H(e._f,e._locale).match(N)||[]).length;o0&&c(e).unusedInput.push(d),_=_.slice(_.indexOf(u)+u.length),g+=u.length),R[h])?(u?c(e).empty=!1:c(e).unusedTokens.push(h),null!=u&&i(ef,h)&&ef[h](u,e._a,e,h)):e._strict&&!u&&c(e).unusedTokens.push(h);c(e).charsLeftOver=y-g,_.length>0&&c(e).unusedInput.push(_),e._a[3]<=12&&!0===c(e).bigHour&&e._a[3]>0&&(c(e).bigHour=void 0),c(e).parsedDateParts=e._a.slice(0),c(e).meridiem=e._meridiem,e._a[3]=(n=e._locale,s=e._a[3],null==(r=e._meridiem)?s:null!=n.meridiemHour?n.meridiemHour(s,r):(null!=n.isPM&&((a=n.isPM(r))&&s<12&&(s+=12),a||12!==s||(s=0)),s)),null!==(f=c(e).era)&&(e._a[0]=e._locale.erasConvertYear(f,e._a[0])),tt(e),eK(e)}function ts(e){var i,r=e._i,d=e._f;return(e._locale=e._locale||eX(e._l),null===r||void 0===d&&""===r)?m({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),k(r))?new v(eK(r)):(u(r)?e._d=r:n(d)?function(e){var t,n,s,i,r,a,o=!1,u=e._f.length;if(0===u){c(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;ithis?this:e:m()});function tu(e,t){var s,i;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return tr();for(i=1,s=t[0];i=0?new Date(e+400,t,n)-126227808e5:new Date(e,t,n).valueOf()}function tC(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-126227808e5:Date.UTC(e,t,n)}function tU(e,t){return t.erasAbbrRegex(e)}function tH(){var e,t,n,s,i,r=[],a=[],o=[],u=[],l=this.eras();for(e=0,t=l.length;e(r=eC(e,s,i))&&(t=r),tE.call(this,e,t,n,s,i))}function tE(e,t,n,s,i){var r=eP(e,t,n,s,i),a=eN(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}C("N",0,0,"eraAbbr"),C("NN",0,0,"eraAbbr"),C("NNN",0,0,"eraAbbr"),C("NNNN",0,0,"eraName"),C("NNNNN",0,0,"eraNarrow"),C("y",["y",1],"yo","eraYear"),C("y",["yy",2],0,"eraYear"),C("y",["yyy",3],0,"eraYear"),C("y",["yyyy",4],0,"eraYear"),el("N",tU),el("NN",tU),el("NNN",tU),el("NNNN",function(e,t){return t.erasNameRegex(e)}),el("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),em(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var i=n._locale.erasParse(e,s,n._strict);i?c(n).era=i:c(n).invalidEra=e}),el("y",en),el("yy",en),el("yyy",en),el("yyyy",en),el("yo",function(e,t){return t._eraYearOrdinalRegex||en}),em(["y","yy","yyy","yyyy"],0),em(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[0]=n._locale.eraYearOrdinalParse(e,i):t[0]=parseInt(e,10)}),C(0,["gg",2],0,function(){return this.weekYear()%100}),C(0,["GG",2],0,function(){return this.isoWeekYear()%100}),tF("gggg","weekYear"),tF("ggggg","weekYear"),tF("GGGG","isoWeekYear"),tF("GGGGG","isoWeekYear"),el("G",es),el("g",es),el("GG",J,z),el("gg",J,z),el("GGGG",ee,q),el("gggg",ee,q),el("GGGGG",et,B),el("ggggg",et,B),e_(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=ec(e)}),e_(["gg","GG"],function(e,n,s,i){n[i]=t.parseTwoDigitYear(e)}),C("Q",0,"Qo","quarter"),el("Q",Z),em("Q",function(e,t){t[1]=(ec(e)-1)*3}),C("D",["DD",2],"Do","date"),el("D",J,eo),el("DD",J,z),el("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),em(["D","DD"],2),em("Do",function(e,t){t[2]=ec(e.match(J)[0])});var tV=ep("Date",!0);C("DDD",["DDDD",3],"DDDo","dayOfYear"),el("DDD",K),el("DDDD",$),em(["DDD","DDDD"],function(e,t,n){n._dayOfYear=ec(e)}),C("m",["mm",2],0,"minute"),el("m",J,eu),el("mm",J,z),em(["m","mm"],4);var tG=ep("Minutes",!1);C("s",["ss",2],0,"second"),el("s",J,eu),el("ss",J,z),em(["s","ss"],5);var tA=ep("Seconds",!1);for(C("S",0,0,function(){return~~(this.millisecond()/100)}),C(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),C(0,["SSS",3],0,"millisecond"),C(0,["SSSS",4],0,function(){return 10*this.millisecond()}),C(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),C(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),C(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),C(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),C(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),el("S",K,Z),el("SS",K,z),el("SSS",K,$),_="SSSS";_.length<=9;_+="S")el(_,en);function tI(e,t){t[6]=ec(("0."+e)*1e3)}for(_="S";_.length<=9;_+="S")em(_,tI);y=ep("Milliseconds",!1),C("z",0,0,"zoneAbbr"),C("zz",0,0,"zoneName");var tj=v.prototype;function tZ(e){return e}tj.add=tO,tj.calendar=function(e,a){if(1==arguments.length){if(arguments[0]){var l,h,d;(l=arguments[0],k(l)||u(l)||tT(l)||o(l)||(h=n(l),d=!1,h&&(d=0===l.filter(function(e){return!o(e)&&tT(l)}).length),h&&d)||function(e){var t,n,a=s(e)&&!r(e),o=!1,u=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],l=u.length;for(t=0;tn.valueOf():n.valueOf()n.year()||n.year()>9999?U(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+6e4*this.utcOffset()).toISOString().replace("Z",U(n,"Z")):U(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},tj.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,s,i="moment",r="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+i+'("]',t=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",s=r+'[")]',this.format(e+t+n+s)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(tj[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),tj.toJSON=function(){return this.isValid()?this.toISOString():null},tj.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},tj.unix=function(){return Math.floor(this.valueOf()/1e3)},tj.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},tj.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},tj.eraName=function(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;eMath.abs(e)&&!s&&(e*=60);return!this._isUTC&&n&&(i=tg(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),r===e||(!n||this._changeInProgress?tS(this,tk(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this},tj.utc=function(e){return this.utcOffset(0,e)},tj.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(tg(this),"m")),this},tj.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=t_(ei,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},tj.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?tr(e).utcOffset():0,(this.utcOffset()-e)%60==0)},tj.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},tj.isLocal=function(){return!!this.isValid()&&!this._isUTC},tj.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},tj.isUtc=tw,tj.isUTC=tw,tj.zoneAbbr=function(){return this._isUTC?"UTC":""},tj.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},tj.dates=D("dates accessor is deprecated. Use date instead.",tV),tj.months=D("months accessor is deprecated. Use month instead",eb),tj.years=D("years accessor is deprecated. Use year instead",ew),tj.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),tj.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e,t={};return p(t,this),(t=ts(t))._a?(e=t._isUTC?d(t._a):tr(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s0):this._isDSTShifted=!1,this._isDSTShifted});var tz=T.prototype;function t$(e,t,n,s){var i=eX(),r=d().set(s,t);return i[n](r,e)}function tq(e,t,n){if(o(e)&&(t=e,e=void 0),e=e||"",null!=t)return t$(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=t$(e,s,n,"month");return i}function tB(e,t,n,s){"boolean"==typeof e||(n=t=e,e=!1),o(t)&&(n=t,t=void 0),t=t||"";var i,r=eX(),a=e?r._week.dow:0,u=[];if(null!=n)return t$(t,(n+a)%7,s,"day");for(i=0;i<7;i++)u[i]=t$(t,(i+a)%7,s,"day");return u}tz.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return O(s)?s.call(t,n):s},tz.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(N).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},tz.invalidDate=function(){return this._invalidDate},tz.ordinal=function(e){return this._ordinal.replace("%d",e)},tz.preparse=tZ,tz.postformat=tZ,tz.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return O(i)?i(e,t,n,s):i.replace(/%d/i,e)},tz.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return O(n)?n(t):n.replace(/%s/i,t)},tz.set=function(e){var t,n;for(n in e)i(e,n)&&(O(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},tz.eras=function(e,n){var s,i,r,a=this._eras||eX("en")._eras;for(s=0,i=a.length;s=0)return u[s]},tz.erasConvertYear=function(e,n){var s=e.since<=e.until?1:-1;return void 0===n?t(e.since).year():t(e.since).year()+(n-e.offset)*s},tz.erasAbbrRegex=function(e){return i(this,"_erasAbbrRegex")||tH.call(this),e?this._erasAbbrRegex:this._erasRegex},tz.erasNameRegex=function(e){return i(this,"_erasNameRegex")||tH.call(this),e?this._erasNameRegex:this._erasRegex},tz.erasNarrowRegex=function(e){return i(this,"_erasNarrowRegex")||tH.call(this),e?this._erasNarrowRegex:this._erasRegex},tz.months=function(e,t){return e?n(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||eY).test(t)?"format":"standalone"][e.month()]:n(this._months)?this._months:this._months.standalone},tz.monthsShort=function(e,t){return e?n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[eY.test(t)?"format":"standalone"][e.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},tz.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return eS.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++)if(i=d([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e)||n&&"MMM"===t&&this._shortMonthsParse[s].test(e)||!n&&this._monthsParse[s].test(e))return s},tz.monthsRegex=function(e){return this._monthsParseExact?(i(this,"_monthsRegex")||eT.call(this),e)?this._monthsStrictRegex:this._monthsRegex:(i(this,"_monthsRegex")||(this._monthsRegex=ea),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},tz.monthsShortRegex=function(e){return this._monthsParseExact?(i(this,"_monthsRegex")||eT.call(this),e)?this._monthsShortStrictRegex:this._monthsShortRegex:(i(this,"_monthsShortRegex")||(this._monthsShortRegex=ea),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},tz.week=function(e){return eR(e,this._week.dow,this._week.doy).week},tz.firstDayOfYear=function(){return this._week.doy},tz.firstDayOfWeek=function(){return this._week.dow},tz.weekdays=function(e,t){var s=n(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?eU(s,this._week.dow):e?s[e.day()]:s},tz.weekdaysMin=function(e){return!0===e?eU(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},tz.weekdaysShort=function(e){return!0===e?eU(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},tz.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return eF.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=d([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e)||n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},tz.weekdaysRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||eL.call(this),e)?this._weekdaysStrictRegex:this._weekdaysRegex:(i(this,"_weekdaysRegex")||(this._weekdaysRegex=ea),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},tz.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||eL.call(this),e)?this._weekdaysShortStrictRegex:this._weekdaysShortRegex:(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ea),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},tz.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||eL.call(this),e)?this._weekdaysMinStrictRegex:this._weekdaysMinRegex:(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ea),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},tz.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},tz.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},eJ("en",{eras:[{since:"0001-01-01",until:Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===ec(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),t.lang=D("moment.lang is deprecated. Use moment.locale instead.",eJ),t.langData=D("moment.langData is deprecated. Use moment.localeData instead.",eX);var tJ=Math.abs;function tQ(e,t,n,s){var i=tk(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function tX(e){return e<0?Math.floor(e):Math.ceil(e)}function tK(e){return 4800*e/146097}function t0(e){return 146097*e/4800}function t1(e){return function(){return this.as(e)}}var t2=t1("ms"),t4=t1("s"),t6=t1("m"),t3=t1("h"),t5=t1("d"),t7=t1("w"),t9=t1("M"),t8=t1("Q"),ne=t1("y");function nt(e){return function(){return this.isValid()?this._data[e]:NaN}}var nn=nt("milliseconds"),ns=nt("seconds"),ni=nt("minutes"),nr=nt("hours"),na=nt("days"),no=nt("months"),nu=nt("years"),nl=Math.round,nh={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function nd(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}var nc=Math.abs;function nf(e){return(e>0)-(e<0)||+e}function nm(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,s,i,r,a,o,u=nc(this._milliseconds)/1e3,l=nc(this._days),h=nc(this._months),d=this.asSeconds();return d?(e=ed(u/60),t=ed(e/60),u%=60,e%=60,n=ed(h/12),h%=12,s=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",r=nf(this._months)!==nf(d)?"-":"",a=nf(this._days)!==nf(d)?"-":"",o=nf(this._milliseconds)!==nf(d)?"-":"",i+"P"+(n?r+n+"Y":"")+(h?r+h+"M":"")+(l?a+l+"D":"")+(t||e||u?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(u?o+s+"S":"")):"P0D"}var n_=th.prototype;return n_.isValid=function(){return this._isValid},n_.abs=function(){var e=this._data;return this._milliseconds=tJ(this._milliseconds),this._days=tJ(this._days),this._months=tJ(this._months),e.milliseconds=tJ(e.milliseconds),e.seconds=tJ(e.seconds),e.minutes=tJ(e.minutes),e.hours=tJ(e.hours),e.months=tJ(e.months),e.years=tJ(e.years),this},n_.add=function(e,t){return tQ(this,e,t,1)},n_.subtract=function(e,t){return tQ(this,e,t,-1)},n_.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=L(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+tK(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(t0(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw Error("Unknown unit "+e)}},n_.asMilliseconds=t2,n_.asSeconds=t4,n_.asMinutes=t6,n_.asHours=t3,n_.asDays=t5,n_.asWeeks=t7,n_.asMonths=t9,n_.asQuarters=t8,n_.asYears=ne,n_.valueOf=t2,n_._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*tX(t0(o)+a),a=0,o=0),u.milliseconds=r%1e3,e=ed(r/1e3),u.seconds=e%60,t=ed(e/60),u.minutes=t%60,n=ed(t/60),u.hours=n%24,a+=ed(n/24),o+=i=ed(tK(a)),a-=tX(t0(i)),s=ed(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},n_.clone=function(){return tk(this)},n_.get=function(e){return e=L(e),this.isValid()?this[e+"s"]():NaN},n_.milliseconds=nn,n_.seconds=ns,n_.minutes=ni,n_.hours=nr,n_.days=na,n_.weeks=function(){return ed(this.days()/7)},n_.months=no,n_.years=nu,n_.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,s,i,r,a,o,u,l,h,d,c,f,m,_=!1,y=nh;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(_=e),"object"==typeof t&&(y=Object.assign({},nh,t),null!=t.s&&null==t.ss&&(y.ss=t.s-1)),f=this.localeData(),n=!_,s=y,i=tk(this).abs(),r=nl(i.as("s")),a=nl(i.as("m")),o=nl(i.as("h")),u=nl(i.as("d")),l=nl(i.as("M")),h=nl(i.as("w")),d=nl(i.as("y")),c=r<=s.ss&&["s",r]||r0,c[4]=f,m=nd.apply(null,c),_&&(m=f.pastFuture(+this,m)),f.postformat(m)},n_.toISOString=nm,n_.toString=nm,n_.toJSON=nm,n_.locale=tN,n_.localeData=tP,n_.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",nm),n_.lang=tW,C("X",0,0,"unix"),C("x",0,0,"valueOf"),el("x",es),el("X",/[+-]?\d+(\.\d{1,3})?/),em("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),em("x",function(e,t,n){n._d=new Date(ec(e))}),t.version="2.30.1",V=tr,t.fn=tj,t.min=function(){var e=[].slice.call(arguments,0);return tu("isBefore",e)},t.max=function(){var e=[].slice.call(arguments,0);return tu("isAfter",e)},t.now=function(){return Date.now?Date.now():+new Date},t.utc=d,t.unix=function(e){return tr(1e3*e)},t.months=function(e,t){return tq(e,t,"months")},t.isDate=u,t.locale=eJ,t.invalid=m,t.duration=tk,t.isMoment=k,t.weekdays=function(e,t,n){return tB(e,t,n,"weekdays")},t.parseZone=function(){return tr.apply(null,arguments).parseZone()},t.localeData=eX,t.isDuration=td,t.monthsShort=function(e,t){return tq(e,t,"monthsShort")},t.weekdaysMin=function(e,t,n){return tB(e,t,n,"weekdaysMin")},t.defineLocale=eQ,t.updateLocale=function(e,t){if(null!=t){var n,s,i=eZ;null!=ez[e]&&null!=ez[e].parentLocale?ez[e].set(b(ez[e]._config,t)):(null!=(s=eB(e))&&(i=s._config),t=b(i,t),null==s&&(t.abbr=e),(n=new T(t)).parentLocale=ez[e],ez[e]=n),eJ(e)}else null!=ez[e]&&(null!=ez[e].parentLocale?(ez[e]=ez[e].parentLocale,e===eJ()&&eJ(e)):null!=ez[e]&&delete ez[e]);return ez[e]},t.locales=function(){return A(ez)},t.weekdaysShort=function(e,t,n){return tB(e,t,n,"weekdaysShort")},t.normalizeUnits=L,t.relativeTimeRounding=function(e){return void 0===e?nl:"function"==typeof e&&(nl=e,!0)},t.relativeTimeThreshold=function(e,t){return void 0!==nh[e]&&(void 0===t?nh[e]:(nh[e]=t,"s"===e&&(nh.ss=t-1),!0))},t.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},t.prototype=tj,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t},e.exports=s()}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/1487-ada9ecf7dd9bca97.js b/ui/litellm-dashboard/out/_next/static/chunks/1487-ada9ecf7dd9bca97.js deleted file mode 100644 index dddce2ff9a..0000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/1487-ada9ecf7dd9bca97.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1487],{21487:function(e,t,n){let r,o,a;n.d(t,{Z:function(){return nU}});var i,l,u,s,d=n(5853),c=n(2265),f=n(54887),m=n(13323),v=n(64518),h=n(96822),p=n(40048),g=n(72238),b=n(93689);let y=(0,c.createContext)(!1);var w=n(61424),x=n(27847);let k=c.Fragment,M=c.Fragment,C=(0,c.createContext)(null),D=(0,c.createContext)(null);Object.assign((0,x.yV)(function(e,t){var n;let r,o,a=(0,c.useRef)(null),i=(0,b.T)((0,b.h)(e=>{a.current=e}),t),l=(0,p.i)(a),u=function(e){let t=(0,c.useContext)(y),n=(0,c.useContext)(C),r=(0,p.i)(e),[o,a]=(0,c.useState)(()=>{if(!t&&null!==n||w.O.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return(0,c.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),(0,c.useEffect)(()=>{t||null!==n&&a(n.current)},[n,a,t]),o}(a),[s]=(0,c.useState)(()=>{var e;return w.O.isServer?null:null!=(e=null==l?void 0:l.createElement("div"))?e:null}),d=(0,c.useContext)(D),M=(0,g.H)();return(0,v.e)(()=>{!u||!s||u.contains(s)||(s.setAttribute("data-headlessui-portal",""),u.appendChild(s))},[u,s]),(0,v.e)(()=>{if(s&&d)return d.register(s)},[d,s]),n=()=>{var e;u&&s&&(s instanceof Node&&u.contains(s)&&u.removeChild(s),u.childNodes.length<=0&&(null==(e=u.parentElement)||e.removeChild(u)))},r=(0,m.z)(n),o=(0,c.useRef)(!1),(0,c.useEffect)(()=>(o.current=!1,()=>{o.current=!0,(0,h.Y)(()=>{o.current&&r()})}),[r]),M&&u&&s?(0,f.createPortal)((0,x.sY)({ourProps:{ref:i},theirProps:e,defaultTag:k,name:"Portal"}),s):null}),{Group:(0,x.yV)(function(e,t){let{target:n,...r}=e,o={ref:(0,b.T)(t)};return c.createElement(C.Provider,{value:n},(0,x.sY)({ourProps:o,theirProps:r,defaultTag:M,name:"Popover.Group"}))})});var T=n(31948),N=n(17684),P=n(32539),E=n(80004),S=n(38198),_=n(3141),j=((r=j||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function O(){let e=(0,c.useRef)(0);return(0,_.s)("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}var Z=n(37863),L=n(47634),Y=n(37105),F=n(24536),W=n(40293),R=n(37388),I=((o=I||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),U=((a=U||{})[a.TogglePopover=0]="TogglePopover",a[a.ClosePopover=1]="ClosePopover",a[a.SetButton=2]="SetButton",a[a.SetButtonId=3]="SetButtonId",a[a.SetPanel=4]="SetPanel",a[a.SetPanelId=5]="SetPanelId",a);let H={0:e=>{let t={...e,popoverState:(0,F.E)(e.popoverState,{0:1,1:0})};return 0===t.popoverState&&(t.__demoMode=!1),t},1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},B=(0,c.createContext)(null);function z(e){let t=(0,c.useContext)(B);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,z),t}return t}B.displayName="PopoverContext";let A=(0,c.createContext)(null);function q(e){let t=(0,c.useContext)(A);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,q),t}return t}A.displayName="PopoverAPIContext";let V=(0,c.createContext)(null);function G(){return(0,c.useContext)(V)}V.displayName="PopoverGroupContext";let X=(0,c.createContext)(null);function K(e,t){return(0,F.E)(t.type,H,e,t)}X.displayName="PopoverPanelContext";let Q=x.AN.RenderStrategy|x.AN.Static,J=x.AN.RenderStrategy|x.AN.Static,$=Object.assign((0,x.yV)(function(e,t){var n,r,o,a;let i,l,u,s,d,f;let{__demoMode:v=!1,...h}=e,g=(0,c.useRef)(null),y=(0,b.T)(t,(0,b.h)(e=>{g.current=e})),w=(0,c.useRef)([]),k=(0,c.useReducer)(K,{__demoMode:v,popoverState:v?0:1,buttons:w,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:(0,c.createRef)(),afterPanelSentinel:(0,c.createRef)()}),[{popoverState:M,button:C,buttonId:N,panel:E,panelId:_,beforePanelSentinel:j,afterPanelSentinel:O},L]=k,W=(0,p.i)(null!=(n=g.current)?n:C),R=(0,c.useMemo)(()=>{if(!C||!E)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(C))^Number(null==e?void 0:e.contains(E)))return!0;let e=(0,Y.GO)(),t=e.indexOf(C),n=(t+e.length-1)%e.length,r=(t+1)%e.length,o=e[n],a=e[r];return!E.contains(o)&&!E.contains(a)},[C,E]),I=(0,T.E)(N),U=(0,T.E)(_),H=(0,c.useMemo)(()=>({buttonId:I,panelId:U,close:()=>L({type:1})}),[I,U,L]),z=G(),q=null==z?void 0:z.registerPopover,V=(0,m.z)(()=>{var e;return null!=(e=null==z?void 0:z.isFocusWithinPopoverGroup())?e:(null==W?void 0:W.activeElement)&&((null==C?void 0:C.contains(W.activeElement))||(null==E?void 0:E.contains(W.activeElement)))});(0,c.useEffect)(()=>null==q?void 0:q(H),[q,H]);let[Q,J]=(i=(0,c.useContext)(D),l=(0,c.useRef)([]),u=(0,m.z)(e=>(l.current.push(e),i&&i.register(e),()=>s(e))),s=(0,m.z)(e=>{let t=l.current.indexOf(e);-1!==t&&l.current.splice(t,1),i&&i.unregister(e)}),d=(0,c.useMemo)(()=>({register:u,unregister:s,portals:l}),[u,s,l]),[l,(0,c.useMemo)(()=>function(e){let{children:t}=e;return c.createElement(D.Provider,{value:d},t)},[d])]),$=function(){var e;let{defaultContainers:t=[],portals:n,mainTreeNodeRef:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(0,c.useRef)(null!=(e=null==r?void 0:r.current)?e:null),a=(0,p.i)(o),i=(0,m.z)(()=>{var e,r,i;let l=[];for(let e of t)null!==e&&(e instanceof HTMLElement?l.push(e):"current"in e&&e.current instanceof HTMLElement&&l.push(e.current));if(null!=n&&n.current)for(let e of n.current)l.push(e);for(let t of null!=(e=null==a?void 0:a.querySelectorAll("html > *, body > *"))?e:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(o.current)||t.contains(null==(i=null==(r=o.current)?void 0:r.getRootNode())?void 0:i.host)||l.some(e=>t.contains(e))||l.push(t));return l});return{resolveContainers:i,contains:(0,m.z)(e=>i().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:(0,c.useMemo)(()=>function(){return null!=r?null:c.createElement(S._,{features:S.A.Hidden,ref:o})},[o,r])}}({mainTreeNodeRef:null==z?void 0:z.mainTreeNodeRef,portals:Q,defaultContainers:[C,E]});r=null==W?void 0:W.defaultView,o="focus",a=e=>{var t,n,r,o;e.target!==window&&e.target instanceof HTMLElement&&0===M&&(V()||C&&E&&($.contains(e.target)||null!=(n=null==(t=j.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(o=null==(r=O.current)?void 0:r.contains)&&o.call(r,e.target)||L({type:1})))},f=(0,T.E)(a),(0,c.useEffect)(()=>{function e(e){f.current(e)}return(r=null!=r?r:window).addEventListener(o,e,!0),()=>r.removeEventListener(o,e,!0)},[r,o,!0]),(0,P.O)($.resolveContainers,(e,t)=>{L({type:1}),(0,Y.sP)(t,Y.tJ.Loose)||(e.preventDefault(),null==C||C.focus())},0===M);let ee=(0,m.z)(e=>{L({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:C:C;null==t||t.focus()}),et=(0,c.useMemo)(()=>({close:ee,isPortalled:R}),[ee,R]),en=(0,c.useMemo)(()=>({open:0===M,close:ee}),[M,ee]);return c.createElement(X.Provider,{value:null},c.createElement(B.Provider,{value:k},c.createElement(A.Provider,{value:et},c.createElement(Z.up,{value:(0,F.E)(M,{0:Z.ZM.Open,1:Z.ZM.Closed})},c.createElement(J,null,(0,x.sY)({ourProps:{ref:y},theirProps:h,slot:en,defaultTag:"div",name:"Popover"}),c.createElement($.MainTreeNode,null))))))}),{Button:(0,x.yV)(function(e,t){let n=(0,N.M)(),{id:r="headlessui-popover-button-".concat(n),...o}=e,[a,i]=z("Popover.Button"),{isPortalled:l}=q("Popover.Button"),u=(0,c.useRef)(null),s="headlessui-focus-sentinel-".concat((0,N.M)()),d=G(),f=null==d?void 0:d.closeOthers,v=null!==(0,c.useContext)(X);(0,c.useEffect)(()=>{if(!v)return i({type:3,buttonId:r}),()=>{i({type:3,buttonId:null})}},[v,r,i]);let[h]=(0,c.useState)(()=>Symbol()),g=(0,b.T)(u,t,v?null:e=>{if(e)a.buttons.current.push(h);else{let e=a.buttons.current.indexOf(h);-1!==e&&a.buttons.current.splice(e,1)}a.buttons.current.length>1&&console.warn("You are already using a but only 1 is supported."),e&&i({type:2,button:e})}),y=(0,b.T)(u,t),w=(0,p.i)(u),k=(0,m.z)(e=>{var t,n,r;if(v){if(1===a.popoverState)return;switch(e.key){case R.R.Space:case R.R.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),i({type:1}),null==(r=a.button)||r.focus()}}else switch(e.key){case R.R.Space:case R.R.Enter:e.preventDefault(),e.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0});break;case R.R.Escape:if(0!==a.popoverState)return null==f?void 0:f(a.buttonId);if(!u.current||null!=w&&w.activeElement&&!u.current.contains(w.activeElement))return;e.preventDefault(),e.stopPropagation(),i({type:1})}}),M=(0,m.z)(e=>{v||e.key===R.R.Space&&e.preventDefault()}),C=(0,m.z)(t=>{var n,r;(0,L.P)(t.currentTarget)||e.disabled||(v?(i({type:1}),null==(n=a.button)||n.focus()):(t.preventDefault(),t.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0}),null==(r=a.button)||r.focus()))}),D=(0,m.z)(e=>{e.preventDefault(),e.stopPropagation()}),T=0===a.popoverState,P=(0,c.useMemo)(()=>({open:T}),[T]),_=(0,E.f)(e,u),Z=v?{ref:y,type:_,onKeyDown:k,onClick:C}:{ref:g,id:a.buttonId,type:_,"aria-expanded":0===a.popoverState,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:k,onKeyUp:M,onClick:C,onMouseDown:D},W=O(),I=(0,m.z)(()=>{let e=a.panel;e&&(0,F.E)(W.current,{[j.Forwards]:()=>(0,Y.jA)(e,Y.TO.First),[j.Backwards]:()=>(0,Y.jA)(e,Y.TO.Last)})===Y.fE.Error&&(0,Y.jA)((0,Y.GO)().filter(e=>"true"!==e.dataset.headlessuiFocusGuard),(0,F.E)(W.current,{[j.Forwards]:Y.TO.Next,[j.Backwards]:Y.TO.Previous}),{relativeTo:a.button})});return c.createElement(c.Fragment,null,(0,x.sY)({ourProps:Z,theirProps:o,slot:P,defaultTag:"button",name:"Popover.Button"}),T&&!v&&l&&c.createElement(S._,{id:s,features:S.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:I}))}),Overlay:(0,x.yV)(function(e,t){let n=(0,N.M)(),{id:r="headlessui-popover-overlay-".concat(n),...o}=e,[{popoverState:a},i]=z("Popover.Overlay"),l=(0,b.T)(t),u=(0,Z.oJ)(),s=null!==u?(u&Z.ZM.Open)===Z.ZM.Open:0===a,d=(0,m.z)(e=>{if((0,L.P)(e.currentTarget))return e.preventDefault();i({type:1})}),f=(0,c.useMemo)(()=>({open:0===a}),[a]);return(0,x.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0,onClick:d},theirProps:o,slot:f,defaultTag:"div",features:Q,visible:s,name:"Popover.Overlay"})}),Panel:(0,x.yV)(function(e,t){let n=(0,N.M)(),{id:r="headlessui-popover-panel-".concat(n),focus:o=!1,...a}=e,[i,l]=z("Popover.Panel"),{close:u,isPortalled:s}=q("Popover.Panel"),d="headlessui-focus-sentinel-before-".concat((0,N.M)()),f="headlessui-focus-sentinel-after-".concat((0,N.M)()),h=(0,c.useRef)(null),g=(0,b.T)(h,t,e=>{l({type:4,panel:e})}),y=(0,p.i)(h),w=(0,x.Y2)();(0,v.e)(()=>(l({type:5,panelId:r}),()=>{l({type:5,panelId:null})}),[r,l]);let k=(0,Z.oJ)(),M=null!==k?(k&Z.ZM.Open)===Z.ZM.Open:0===i.popoverState,C=(0,m.z)(e=>{var t;if(e.key===R.R.Escape){if(0!==i.popoverState||!h.current||null!=y&&y.activeElement&&!h.current.contains(y.activeElement))return;e.preventDefault(),e.stopPropagation(),l({type:1}),null==(t=i.button)||t.focus()}});(0,c.useEffect)(()=>{var t;e.static||1===i.popoverState&&(null==(t=e.unmount)||t)&&l({type:4,panel:null})},[i.popoverState,e.unmount,e.static,l]),(0,c.useEffect)(()=>{if(i.__demoMode||!o||0!==i.popoverState||!h.current)return;let e=null==y?void 0:y.activeElement;h.current.contains(e)||(0,Y.jA)(h.current,Y.TO.First)},[i.__demoMode,o,h,i.popoverState]);let D=(0,c.useMemo)(()=>({open:0===i.popoverState,close:u}),[i,u]),T={ref:g,id:r,onKeyDown:C,onBlur:o&&0===i.popoverState?e=>{var t,n,r,o,a;let u=e.relatedTarget;u&&h.current&&(null!=(t=h.current)&&t.contains(u)||(l({type:1}),(null!=(r=null==(n=i.beforePanelSentinel.current)?void 0:n.contains)&&r.call(n,u)||null!=(a=null==(o=i.afterPanelSentinel.current)?void 0:o.contains)&&a.call(o,u))&&u.focus({preventScroll:!0})))}:void 0,tabIndex:-1},P=O(),E=(0,m.z)(()=>{let e=h.current;e&&(0,F.E)(P.current,{[j.Forwards]:()=>{var t;(0,Y.jA)(e,Y.TO.First)===Y.fE.Error&&(null==(t=i.afterPanelSentinel.current)||t.focus())},[j.Backwards]:()=>{var e;null==(e=i.button)||e.focus({preventScroll:!0})}})}),_=(0,m.z)(()=>{let e=h.current;e&&(0,F.E)(P.current,{[j.Forwards]:()=>{var e;if(!i.button)return;let t=(0,Y.GO)(),n=t.indexOf(i.button),r=t.slice(0,n+1),o=[...t.slice(n+1),...r];for(let t of o.slice())if("true"===t.dataset.headlessuiFocusGuard||null!=(e=i.panel)&&e.contains(t)){let e=o.indexOf(t);-1!==e&&o.splice(e,1)}(0,Y.jA)(o,Y.TO.First,{sorted:!1})},[j.Backwards]:()=>{var t;(0,Y.jA)(e,Y.TO.Previous)===Y.fE.Error&&(null==(t=i.button)||t.focus())}})});return c.createElement(X.Provider,{value:r},M&&s&&c.createElement(S._,{id:d,ref:i.beforePanelSentinel,features:S.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:E}),(0,x.sY)({mergeRefs:w,ourProps:T,theirProps:a,slot:D,defaultTag:"div",features:J,visible:M,name:"Popover.Panel"}),M&&s&&c.createElement(S._,{id:f,ref:i.afterPanelSentinel,features:S.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:_}))}),Group:(0,x.yV)(function(e,t){let n;let r=(0,c.useRef)(null),o=(0,b.T)(r,t),[a,i]=(0,c.useState)([]),l={mainTreeNodeRef:n=(0,c.useRef)(null),MainTreeNode:(0,c.useMemo)(()=>function(){return c.createElement(S._,{features:S.A.Hidden,ref:n})},[n])},u=(0,m.z)(e=>{i(t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t})}),s=(0,m.z)(e=>(i(t=>[...t,e]),()=>u(e))),d=(0,m.z)(()=>{var e;let t=(0,W.r)(r);if(!t)return!1;let n=t.activeElement;return!!(null!=(e=r.current)&&e.contains(n))||a.some(e=>{var r,o;return(null==(r=t.getElementById(e.buttonId.current))?void 0:r.contains(n))||(null==(o=t.getElementById(e.panelId.current))?void 0:o.contains(n))})}),f=(0,m.z)(e=>{for(let t of a)t.buttonId.current!==e&&t.close()}),v=(0,c.useMemo)(()=>({registerPopover:s,unregisterPopover:u,isFocusWithinPopoverGroup:d,closeOthers:f,mainTreeNodeRef:l.mainTreeNodeRef}),[s,u,d,f,l.mainTreeNodeRef]),h=(0,c.useMemo)(()=>({}),[]);return c.createElement(V.Provider,{value:v},(0,x.sY)({ourProps:{ref:o},theirProps:e,slot:h,defaultTag:"div",name:"Popover.Group"}),c.createElement(l.MainTreeNode,null))})});var ee=n(33044),et=n(9528);let en=e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),c.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};var er=n(4537),eo=n(99735),ea=n(7656);function ei(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setHours(0,0,0,0),t}function el(){return ei(Date.now())}function eu(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setDate(1),t.setHours(0,0,0,0),t}var es=n(97324),ed=n(96398),ec=n(41154);function ef(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ec.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||nt||isNaN(t.getDate()))&&(n=t)}),n||new Date(NaN)}var ev=n(25721),eh=n(47869);function ep(e,t){(0,ea.Z)(2,arguments);var n=(0,eh.Z)(t);return(0,ev.Z)(e,-n)}var eg=n(55463);function eb(e,t){if((0,ea.Z)(2,arguments),!t||"object"!==(0,ec.Z)(t))return new Date(NaN);var n=t.years?(0,eh.Z)(t.years):0,r=t.months?(0,eh.Z)(t.months):0,o=t.weeks?(0,eh.Z)(t.weeks):0,a=t.days?(0,eh.Z)(t.days):0,i=t.hours?(0,eh.Z)(t.hours):0,l=t.minutes?(0,eh.Z)(t.minutes):0,u=t.seconds?(0,eh.Z)(t.seconds):0;return new Date(ep(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eh.Z)(t);return(0,eg.Z)(e,-n)}(e,r+12*n),a+7*o).getTime()-1e3*(u+60*(l+60*i)))}function ey(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ew(e){return(0,ea.Z)(1,arguments),e instanceof Date||"object"===(0,ec.Z)(e)&&"[object Date]"===Object.prototype.toString.call(e)}function ex(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCDay();return t.setUTCDate(t.getUTCDate()-((n<1?7:0)+n-1)),t.setUTCHours(0,0,0,0),t}function ek(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=ex(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=ex(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}var eM={};function eC(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,u,s,d=(0,eh.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eM.weekStartsOn)&&void 0!==r?r:null===(u=eM.locale)||void 0===u?void 0:null===(s=u.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=(0,eo.Z)(e),f=c.getUTCDay();return c.setUTCDate(c.getUTCDate()-((f=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(c+1,0,f),m.setUTCHours(0,0,0,0);var v=eC(m,t),h=new Date(0);h.setUTCFullYear(c,0,f),h.setUTCHours(0,0,0,0);var p=eC(h,t);return d.getTime()>=v.getTime()?c+1:d.getTime()>=p.getTime()?c:c-1}function eT(e,t){for(var n=Math.abs(e).toString();n.length0?n:1-n;return eT("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):eT(n+1,2)},d:function(e,t){return eT(e.getUTCDate(),t.length)},h:function(e,t){return eT(e.getUTCHours()%12||12,t.length)},H:function(e,t){return eT(e.getUTCHours(),t.length)},m:function(e,t){return eT(e.getUTCMinutes(),t.length)},s:function(e,t){return eT(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length;return eT(Math.floor(e.getUTCMilliseconds()*Math.pow(10,n-3)),t.length)}},eP={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function eE(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+(t||"")+eT(a,2)}function eS(e,t){return e%60==0?(e>0?"-":"+")+eT(Math.abs(e)/60,2):e_(e,t)}function e_(e,t){var n=Math.abs(e);return(e>0?"-":"+")+eT(Math.floor(n/60),2)+(t||"")+eT(n%60,2)}var ej={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return eN.y(e,t)},Y:function(e,t,n,r){var o=eD(e,r),a=o>0?o:1-o;return"YY"===t?eT(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):eT(a,t.length)},R:function(e,t){return eT(ek(e),t.length)},u:function(e,t){return eT(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return eT(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return eT(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return eN.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return eT(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((eC(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,u,s,d=(0,eh.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eM.firstWeekContainsDate)&&void 0!==r?r:null===(u=eM.locale)||void 0===u?void 0:null===(s=u.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1),c=eD(e,t),f=new Date(0);return f.setUTCFullYear(c,0,d),f.setUTCHours(0,0,0,0),eC(f,t)})(n,t).getTime())/6048e5)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):eT(o,t.length)},I:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((ex(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=ek(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),ex(n)})(t).getTime())/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):eT(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):eN.d(e,t)},D:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getTime();return t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),Math.floor((n-t.getTime())/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):eT(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return eT(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return eT(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return eT(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?eP.noon:0===o?eP.midnight:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?eP.evening:o>=12?eP.afternoon:o>=4?eP.morning:eP.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return eN.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):eN.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):eT(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):eT(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):eN.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):eN.s(e,t)},S:function(e,t){return eN.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return eS(o);case"XXXX":case"XX":return e_(o);default:return e_(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return eS(o);case"xxxx":case"xx":return e_(o);default:return e_(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eE(o,":");default:return"GMT"+e_(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eE(o,":");default:return"GMT"+e_(o,":")}},t:function(e,t,n,r){return eT(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return eT((r._originalDate||e).getTime(),t.length)}},eO=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},eZ=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},eL={p:eZ,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],a=r[2];if(!a)return eO(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",eO(o,t)).replace("{{time}}",eZ(a,t))}};function eY(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var eF=["D","DD"],eW=["YY","YYYY"];function eR(e,t,n){if("YYYY"===e)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var eI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function eU(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var eH={date:eU({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:eU({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:eU({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},eB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ez(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=null!=n&&n.width?String(n.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var i=e.defaultWidth,l=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[i]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function eA(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var l=i[0],u=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(u)?function(e,t){for(var n=0;n0?"in "+r:r+" ago":r},formatLong:eH,formatRelative:function(e,t,n,r){return eB[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ez({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ez({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:ez({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ez({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ez({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(i={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(i.matchPattern);if(!n)return null;var r=n[0],o=e.match(i.parsePattern);if(!o)return null;var a=i.valueCallback?i.valueCallback(o[0]):o[0];return{value:a=t.valueCallback?t.valueCallback(a):a,rest:e.slice(r.length)}}),era:eA({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:eA({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:eA({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:eA({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:eA({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},eV=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eG=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eX=/^'([^]*?)'?$/,eK=/''/g,eQ=/[a-zA-Z]/;function eJ(e,t,n){(0,ea.Z)(2,arguments);var r,o,a,i,l,u,s,d,c,f,m,v,h,p,g,b,y,w,x=String(t),k=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:eM.locale)&&void 0!==r?r:eq,M=(0,eh.Z)(null!==(a=null!==(i=null!==(l=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n?void 0:null===(s=n.locale)||void 0===s?void 0:null===(d=s.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==l?l:eM.firstWeekContainsDate)&&void 0!==i?i:null===(c=eM.locale)||void 0===c?void 0:null===(f=c.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==a?a:1);if(!(M>=1&&M<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=(0,eh.Z)(null!==(m=null!==(v=null!==(h=null!==(p=null==n?void 0:n.weekStartsOn)&&void 0!==p?p:null==n?void 0:null===(g=n.locale)||void 0===g?void 0:null===(b=g.options)||void 0===b?void 0:b.weekStartsOn)&&void 0!==h?h:eM.weekStartsOn)&&void 0!==v?v:null===(y=eM.locale)||void 0===y?void 0:null===(w=y.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==m?m:0);if(!(C>=0&&C<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw RangeError("locale must contain localize property");if(!k.formatLong)throw RangeError("locale must contain formatLong property");var D=(0,eo.Z)(e);if(!function(e){return(0,ea.Z)(1,arguments),(!!ew(e)||"number"==typeof e)&&!isNaN(Number((0,eo.Z)(e)))}(D))throw RangeError("Invalid time value");var T=eY(D),N=function(e,t){return(0,ea.Z)(2,arguments),function(e,t){return(0,ea.Z)(2,arguments),new Date((0,eo.Z)(e).getTime()+(0,eh.Z)(t))}(e,-(0,eh.Z)(t))}(D,T),P={firstWeekContainsDate:M,weekStartsOn:C,locale:k,_originalDate:D};return x.match(eG).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,eL[t])(e,k.formatLong):e}).join("").match(eV).map(function(r){if("''"===r)return"'";var o,a=r[0];if("'"===a)return(o=r.match(eX))?o[1].replace(eK,"'"):r;var i=ej[a];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===eW.indexOf(r)||eR(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||-1===eF.indexOf(r)||eR(r,t,String(e)),i(N,r,k.localize,P);if(a.match(eQ))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r}).join("")}var e$=n(1153);let e0=(0,e$.fn)("DateRangePicker"),e1=(e,t,n,r)=>{var o;if(n&&(e=null===(o=r.get(n))||void 0===o?void 0:o.from),e)return ei(e&&!t?e:ef([e,t]))},e2=(e,t,n,r)=>{var o,a;if(n&&(e=ei(null!==(a=null===(o=r.get(n))||void 0===o?void 0:o.to)&&void 0!==a?a:el())),e)return ei(e&&!t?e:em([e,t]))},e4=[{value:"tdy",text:"Today",from:el()},{value:"w",text:"Last 7 days",from:eb(el(),{days:7})},{value:"t",text:"Last 30 days",from:eb(el(),{days:30})},{value:"m",text:"Month to Date",from:eu(el())},{value:"y",text:"Year to Date",from:ey(el())}],e3=(e,t,n,r)=>{let o=(null==n?void 0:n.code)||"en-US";if(!e&&!t)return"";if(e&&!t)return r?eJ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e&&t){if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()===r.getTime()}(e,t))return r?eJ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())return r?"".concat(eJ(e,r)," - ").concat(eJ(t,r)):"".concat(e.toLocaleDateString(o,{month:"short",day:"numeric"})," - \n ").concat(t.getDate(),", ").concat(t.getFullYear());{if(r)return"".concat(eJ(e,r)," - ").concat(eJ(t,r));let n={year:"numeric",month:"short",day:"numeric"};return"".concat(e.toLocaleDateString(o,n)," - \n ").concat(t.toLocaleDateString(o,n))}}return""};function e5(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function e6(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eh.Z)(t),o=n.getFullYear(),a=n.getDate(),i=new Date(0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);var l=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(i);return n.setMonth(r,Math.min(a,l)),n}function e8(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eh.Z)(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function e7(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function e9(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function te(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()=0&&d<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=(0,eo.Z)(e),f=c.getDay();return c.setDate(c.getDate()-((fr.getTime()}function ta(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return Math.round((n.getTime()-eY(n)-(r.getTime()-eY(r)))/864e5)}function ti(e,t){(0,ea.Z)(2,arguments);var n=(0,eh.Z)(t);return(0,ev.Z)(e,7*n)}function tl(e,t){(0,ea.Z)(2,arguments);var n=(0,eh.Z)(t);return(0,eg.Z)(e,12*n)}function tu(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,u,s,d=(0,eh.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eM.weekStartsOn)&&void 0!==r?r:null===(u=eM.locale)||void 0===u?void 0:null===(s=u.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=(0,eo.Z)(e),f=c.getDay();return c.setDate(c.getDate()+((fe7(l,i)&&(i=(0,eg.Z)(l,-1*((void 0===s?1:s)-1))),u&&0>e7(i,u)&&(i=u),d=eu(i),f=t.month,v=(m=(0,c.useState)(d))[0],h=[void 0===f?v:f,m[1]])[0],g=h[1],[p,function(e){if(!t.disableNavigation){var n,r=eu(e);g(r),null===(n=t.onMonthChange)||void 0===n||n.call(t,r)}}]),w=y[0],x=y[1],k=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=eu(e),a=e7(eu((0,eg.Z)(o,r)),o),i=[],l=0;l=e7(a,n)))return(0,eg.Z)(a,-(r?void 0===o?1:o:1))}}(w,b),D=function(e){return k.some(function(t){return e9(e,t)})};return tv.jsx(tE.Provider,{value:{currentMonth:w,displayMonths:k,goToMonth:x,goToDate:function(e,t){D(e)||(t&&te(e,t)?x((0,eg.Z)(e,1+-1*b.numberOfMonths)):x(e))},previousMonth:C,nextMonth:M,isDateDisplayed:D},children:e.children})}function t_(){var e=(0,c.useContext)(tE);if(!e)throw Error("useNavigation must be used within a NavigationProvider");return e}function tj(e){var t,n=tM(),r=n.classNames,o=n.styles,a=n.components,i=t_().goToMonth,l=function(t){i((0,eg.Z)(t,e.displayIndex?-e.displayIndex:0))},u=null!==(t=null==a?void 0:a.CaptionLabel)&&void 0!==t?t:tC,s=tv.jsx(u,{id:e.id,displayMonth:e.displayMonth});return tv.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[tv.jsx("div",{className:r.vhidden,children:s}),tv.jsx(tN,{onChange:l,displayMonth:e.displayMonth}),tv.jsx(tP,{onChange:l,displayMonth:e.displayMonth})]})}function tO(e){return tv.jsx("svg",td({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:tv.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tZ(e){return tv.jsx("svg",td({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:tv.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var tL=(0,c.forwardRef)(function(e,t){var n=tM(),r=n.classNames,o=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var i=a.join(" "),l=td(td({},o.button_reset),o.button);return e.style&&Object.assign(l,e.style),tv.jsx("button",td({},e,{ref:t,type:"button",className:i,style:l}))});function tY(e){var t,n,r=tM(),o=r.dir,a=r.locale,i=r.classNames,l=r.styles,u=r.labels,s=u.labelPrevious,d=u.labelNext,c=r.components;if(!e.nextMonth&&!e.previousMonth)return tv.jsx(tv.Fragment,{});var f=s(e.previousMonth,{locale:a}),m=[i.nav_button,i.nav_button_previous].join(" "),v=d(e.nextMonth,{locale:a}),h=[i.nav_button,i.nav_button_next].join(" "),p=null!==(t=null==c?void 0:c.IconRight)&&void 0!==t?t:tZ,g=null!==(n=null==c?void 0:c.IconLeft)&&void 0!==n?n:tO;return tv.jsxs("div",{className:i.nav,style:l.nav,children:[!e.hidePrevious&&tv.jsx(tL,{name:"previous-month","aria-label":f,className:m,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===o?tv.jsx(p,{className:i.nav_icon,style:l.nav_icon}):tv.jsx(g,{className:i.nav_icon,style:l.nav_icon})}),!e.hideNext&&tv.jsx(tL,{name:"next-month","aria-label":v,className:h,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===o?tv.jsx(g,{className:i.nav_icon,style:l.nav_icon}):tv.jsx(p,{className:i.nav_icon,style:l.nav_icon})})]})}function tF(e){var t=tM().numberOfMonths,n=t_(),r=n.previousMonth,o=n.nextMonth,a=n.goToMonth,i=n.displayMonths,l=i.findIndex(function(t){return e9(e.displayMonth,t)}),u=0===l,s=l===i.length-1;return tv.jsx(tY,{displayMonth:e.displayMonth,hideNext:t>1&&(u||!s),hidePrevious:t>1&&(s||!u),nextMonth:o,previousMonth:r,onPreviousClick:function(){r&&a(r)},onNextClick:function(){o&&a(o)}})}function tW(e){var t,n,r=tM(),o=r.classNames,a=r.disableNavigation,i=r.styles,l=r.captionLayout,u=r.components,s=null!==(t=null==u?void 0:u.CaptionLabel)&&void 0!==t?t:tC;return n=a?tv.jsx(s,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?tv.jsx(tj,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?tv.jsxs(tv.Fragment,{children:[tv.jsx(tj,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),tv.jsx(tF,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):tv.jsxs(tv.Fragment,{children:[tv.jsx(s,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),tv.jsx(tF,{displayMonth:e.displayMonth,id:e.id})]}),tv.jsx("div",{className:o.caption,style:i.caption,children:n})}function tR(e){var t=tM(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?tv.jsx("tfoot",{className:o,style:r.tfoot,children:tv.jsx("tr",{children:tv.jsx("td",{colSpan:8,children:n})})}):tv.jsx(tv.Fragment,{})}function tI(){var e=tM(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,a=e.weekStartsOn,i=e.ISOWeek,l=e.formatters.formatWeekdayName,u=e.labels.labelWeekday,s=function(e,t,n){for(var r=n?tn(new Date):tt(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=(0,ev.Z)(r,a);o.push(i)}return o}(o,a,i);return tv.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&tv.jsx("td",{style:n.head_cell,className:t.head_cell}),s.map(function(e,r){return tv.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":u(e,{locale:o}),children:l(e,{locale:o})},r)})]})}function tU(){var e,t=tM(),n=t.classNames,r=t.styles,o=t.components,a=null!==(e=null==o?void 0:o.HeadRow)&&void 0!==e?e:tI;return tv.jsx("thead",{style:r.head,className:n.head,children:tv.jsx(a,{})})}function tH(e){var t=tM(),n=t.locale,r=t.formatters.formatDay;return tv.jsx(tv.Fragment,{children:r(e.date,{locale:n})})}var tB=(0,c.createContext)(void 0);function tz(e){return th(e.initialProps)?tv.jsx(tA,{initialProps:e.initialProps,children:e.children}):tv.jsx(tB.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}function tA(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,a=t.max,i={disabled:[]};return r&&i.disabled.push(function(e){var t=a&&r.length>a-1,n=r.some(function(t){return tr(t,e)});return!!(t&&!n)}),tv.jsx(tB.Provider,{value:{selected:r,onDayClick:function(e,n,i){if(null===(l=t.onDayClick)||void 0===l||l.call(t,e,n,i),(!n.selected||!o||(null==r?void 0:r.length)!==o)&&(n.selected||!a||(null==r?void 0:r.length)!==a)){var l,u,s=r?tc([],r,!0):[];if(n.selected){var d=s.findIndex(function(t){return tr(e,t)});s.splice(d,1)}else s.push(e);null===(u=t.onSelect)||void 0===u||u.call(t,s,e,n,i)}},modifiers:i},children:n})}function tq(){var e=(0,c.useContext)(tB);if(!e)throw Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var tV=(0,c.createContext)(void 0);function tG(e){return tp(e.initialProps)?tv.jsx(tX,{initialProps:e.initialProps,children:e.children}):tv.jsx(tV.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}function tX(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},a=o.from,i=o.to,l=t.min,u=t.max,s={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(s.range_start=[a],i?(s.range_end=[i],tr(a,i)||(s.range_middle=[{after:a,before:i}])):s.range_end=[a]):i&&(s.range_start=[i],s.range_end=[i]),l&&(a&&!i&&s.disabled.push({after:ep(a,l-1),before:(0,ev.Z)(a,l-1)}),a&&i&&s.disabled.push({after:a,before:(0,ev.Z)(a,l-1)}),!a&&i&&s.disabled.push({after:ep(i,l-1),before:(0,ev.Z)(i,l-1)})),u){if(a&&!i&&(s.disabled.push({before:(0,ev.Z)(a,-u+1)}),s.disabled.push({after:(0,ev.Z)(a,u-1)})),a&&i){var d=u-(ta(i,a)+1);s.disabled.push({before:ep(a,d)}),s.disabled.push({after:(0,ev.Z)(i,d)})}!a&&i&&(s.disabled.push({before:(0,ev.Z)(i,-u+1)}),s.disabled.push({after:(0,ev.Z)(i,u-1)}))}return tv.jsx(tV.Provider,{value:{selected:r,onDayClick:function(e,n,o){null===(u=t.onDayClick)||void 0===u||u.call(t,e,n,o);var a,i,l,u,s,d=(i=(a=r||{}).from,l=a.to,i&&l?tr(l,e)&&tr(i,e)?void 0:tr(l,e)?{from:l,to:void 0}:tr(i,e)?void 0:to(i,e)?{from:e,to:l}:{from:i,to:e}:l?to(e,l)?{from:l,to:e}:{from:e,to:l}:i?te(e,i)?{from:e,to:i}:{from:i,to:e}:{from:e,to:void 0});null===(s=t.onSelect)||void 0===s||s.call(t,d,e,n,o)},modifiers:s},children:n})}function tK(){var e=(0,c.useContext)(tV);if(!e)throw Error("useSelectRange must be used within a SelectRangeProvider");return e}function tQ(e){return Array.isArray(e)?tc([],e,!0):void 0!==e?[e]:[]}(l=s||(s={})).Outside="outside",l.Disabled="disabled",l.Selected="selected",l.Hidden="hidden",l.Today="today",l.RangeStart="range_start",l.RangeEnd="range_end",l.RangeMiddle="range_middle";var tJ=s.Selected,t$=s.Disabled,t0=s.Hidden,t1=s.Today,t2=s.RangeEnd,t4=s.RangeMiddle,t3=s.RangeStart,t5=s.Outside,t6=(0,c.createContext)(void 0);function t8(e){var t,n,r,o=tM(),a=tq(),i=tK(),l=((t={})[tJ]=tQ(o.selected),t[t$]=tQ(o.disabled),t[t0]=tQ(o.hidden),t[t1]=[o.today],t[t2]=[],t[t4]=[],t[t3]=[],t[t5]=[],o.fromDate&&t[t$].push({before:o.fromDate}),o.toDate&&t[t$].push({after:o.toDate}),th(o)?t[t$]=t[t$].concat(a.modifiers[t$]):tp(o)&&(t[t$]=t[t$].concat(i.modifiers[t$]),t[t3]=i.modifiers[t3],t[t4]=i.modifiers[t4],t[t2]=i.modifiers[t2]),t),u=(n=o.modifiers,r={},Object.entries(n).forEach(function(e){var t=e[0],n=e[1];r[t]=tQ(n)}),r),s=td(td({},l),u);return tv.jsx(t6.Provider,{value:s,children:e.children})}function t7(){var e=(0,c.useContext)(t6);if(!e)throw Error("useModifiers must be used within a ModifiersProvider");return e}function t9(e,t,n){var r=Object.keys(t).reduce(function(n,r){return t[r].some(function(t){if("boolean"==typeof t)return t;if(ew(t))return tr(e,t);if(Array.isArray(t)&&t.every(ew))return t.includes(e);if(t&&"object"==typeof t&&"from"in t)return r=t.from,o=t.to,r&&o?(0>ta(o,r)&&(r=(n=[o,r])[0],o=n[1]),ta(e,r)>=0&&ta(o,e)>=0):o?tr(o,e):!!r&&tr(r,e);if(t&&"object"==typeof t&&"dayOfWeek"in t)return t.dayOfWeek.includes(e.getDay());if(t&&"object"==typeof t&&"before"in t&&"after"in t){var n,r,o,a=ta(t.before,e),i=ta(t.after,e),l=a>0,u=i<0;return to(t.before,t.after)?u&&l:l||u}return t&&"object"==typeof t&&"after"in t?ta(e,t.after)>0:t&&"object"==typeof t&&"before"in t?ta(t.before,e)>0:"function"==typeof t&&t(e)})&&n.push(r),n},[]),o={};return r.forEach(function(e){return o[e]=!0}),n&&!e9(e,n)&&(o.outside=!0),o}var ne=(0,c.createContext)(void 0);function nt(e){var t=t_(),n=t7(),r=(0,c.useState)(),o=r[0],a=r[1],i=(0,c.useState)(),l=i[0],u=i[1],s=function(e,t){for(var n,r,o=eu(e[0]),a=e5(e[e.length-1]),i=o;i<=a;){var l=t9(i,t);if(!(!l.disabled&&!l.hidden)){i=(0,ev.Z)(i,1);continue}if(l.selected)return i;l.today&&!r&&(r=i),n||(n=i),i=(0,ev.Z)(i,1)}return r||n}(t.displayMonths,n),d=(null!=o?o:l&&t.isDateDisplayed(l))?l:s,f=function(e){a(e)},m=tM(),v=function(e,r){if(o){var a=function e(t,n){var r=n.moveBy,o=n.direction,a=n.context,i=n.modifiers,l=n.retry,u=void 0===l?{count:0,lastFocused:t}:l,s=a.weekStartsOn,d=a.fromDate,c=a.toDate,f=a.locale,m=({day:ev.Z,week:ti,month:eg.Z,year:tl,startOfWeek:function(e){return a.ISOWeek?tn(e):tt(e,{locale:f,weekStartsOn:s})},endOfWeek:function(e){return a.ISOWeek?ts(e):tu(e,{locale:f,weekStartsOn:s})}})[r](t,"after"===o?1:-1);"before"===o&&d?m=ef([d,m]):"after"===o&&c&&(m=em([c,m]));var v=!0;if(i){var h=t9(m,i);v=!h.disabled&&!h.hidden}return v?m:u.count>365?u.lastFocused:e(m,{moveBy:r,direction:o,context:a,modifiers:i,retry:td(td({},u),{count:u.count+1})})}(o,{moveBy:e,direction:r,context:m,modifiers:n});tr(o,a)||(t.goToDate(a,o),f(a))}};return tv.jsx(ne.Provider,{value:{focusedDay:o,focusTarget:d,blur:function(){u(o),a(void 0)},focus:f,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}},children:e.children})}function nn(){var e=(0,c.useContext)(ne);if(!e)throw Error("useFocusContext must be used within a FocusProvider");return e}var nr=(0,c.createContext)(void 0);function no(e){return tg(e.initialProps)?tv.jsx(na,{initialProps:e.initialProps,children:e.children}):tv.jsx(nr.Provider,{value:{selected:void 0},children:e.children})}function na(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var o,a,i;if(null===(o=t.onDayClick)||void 0===o||o.call(t,e,n,r),n.selected&&!t.required){null===(a=t.onSelect)||void 0===a||a.call(t,void 0,e,n,r);return}null===(i=t.onSelect)||void 0===i||i.call(t,e,e,n,r)}};return tv.jsx(nr.Provider,{value:r,children:n})}function ni(){var e=(0,c.useContext)(nr);if(!e)throw Error("useSelectSingle must be used within a SelectSingleProvider");return e}function nl(e){var t,n,r,o,a,i,l,u,d,f,m,v,h,p,g,b,y,w,x,k,M,C,D,T,N,P,E,S,_,j,O,Z,L,Y,F,W,R,I,U,H,B,z,A=(0,c.useRef)(null),q=(t=e.date,n=e.displayMonth,i=tM(),l=nn(),u=t9(t,t7(),n),d=tM(),f=ni(),m=tq(),v=tK(),p=(h=nn()).focusDayAfter,g=h.focusDayBefore,b=h.focusWeekAfter,y=h.focusWeekBefore,w=h.blur,x=h.focus,k=h.focusMonthBefore,M=h.focusMonthAfter,C=h.focusYearBefore,D=h.focusYearAfter,T=h.focusStartOfWeek,N=h.focusEndOfWeek,P={onClick:function(e){var n,r,o,a;tg(d)?null===(n=f.onDayClick)||void 0===n||n.call(f,t,u,e):th(d)?null===(r=m.onDayClick)||void 0===r||r.call(m,t,u,e):tp(d)?null===(o=v.onDayClick)||void 0===o||o.call(v,t,u,e):null===(a=d.onDayClick)||void 0===a||a.call(d,t,u,e)},onFocus:function(e){var n;x(t),null===(n=d.onDayFocus)||void 0===n||n.call(d,t,u,e)},onBlur:function(e){var n;w(),null===(n=d.onDayBlur)||void 0===n||n.call(d,t,u,e)},onKeyDown:function(e){var n;switch(e.key){case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===d.dir?p():g();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===d.dir?g():p();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),b();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),y();break;case"PageUp":e.preventDefault(),e.stopPropagation(),e.shiftKey?C():k();break;case"PageDown":e.preventDefault(),e.stopPropagation(),e.shiftKey?D():M();break;case"Home":e.preventDefault(),e.stopPropagation(),T();break;case"End":e.preventDefault(),e.stopPropagation(),N()}null===(n=d.onDayKeyDown)||void 0===n||n.call(d,t,u,e)},onKeyUp:function(e){var n;null===(n=d.onDayKeyUp)||void 0===n||n.call(d,t,u,e)},onMouseEnter:function(e){var n;null===(n=d.onDayMouseEnter)||void 0===n||n.call(d,t,u,e)},onMouseLeave:function(e){var n;null===(n=d.onDayMouseLeave)||void 0===n||n.call(d,t,u,e)},onPointerEnter:function(e){var n;null===(n=d.onDayPointerEnter)||void 0===n||n.call(d,t,u,e)},onPointerLeave:function(e){var n;null===(n=d.onDayPointerLeave)||void 0===n||n.call(d,t,u,e)},onTouchCancel:function(e){var n;null===(n=d.onDayTouchCancel)||void 0===n||n.call(d,t,u,e)},onTouchEnd:function(e){var n;null===(n=d.onDayTouchEnd)||void 0===n||n.call(d,t,u,e)},onTouchMove:function(e){var n;null===(n=d.onDayTouchMove)||void 0===n||n.call(d,t,u,e)},onTouchStart:function(e){var n;null===(n=d.onDayTouchStart)||void 0===n||n.call(d,t,u,e)}},E=tM(),S=ni(),_=tq(),j=tK(),O=tg(E)?S.selected:th(E)?_.selected:tp(E)?j.selected:void 0,Z=!!(i.onDayClick||"default"!==i.mode),(0,c.useEffect)(function(){var e;!u.outside&&l.focusedDay&&Z&&tr(l.focusedDay,t)&&(null===(e=A.current)||void 0===e||e.focus())},[l.focusedDay,t,A,Z,u.outside]),Y=(L=[i.classNames.day],Object.keys(u).forEach(function(e){var t=i.modifiersClassNames[e];if(t)L.push(t);else if(Object.values(s).includes(e)){var n=i.classNames["day_".concat(e)];n&&L.push(n)}}),L).join(" "),F=td({},i.styles.day),Object.keys(u).forEach(function(e){var t;F=td(td({},F),null===(t=i.modifiersStyles)||void 0===t?void 0:t[e])}),W=F,R=!!(u.outside&&!i.showOutsideDays||u.hidden),I=null!==(a=null===(o=i.components)||void 0===o?void 0:o.DayContent)&&void 0!==a?a:tH,U={style:W,className:Y,children:tv.jsx(I,{date:t,displayMonth:n,activeModifiers:u}),role:"gridcell"},H=l.focusTarget&&tr(l.focusTarget,t)&&!u.outside,B=l.focusedDay&&tr(l.focusedDay,t),z=td(td(td({},U),((r={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,r.tabIndex=B||H?0:-1,r)),P),{isButton:Z,isHidden:R,activeModifiers:u,selectedDays:O,buttonProps:z,divProps:U});return q.isHidden?tv.jsx("div",{role:"gridcell"}):q.isButton?tv.jsx(tL,td({name:"day",ref:A},q.buttonProps)):tv.jsx("div",td({},q.divProps))}function nu(e){var t=e.number,n=e.dates,r=tM(),o=r.onWeekNumberClick,a=r.styles,i=r.classNames,l=r.locale,u=r.labels.labelWeekNumber,s=(0,r.formatters.formatWeekNumber)(Number(t),{locale:l});if(!o)return tv.jsx("span",{className:i.weeknumber,style:a.weeknumber,children:s});var d=u(Number(t),{locale:l});return tv.jsx(tL,{name:"week-number","aria-label":d,className:i.weeknumber,style:a.weeknumber,onClick:function(e){o(t,n,e)},children:s})}function ns(e){var t,n,r,o=tM(),a=o.styles,i=o.classNames,l=o.showWeekNumber,u=o.components,s=null!==(t=null==u?void 0:u.Day)&&void 0!==t?t:nl,d=null!==(n=null==u?void 0:u.WeekNumber)&&void 0!==n?n:nu;return l&&(r=tv.jsx("td",{className:i.cell,style:a.cell,children:tv.jsx(d,{number:e.weekNumber,dates:e.dates})})),tv.jsxs("tr",{className:i.row,style:a.row,children:[r,e.dates.map(function(t){return tv.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:tv.jsx(s,{displayMonth:e.displayMonth,date:t})},function(e){return(0,ea.Z)(1,arguments),Math.floor(function(e){return(0,ea.Z)(1,arguments),(0,eo.Z)(e).getTime()}(e)/1e3)}(t))})]})}function nd(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?ts(t):tu(t,n),o=(null==n?void 0:n.ISOWeek)?tn(e):tt(e,n),a=ta(r,o),i=[],l=0;l<=a;l++)i.push((0,ev.Z)(o,l));return i.reduce(function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((tn(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=tn(r),a=new Date(0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);var i=tn(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),tn(n)})(t).getTime())/6048e5)+1}(t):function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((tt(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,u,s,d=(0,eh.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eM.firstWeekContainsDate)&&void 0!==r?r:null===(u=eM.locale)||void 0===u?void 0:null===(s=u.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1),c=function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,u,s,d=(0,eo.Z)(e),c=d.getFullYear(),f=(0,eh.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eM.firstWeekContainsDate)&&void 0!==r?r:null===(u=eM.locale)||void 0===u?void 0:null===(s=u.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setFullYear(c+1,0,f),m.setHours(0,0,0,0);var v=tt(m,t),h=new Date(0);h.setFullYear(c,0,f),h.setHours(0,0,0,0);var p=tt(h,t);return d.getTime()>=v.getTime()?c+1:d.getTime()>=p.getTime()?c:c-1}(e,t),f=new Date(0);return f.setFullYear(c,0,d),f.setHours(0,0,0,0),tt(f,t)})(n,t).getTime())/6048e5)+1}(t,n),o=e.find(function(e){return e.weekNumber===r});return o?o.dates.push(t):e.push({weekNumber:r,dates:[t]}),e},[])}function nc(e){var t,n,r,o=tM(),a=o.locale,i=o.classNames,l=o.styles,u=o.hideHead,s=o.fixedWeeks,d=o.components,c=o.weekStartsOn,f=o.firstWeekContainsDate,m=o.ISOWeek,v=function(e,t){var n=nd(eu(e),e5(e),t);if(null==t?void 0:t.useFixedWeeks){var r=function(e,t){return(0,ea.Z)(1,arguments),function(e,t,n){(0,ea.Z)(2,arguments);var r=tt(e,n),o=tt(t,n);return Math.round((r.getTime()-eY(r)-(o.getTime()-eY(o)))/6048e5)}(function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),eu(e),t)+1}(e,t);if(r<6){var o=n[n.length-1],a=o.dates[o.dates.length-1],i=ti(a,6-r),l=nd(ti(a,1),i,t);n.push.apply(n,l)}}return n}(e.displayMonth,{useFixedWeeks:!!s,ISOWeek:m,locale:a,weekStartsOn:c,firstWeekContainsDate:f}),h=null!==(t=null==d?void 0:d.Head)&&void 0!==t?t:tU,p=null!==(n=null==d?void 0:d.Row)&&void 0!==n?n:ns,g=null!==(r=null==d?void 0:d.Footer)&&void 0!==r?r:tR;return tv.jsxs("table",{id:e.id,className:i.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!u&&tv.jsx(h,{}),tv.jsx("tbody",{className:i.tbody,style:l.tbody,children:v.map(function(t){return tv.jsx(p,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),tv.jsx(g,{displayMonth:e.displayMonth})]})}var nf="undefined"!=typeof window&&window.document&&window.document.createElement?c.useLayoutEffect:c.useEffect,nm=!1,nv=0;function nh(){return"react-day-picker-".concat(++nv)}function np(e){var t,n,r,o,a,i,l,u,s=tM(),d=s.dir,f=s.classNames,m=s.styles,v=s.components,h=t_().displayMonths,p=(r=null!=(t=s.id?"".concat(s.id,"-").concat(e.displayIndex):void 0)?t:nm?nh():null,a=(o=(0,c.useState)(r))[0],i=o[1],nf(function(){null===a&&i(nh())},[]),(0,c.useEffect)(function(){!1===nm&&(nm=!0)},[]),null!==(n=null!=t?t:a)&&void 0!==n?n:void 0),g=s.id?"".concat(s.id,"-grid-").concat(e.displayIndex):void 0,b=[f.month],y=m.month,w=0===e.displayIndex,x=e.displayIndex===h.length-1,k=!w&&!x;"rtl"===d&&(x=(l=[w,x])[0],w=l[1]),w&&(b.push(f.caption_start),y=td(td({},y),m.caption_start)),x&&(b.push(f.caption_end),y=td(td({},y),m.caption_end)),k&&(b.push(f.caption_between),y=td(td({},y),m.caption_between));var M=null!==(u=null==v?void 0:v.Caption)&&void 0!==u?u:tW;return tv.jsxs("div",{className:b.join(" "),style:y,children:[tv.jsx(M,{id:p,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),tv.jsx(nc,{id:g,"aria-labelledby":p,displayMonth:e.displayMonth})]},e.displayIndex)}function ng(e){var t=tM(),n=t.classNames,r=t.styles;return tv.jsx("div",{className:n.months,style:r.months,children:e.children})}function nb(e){var t,n,r=e.initialProps,o=tM(),a=nn(),i=t_(),l=(0,c.useState)(!1),u=l[0],s=l[1];(0,c.useEffect)(function(){o.initialFocus&&a.focusTarget&&(u||(a.focus(a.focusTarget),s(!0)))},[o.initialFocus,u,a.focus,a.focusTarget,a]);var d=[o.classNames.root,o.className];o.numberOfMonths>1&&d.push(o.classNames.multiple_months),o.showWeekNumber&&d.push(o.classNames.with_weeknumber);var f=td(td({},o.styles.root),o.style),m=Object.keys(r).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var n;return td(td({},e),((n={})[t]=r[t],n))},{}),v=null!==(n=null===(t=r.components)||void 0===t?void 0:t.Months)&&void 0!==n?n:ng;return tv.jsx("div",td({className:d.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},m,{children:tv.jsx(v,{children:i.displayMonths.map(function(e,t){return tv.jsx(np,{displayIndex:t,displayMonth:e},t)})})}))}function ny(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}(e,["children"]);return tv.jsx(tk,{initialProps:n,children:tv.jsx(tS,{children:tv.jsx(no,{initialProps:n,children:tv.jsx(tz,{initialProps:n,children:tv.jsx(tG,{initialProps:n,children:tv.jsx(t8,{children:tv.jsx(nt,{children:t})})})})})})})}function nw(e){return tv.jsx(ny,td({},e,{children:tv.jsx(nb,{initialProps:e})}))}let nx=e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),c.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))},nk=e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),c.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))},nM=e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),c.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))},nC=e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),c.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))};var nD=n(84264);n(41649);var nT=n(1526),nN=n(7084),nP=n(26898);let nE={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},nS={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},n_={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},nj={[nN.wu.Increase]:{bgColor:(0,e$.bM)(nN.fr.Emerald,nP.K.background).bgColor,textColor:(0,e$.bM)(nN.fr.Emerald,nP.K.text).textColor},[nN.wu.ModerateIncrease]:{bgColor:(0,e$.bM)(nN.fr.Emerald,nP.K.background).bgColor,textColor:(0,e$.bM)(nN.fr.Emerald,nP.K.text).textColor},[nN.wu.Decrease]:{bgColor:(0,e$.bM)(nN.fr.Rose,nP.K.background).bgColor,textColor:(0,e$.bM)(nN.fr.Rose,nP.K.text).textColor},[nN.wu.ModerateDecrease]:{bgColor:(0,e$.bM)(nN.fr.Rose,nP.K.background).bgColor,textColor:(0,e$.bM)(nN.fr.Rose,nP.K.text).textColor},[nN.wu.Unchanged]:{bgColor:(0,e$.bM)(nN.fr.Orange,nP.K.background).bgColor,textColor:(0,e$.bM)(nN.fr.Orange,nP.K.text).textColor}},nO={[nN.wu.Increase]:e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),c.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))},[nN.wu.ModerateIncrease]:e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),c.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))},[nN.wu.Decrease]:e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),c.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))},[nN.wu.ModerateDecrease]:e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),c.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))},[nN.wu.Unchanged]:e=>{var t=(0,d._T)(e,[]);return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),c.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))}},nZ=(0,e$.fn)("BadgeDelta");c.forwardRef((e,t)=>{let{deltaType:n=nN.wu.Increase,isIncreasePositive:r=!0,size:o=nN.u8.SM,tooltip:a,children:i,className:l}=e,u=(0,d._T)(e,["deltaType","isIncreasePositive","size","tooltip","children","className"]),s=nO[n],f=(0,e$.Fo)(n,r),m=i?nS:nE,{tooltipProps:v,getReferenceProps:h}=(0,nT.l)();return c.createElement("span",Object.assign({ref:(0,e$.lq)([t,v.refs.setReference]),className:(0,es.q)(nZ("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-full bg-opacity-20 dark:bg-opacity-25",nj[f].bgColor,nj[f].textColor,m[o].paddingX,m[o].paddingY,m[o].fontSize,l)},h,u),c.createElement(nT.Z,Object.assign({text:a},v)),c.createElement(s,{className:(0,es.q)(nZ("icon"),"shrink-0",i?(0,es.q)("-ml-1 mr-1.5"):n_[o].height,n_[o].width)}),i?c.createElement("p",{className:(0,es.q)(nZ("text"),"text-sm whitespace-nowrap")},i):null)}).displayName="BadgeDelta";var nL=n(47323);let nY=e=>{var{onClick:t,icon:n}=e,r=(0,d._T)(e,["onClick","icon"]);return c.createElement("button",Object.assign({type:"button",className:(0,es.q)("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},r),c.createElement(nL.Z,{onClick:t,icon:n,variant:"simple",color:"slate",size:"sm"}))};function nF(e){var{mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,enableYearNavigation:l,classNames:u,weekStartsOn:s=0}=e,f=(0,d._T)(e,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return c.createElement(nw,Object.assign({showOutsideDays:!0,mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,weekStartsOn:s,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},u),components:{IconLeft:e=>{var t=(0,d._T)(e,[]);return c.createElement(nx,Object.assign({className:"h-4 w-4"},t))},IconRight:e=>{var t=(0,d._T)(e,[]);return c.createElement(nk,Object.assign({className:"h-4 w-4"},t))},Caption:e=>{var t=(0,d._T)(e,[]);let{goToMonth:n,nextMonth:r,previousMonth:o,currentMonth:i}=t_();return c.createElement("div",{className:"flex justify-between items-center"},c.createElement("div",{className:"flex items-center space-x-1"},l&&c.createElement(nY,{onClick:()=>i&&n(tl(i,-1)),icon:nM}),c.createElement(nY,{onClick:()=>o&&n(o),icon:nx})),c.createElement(nD.Z,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},eJ(t.displayMonth,"LLLL yyy",{locale:a})),c.createElement("div",{className:"flex items-center space-x-1"},c.createElement(nY,{onClick:()=>r&&n(r),icon:nk}),l&&c.createElement(nY,{onClick:()=>i&&n(tl(i,1)),icon:nC})))}}},f))}nF.displayName="DateRangePicker",n(27281);var nW=n(57365),nR=n(44140);let nI=el(),nU=c.forwardRef((e,t)=>{var n,r;let{value:o,defaultValue:a,onValueChange:i,enableSelect:l=!0,minDate:u,maxDate:s,placeholder:f="Select range",selectPlaceholder:m="Select range",disabled:v=!1,locale:h=eq,enableClear:p=!0,displayFormat:g,children:b,className:y,enableYearNavigation:w=!1,weekStartsOn:x=0,disabledDates:k}=e,M=(0,d._T)(e,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[C,D]=(0,nR.Z)(a,o),[T,N]=(0,c.useState)(!1),[P,E]=(0,c.useState)(!1),S=(0,c.useMemo)(()=>{let e=[];return u&&e.push({before:u}),s&&e.push({after:s}),[...e,...null!=k?k:[]]},[u,s,k]),_=(0,c.useMemo)(()=>{let e=new Map;return b?c.Children.forEach(b,t=>{var n;e.set(t.props.value,{text:null!==(n=(0,ed.qg)(t))&&void 0!==n?n:t.props.value,from:t.props.from,to:t.props.to})}):e4.forEach(t=>{e.set(t.value,{text:t.text,from:t.from,to:nI})}),e},[b]),j=(0,c.useMemo)(()=>{if(b)return(0,ed.sl)(b);let e=new Map;return e4.forEach(t=>e.set(t.value,t.text)),e},[b]),O=(null==C?void 0:C.selectValue)||"",Z=e1(null==C?void 0:C.from,u,O,_),L=e2(null==C?void 0:C.to,s,O,_),Y=Z||L?e3(Z,L,h,g):f,F=eu(null!==(r=null!==(n=null!=L?L:Z)&&void 0!==n?n:s)&&void 0!==r?r:nI),W=p&&!v;return c.createElement("div",Object.assign({ref:t,className:(0,es.q)("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",y)},M),c.createElement($,{as:"div",className:(0,es.q)("w-full",l?"rounded-l-tremor-default":"rounded-tremor-default",T&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},c.createElement("div",{className:"relative w-full"},c.createElement($.Button,{onFocus:()=>N(!0),onBlur:()=>N(!1),disabled:v,className:(0,es.q)("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",l?"rounded-l-tremor-default":"rounded-tremor-default",W?"pr-8":"pr-4",(0,ed.um)((0,ed.Uh)(Z||L),v))},c.createElement(en,{className:(0,es.q)(e0("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),c.createElement("p",{className:"truncate"},Y)),W&&Z?c.createElement("button",{type:"button",className:(0,es.q)("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==i||i({}),D({})}},c.createElement(er.Z,{className:(0,es.q)(e0("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),c.createElement(ee.u,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},c.createElement($.Panel,{focus:!0,className:(0,es.q)("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},c.createElement(nF,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:F,selected:{from:Z,to:L},onSelect:e=>{null==i||i({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),D({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:h,disabled:S,enableYearNavigation:w,classNames:{day_range_middle:(0,es.q)("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:x},e))))),l&&c.createElement(et.R,{as:"div",className:(0,es.q)("w-48 -ml-px rounded-r-tremor-default",P&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:O,onChange:e=>{let{from:t,to:n}=_.get(e),r=null!=n?n:nI;null==i||i({from:t,to:r,selectValue:e}),D({from:t,to:r,selectValue:e})},disabled:v},e=>{var t;let{value:n}=e;return c.createElement(c.Fragment,null,c.createElement(et.R.Button,{onFocus:()=>E(!0),onBlur:()=>E(!1),className:(0,es.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",(0,ed.um)((0,ed.Uh)(n),v))},n&&null!==(t=j.get(n))&&void 0!==t?t:m),c.createElement(ee.u,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},c.createElement(et.R.Options,{className:(0,es.q)("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=b?b:e4.map(e=>c.createElement(nW.Z,{key:e.value,value:e.value},e.text)))))}))});nU.displayName="DateRangePicker"},40048:function(e,t,n){n.d(t,{i:function(){return a}});var r=n(2265),o=n(40293);function a(){for(var e=arguments.length,t=Array(e),n=0;n(0,o.r)(...t),[...t])}}}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/1491-8280340b5391aa11.js b/ui/litellm-dashboard/out/_next/static/chunks/1491-8280340b5391aa11.js deleted file mode 100644 index f2f6a5f9bd..0000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/1491-8280340b5391aa11.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1491],{31373:function(e,t,n){"use strict";n.d(t,{iN:function(){return h},R_:function(){return d},EV:function(){return g},ez:function(){return f}});var r=n(82082),o=n(96021),a=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function i(e){var t=e.r,n=e.g,o=e.b,a=(0,r.py)(t,n,o);return{h:360*a.h,s:a.s,v:a.v}}function c(e){var t=e.r,n=e.g,o=e.b;return"#".concat((0,r.vq)(t,n,o,!1))}function l(e,t,n){var r;return(r=Math.round(e.h)>=60&&240>=Math.round(e.h)?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function s(e,t,n){var r;return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)))}function u(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function d(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=(0,o.uA)(e),d=5;d>0;d-=1){var f=i(r),p=c((0,o.uA)({h:l(f,d,!0),s:s(f,d,!0),v:u(f,d,!0)}));n.push(p)}n.push(c(r));for(var m=1;m<=4;m+=1){var g=i(r),h=c((0,o.uA)({h:l(g,m),s:s(g,m),v:u(g,m)}));n.push(h)}return"dark"===t.theme?a.map(function(e){var r,a,i,l=e.index,s=e.opacity;return c((r=(0,o.uA)(t.backgroundColor||"#141414"),a=(0,o.uA)(n[l]),i=100*s/100,{r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b}))}):n}var f={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},p={},m={};Object.keys(f).forEach(function(e){p[e]=d(f[e]),p[e].primary=p[e][5],m[e]=d(f[e],{theme:"dark",backgroundColor:"#141414"}),m[e].primary=m[e][5]}),p.red,p.volcano;var g=p.gold;p.orange,p.yellow,p.lime,p.green,p.cyan;var h=p.blue;p.geekblue,p.purple,p.magenta,p.grey,p.grey},352:function(e,t,n){"use strict";n.d(t,{E4:function(){return eL},jG:function(){return M},ks:function(){return H},bf:function(){return z},CI:function(){return eA},fp:function(){return Y},xy:function(){return eF}});var r,o,a=n(11993),i=n(26365),c=n(83145),l=n(31686),s=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))*1540483477+((t>>>16)*59797<<16),t^=t>>>24,n=(65535&t)*1540483477+((t>>>16)*59797<<16)^(65535&n)*1540483477+((n>>>16)*59797<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n^=255&e.charCodeAt(r),n=(65535&n)*1540483477+((n>>>16)*59797<<16)}return n^=n>>>13,(((n=(65535&n)*1540483477+((n>>>16)*59797<<16))^n>>>15)>>>0).toString(36)},u=n(21717),d=n(2265),f=n.t(d,2);n(6397),n(16671);var p=n(76405),m=n(25049);function g(e){return e.join("%")}var h=function(){function e(t){(0,p.Z)(this,e),(0,a.Z)(this,"instanceId",void 0),(0,a.Z)(this,"cache",new Map),this.instanceId=t}return(0,m.Z)(e,[{key:"get",value:function(e){return this.opGet(g(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(g(e),t)}},{key:"opUpdate",value:function(e,t){var n=t(this.cache.get(e));null===n?this.cache.delete(e):this.cache.set(e,n)}}]),e}(),v="data-token-hash",b="data-css-hash",y="__cssinjs_instance__",w=d.createContext({hashPriority:"low",cache:function(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(b,"]"))||[],n=document.head.firstChild;Array.from(t).forEach(function(t){t[y]=t[y]||e,t[y]===e&&document.head.insertBefore(t,n)});var r={};Array.from(document.querySelectorAll("style[".concat(b,"]"))).forEach(function(t){var n,o=t.getAttribute(b);r[o]?t[y]===e&&(null===(n=t.parentNode)||void 0===n||n.removeChild(t)):r[o]=!0})}return new h(e)}(),defaultCache:!0}),x=n(41154),E=n(94981),S=function(){function e(){(0,p.Z)(this,e),(0,a.Z)(this,"cache",void 0),(0,a.Z)(this,"keys",void 0),(0,a.Z)(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return(0,m.Z)(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o={map:this.cache};return e.forEach(function(e){if(o){var t;o=null===(t=o)||void 0===t||null===(t=t.map)||void 0===t?void 0:t.get(e)}else o=void 0}),null!==(t=o)&&void 0!==t&&t.value&&r&&(o.value[1]=this.cacheCallTimes++),null===(n=o)||void 0===n?void 0:n.value}},{key:"get",value:function(e){var t;return null===(t=this.internalGet(e,!0))||void 0===t?void 0:t[0]}},{key:"has",value:function(e){return!!this.internalGet(e)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(e,t){var n=(0,i.Z)(e,2)[1];return r.internalGet(t)[1]0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),Z+=1}return(0,m.Z)(e,[{key:"getDerivativeToken",value:function(e){return this.derivatives.reduce(function(t,n){return n(e,t)},void 0)}}]),e}(),k=new S;function M(e){var t=Array.isArray(e)?e:[e];return k.has(t)||k.set(t,new O(t)),k.get(t)}var j=new WeakMap,I={},R=new WeakMap;function N(e){var t=R.get(e)||"";return t||(Object.keys(e).forEach(function(n){var r=e[n];t+=n,r instanceof O?t+=r.id:r&&"object"===(0,x.Z)(r)?t+=N(r):t+=r}),R.set(e,t)),t}function P(e,t){return s("".concat(t,"_").concat(N(e)))}var F="random-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,""),T="_bAmBoO_",A=void 0,L=(0,E.Z)();function z(e){return"number"==typeof e?"".concat(e,"px"):e}function _(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(i)return e;var c=(0,l.Z)((0,l.Z)({},o),{},(r={},(0,a.Z)(r,v,t),(0,a.Z)(r,b,n),r)),s=Object.keys(c).map(function(e){var t=c[e];return t?"".concat(e,'="').concat(t,'"'):null}).filter(function(e){return e}).join(" ");return"")}var H=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"--".concat(t?"".concat(t,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},B=function(e,t,n){var r,o={},a={};return Object.entries(e).forEach(function(e){var t=(0,i.Z)(e,2),r=t[0],c=t[1];if(null!=n&&null!==(l=n.preserve)&&void 0!==l&&l[r])a[r]=c;else if(("string"==typeof c||"number"==typeof c)&&!(null!=n&&null!==(s=n.ignore)&&void 0!==s&&s[r])){var l,s,u,d=H(r,null==n?void 0:n.prefix);o[d]="number"!=typeof c||null!=n&&null!==(u=n.unitless)&&void 0!==u&&u[r]?String(c):"".concat(c,"px"),a[r]="var(".concat(d,")")}}),[a,(r={scope:null==n?void 0:n.scope},Object.keys(o).length?".".concat(t).concat(null!=r&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(o).map(function(e){var t=(0,i.Z)(e,2),n=t[0],r=t[1];return"".concat(n,":").concat(r,";")}).join(""),"}"):"")]},D=n(27380),W=(0,l.Z)({},f).useInsertionEffect,V=W?function(e,t,n){return W(function(){return e(),t()},n)}:function(e,t,n){d.useMemo(e,n),(0,D.Z)(function(){return t(!0)},n)},q=void 0!==(0,l.Z)({},f).useInsertionEffect?function(e){var t=[],n=!1;return d.useEffect(function(){return n=!1,function(){n=!0,t.length&&t.forEach(function(e){return e()})}},e),function(e){n||t.push(e)}}:function(){return function(e){e()}};function G(e,t,n,r,o){var a=d.useContext(w).cache,l=g([e].concat((0,c.Z)(t))),s=q([l]),u=function(e){a.opUpdate(l,function(t){var r=(0,i.Z)(t||[void 0,void 0],2),o=r[0],a=[void 0===o?0:o,r[1]||n()];return e?e(a):a})};d.useMemo(function(){u()},[l]);var f=a.opGet(l)[1];return V(function(){null==o||o(f)},function(e){return u(function(t){var n=(0,i.Z)(t,2),r=n[0],a=n[1];return e&&0===r&&(null==o||o(f)),[r+1,a]}),function(){a.opUpdate(l,function(t){var n=(0,i.Z)(t||[],2),o=n[0],c=void 0===o?0:o,u=n[1];return 0==c-1?(s(function(){(e||!a.opGet(l))&&(null==r||r(u,!1))}),null):[c-1,u]})}},[l]),f}var X={},U=new Map,$=function(e,t,n,r){var o=n.getDerivativeToken(e),a=(0,l.Z)((0,l.Z)({},o),t);return r&&(a=r(a)),a},K="token";function Y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(0,d.useContext)(w),o=r.cache.instanceId,a=r.container,f=n.salt,p=void 0===f?"":f,m=n.override,g=void 0===m?X:m,h=n.formatToken,x=n.getComputedToken,E=n.cssVar,S=function(e,t){for(var n=j,r=0;r=(U.get(e)||0)}),n.length-r.length>0&&r.forEach(function(e){"undefined"!=typeof document&&document.querySelectorAll("style[".concat(v,'="').concat(e,'"]')).forEach(function(e){if(e[y]===o){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}}),U.delete(e)})},function(e){var t=(0,i.Z)(e,4),n=t[0],r=t[3];if(E&&r){var c=(0,u.hq)(r,s("css-variables-".concat(n._themeKey)),{mark:b,prepend:"queue",attachTo:a,priority:-999});c[y]=o,c.setAttribute(v,n._themeKey)}})}var Q=n(1119),J={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ee="comm",et="rule",en="decl",er=Math.abs,eo=String.fromCharCode;function ea(e,t,n){return e.replace(t,n)}function ei(e,t){return 0|e.charCodeAt(t)}function ec(e,t,n){return e.slice(t,n)}function el(e){return e.length}function es(e,t){return t.push(e),e}function eu(e,t){for(var n="",r=0;r0?p[b]+" "+y:ea(y,/&\f/g,p[b])).trim())&&(l[v++]=w);return eb(e,t,n,0===o?et:c,l,s,u,d)}function eC(e,t,n,r,o){return eb(e,t,n,en,ec(e,0,r),ec(e,r+1,-1),r,o)}var eZ="data-ant-cssinjs-cache-path",eO="_FILE_STYLE__",ek=!0,eM="_multi_value_";function ej(e){var t,n,r;return eu((r=function e(t,n,r,o,a,i,c,l,s){for(var u,d,f,p=0,m=0,g=c,h=0,v=0,b=0,y=1,w=1,x=1,E=0,S="",C=a,Z=i,O=o,k=S;w;)switch(b=E,E=ey()){case 40:if(108!=b&&58==ei(k,g-1)){-1!=(d=k+=ea(eE(E),"&","&\f"),f=er(p?l[p-1]:0),d.indexOf("&\f",f))&&(x=-1);break}case 34:case 39:case 91:k+=eE(E);break;case 9:case 10:case 13:case 32:k+=function(e){for(;eh=ew();)if(eh<33)ey();else break;return ex(e)>2||ex(eh)>3?"":" "}(b);break;case 92:k+=function(e,t){for(var n;--t&&ey()&&!(eh<48)&&!(eh>102)&&(!(eh>57)||!(eh<65))&&(!(eh>70)||!(eh<97)););return n=eg+(t<6&&32==ew()&&32==ey()),ec(ev,e,n)}(eg-1,7);continue;case 47:switch(ew()){case 42:case 47:es(eb(u=function(e,t){for(;ey();)if(e+eh===57)break;else if(e+eh===84&&47===ew())break;return"/*"+ec(ev,t,eg-1)+"*"+eo(47===e?e:ey())}(ey(),eg),n,r,ee,eo(eh),ec(u,2,-2),0,s),s),(5==ex(b||1)||5==ex(ew()||1))&&el(k)&&" "!==ec(k,-1,void 0)&&(k+=" ");break;default:k+="/"}break;case 123*y:l[p++]=el(k)*x;case 125*y:case 59:case 0:switch(E){case 0:case 125:w=0;case 59+m:-1==x&&(k=ea(k,/\f/g,"")),v>0&&(el(k)-g||0===y&&47===b)&&es(v>32?eC(k+";",o,r,g-1,s):eC(ea(k," ","")+";",o,r,g-2,s),s);break;case 59:k+=";";default:if(es(O=eS(k,n,r,p,m,a,l,S,C=[],Z=[],g,i),i),123===E){if(0===m)e(k,n,O,O,C,i,g,l,Z);else{switch(h){case 99:if(110===ei(k,3))break;case 108:if(97===ei(k,2))break;default:m=0;case 100:case 109:case 115:}m?e(t,O,O,o&&es(eS(t,O,O,0,0,a,l,S,a,C=[],g,Z),Z),a,Z,g,l,o?C:Z):e(k,O,O,O,[""],Z,0,l,Z)}}}p=m=v=0,y=x=1,S=k="",g=c;break;case 58:g=1+el(k),v=b;default:if(y<1){if(123==E)--y;else if(125==E&&0==y++&&125==(eh=eg>0?ei(ev,--eg):0,ep--,10===eh&&(ep=1,ef--),eh))continue}switch(k+=eo(E),E*y){case 38:x=m>0?1:(k+="\f",-1);break;case 44:l[p++]=(el(k)-1)*x,x=1;break;case 64:45===ew()&&(k+=eE(ey())),h=ew(),m=g=el(S=k+=function(e){for(;!ex(ew());)ey();return ec(ev,e,eg)}(eg)),E++;break;case 45:45===b&&2==el(k)&&(y=0)}}return i}("",null,null,null,[""],(n=t=e,ef=ep=1,em=el(ev=n),eg=0,t=[]),0,[0],t),ev="",r),ed).replace(/\{%%%\:[^;];}/g,";")}var eI=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{root:!0,parentSelectors:[]},o=r.root,a=r.injectHash,s=r.parentSelectors,d=n.hashId,f=n.layer,p=(n.path,n.hashPriority),m=n.transformers,g=void 0===m?[]:m;n.linters;var h="",v={};function b(t){var r=t.getName(d);if(!v[r]){var o=e(t.style,n,{root:!1,parentSelectors:s}),a=(0,i.Z)(o,1)[0];v[r]="@keyframes ".concat(t.getName(d)).concat(a)}}if((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.forEach(function(t){Array.isArray(t)?e(t,n):t&&n.push(t)}),n})(Array.isArray(t)?t:[t]).forEach(function(t){var r="string"!=typeof t||o?t:{};if("string"==typeof r)h+="".concat(r,"\n");else if(r._keyframe)b(r);else{var u=g.reduce(function(e,t){var n;return(null==t||null===(n=t.visit)||void 0===n?void 0:n.call(t,e))||e},r);Object.keys(u).forEach(function(t){var r=u[t];if("object"!==(0,x.Z)(r)||!r||"animationName"===t&&r._keyframe||"object"===(0,x.Z)(r)&&r&&("_skip_check_"in r||eM in r)){function f(e,t){var n=e.replace(/[A-Z]/g,function(e){return"-".concat(e.toLowerCase())}),r=t;J[e]||"number"!=typeof r||0===r||(r="".concat(r,"px")),"animationName"===e&&null!=t&&t._keyframe&&(b(t),r=t.getName(d)),h+="".concat(n,":").concat(r,";")}var m,g=null!==(m=null==r?void 0:r.value)&&void 0!==m?m:r;"object"===(0,x.Z)(r)&&null!=r&&r[eM]&&Array.isArray(g)?g.forEach(function(e){f(t,e)}):f(t,g)}else{var y=!1,w=t.trim(),E=!1;(o||a)&&d?w.startsWith("@")?y=!0:w=function(e,t,n){if(!t)return e;var r=".".concat(t),o="low"===n?":where(".concat(r,")"):r;return e.split(",").map(function(e){var t,n=e.trim().split(/\s+/),r=n[0]||"",a=(null===(t=r.match(/^\w+/))||void 0===t?void 0:t[0])||"";return[r="".concat(a).concat(o).concat(r.slice(a.length))].concat((0,c.Z)(n.slice(1))).join(" ")}).join(",")}(t,d,p):o&&!d&&("&"===w||""===w)&&(w="",E=!0);var S=e(r,n,{root:E,injectHash:y,parentSelectors:[].concat((0,c.Z)(s),[w])}),C=(0,i.Z)(S,2),Z=C[0],O=C[1];v=(0,l.Z)((0,l.Z)({},v),O),h+="".concat(w).concat(Z)}})}}),o){if(f&&(void 0===A&&(A=function(e,t,n){if((0,E.Z)()){(0,u.hq)(e,F);var r,o,a=document.createElement("div");a.style.position="fixed",a.style.left="0",a.style.top="0",null==t||t(a),document.body.appendChild(a);var i=null===(r=getComputedStyle(a).content)||void 0===r?void 0:r.includes(T);return null===(o=a.parentNode)||void 0===o||o.removeChild(a),(0,u.jL)(F),i}return!1}("@layer ".concat(F," { .").concat(F,' { content: "').concat(T,'"!important; } }'),function(e){e.className=F})),A)){var y=f.split(","),w=y[y.length-1].trim();h="@layer ".concat(w," {").concat(h,"}"),y.length>1&&(h="@layer ".concat(f,"{%%%:%}").concat(h))}}else h="{".concat(h,"}");return[h,v]};function eR(e,t){return s("".concat(e.join("%")).concat(t))}function eN(){return null}var eP="style";function eF(e,t){var n=e.token,o=e.path,l=e.hashId,s=e.layer,f=e.nonce,p=e.clientOnly,m=e.order,g=void 0===m?0:m,h=d.useContext(w),x=h.autoClear,S=(h.mock,h.defaultCache),C=h.hashPriority,Z=h.container,O=h.ssrInline,k=h.transformers,M=h.linters,j=h.cache,I=n._tokenKey,R=[I].concat((0,c.Z)(o)),N=G(eP,R,function(){var e=R.join("|");if(!function(){if(!r&&(r={},(0,E.Z)())){var e,t=document.createElement("div");t.className=eZ,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);var n=getComputedStyle(t).content||"";(n=n.replace(/^"/,"").replace(/"$/,"")).split(";").forEach(function(e){var t=e.split(":"),n=(0,i.Z)(t,2),o=n[0],a=n[1];r[o]=a});var o=document.querySelector("style[".concat(eZ,"]"));o&&(ek=!1,null===(e=o.parentNode)||void 0===e||e.removeChild(o)),document.body.removeChild(t)}}(),r[e]){var n=function(e){var t=r[e],n=null;if(t&&(0,E.Z)()){if(ek)n=eO;else{var o=document.querySelector("style[".concat(b,'="').concat(r[e],'"]'));o?n=o.innerHTML:delete r[e]}}return[n,t]}(e),a=(0,i.Z)(n,2),c=a[0],u=a[1];if(c)return[c,I,u,{},p,g]}var d=eI(t(),{hashId:l,hashPriority:C,layer:s,path:o.join("-"),transformers:k,linters:M}),f=(0,i.Z)(d,2),m=f[0],h=f[1],v=ej(m),y=eR(R,v);return[v,I,y,h,p,g]},function(e,t){var n=(0,i.Z)(e,3)[2];(t||x)&&L&&(0,u.jL)(n,{mark:b})},function(e){var t=(0,i.Z)(e,4),n=t[0],r=(t[1],t[2]),o=t[3];if(L&&n!==eO){var a={mark:b,prepend:"queue",attachTo:Z,priority:g},c="function"==typeof f?f():f;c&&(a.csp={nonce:c});var l=(0,u.hq)(n,r,a);l[y]=j.instanceId,l.setAttribute(v,I),Object.keys(o).forEach(function(e){(0,u.hq)(ej(o[e]),"_effect-".concat(e),a)})}}),P=(0,i.Z)(N,3),F=P[0],T=P[1],A=P[2];return function(e){var t,n;return t=O&&!L&&S?d.createElement("style",(0,Q.Z)({},(n={},(0,a.Z)(n,v,T),(0,a.Z)(n,b,A),n),{dangerouslySetInnerHTML:{__html:F}})):d.createElement(eN,null),d.createElement(d.Fragment,null,t,e)}}var eT="cssVar",eA=function(e,t){var n=e.key,r=e.prefix,o=e.unitless,a=e.ignore,l=e.token,s=e.scope,f=void 0===s?"":s,p=(0,d.useContext)(w),m=p.cache.instanceId,g=p.container,h=l._tokenKey,x=[].concat((0,c.Z)(e.path),[n,f,h]);return G(eT,x,function(){var e=B(t(),n,{prefix:r,unitless:o,ignore:a,scope:f}),c=(0,i.Z)(e,2),l=c[0],s=c[1],u=eR(x,s);return[l,s,u,n]},function(e){var t=(0,i.Z)(e,3)[2];L&&(0,u.jL)(t,{mark:b})},function(e){var t=(0,i.Z)(e,3),r=t[1],o=t[2];if(r){var a=(0,u.hq)(r,o,{mark:b,prepend:"queue",attachTo:g,priority:-999});a[y]=m,a.setAttribute(v,n)}})};o={},(0,a.Z)(o,eP,function(e,t,n){var r=(0,i.Z)(e,6),o=r[0],a=r[1],c=r[2],l=r[3],s=r[4],u=r[5],d=(n||{}).plain;if(s)return null;var f=o,p={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return f=_(o,a,c,p,d),l&&Object.keys(l).forEach(function(e){if(!t[e]){t[e]=!0;var n=ej(l[e]);f+=_(n,a,"_effect-".concat(e),p,d)}}),[u,c,f]}),(0,a.Z)(o,K,function(e,t,n){var r=(0,i.Z)(e,5),o=r[2],a=r[3],c=r[4],l=(n||{}).plain;if(!a)return null;var s=o._tokenKey,u=_(a,c,s,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},l);return[-999,s,u]}),(0,a.Z)(o,eT,function(e,t,n){var r=(0,i.Z)(e,4),o=r[1],a=r[2],c=r[3],l=(n||{}).plain;if(!o)return null;var s=_(o,c,a,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},l);return[-999,a,s]});var eL=function(){function e(t,n){(0,p.Z)(this,e),(0,a.Z)(this,"name",void 0),(0,a.Z)(this,"style",void 0),(0,a.Z)(this,"_keyframe",!0),this.name=t,this.style=n}return(0,m.Z)(e,[{key:"getName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?"".concat(e,"-").concat(this.name):this.name}}]),e}();function ez(e){return e.notSplit=!0,e}ez(["borderTop","borderBottom"]),ez(["borderTop"]),ez(["borderBottom"]),ez(["borderLeft","borderRight"]),ez(["borderLeft"]),ez(["borderRight"])},55015:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var r=n(1119),o=n(26365),a=n(11993),i=n(6989),c=n(2265),l=n(36760),s=n.n(l),u=n(31373),d=n(20902),f=n(31686),p=n(41154),m=n(21717),g=n(13211),h=n(32559);function v(e){return"object"===(0,p.Z)(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===(0,p.Z)(e.icon)||"function"==typeof e.icon)}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];return"class"===n?(t.className=r,delete t.class):(delete t[n],t[n.replace(/-(.)/g,function(e,t){return t.toUpperCase()})]=r),t},{})}function y(e){return(0,u.R_)(e)[0]}function w(e){return e?Array.isArray(e)?e:[e]:[]}var x=function(e){var t=(0,c.useContext)(d.Z),n=t.csp,r=t.prefixCls,o="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";r&&(o=o.replace(/anticon/g,r)),(0,c.useEffect)(function(){var t=e.current,r=(0,g.A)(t);(0,m.hq)(o,"@ant-design-icons",{prepend:!0,csp:n,attachTo:r})},[])},E=["icon","className","onClick","style","primaryColor","secondaryColor"],S={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},C=function(e){var t,n,r=e.icon,o=e.className,a=e.onClick,l=e.style,s=e.primaryColor,u=e.secondaryColor,d=(0,i.Z)(e,E),p=c.useRef(),m=S;if(s&&(m={primaryColor:s,secondaryColor:u||y(s)}),x(p),t=v(r),n="icon should be icon definiton, but got ".concat(r),(0,h.ZP)(t,"[@ant-design/icons] ".concat(n)),!v(r))return null;var g=r;return g&&"function"==typeof g.icon&&(g=(0,f.Z)((0,f.Z)({},g),{},{icon:g.icon(m.primaryColor,m.secondaryColor)})),function e(t,n,r){return r?c.createElement(t.tag,(0,f.Z)((0,f.Z)({key:n},b(t.attrs)),r),(t.children||[]).map(function(r,o){return e(r,"".concat(n,"-").concat(t.tag,"-").concat(o))})):c.createElement(t.tag,(0,f.Z)({key:n},b(t.attrs)),(t.children||[]).map(function(r,o){return e(r,"".concat(n,"-").concat(t.tag,"-").concat(o))}))}(g.icon,"svg-".concat(g.name),(0,f.Z)((0,f.Z)({className:o,onClick:a,style:l,"data-icon":g.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:p}))};function Z(e){var t=w(e),n=(0,o.Z)(t,2),r=n[0],a=n[1];return C.setTwoToneColors({primaryColor:r,secondaryColor:a})}C.displayName="IconReact",C.getTwoToneColors=function(){return(0,f.Z)({},S)},C.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;S.primaryColor=t,S.secondaryColor=n||y(t),S.calculated=!!n};var O=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Z(u.iN.primary);var k=c.forwardRef(function(e,t){var n,l=e.className,u=e.icon,f=e.spin,p=e.rotate,m=e.tabIndex,g=e.onClick,h=e.twoToneColor,v=(0,i.Z)(e,O),b=c.useContext(d.Z),y=b.prefixCls,x=void 0===y?"anticon":y,E=b.rootClassName,S=s()(E,x,(n={},(0,a.Z)(n,"".concat(x,"-").concat(u.name),!!u.name),(0,a.Z)(n,"".concat(x,"-spin"),!!f||"loading"===u.name),n),l),Z=m;void 0===Z&&g&&(Z=-1);var k=w(h),M=(0,o.Z)(k,2),j=M[0],I=M[1];return c.createElement("span",(0,r.Z)({role:"img","aria-label":u.name},v,{ref:t,tabIndex:Z,onClick:g,className:S}),c.createElement(C,{icon:u,primaryColor:j,secondaryColor:I,style:p?{msTransform:"rotate(".concat(p,"deg)"),transform:"rotate(".concat(p,"deg)")}:void 0}))});k.displayName="AntdIcon",k.getTwoToneColor=function(){var e=C.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},k.setTwoToneColor=Z;var M=k},20902:function(e,t,n){"use strict";var r=(0,n(2265).createContext)({});t.Z=r},8900:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},9738:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},39725:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},49638:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},70464:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},54537:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},97416:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},6520:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},55726:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},15424:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},61935:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},67187:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},29436:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},82082:function(e,t,n){"use strict";n.d(t,{T6:function(){return f},VD:function(){return p},WE:function(){return s},Yt:function(){return m},lC:function(){return a},py:function(){return l},rW:function(){return o},s:function(){return d},ve:function(){return c},vq:function(){return u}});var r=n(58317);function o(e,t,n){return{r:255*(0,r.sh)(e,255),g:255*(0,r.sh)(t,255),b:255*(0,r.sh)(n,255)}}function a(e,t,n){var o=Math.max(e=(0,r.sh)(e,255),t=(0,r.sh)(t,255),n=(0,r.sh)(n,255)),a=Math.min(e,t,n),i=0,c=0,l=(o+a)/2;if(o===a)c=0,i=0;else{var s=o-a;switch(c=l>.5?s/(2-o-a):s/(o+a),o){case e:i=(t-n)/s+(t1&&(n-=1),n<1/6)?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function c(e,t,n){if(e=(0,r.sh)(e,360),t=(0,r.sh)(t,100),n=(0,r.sh)(n,100),0===t)a=n,c=n,o=n;else{var o,a,c,l=n<.5?n*(1+t):n+t-n*t,s=2*n-l;o=i(s,l,e+1/3),a=i(s,l,e),c=i(s,l,e-1/3)}return{r:255*o,g:255*a,b:255*c}}function l(e,t,n){var o=Math.max(e=(0,r.sh)(e,255),t=(0,r.sh)(t,255),n=(0,r.sh)(n,255)),a=Math.min(e,t,n),i=0,c=o-a;if(o===a)i=0;else{switch(o){case e:i=(t-n)/c+(t>16,g:(65280&e)>>8,b:255&e}}},28052:function(e,t,n){"use strict";n.d(t,{R:function(){return r}});var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},96021:function(e,t,n){"use strict";n.d(t,{uA:function(){return i}});var r=n(82082),o=n(28052),a=n(58317);function i(e){var t={r:0,g:0,b:0},n=1,i=null,c=null,l=null,s=!1,f=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(o.R[e])e=o.R[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=u.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=u.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=u.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=u.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=u.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=u.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=u.hex8.exec(e))?{r:(0,r.VD)(n[1]),g:(0,r.VD)(n[2]),b:(0,r.VD)(n[3]),a:(0,r.T6)(n[4]),format:t?"name":"hex8"}:(n=u.hex6.exec(e))?{r:(0,r.VD)(n[1]),g:(0,r.VD)(n[2]),b:(0,r.VD)(n[3]),format:t?"name":"hex"}:(n=u.hex4.exec(e))?{r:(0,r.VD)(n[1]+n[1]),g:(0,r.VD)(n[2]+n[2]),b:(0,r.VD)(n[3]+n[3]),a:(0,r.T6)(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=u.hex3.exec(e))&&{r:(0,r.VD)(n[1]+n[1]),g:(0,r.VD)(n[2]+n[2]),b:(0,r.VD)(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(d(e.r)&&d(e.g)&&d(e.b)?(t=(0,r.rW)(e.r,e.g,e.b),s=!0,f="%"===String(e.r).substr(-1)?"prgb":"rgb"):d(e.h)&&d(e.s)&&d(e.v)?(i=(0,a.JX)(e.s),c=(0,a.JX)(e.v),t=(0,r.WE)(e.h,i,c),s=!0,f="hsv"):d(e.h)&&d(e.s)&&d(e.l)&&(i=(0,a.JX)(e.s),l=(0,a.JX)(e.l),t=(0,r.ve)(e.h,i,l),s=!0,f="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=(0,a.Yq)(n),{ok:s,format:e.format||f,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var c="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),l="[\\s|\\(]+(".concat(c,")[,|\\s]+(").concat(c,")[,|\\s]+(").concat(c,")\\s*\\)?"),s="[\\s|\\(]+(".concat(c,")[,|\\s]+(").concat(c,")[,|\\s]+(").concat(c,")[,|\\s]+(").concat(c,")\\s*\\)?"),u={CSS_UNIT:new RegExp(c),rgb:RegExp("rgb"+l),rgba:RegExp("rgba"+s),hsl:RegExp("hsl"+l),hsla:RegExp("hsla"+s),hsv:RegExp("hsv"+l),hsva:RegExp("hsva"+s),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function d(e){return!!u.CSS_UNIT.exec(String(e))}},36360:function(e,t,n){"use strict";n.d(t,{C:function(){return c}});var r=n(82082),o=n(28052),a=n(96021),i=n(58317),c=function(){function e(t,n){if(void 0===t&&(t=""),void 0===n&&(n={}),t instanceof e)return t;"number"==typeof t&&(t=(0,r.Yt)(t)),this.originalInput=t;var o,i=(0,a.uA)(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(o=n.format)&&void 0!==o?o:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return 128>this.getBrightness()},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=(0,i.Yq)(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=(0,r.py)(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=(0,r.py)(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),o=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=(0,r.lC)(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=(0,r.lC)(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),o=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(o,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),(0,r.vq)(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),(0,r.s)(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*(0,i.sh)(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*(0,i.sh)(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+(0,r.vq)(this.r,this.g,this.b,!1),t=0,n=Object.entries(o.R);t=0;return!t&&r&&(e.startsWith("hex")||"name"===e)?"name"===e&&0===this.a?this.toName():this.toRgbString():("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=(0,i.V2)(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-(t/100*255)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-(t/100*255)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-(t/100*255)))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=(0,i.V2)(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=(0,i.V2)(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=(0,i.V2)(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var r=this.toRgb(),o=new e(t).toRgb(),a=n/100;return new e({r:(o.r-r.r)*a+r.r,g:(o.g-r.g)*a+r.g,b:(o.b-r.b)*a+r.b,a:(o.a-r.a)*a+r.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var r=this.toHsl(),o=360/n,a=[this];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,a.push(new e(r));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),r=n.h,o=n.s,a=n.v,i=[],c=1/t;t--;)i.push(new e({h:r,s:o,v:a})),a=(a+c)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),o=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/o,g:(n.g*n.a+r.g*r.a*(1-n.a))/o,b:(n.b*n.a+r.b*r.a*(1-n.a))/o,a:o})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,o=[this],a=360/t,i=1;iMath.abs(e-t))?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function o(e){return Math.min(1,Math.max(0,e))}function a(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function i(e){return e<=1?"".concat(100*Number(e),"%"):e}function c(e){return 1===e.length?"0"+e:String(e)}n.d(t,{FZ:function(){return c},JX:function(){return i},V2:function(){return o},Yq:function(){return a},sh:function(){return r}})},28036:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(26365),o=n(2265),a=n(54887),i=n(94981);n(32559);var c=n(28791),l=o.createContext(null),s=n(83145),u=n(27380),d=[],f=n(21717),p=n(3208),m="rc-util-locker-".concat(Date.now()),g=0,h=function(e){return!1!==e&&((0,i.Z)()&&e?"string"==typeof e?document.querySelector(e):"function"==typeof e?e():e:null)},v=o.forwardRef(function(e,t){var n,v,b,y=e.open,w=e.autoLock,x=e.getContainer,E=(e.debug,e.autoDestroy),S=void 0===E||E,C=e.children,Z=o.useState(y),O=(0,r.Z)(Z,2),k=O[0],M=O[1],j=k||y;o.useEffect(function(){(S||y)&&M(y)},[y,S]);var I=o.useState(function(){return h(x)}),R=(0,r.Z)(I,2),N=R[0],P=R[1];o.useEffect(function(){var e=h(x);P(null!=e?e:null)});var F=function(e,t){var n=o.useState(function(){return(0,i.Z)()?document.createElement("div"):null}),a=(0,r.Z)(n,1)[0],c=o.useRef(!1),f=o.useContext(l),p=o.useState(d),m=(0,r.Z)(p,2),g=m[0],h=m[1],v=f||(c.current?void 0:function(e){h(function(t){return[e].concat((0,s.Z)(t))})});function b(){a.parentElement||document.body.appendChild(a),c.current=!0}function y(){var e;null===(e=a.parentElement)||void 0===e||e.removeChild(a),c.current=!1}return(0,u.Z)(function(){return e?f?f(b):b():y(),y},[e]),(0,u.Z)(function(){g.length&&(g.forEach(function(e){return e()}),h(d))},[g]),[a,v]}(j&&!N,0),T=(0,r.Z)(F,2),A=T[0],L=T[1],z=null!=N?N:A;n=!!(w&&y&&(0,i.Z)()&&(z===A||z===document.body)),v=o.useState(function(){return g+=1,"".concat(m,"_").concat(g)}),b=(0,r.Z)(v,1)[0],(0,u.Z)(function(){if(n){var e=(0,p.o)(document.body).width,t=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth;(0,f.hq)("\nhtml body {\n overflow-y: hidden;\n ".concat(t?"width: calc(100% - ".concat(e,"px);"):"","\n}"),b)}else(0,f.jL)(b);return function(){(0,f.jL)(b)}},[n,b]);var _=null;C&&(0,c.Yr)(C)&&t&&(_=C.ref);var H=(0,c.x1)(_,t);if(!j||!(0,i.Z)()||void 0===N)return null;var B=!1===z,D=C;return t&&(D=o.cloneElement(C,{ref:H})),o.createElement(l.Provider,{value:L},B?D:(0,a.createPortal)(D,z))})},97821:function(e,t,n){"use strict";n.d(t,{Z:function(){return D}});var r=n(31686),o=n(26365),a=n(6989),i=n(28036),c=n(36760),l=n.n(c),s=n(31474),u=n(2868),d=n(13211),f=n(58525),p=n(92491),m=n(27380),g=n(79267),h=n(2265),v=n(1119),b=n(47970),y=n(28791);function w(e){var t=e.prefixCls,n=e.align,r=e.arrow,o=e.arrowPos,a=r||{},i=a.className,c=a.content,s=o.x,u=o.y,d=h.useRef();if(!n||!n.points)return null;var f={position:"absolute"};if(!1!==n.autoArrow){var p=n.points[0],m=n.points[1],g=p[0],v=p[1],b=m[0],y=m[1];g!==b&&["t","b"].includes(g)?"t"===g?f.top=0:f.bottom=0:f.top=void 0===u?0:u,v!==y&&["l","r"].includes(v)?"l"===v?f.left=0:f.right=0:f.left=void 0===s?0:s}return h.createElement("div",{ref:d,className:l()("".concat(t,"-arrow"),i),style:f},c)}function x(e){var t=e.prefixCls,n=e.open,r=e.zIndex,o=e.mask,a=e.motion;return o?h.createElement(b.ZP,(0,v.Z)({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(e){var n=e.className;return h.createElement("div",{style:{zIndex:r},className:l()("".concat(t,"-mask"),n)})}):null}var E=h.memo(function(e){return e.children},function(e,t){return t.cache}),S=h.forwardRef(function(e,t){var n=e.popup,a=e.className,i=e.prefixCls,c=e.style,u=e.target,d=e.onVisibleChanged,f=e.open,p=e.keepDom,g=e.fresh,S=e.onClick,C=e.mask,Z=e.arrow,O=e.arrowPos,k=e.align,M=e.motion,j=e.maskMotion,I=e.forceRender,R=e.getPopupContainer,N=e.autoDestroy,P=e.portal,F=e.zIndex,T=e.onMouseEnter,A=e.onMouseLeave,L=e.onPointerEnter,z=e.ready,_=e.offsetX,H=e.offsetY,B=e.offsetR,D=e.offsetB,W=e.onAlign,V=e.onPrepare,q=e.stretch,G=e.targetWidth,X=e.targetHeight,U="function"==typeof n?n():n,$=f||p,K=(null==R?void 0:R.length)>0,Y=h.useState(!R||!K),Q=(0,o.Z)(Y,2),J=Q[0],ee=Q[1];if((0,m.Z)(function(){!J&&K&&u&&ee(!0)},[J,K,u]),!J)return null;var et="auto",en={left:"-1000vw",top:"-1000vh",right:et,bottom:et};if(z||!f){var er,eo=k.points,ea=k.dynamicInset||(null===(er=k._experimental)||void 0===er?void 0:er.dynamicInset),ei=ea&&"r"===eo[0][1],ec=ea&&"b"===eo[0][0];ei?(en.right=B,en.left=et):(en.left=_,en.right=et),ec?(en.bottom=D,en.top=et):(en.top=H,en.bottom=et)}var el={};return q&&(q.includes("height")&&X?el.height=X:q.includes("minHeight")&&X&&(el.minHeight=X),q.includes("width")&&G?el.width=G:q.includes("minWidth")&&G&&(el.minWidth=G)),f||(el.pointerEvents="none"),h.createElement(P,{open:I||$,getContainer:R&&function(){return R(u)},autoDestroy:N},h.createElement(x,{prefixCls:i,open:f,zIndex:F,mask:C,motion:j}),h.createElement(s.Z,{onResize:W,disabled:!f},function(e){return h.createElement(b.ZP,(0,v.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:I,leavedClassName:"".concat(i,"-hidden")},M,{onAppearPrepare:V,onEnterPrepare:V,visible:f,onVisibleChanged:function(e){var t;null==M||null===(t=M.onVisibleChanged)||void 0===t||t.call(M,e),d(e)}}),function(n,o){var s=n.className,u=n.style,d=l()(i,s,a);return h.createElement("div",{ref:(0,y.sQ)(e,t,o),className:d,style:(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({"--arrow-x":"".concat(O.x||0,"px"),"--arrow-y":"".concat(O.y||0,"px")},en),el),u),{},{boxSizing:"border-box",zIndex:F},c),onMouseEnter:T,onMouseLeave:A,onPointerEnter:L,onClick:S},Z&&h.createElement(w,{prefixCls:i,arrow:Z,arrowPos:O,align:k}),h.createElement(E,{cache:!f&&!g},U))})}))}),C=h.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,o=(0,y.Yr)(n),a=h.useCallback(function(e){(0,y.mH)(t,r?r(e):e)},[r]),i=(0,y.x1)(a,n.ref);return o?h.cloneElement(n,{ref:i}):n}),Z=h.createContext(null);function O(e){return e?Array.isArray(e)?e:[e]:[]}var k=n(2857);function M(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function j(e){return e.ownerDocument.defaultView}function I(e){for(var t=[],n=null==e?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var o=j(n).getComputedStyle(n);[o.overflowX,o.overflowY,o.overflow].some(function(e){return r.includes(e)})&&t.push(n),n=n.parentElement}return t}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(e)?t:e}function N(e){return R(parseFloat(e),0)}function P(e,t){var n=(0,r.Z)({},e);return(t||[]).forEach(function(e){if(!(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)){var t=j(e).getComputedStyle(e),r=t.overflow,o=t.overflowClipMargin,a=t.borderTopWidth,i=t.borderBottomWidth,c=t.borderLeftWidth,l=t.borderRightWidth,s=e.getBoundingClientRect(),u=e.offsetHeight,d=e.clientHeight,f=e.offsetWidth,p=e.clientWidth,m=N(a),g=N(i),h=N(c),v=N(l),b=R(Math.round(s.width/f*1e3)/1e3),y=R(Math.round(s.height/u*1e3)/1e3),w=m*y,x=h*b,E=0,S=0;if("clip"===r){var C=N(o);E=C*b,S=C*y}var Z=s.x+x-E,O=s.y+w-S,k=Z+s.width+2*E-x-v*b-(f-p-h-v)*b,M=O+s.height+2*S-w-g*y-(u-d-m-g)*y;n.left=Math.max(n.left,Z),n.top=Math.max(n.top,O),n.right=Math.min(n.right,k),n.bottom=Math.min(n.bottom,M)}}),n}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?parseFloat(r[1])/100*e:parseFloat(n)}function T(e,t){var n=(0,o.Z)(t||[],2),r=n[0],a=n[1];return[F(e.width,r),F(e.height,a)]}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[e[0],e[1]]}function L(e,t){var n,r=t[0],o=t[1];return n="t"===r?e.y:"b"===r?e.y+e.height:e.y+e.height/2,{x:"l"===o?e.x:"r"===o?e.x+e.width:e.x+e.width/2,y:n}}function z(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(e,r){return r===t?n[e]||"c":e}).join("")}var _=n(83145);n(32559);var H=n(53346),B=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"],D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.Z;return h.forwardRef(function(t,n){var i,c,v,b,y,w,x,E,N,F,D,W,V,q,G,X,U,$=t.prefixCls,K=void 0===$?"rc-trigger-popup":$,Y=t.children,Q=t.action,J=t.showAction,ee=t.hideAction,et=t.popupVisible,en=t.defaultPopupVisible,er=t.onPopupVisibleChange,eo=t.afterPopupVisibleChange,ea=t.mouseEnterDelay,ei=t.mouseLeaveDelay,ec=void 0===ei?.1:ei,el=t.focusDelay,es=t.blurDelay,eu=t.mask,ed=t.maskClosable,ef=t.getPopupContainer,ep=t.forceRender,em=t.autoDestroy,eg=t.destroyPopupOnHide,eh=t.popup,ev=t.popupClassName,eb=t.popupStyle,ey=t.popupPlacement,ew=t.builtinPlacements,ex=void 0===ew?{}:ew,eE=t.popupAlign,eS=t.zIndex,eC=t.stretch,eZ=t.getPopupClassNameFromAlign,eO=t.fresh,ek=t.alignPoint,eM=t.onPopupClick,ej=t.onPopupAlign,eI=t.arrow,eR=t.popupMotion,eN=t.maskMotion,eP=t.popupTransitionName,eF=t.popupAnimation,eT=t.maskTransitionName,eA=t.maskAnimation,eL=t.className,ez=t.getTriggerDOMNode,e_=(0,a.Z)(t,B),eH=h.useState(!1),eB=(0,o.Z)(eH,2),eD=eB[0],eW=eB[1];(0,m.Z)(function(){eW((0,g.Z)())},[]);var eV=h.useRef({}),eq=h.useContext(Z),eG=h.useMemo(function(){return{registerSubPopup:function(e,t){eV.current[e]=t,null==eq||eq.registerSubPopup(e,t)}}},[eq]),eX=(0,p.Z)(),eU=h.useState(null),e$=(0,o.Z)(eU,2),eK=e$[0],eY=e$[1],eQ=(0,f.Z)(function(e){(0,u.S)(e)&&eK!==e&&eY(e),null==eq||eq.registerSubPopup(eX,e)}),eJ=h.useState(null),e0=(0,o.Z)(eJ,2),e1=e0[0],e2=e0[1],e6=h.useRef(null),e5=(0,f.Z)(function(e){(0,u.S)(e)&&e1!==e&&(e2(e),e6.current=e)}),e4=h.Children.only(Y),e3=(null==e4?void 0:e4.props)||{},e8={},e9=(0,f.Z)(function(e){var t,n;return(null==e1?void 0:e1.contains(e))||(null===(t=(0,d.A)(e1))||void 0===t?void 0:t.host)===e||e===e1||(null==eK?void 0:eK.contains(e))||(null===(n=(0,d.A)(eK))||void 0===n?void 0:n.host)===e||e===eK||Object.values(eV.current).some(function(t){return(null==t?void 0:t.contains(e))||e===t})}),e7=M(K,eR,eF,eP),te=M(K,eN,eA,eT),tt=h.useState(en||!1),tn=(0,o.Z)(tt,2),tr=tn[0],to=tn[1],ta=null!=et?et:tr,ti=(0,f.Z)(function(e){void 0===et&&to(e)});(0,m.Z)(function(){to(et||!1)},[et]);var tc=h.useRef(ta);tc.current=ta;var tl=h.useRef([]);tl.current=[];var ts=(0,f.Z)(function(e){var t;ti(e),(null!==(t=tl.current[tl.current.length-1])&&void 0!==t?t:ta)!==e&&(tl.current.push(e),null==er||er(e))}),tu=h.useRef(),td=function(){clearTimeout(tu.current)},tf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;td(),0===t?ts(e):tu.current=setTimeout(function(){ts(e)},1e3*t)};h.useEffect(function(){return td},[]);var tp=h.useState(!1),tm=(0,o.Z)(tp,2),tg=tm[0],th=tm[1];(0,m.Z)(function(e){(!e||ta)&&th(!0)},[ta]);var tv=h.useState(null),tb=(0,o.Z)(tv,2),ty=tb[0],tw=tb[1],tx=h.useState([0,0]),tE=(0,o.Z)(tx,2),tS=tE[0],tC=tE[1],tZ=function(e){tC([e.clientX,e.clientY])},tO=(i=ek?tS:e1,c=h.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:ex[ey]||{}}),b=(v=(0,o.Z)(c,2))[0],y=v[1],w=h.useRef(0),x=h.useMemo(function(){return eK?I(eK):[]},[eK]),E=h.useRef({}),ta||(E.current={}),N=(0,f.Z)(function(){if(eK&&i&&ta){var e,t,n,a,c,l,s,d=eK.ownerDocument,f=j(eK).getComputedStyle(eK),p=f.width,m=f.height,g=f.position,h=eK.style.left,v=eK.style.top,b=eK.style.right,w=eK.style.bottom,S=eK.style.overflow,C=(0,r.Z)((0,r.Z)({},ex[ey]),eE),Z=d.createElement("div");if(null===(e=eK.parentElement)||void 0===e||e.appendChild(Z),Z.style.left="".concat(eK.offsetLeft,"px"),Z.style.top="".concat(eK.offsetTop,"px"),Z.style.position=g,Z.style.height="".concat(eK.offsetHeight,"px"),Z.style.width="".concat(eK.offsetWidth,"px"),eK.style.left="0",eK.style.top="0",eK.style.right="auto",eK.style.bottom="auto",eK.style.overflow="hidden",Array.isArray(i))n={x:i[0],y:i[1],width:0,height:0};else{var O=i.getBoundingClientRect();n={x:O.x,y:O.y,width:O.width,height:O.height}}var M=eK.getBoundingClientRect(),I=d.documentElement,N=I.clientWidth,F=I.clientHeight,_=I.scrollWidth,H=I.scrollHeight,B=I.scrollTop,D=I.scrollLeft,W=M.height,V=M.width,q=n.height,G=n.width,X=C.htmlRegion,U="visible",$="visibleFirst";"scroll"!==X&&X!==$&&(X=U);var K=X===$,Y=P({left:-D,top:-B,right:_-D,bottom:H-B},x),Q=P({left:0,top:0,right:N,bottom:F},x),J=X===U?Q:Y,ee=K?Q:J;eK.style.left="auto",eK.style.top="auto",eK.style.right="0",eK.style.bottom="0";var et=eK.getBoundingClientRect();eK.style.left=h,eK.style.top=v,eK.style.right=b,eK.style.bottom=w,eK.style.overflow=S,null===(t=eK.parentElement)||void 0===t||t.removeChild(Z);var en=R(Math.round(V/parseFloat(p)*1e3)/1e3),er=R(Math.round(W/parseFloat(m)*1e3)/1e3);if(!(0===en||0===er||(0,u.S)(i)&&!(0,k.Z)(i))){var eo=C.offset,ea=C.targetOffset,ei=T(M,eo),ec=(0,o.Z)(ei,2),el=ec[0],es=ec[1],eu=T(n,ea),ed=(0,o.Z)(eu,2),ef=ed[0],ep=ed[1];n.x-=ef,n.y-=ep;var em=C.points||[],eg=(0,o.Z)(em,2),eh=eg[0],ev=A(eg[1]),eb=A(eh),ew=L(n,ev),eS=L(M,eb),eC=(0,r.Z)({},C),eZ=ew.x-eS.x+el,eO=ew.y-eS.y+es,ek=tt(eZ,eO),eM=tt(eZ,eO,Q),eI=L(n,["t","l"]),eR=L(M,["t","l"]),eN=L(n,["b","r"]),eP=L(M,["b","r"]),eF=C.overflow||{},eT=eF.adjustX,eA=eF.adjustY,eL=eF.shiftX,ez=eF.shiftY,e_=function(e){return"boolean"==typeof e?e:e>=0};tn();var eH=e_(eA),eB=eb[0]===ev[0];if(eH&&"t"===eb[0]&&(c>ee.bottom||E.current.bt)){var eD=eO;eB?eD-=W-q:eD=eI.y-eP.y-es;var eW=tt(eZ,eD),eV=tt(eZ,eD,Q);eW>ek||eW===ek&&(!K||eV>=eM)?(E.current.bt=!0,eO=eD,es=-es,eC.points=[z(eb,0),z(ev,0)]):E.current.bt=!1}if(eH&&"b"===eb[0]&&(aek||eG===ek&&(!K||eX>=eM)?(E.current.tb=!0,eO=eq,es=-es,eC.points=[z(eb,0),z(ev,0)]):E.current.tb=!1}var eU=e_(eT),e$=eb[1]===ev[1];if(eU&&"l"===eb[1]&&(s>ee.right||E.current.rl)){var eY=eZ;e$?eY-=V-G:eY=eI.x-eP.x-el;var eQ=tt(eY,eO),eJ=tt(eY,eO,Q);eQ>ek||eQ===ek&&(!K||eJ>=eM)?(E.current.rl=!0,eZ=eY,el=-el,eC.points=[z(eb,1),z(ev,1)]):E.current.rl=!1}if(eU&&"r"===eb[1]&&(lek||e1===ek&&(!K||e2>=eM)?(E.current.lr=!0,eZ=e0,el=-el,eC.points=[z(eb,1),z(ev,1)]):E.current.lr=!1}tn();var e6=!0===eL?0:eL;"number"==typeof e6&&(lQ.right&&(eZ-=s-Q.right-el,n.x>Q.right-e6&&(eZ+=n.x-Q.right+e6)));var e5=!0===ez?0:ez;"number"==typeof e5&&(aQ.bottom&&(eO-=c-Q.bottom-es,n.y>Q.bottom-e5&&(eO+=n.y-Q.bottom+e5)));var e4=M.x+eZ,e3=M.y+eO,e8=n.x,e9=n.y;null==ej||ej(eK,eC);var e7=et.right-M.x-(eZ+M.width),te=et.bottom-M.y-(eO+M.height);y({ready:!0,offsetX:eZ/en,offsetY:eO/er,offsetR:e7/en,offsetB:te/er,arrowX:((Math.max(e4,e8)+Math.min(e4+V,e8+G))/2-e4)/en,arrowY:((Math.max(e3,e9)+Math.min(e3+W,e9+q))/2-e3)/er,scaleX:en,scaleY:er,align:eC})}function tt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J,r=M.x+e,o=M.y+t,a=Math.max(r,n.left),i=Math.max(o,n.top);return Math.max(0,(Math.min(r+V,n.right)-a)*(Math.min(o+W,n.bottom)-i))}function tn(){c=(a=M.y+eO)+W,s=(l=M.x+eZ)+V}}}),F=function(){y(function(e){return(0,r.Z)((0,r.Z)({},e),{},{ready:!1})})},(0,m.Z)(F,[ey]),(0,m.Z)(function(){ta||F()},[ta]),[b.ready,b.offsetX,b.offsetY,b.offsetR,b.offsetB,b.arrowX,b.arrowY,b.scaleX,b.scaleY,b.align,function(){w.current+=1;var e=w.current;Promise.resolve().then(function(){w.current===e&&N()})}]),tk=(0,o.Z)(tO,11),tM=tk[0],tj=tk[1],tI=tk[2],tR=tk[3],tN=tk[4],tP=tk[5],tF=tk[6],tT=tk[7],tA=tk[8],tL=tk[9],tz=tk[10],t_=(D=void 0===Q?"hover":Q,h.useMemo(function(){var e=O(null!=J?J:D),t=O(null!=ee?ee:D),n=new Set(e),r=new Set(t);return eD&&(n.has("hover")&&(n.delete("hover"),n.add("click")),r.has("hover")&&(r.delete("hover"),r.add("click"))),[n,r]},[eD,D,J,ee])),tH=(0,o.Z)(t_,2),tB=tH[0],tD=tH[1],tW=tB.has("click"),tV=tD.has("click")||tD.has("contextMenu"),tq=(0,f.Z)(function(){tg||tz()});W=function(){tc.current&&ek&&tV&&tf(!1)},(0,m.Z)(function(){if(ta&&e1&&eK){var e=I(e1),t=I(eK),n=j(eK),r=new Set([n].concat((0,_.Z)(e),(0,_.Z)(t)));function o(){tq(),W()}return r.forEach(function(e){e.addEventListener("scroll",o,{passive:!0})}),n.addEventListener("resize",o,{passive:!0}),tq(),function(){r.forEach(function(e){e.removeEventListener("scroll",o),n.removeEventListener("resize",o)})}}},[ta,e1,eK]),(0,m.Z)(function(){tq()},[tS,ey]),(0,m.Z)(function(){ta&&!(null!=ex&&ex[ey])&&tq()},[JSON.stringify(eE)]);var tG=h.useMemo(function(){var e=function(e,t,n,r){for(var o=n.points,a=Object.keys(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}(null===(c=e[l])||void 0===c?void 0:c.points,o,r))return"".concat(t,"-placement-").concat(l)}return""}(ex,K,tL,ek);return l()(e,null==eZ?void 0:eZ(tL))},[tL,eZ,ex,K,ek]);h.useImperativeHandle(n,function(){return{nativeElement:e6.current,forceAlign:tq}});var tX=h.useState(0),tU=(0,o.Z)(tX,2),t$=tU[0],tK=tU[1],tY=h.useState(0),tQ=(0,o.Z)(tY,2),tJ=tQ[0],t0=tQ[1],t1=function(){if(eC&&e1){var e=e1.getBoundingClientRect();tK(e.width),t0(e.height)}};function t2(e,t,n,r){e8[e]=function(o){var a;null==r||r(o),tf(t,n);for(var i=arguments.length,c=Array(i>1?i-1:0),l=1;l1?n-1:0),o=1;o1?n-1:0),o=1;o{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},c=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var l=n(96398),s=n(97324),u=n(1153);let d=o.forwardRef((e,t)=>{let{value:n,defaultValue:d,type:f,placeholder:p="Type...",icon:m,error:g=!1,errorMessage:h,disabled:v=!1,stepper:b,makeInputClassName:y,className:w,onChange:x,onValueChange:E,autoFocus:S}=e,C=(0,r._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[Z,O]=(0,o.useState)(S||!1),[k,M]=(0,o.useState)(!1),j=(0,o.useCallback)(()=>M(!k),[k,M]),I=(0,o.useRef)(null),R=(0,l.Uh)(n||d);return o.useEffect(()=>{let e=()=>O(!0),t=()=>O(!1),n=I.current;return n&&(n.addEventListener("focus",e),n.addEventListener("blur",t),S&&n.focus()),()=>{n&&(n.removeEventListener("focus",e),n.removeEventListener("blur",t))}},[S]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,s.q)(y("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,l.um)(R,v,g),Z&&(0,s.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),w)},m?o.createElement(m,{className:(0,s.q)(y("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,u.lq)([I,t]),defaultValue:d,value:n,type:k?"text":f,className:(0,s.q)(y("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",m?"pl-2":"pl-3",g?"pr-3":"pr-4",v?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:v,"data-testid":"base-input",onChange:e=>{null==x||x(e),null==E||E(e.target.value)}},C)),"password"!==f||v?null:o.createElement("button",{className:(0,s.q)(y("toggleButton"),"mr-2"),type:"button",onClick:()=>j(),"aria-label":k?"Hide password":"Show Password"},k?o.createElement(c,{className:(0,s.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(i,{className:(0,s.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),g?o.createElement(a,{className:(0,s.q)(y("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=b?b:null),g&&h?o.createElement("p",{className:(0,s.q)(y("errorMessage"),"text-sm text-red-500 mt-1")},h):null)});d.displayName="BaseInput"},49566:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(5853),o=n(2265);n(97324);var a=n(1153),i=n(69262);let c=(0,a.fn)("TextInput"),l=o.forwardRef((e,t)=>{let{type:n="text"}=e,a=(0,r._T)(e,["type"]);return o.createElement(i.Z,Object.assign({ref:t,type:n,makeInputClassName:c},a))});l.displayName="TextInput"},96398:function(e,t,n){"use strict";n.d(t,{Uh:function(){return s},n0:function(){return c},qg:function(){return a},sl:function(){return i},um:function(){return l}});var r=n(97324),o=n(2265);let a=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(a).join(""):"object"==typeof e&&e?a(e.props.children):void 0;function i(e){let t=new Map;return o.Children.map(e,e=>{var n;t.set(e.props.value,null!==(n=a(e))&&void 0!==n?n:e.props.value)}),t}function c(e,t){return o.Children.map(t,t=>{var n;if((null!==(n=a(t))&&void 0!==n?n:t.props.value).toLowerCase().includes(e.toLowerCase()))return t})}let l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.q)(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",n&&"text-red-500",n?"border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function s(e){return null!=e&&""!==e}},93942:function(e,t,n){"use strict";n.d(t,{i:function(){return c}});var r=n(2265),o=n(50506),a=n(13959),i=n(71744);function c(e){return t=>r.createElement(a.ZP,{theme:{token:{motion:!1,zIndexPopupBase:0}}},r.createElement(e,Object.assign({},t)))}t.Z=(e,t,n,a)=>c(c=>{let{prefixCls:l,style:s}=c,u=r.useRef(null),[d,f]=r.useState(0),[p,m]=r.useState(0),[g,h]=(0,o.Z)(!1,{value:c.open}),{getPrefixCls:v}=r.useContext(i.E_),b=v(t||"select",l);r.useEffect(()=>{if(h(!0),"undefined"!=typeof ResizeObserver){let e=new ResizeObserver(e=>{let t=e[0].target;f(t.offsetHeight+8),m(t.offsetWidth)}),t=setInterval(()=>{var r;let o=n?".".concat(n(b)):".".concat(b,"-dropdown"),a=null===(r=u.current)||void 0===r?void 0:r.querySelector(o);a&&(clearInterval(t),e.observe(a))},10);return()=>{clearInterval(t),e.disconnect()}}},[]);let y=Object.assign(Object.assign({},c),{style:Object.assign(Object.assign({},s),{margin:0}),open:g,visible:g,getPopupContainer:()=>u.current});return a&&(y=a(y)),r.createElement("div",{ref:u,style:{paddingBottom:d,position:"relative",minWidth:p}},r.createElement(e,Object.assign({},y)))})},93350:function(e,t,n){"use strict";n.d(t,{o2:function(){return c},yT:function(){return l}});var r=n(83145),o=n(53454);let a=o.i.map(e=>"".concat(e,"-inverse")),i=["success","processing","error","default","warning"];function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return t?[].concat((0,r.Z)(a),(0,r.Z)(o.i)).includes(e):o.i.includes(e)}function l(e){return i.includes(e)}},62236:function(e,t,n){"use strict";n.d(t,{Cn:function(){return s},u6:function(){return i}});var r=n(2265),o=n(29961),a=n(95140);let i=1e3,c={Modal:100,Drawer:100,Popover:100,Popconfirm:100,Tooltip:100,Tour:100},l={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function s(e,t){let[,n]=(0,o.ZP)(),s=r.useContext(a.Z);if(void 0!==t)return[t,t];let u=null!=s?s:0;return e in c?(u+=(s?0:n.zIndexPopupBase)+c[e],u=Math.min(u,n.zIndexPopupBase+i)):u+=l[e],[void 0===s?t:u,u]}},68710:function(e,t,n){"use strict";n.d(t,{m:function(){return c}});let r=()=>({height:0,opacity:0}),o=e=>{let{scrollHeight:t}=e;return{height:t,opacity:1}},a=e=>({height:e?e.offsetHeight:0}),i=(e,t)=>(null==t?void 0:t.deadline)===!0||"height"===t.propertyName,c=(e,t,n)=>void 0!==n?n:"".concat(e,"-").concat(t);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ant";return{motionName:"".concat(e,"-motion-collapse"),onAppearStart:r,onEnterStart:r,onAppearActive:o,onEnterActive:o,onLeaveStart:a,onLeaveActive:r,onAppearEnd:i,onEnterEnd:i,onLeaveEnd:i,motionDeadline:500}}},92736:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(88260);let o={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},a={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},i=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function c(e){let{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:c,offset:l,borderRadius:s,visibleFirst:u}=e,d=t/2,f={};return Object.keys(o).forEach(e=>{let p=Object.assign(Object.assign({},c&&a[e]||o[e]),{offset:[0,0],dynamicInset:!0});switch(f[e]=p,i.has(e)&&(p.autoArrow=!1),e){case"top":case"topLeft":case"topRight":p.offset[1]=-d-l;break;case"bottom":case"bottomLeft":case"bottomRight":p.offset[1]=d+l;break;case"left":case"leftTop":case"leftBottom":p.offset[0]=-d-l;break;case"right":case"rightTop":case"rightBottom":p.offset[0]=d+l}let m=(0,r.wZ)({contentRadius:s,limitVerticalRadius:!0});if(c)switch(e){case"topLeft":case"bottomLeft":p.offset[0]=-m.arrowOffsetHorizontal-d;break;case"topRight":case"bottomRight":p.offset[0]=m.arrowOffsetHorizontal+d;break;case"leftTop":case"rightTop":p.offset[1]=-m.arrowOffsetHorizontal-d;break;case"leftBottom":case"rightBottom":p.offset[1]=m.arrowOffsetHorizontal+d}p.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};let o={};switch(e){case"top":case"bottom":o.shiftX=2*t.arrowOffsetHorizontal+n,o.shiftY=!0,o.adjustY=!0;break;case"left":case"right":o.shiftY=2*t.arrowOffsetVertical+n,o.shiftX=!0,o.adjustX=!0}let a=Object.assign(Object.assign({},o),r&&"object"==typeof r?r:{});return a.shiftX||(a.adjustX=!0),a.shiftY||(a.adjustY=!0),a}(e,m,t,n),u&&(p.htmlRegion="visibleFirst")}),f}},19722:function(e,t,n){"use strict";n.d(t,{M2:function(){return i},Tm:function(){return l},l$:function(){return a},wm:function(){return c}});var r,o=n(2265);let{isValidElement:a}=r||(r=n.t(o,2));function i(e){return e&&a(e)&&e.type===o.Fragment}function c(e,t,n){return a(e)?o.cloneElement(e,"function"==typeof n?n(e.props||{}):n):t}function l(e,t){return c(e,e,t)}},6543:function(e,t,n){"use strict";n.d(t,{ZP:function(){return l},c4:function(){return a}});var r=n(2265),o=n(29961);let a=["xxl","xl","lg","md","sm","xs"],i=e=>({xs:"(max-width: ".concat(e.screenXSMax,"px)"),sm:"(min-width: ".concat(e.screenSM,"px)"),md:"(min-width: ".concat(e.screenMD,"px)"),lg:"(min-width: ".concat(e.screenLG,"px)"),xl:"(min-width: ".concat(e.screenXL,"px)"),xxl:"(min-width: ".concat(e.screenXXL,"px)")}),c=e=>{let t=[].concat(a).reverse();return t.forEach((n,r)=>{let o=n.toUpperCase(),a="screen".concat(o,"Min"),i="screen".concat(o);if(!(e[a]<=e[i]))throw Error("".concat(a,"<=").concat(i," fails : !(").concat(e[a],"<=").concat(e[i],")"));if(r{let e=new Map,n=-1,r={};return{matchHandlers:{},dispatch:t=>(r=t,e.forEach(e=>e(r)),e.size>=1),subscribe(t){return e.size||this.register(),n+=1,e.set(n,t),t(r),n},unsubscribe(t){e.delete(t),e.size||this.unregister()},unregister(){Object.keys(t).forEach(e=>{let n=t[e],r=this.matchHandlers[n];null==r||r.mql.removeListener(null==r?void 0:r.listener)}),e.clear()},register(){Object.keys(t).forEach(e=>{let n=t[e],o=t=>{let{matches:n}=t;this.dispatch(Object.assign(Object.assign({},r),{[e]:n}))},a=window.matchMedia(n);a.addListener(o),this.matchHandlers[n]={mql:a,listener:o},o(a)})},responsiveMap:t}},[e])}},12757:function(e,t,n){"use strict";n.d(t,{F:function(){return i},Z:function(){return a}});var r=n(36760),o=n.n(r);function a(e,t,n){return o()({["".concat(e,"-status-success")]:"success"===t,["".concat(e,"-status-warning")]:"warning"===t,["".concat(e,"-status-error")]:"error"===t,["".concat(e,"-status-validating")]:"validating"===t,["".concat(e,"-has-feedback")]:n})}let i=(e,t)=>t||e},13613:function(e,t,n){"use strict";n.d(t,{G8:function(){return a},ln:function(){return i}});var r=n(2265);function o(){}n(32559);let a=r.createContext({}),i=()=>{let e=()=>{};return e.deprecated=o,e}},6694:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(36760),o=n.n(r),a=n(28791),i=n(2857),c=n(2265),l=n(71744),s=n(19722),u=n(80669);let d=e=>{let{componentCls:t,colorPrimary:n}=e;return{[t]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:"var(--wave-color, ".concat(n,")"),boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:["box-shadow 0.4s ".concat(e.motionEaseOutCirc),"opacity 2s ".concat(e.motionEaseOutCirc)].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:["box-shadow 0.3s ".concat(e.motionEaseInOut),"opacity 0.35s ".concat(e.motionEaseInOut)].join(",")}}}}};var f=(0,u.ZP)("Wave",e=>[d(e)]),p=n(74126),m=n(53346),g=n(47970),h=n(18404);function v(e){return e&&"#fff"!==e&&"#ffffff"!==e&&"rgb(255, 255, 255)"!==e&&"rgba(255, 255, 255, 1)"!==e&&function(e){let t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return!t||!t[1]||!t[2]||!t[3]||!(t[1]===t[2]&&t[2]===t[3])}(e)&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&"transparent"!==e}var b=n(34709);function y(e){return Number.isNaN(e)?0:e}let w=e=>{let{className:t,target:n,component:r}=e,a=c.useRef(null),[i,l]=c.useState(null),[s,u]=c.useState([]),[d,f]=c.useState(0),[p,w]=c.useState(0),[x,E]=c.useState(0),[S,C]=c.useState(0),[Z,O]=c.useState(!1),k={left:d,top:p,width:x,height:S,borderRadius:s.map(e=>"".concat(e,"px")).join(" ")};function M(){let e=getComputedStyle(n);l(function(e){let{borderTopColor:t,borderColor:n,backgroundColor:r}=getComputedStyle(e);return v(t)?t:v(n)?n:v(r)?r:null}(n));let t="static"===e.position,{borderLeftWidth:r,borderTopWidth:o}=e;f(t?n.offsetLeft:y(-parseFloat(r))),w(t?n.offsetTop:y(-parseFloat(o))),E(n.offsetWidth),C(n.offsetHeight);let{borderTopLeftRadius:a,borderTopRightRadius:i,borderBottomLeftRadius:c,borderBottomRightRadius:s}=e;u([a,i,s,c].map(e=>y(parseFloat(e))))}if(i&&(k["--wave-color"]=i),c.useEffect(()=>{if(n){let e;let t=(0,m.Z)(()=>{M(),O(!0)});return"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(M)).observe(n),()=>{m.Z.cancel(t),null==e||e.disconnect()}}},[]),!Z)return null;let j=("Checkbox"===r||"Radio"===r)&&(null==n?void 0:n.classList.contains(b.A));return c.createElement(g.ZP,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(e,t)=>{var n;if(t.deadline||"opacity"===t.propertyName){let e=null===(n=a.current)||void 0===n?void 0:n.parentElement;(0,h.v)(e).then(()=>{null==e||e.remove()})}return!1}},e=>{let{className:n}=e;return c.createElement("div",{ref:a,className:o()(t,{"wave-quick":j},n),style:k})})};var x=(e,t)=>{var n;let{component:r}=t;if("Checkbox"===r&&!(null===(n=e.querySelector("input"))||void 0===n?void 0:n.checked))return;let o=document.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.top="0px",null==e||e.insertBefore(o,null==e?void 0:e.firstChild),(0,h.s)(c.createElement(w,Object.assign({},t,{target:e})),o)},E=n(29961),S=e=>{let{children:t,disabled:n,component:r}=e,{getPrefixCls:u}=(0,c.useContext)(l.E_),d=(0,c.useRef)(null),g=u("wave"),[,h]=f(g),v=function(e,t,n){let{wave:r}=c.useContext(l.E_),[,o,a]=(0,E.ZP)(),i=(0,p.zX)(i=>{let c=e.current;if((null==r?void 0:r.disabled)||!c)return;let l=c.querySelector(".".concat(b.A))||c,{showEffect:s}=r||{};(s||x)(l,{className:t,token:o,component:n,event:i,hashId:a})}),s=c.useRef();return e=>{m.Z.cancel(s.current),s.current=(0,m.Z)(()=>{i(e)})}}(d,o()(g,h),r);if(c.useEffect(()=>{let e=d.current;if(!e||1!==e.nodeType||n)return;let t=t=>{!(0,i.Z)(t.target)||!e.getAttribute||e.getAttribute("disabled")||e.disabled||e.className.includes("disabled")||e.className.includes("-leave")||v(t)};return e.addEventListener("click",t,!0),()=>{e.removeEventListener("click",t,!0)}},[n]),!c.isValidElement(t))return null!=t?t:null;let y=(0,a.Yr)(t)?(0,a.sQ)(t.ref,d):d;return(0,s.Tm)(t,{ref:y})}},34709:function(e,t,n){"use strict";n.d(t,{A:function(){return r}});let r="ant-wave-target"},95140:function(e,t,n){"use strict";let r=n(2265).createContext(void 0);t.Z=r},52402:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});let r=n(2265).createContext({})},51248:function(e,t,n){"use strict";n.d(t,{Te:function(){return s},aG:function(){return i},hU:function(){return u},nx:function(){return c}});var r=n(2265),o=n(19722);let a=/^[\u4e00-\u9fa5]{2}$/,i=a.test.bind(a);function c(e){return"danger"===e?{danger:!0}:{type:e}}function l(e){return"string"==typeof e}function s(e){return"text"===e||"link"===e}function u(e,t){let n=!1,a=[];return r.Children.forEach(e,e=>{let t=typeof e,r="string"===t||"number"===t;if(n&&r){let t=a.length-1,n=a[t];a[t]="".concat(n).concat(e)}else a.push(e);n=r}),r.Children.map(a,e=>(function(e,t){if(null==e)return;let n=t?" ":"";return"string"!=typeof e&&"number"!=typeof e&&l(e.type)&&i(e.props.children)?(0,o.Tm)(e,{children:e.props.children.split("").join(n)}):l(e)?i(e)?r.createElement("span",null,e.split("").join(n)):r.createElement("span",null,e):(0,o.M2)(e)?r.createElement("span",null,e):e})(e,t))}},73002:function(e,t,n){"use strict";n.d(t,{ZP:function(){return ea}});var r=n(2265),o=n(36760),a=n.n(o),i=n(18694),c=n(28791),l=n(6694),s=n(71744),u=n(86586),d=n(33759),f=n(65658),p=n(29961),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let g=r.createContext(void 0);var h=n(51248);let v=(0,r.forwardRef)((e,t)=>{let{className:n,style:o,children:i,prefixCls:c}=e,l=a()("".concat(c,"-icon"),n);return r.createElement("span",{ref:t,className:l,style:o},i)});var b=n(61935),y=n(47970);let w=(0,r.forwardRef)((e,t)=>{let{prefixCls:n,className:o,style:i,iconClassName:c}=e,l=a()("".concat(n,"-loading-icon"),o);return r.createElement(v,{prefixCls:n,className:l,style:i,ref:t},r.createElement(b.Z,{className:c}))}),x=()=>({width:0,opacity:0,transform:"scale(0)"}),E=e=>({width:e.scrollWidth,opacity:1,transform:"scale(1)"});var S=e=>{let{prefixCls:t,loading:n,existIcon:o,className:a,style:i}=e,c=!!n;return o?r.createElement(w,{prefixCls:t,className:a,style:i}):r.createElement(y.ZP,{visible:c,motionName:"".concat(t,"-loading-icon-motion"),motionLeave:c,removeOnLeave:!0,onAppearStart:x,onAppearActive:E,onEnterStart:x,onEnterActive:E,onLeaveStart:E,onLeaveActive:x},(e,n)=>{let{className:o,style:c}=e;return r.createElement(w,{prefixCls:t,className:a,style:Object.assign(Object.assign({},i),c),ref:n,iconClassName:o})})},C=n(352),Z=n(12918),O=n(3104),k=n(80669);let M=(e,t)=>({["> span, > ".concat(e)]:{"&:not(:last-child)":{["&, & > ".concat(e)]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{["&, & > ".concat(e)]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}});var j=e=>{let{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:o,colorErrorHover:a}=e;return{["".concat(t,"-group")]:[{position:"relative",display:"inline-flex",["> span, > ".concat(t)]:{"&:not(:last-child)":{["&, & > ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),["&, & > ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:"relative",zIndex:1,"&:hover,\n &:focus,\n &:active":{zIndex:2},"&[disabled]":{zIndex:0}},["".concat(t,"-icon-only")]:{fontSize:n}},M("".concat(t,"-primary"),o),M("".concat(t,"-danger"),a)]}},I=n(1319);let R=e=>{let{paddingInline:t,onlyIconSize:n,paddingBlock:r}=e;return(0,O.TS)(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:r,buttonIconOnlyFontSize:n})},N=e=>{var t,n,r,o,a,i;let c=null!==(t=e.contentFontSize)&&void 0!==t?t:e.fontSize,l=null!==(n=e.contentFontSizeSM)&&void 0!==n?n:e.fontSize,s=null!==(r=e.contentFontSizeLG)&&void 0!==r?r:e.fontSizeLG,u=null!==(o=e.contentLineHeight)&&void 0!==o?o:(0,I.D)(c),d=null!==(a=e.contentLineHeightSM)&&void 0!==a?a:(0,I.D)(l),f=null!==(i=e.contentLineHeightLG)&&void 0!==i?i:(0,I.D)(s);return{fontWeight:400,defaultShadow:"0 ".concat(e.controlOutlineWidth,"px 0 ").concat(e.controlTmpOutline),primaryShadow:"0 ".concat(e.controlOutlineWidth,"px 0 ").concat(e.controlOutline),dangerShadow:"0 ".concat(e.controlOutlineWidth,"px 0 ").concat(e.colorErrorOutline),primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorder,defaultGhostColor:e.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:e.fontSizeLG,onlyIconSizeSM:e.fontSizeLG-2,onlyIconSizeLG:e.fontSizeLG+2,groupBorderColor:e.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:e.colorBgTextHover,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,contentFontSize:c,contentFontSizeSM:l,contentFontSizeLG:s,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:f,paddingBlock:Math.max((e.controlHeight-c*u)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-l*d)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-s*f)/2-e.lineWidth,0)}},P=e=>{let{componentCls:t,iconCls:n,fontWeight:r}=e;return{[t]:{outline:"none",position:"relative",display:"inline-block",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:"".concat((0,C.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),cursor:"pointer",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut),userSelect:"none",touchAction:"manipulation",color:e.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},["".concat(t,"-icon")]:{lineHeight:0},["> ".concat(n," + span, > span + ").concat(n)]:{marginInlineStart:e.marginXS},["&:not(".concat(t,"-icon-only) > ").concat(t,"-icon")]:{["&".concat(t,"-loading-icon, &:not(:last-child)")]:{marginInlineEnd:e.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},(0,Z.Qy)(e)),["&".concat(t,"-two-chinese-chars::first-letter")]:{letterSpacing:"0.34em"},["&".concat(t,"-two-chinese-chars > *:not(").concat(n,")")]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},["&-icon-only".concat(t,"-compact-item")]:{flex:"none"}}}},F=(e,t,n)=>({["&:not(:disabled):not(".concat(e,"-disabled)")]:{"&:hover":t,"&:active":n}}),T=e=>({minWidth:e.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),A=e=>({borderRadius:e.controlHeight,paddingInlineStart:e.calc(e.controlHeight).div(2).equal(),paddingInlineEnd:e.calc(e.controlHeight).div(2).equal()}),L=e=>({cursor:"not-allowed",borderColor:e.borderColorDisabled,color:e.colorTextDisabled,background:e.colorBgContainerDisabled,boxShadow:"none"}),z=(e,t,n,r,o,a,i,c)=>({["&".concat(e,"-background-ghost")]:Object.assign(Object.assign({color:n||void 0,background:t,borderColor:r||void 0,boxShadow:"none"},F(e,Object.assign({background:t},i),Object.assign({background:t},c))),{"&:disabled":{cursor:"not-allowed",color:o||void 0,borderColor:a||void 0}})}),_=e=>({["&:disabled, &".concat(e.componentCls,"-disabled")]:Object.assign({},L(e))}),H=e=>Object.assign({},_(e)),B=e=>({["&:disabled, &".concat(e.componentCls,"-disabled")]:{cursor:"not-allowed",color:e.colorTextDisabled}}),D=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},H(e)),{background:e.defaultBg,borderColor:e.defaultBorderColor,color:e.defaultColor,boxShadow:e.defaultShadow}),F(e.componentCls,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),z(e.componentCls,e.ghostBg,e.defaultGhostColor,e.defaultGhostBorderColor,e.colorTextDisabled,e.colorBorder)),{["&".concat(e.componentCls,"-dangerous")]:Object.assign(Object.assign(Object.assign({color:e.colorError,borderColor:e.colorError},F(e.componentCls,{color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),z(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder)),_(e))}),W=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},H(e)),{color:e.primaryColor,background:e.colorPrimary,boxShadow:e.primaryShadow}),F(e.componentCls,{color:e.colorTextLightSolid,background:e.colorPrimaryHover},{color:e.colorTextLightSolid,background:e.colorPrimaryActive})),z(e.componentCls,e.ghostBg,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),{["&".concat(e.componentCls,"-dangerous")]:Object.assign(Object.assign(Object.assign({background:e.colorError,boxShadow:e.dangerShadow,color:e.dangerColor},F(e.componentCls,{background:e.colorErrorHover},{background:e.colorErrorActive})),z(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),_(e))}),V=e=>Object.assign(Object.assign({},D(e)),{borderStyle:"dashed"}),q=e=>Object.assign(Object.assign(Object.assign({color:e.colorLink},F(e.componentCls,{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),B(e)),{["&".concat(e.componentCls,"-dangerous")]:Object.assign(Object.assign({color:e.colorError},F(e.componentCls,{color:e.colorErrorHover},{color:e.colorErrorActive})),B(e))}),G=e=>Object.assign(Object.assign(Object.assign({},F(e.componentCls,{color:e.colorText,background:e.textHoverBg},{color:e.colorText,background:e.colorBgTextActive})),B(e)),{["&".concat(e.componentCls,"-dangerous")]:Object.assign(Object.assign({color:e.colorError},B(e)),F(e.componentCls,{color:e.colorErrorHover,background:e.colorErrorBg},{color:e.colorErrorHover,background:e.colorErrorBg}))}),X=e=>{let{componentCls:t}=e;return{["".concat(t,"-default")]:D(e),["".concat(t,"-primary")]:W(e),["".concat(t,"-dashed")]:V(e),["".concat(t,"-link")]:q(e),["".concat(t,"-text")]:G(e),["".concat(t,"-ghost")]:z(e.componentCls,e.ghostBg,e.colorBgContainer,e.colorBgContainer,e.colorTextDisabled,e.colorBorder)}},U=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",{componentCls:n,controlHeight:r,fontSize:o,lineHeight:a,borderRadius:i,buttonPaddingHorizontal:c,iconCls:l,buttonPaddingVertical:s}=e,u="".concat(n,"-icon-only");return[{["".concat(n).concat(t)]:{fontSize:o,lineHeight:a,height:r,padding:"".concat((0,C.bf)(s)," ").concat((0,C.bf)(c)),borderRadius:i,["&".concat(u)]:{width:r,paddingInlineStart:0,paddingInlineEnd:0,["&".concat(n,"-round")]:{width:"auto"},[l]:{fontSize:e.buttonIconOnlyFontSize}},["&".concat(n,"-loading")]:{opacity:e.opacityLoading,cursor:"default"},["".concat(n,"-loading-icon")]:{transition:"width ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut,", opacity ").concat(e.motionDurationSlow," ").concat(e.motionEaseInOut)}}},{["".concat(n).concat(n,"-circle").concat(t)]:T(e)},{["".concat(n).concat(n,"-round").concat(t)]:A(e)}]},$=e=>U((0,O.TS)(e,{fontSize:e.contentFontSize,lineHeight:e.contentLineHeight})),K=e=>U((0,O.TS)(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,lineHeight:e.contentLineHeightSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:e.paddingBlockSM,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM}),"".concat(e.componentCls,"-sm")),Y=e=>U((0,O.TS)(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,lineHeight:e.contentLineHeightLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:e.paddingBlockLG,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG}),"".concat(e.componentCls,"-lg")),Q=e=>{let{componentCls:t}=e;return{[t]:{["&".concat(t,"-block")]:{width:"100%"}}}};var J=(0,k.I$)("Button",e=>{let t=R(e);return[P(t),K(t),$(t),Y(t),Q(t),X(t),j(t)]},N,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}}),ee=n(17691);let et=e=>{let{componentCls:t,calc:n}=e;return{[t]:{["&-compact-item".concat(t,"-primary")]:{["&:not([disabled]) + ".concat(t,"-compact-item").concat(t,"-primary:not([disabled])")]:{position:"relative","&:before":{position:"absolute",top:n(e.lineWidth).mul(-1).equal(),insetInlineStart:n(e.lineWidth).mul(-1).equal(),display:"inline-block",width:e.lineWidth,height:"calc(100% + ".concat((0,C.bf)(e.lineWidth)," * 2)"),backgroundColor:e.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{["&".concat(t,"-primary")]:{["&:not([disabled]) + ".concat(t,"-compact-vertical-item").concat(t,"-primary:not([disabled])")]:{position:"relative","&:before":{position:"absolute",top:n(e.lineWidth).mul(-1).equal(),insetInlineStart:n(e.lineWidth).mul(-1).equal(),display:"inline-block",width:"calc(100% + ".concat((0,C.bf)(e.lineWidth)," * 2)"),height:e.lineWidth,backgroundColor:e.colorPrimaryHover,content:'""'}}}}}}};var en=(0,k.bk)(["Button","compact"],e=>{let t=R(e);return[(0,ee.c)(t),function(e){var t;let n="".concat(e.componentCls,"-compact-vertical");return{[n]:Object.assign(Object.assign({},{["&-item:not(".concat(n,"-last-item)")]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}),(t=e.componentCls,{["&-item:not(".concat(n,"-first-item):not(").concat(n,"-last-item)")]:{borderRadius:0},["&-item".concat(n,"-first-item:not(").concat(n,"-last-item)")]:{["&, &".concat(t,"-sm, &").concat(t,"-lg")]:{borderEndEndRadius:0,borderEndStartRadius:0}},["&-item".concat(n,"-last-item:not(").concat(n,"-first-item)")]:{["&, &".concat(t,"-sm, &").concat(t,"-lg")]:{borderStartStartRadius:0,borderStartEndRadius:0}}}))}}(t),et(t)]},N),er=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eo=(0,r.forwardRef)((e,t)=>{var n,o;let{loading:p=!1,prefixCls:m,type:b="default",danger:y,shape:w="default",size:x,styles:E,disabled:C,className:Z,rootClassName:O,children:k,icon:M,ghost:j=!1,block:I=!1,htmlType:R="button",classNames:N,style:P={}}=e,F=er(e,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","ghost","block","htmlType","classNames","style"]),{getPrefixCls:T,autoInsertSpaceInButton:A,direction:L,button:z}=(0,r.useContext)(s.E_),_=T("btn",m),[H,B,D]=J(_),W=(0,r.useContext)(u.Z),V=null!=C?C:W,q=(0,r.useContext)(g),G=(0,r.useMemo)(()=>(function(e){if("object"==typeof e&&e){let t=null==e?void 0:e.delay;return{loading:(t=Number.isNaN(t)||"number"!=typeof t?0:t)<=0,delay:t}}return{loading:!!e,delay:0}})(p),[p]),[X,U]=(0,r.useState)(G.loading),[$,K]=(0,r.useState)(!1),Y=(0,r.createRef)(),Q=(0,c.sQ)(t,Y),ee=1===r.Children.count(k)&&!M&&!(0,h.Te)(b);(0,r.useEffect)(()=>{let e=null;return G.delay>0?e=setTimeout(()=>{e=null,U(!0)},G.delay):U(G.loading),function(){e&&(clearTimeout(e),e=null)}},[G]),(0,r.useEffect)(()=>{if(!Q||!Q.current||!1===A)return;let e=Q.current.textContent;ee&&(0,h.aG)(e)?$||K(!0):$&&K(!1)},[Q]);let et=t=>{let{onClick:n}=e;if(X||V){t.preventDefault();return}null==n||n(t)},eo=!1!==A,{compactSize:ea,compactItemClassnames:ei}=(0,f.ri)(_,L),ec=(0,d.Z)(e=>{var t,n;return null!==(n=null!==(t=null!=x?x:ea)&&void 0!==t?t:q)&&void 0!==n?n:e}),el=ec&&({large:"lg",small:"sm",middle:void 0})[ec]||"",es=X?"loading":M,eu=(0,i.Z)(F,["navigate"]),ed=a()(_,B,D,{["".concat(_,"-").concat(w)]:"default"!==w&&w,["".concat(_,"-").concat(b)]:b,["".concat(_,"-").concat(el)]:el,["".concat(_,"-icon-only")]:!k&&0!==k&&!!es,["".concat(_,"-background-ghost")]:j&&!(0,h.Te)(b),["".concat(_,"-loading")]:X,["".concat(_,"-two-chinese-chars")]:$&&eo&&!X,["".concat(_,"-block")]:I,["".concat(_,"-dangerous")]:!!y,["".concat(_,"-rtl")]:"rtl"===L},ei,Z,O,null==z?void 0:z.className),ef=Object.assign(Object.assign({},null==z?void 0:z.style),P),ep=a()(null==N?void 0:N.icon,null===(n=null==z?void 0:z.classNames)||void 0===n?void 0:n.icon),em=Object.assign(Object.assign({},(null==E?void 0:E.icon)||{}),(null===(o=null==z?void 0:z.styles)||void 0===o?void 0:o.icon)||{}),eg=M&&!X?r.createElement(v,{prefixCls:_,className:ep,style:em},M):r.createElement(S,{existIcon:!!M,prefixCls:_,loading:!!X}),eh=k||0===k?(0,h.hU)(k,ee&&eo):null;if(void 0!==eu.href)return H(r.createElement("a",Object.assign({},eu,{className:a()(ed,{["".concat(_,"-disabled")]:V}),href:V?void 0:eu.href,style:ef,onClick:et,ref:Q,tabIndex:V?-1:0}),eg,eh));let ev=r.createElement("button",Object.assign({},F,{type:R,className:ed,style:ef,onClick:et,disabled:V,ref:Q}),eg,eh,!!ei&&r.createElement(en,{key:"compact",prefixCls:_}));return(0,h.Te)(b)||(ev=r.createElement(l.Z,{component:"Button",disabled:!!X},ev)),H(ev)});eo.Group=e=>{let{getPrefixCls:t,direction:n}=r.useContext(s.E_),{prefixCls:o,size:i,className:c}=e,l=m(e,["prefixCls","size","className"]),u=t("btn-group",o),[,,d]=(0,p.ZP)(),f="";switch(i){case"large":f="lg";break;case"small":f="sm"}let h=a()(u,{["".concat(u,"-").concat(f)]:f,["".concat(u,"-rtl")]:"rtl"===n},c,d);return r.createElement(g.Provider,{value:i},r.createElement("div",Object.assign({},l,{className:h})))},eo.__ANT_BUTTON=!0;var ea=eo},86586:function(e,t,n){"use strict";n.d(t,{n:function(){return a}});var r=n(2265);let o=r.createContext(!1),a=e=>{let{children:t,disabled:n}=e,a=r.useContext(o);return r.createElement(o.Provider,{value:null!=n?n:a},t)};t.Z=o},59189:function(e,t,n){"use strict";n.d(t,{q:function(){return a}});var r=n(2265);let o=r.createContext(void 0),a=e=>{let{children:t,size:n}=e,a=r.useContext(o);return r.createElement(o.Provider,{value:n||a},t)};t.Z=o},71744:function(e,t,n){"use strict";n.d(t,{E_:function(){return a},oR:function(){return o}});var r=n(2265);let o="anticon",a=r.createContext({getPrefixCls:(e,t)=>t||(e?"ant-".concat(e):"ant"),iconPrefixCls:o}),{Consumer:i}=a},91086:function(e,t,n){"use strict";var r=n(2265),o=n(71744),a=n(85180);t.Z=e=>{let{componentName:t}=e,{getPrefixCls:n}=(0,r.useContext)(o.E_),i=n("empty");switch(t){case"Table":case"List":return r.createElement(a.Z,{image:a.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return r.createElement(a.Z,{image:a.Z.PRESENTED_IMAGE_SIMPLE,className:"".concat(i,"-small")});default:return r.createElement(a.Z,null)}}},64024:function(e,t,n){"use strict";var r=n(29961);t.Z=e=>{let[,,,,t]=(0,r.ZP)();return t?"".concat(e,"-css-var"):""}},33759:function(e,t,n){"use strict";var r=n(2265),o=n(59189);t.Z=e=>{let t=r.useContext(o.Z);return r.useMemo(()=>e?"string"==typeof e?null!=e?e:t:e instanceof Function?e(t):t:t,[e,t])}},13959:function(e,t,n){"use strict";let r,o,a,i;n.d(t,{ZP:function(){return V},w6:function(){return B}});var c=n(2265),l=n.t(c,2),s=n(352),u=n(20902),d=n(6397),f=n(23789),p=n(13613),m=n(77360),g=n(92246),h=n(91325),v=e=>{let{locale:t={},children:n,_ANT_MARK__:r}=e;c.useEffect(()=>(0,g.f)(t&&t.Modal),[t]);let o=c.useMemo(()=>Object.assign(Object.assign({},t),{exist:!0}),[t]);return c.createElement(h.Z.Provider,{value:o},n)},b=n(13823),y=n(37516),w=n(70774),x=n(71744),E=n(31373),S=n(36360),C=n(94981),Z=n(21717);let O="-ant-".concat(Date.now(),"-").concat(Math.random());var k=n(86586),M=n(59189),j=n(16671);let{useId:I}=Object.assign({},l);var R=void 0===I?()=>"":I,N=n(47970),P=n(29961);function F(e){let{children:t}=e,[,n]=(0,P.ZP)(),{motion:r}=n,o=c.useRef(!1);return(o.current=o.current||!1===r,o.current)?c.createElement(N.zt,{motion:r},t):t}var T=()=>null,A=n(36198),L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let z=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form","select","button"];function _(){return r||"ant"}function H(){return o||x.oR}let B=()=>({getPrefixCls:(e,t)=>t||(e?"".concat(_(),"-").concat(e):_()),getIconPrefixCls:H,getRootPrefixCls:()=>r||_(),getTheme:()=>a,holderRender:i}),D=e=>{let{children:t,csp:n,autoInsertSpaceInButton:r,alert:o,anchor:a,form:i,locale:l,componentSize:g,direction:h,space:E,virtual:S,dropdownMatchSelectWidth:C,popupMatchSelectWidth:Z,popupOverflow:O,legacyLocale:I,parentContext:N,iconPrefixCls:P,theme:_,componentDisabled:H,segmented:B,statistic:D,spin:W,calendar:V,carousel:q,cascader:G,collapse:X,typography:U,checkbox:$,descriptions:K,divider:Y,drawer:Q,skeleton:J,steps:ee,image:et,layout:en,list:er,mentions:eo,modal:ea,progress:ei,result:ec,slider:el,breadcrumb:es,menu:eu,pagination:ed,input:ef,empty:ep,badge:em,radio:eg,rate:eh,switch:ev,transfer:eb,avatar:ey,message:ew,tag:ex,table:eE,card:eS,tabs:eC,timeline:eZ,timePicker:eO,upload:ek,notification:eM,tree:ej,colorPicker:eI,datePicker:eR,rangePicker:eN,flex:eP,wave:eF,dropdown:eT,warning:eA}=e,eL=c.useCallback((t,n)=>{let{prefixCls:r}=e;if(n)return n;let o=r||N.getPrefixCls("");return t?"".concat(o,"-").concat(t):o},[N.getPrefixCls,e.prefixCls]),ez=P||N.iconPrefixCls||x.oR,e_=n||N.csp;(0,A.Z)(ez,e_);let eH=function(e,t){(0,p.ln)("ConfigProvider");let n=e||{},r=!1!==n.inherit&&t?t:y.u_,o=R();return(0,d.Z)(()=>{var a,i;if(!e)return t;let c=Object.assign({},r.components);Object.keys(e.components||{}).forEach(t=>{c[t]=Object.assign(Object.assign({},c[t]),e.components[t])});let l="css-var-".concat(o.replace(/:/g,"")),s=(null!==(a=n.cssVar)&&void 0!==a?a:r.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:"ant"},"object"==typeof r.cssVar?r.cssVar:{}),"object"==typeof n.cssVar?n.cssVar:{}),{key:"object"==typeof n.cssVar&&(null===(i=n.cssVar)||void 0===i?void 0:i.key)||l});return Object.assign(Object.assign(Object.assign({},r),n),{token:Object.assign(Object.assign({},r.token),n.token),components:c,cssVar:s})},[n,r],(e,t)=>e.some((e,n)=>{let r=t[n];return!(0,j.Z)(e,r,!0)}))}(_,N.theme),eB={csp:e_,autoInsertSpaceInButton:r,alert:o,anchor:a,locale:l||I,direction:h,space:E,virtual:S,popupMatchSelectWidth:null!=Z?Z:C,popupOverflow:O,getPrefixCls:eL,iconPrefixCls:ez,theme:eH,segmented:B,statistic:D,spin:W,calendar:V,carousel:q,cascader:G,collapse:X,typography:U,checkbox:$,descriptions:K,divider:Y,drawer:Q,skeleton:J,steps:ee,image:et,input:ef,layout:en,list:er,mentions:eo,modal:ea,progress:ei,result:ec,slider:el,breadcrumb:es,menu:eu,pagination:ed,empty:ep,badge:em,radio:eg,rate:eh,switch:ev,transfer:eb,avatar:ey,message:ew,tag:ex,table:eE,card:eS,tabs:eC,timeline:eZ,timePicker:eO,upload:ek,notification:eM,tree:ej,colorPicker:eI,datePicker:eR,rangePicker:eN,flex:eP,wave:eF,dropdown:eT,warning:eA},eD=Object.assign({},N);Object.keys(eB).forEach(e=>{void 0!==eB[e]&&(eD[e]=eB[e])}),z.forEach(t=>{let n=e[t];n&&(eD[t]=n)});let eW=(0,d.Z)(()=>eD,eD,(e,t)=>{let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||n.some(n=>e[n]!==t[n])}),eV=c.useMemo(()=>({prefixCls:ez,csp:e_}),[ez,e_]),eq=c.createElement(c.Fragment,null,c.createElement(T,{dropdownMatchSelectWidth:C}),t),eG=c.useMemo(()=>{var e,t,n,r;return(0,f.T)((null===(e=b.Z.Form)||void 0===e?void 0:e.defaultValidateMessages)||{},(null===(n=null===(t=eW.locale)||void 0===t?void 0:t.Form)||void 0===n?void 0:n.defaultValidateMessages)||{},(null===(r=eW.form)||void 0===r?void 0:r.validateMessages)||{},(null==i?void 0:i.validateMessages)||{})},[eW,null==i?void 0:i.validateMessages]);Object.keys(eG).length>0&&(eq=c.createElement(m.Z.Provider,{value:eG},eq)),l&&(eq=c.createElement(v,{locale:l,_ANT_MARK__:"internalMark"},eq)),(ez||e_)&&(eq=c.createElement(u.Z.Provider,{value:eV},eq)),g&&(eq=c.createElement(M.q,{size:g},eq)),eq=c.createElement(F,null,eq);let eX=c.useMemo(()=>{let e=eH||{},{algorithm:t,token:n,components:r,cssVar:o}=e,a=L(e,["algorithm","token","components","cssVar"]),i=t&&(!Array.isArray(t)||t.length>0)?(0,s.jG)(t):y.uH,c={};Object.entries(r||{}).forEach(e=>{let[t,n]=e,r=Object.assign({},n);"algorithm"in r&&(!0===r.algorithm?r.theme=i:(Array.isArray(r.algorithm)||"function"==typeof r.algorithm)&&(r.theme=(0,s.jG)(r.algorithm)),delete r.algorithm),c[t]=r});let l=Object.assign(Object.assign({},w.Z),n);return Object.assign(Object.assign({},a),{theme:i,token:l,components:c,override:Object.assign({override:l},c),cssVar:o})},[eH]);return _&&(eq=c.createElement(y.Mj.Provider,{value:eX},eq)),eW.warning&&(eq=c.createElement(p.G8.Provider,{value:eW.warning},eq)),void 0!==H&&(eq=c.createElement(k.n,{disabled:H},eq)),c.createElement(x.E_.Provider,{value:eW},eq)},W=e=>{let t=c.useContext(x.E_),n=c.useContext(h.Z);return c.createElement(D,Object.assign({parentContext:t,legacyLocale:n},e))};W.ConfigContext=x.E_,W.SizeContext=M.Z,W.config=e=>{let{prefixCls:t,iconPrefixCls:n,theme:c,holderRender:l}=e;void 0!==t&&(r=t),void 0!==n&&(o=n),"holderRender"in e&&(i=l),c&&(Object.keys(c).some(e=>e.endsWith("Color"))?function(e,t){let n=function(e,t){let n={},r=(e,t)=>{let n=e.clone();return(n=(null==t?void 0:t(n))||n).toRgbString()},o=(e,t)=>{let o=new S.C(e),a=(0,E.R_)(o.toRgbString());n["".concat(t,"-color")]=r(o),n["".concat(t,"-color-disabled")]=a[1],n["".concat(t,"-color-hover")]=a[4],n["".concat(t,"-color-active")]=a[6],n["".concat(t,"-color-outline")]=o.clone().setAlpha(.2).toRgbString(),n["".concat(t,"-color-deprecated-bg")]=a[0],n["".concat(t,"-color-deprecated-border")]=a[2]};if(t.primaryColor){o(t.primaryColor,"primary");let e=new S.C(t.primaryColor),a=(0,E.R_)(e.toRgbString());a.forEach((e,t)=>{n["primary-".concat(t+1)]=e}),n["primary-color-deprecated-l-35"]=r(e,e=>e.lighten(35)),n["primary-color-deprecated-l-20"]=r(e,e=>e.lighten(20)),n["primary-color-deprecated-t-20"]=r(e,e=>e.tint(20)),n["primary-color-deprecated-t-50"]=r(e,e=>e.tint(50)),n["primary-color-deprecated-f-12"]=r(e,e=>e.setAlpha(.12*e.getAlpha()));let i=new S.C(a[0]);n["primary-color-active-deprecated-f-30"]=r(i,e=>e.setAlpha(.3*e.getAlpha())),n["primary-color-active-deprecated-d-02"]=r(i,e=>e.darken(2))}t.successColor&&o(t.successColor,"success"),t.warningColor&&o(t.warningColor,"warning"),t.errorColor&&o(t.errorColor,"error"),t.infoColor&&o(t.infoColor,"info");let a=Object.keys(n).map(t=>"--".concat(e,"-").concat(t,": ").concat(n[t],";"));return"\n :root {\n ".concat(a.join("\n"),"\n }\n ").trim()}(e,t);(0,C.Z)()&&(0,Z.hq)(n,"".concat(O,"-dynamic-theme"))}(_(),c):a=c)},W.useConfig=function(){return{componentDisabled:(0,c.useContext)(k.Z),componentSize:(0,c.useContext)(M.Z)}},Object.defineProperty(W,"SizeContext",{get:()=>M.Z});var V=W},85180:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(36760),o=n.n(r),a=n(2265),i=n(71744),c=n(55274),l=n(36360),s=n(29961),u=n(80669),d=n(3104);let f=e=>{let{componentCls:t,margin:n,marginXS:r,marginXL:o,fontSize:a,lineHeight:i}=e;return{[t]:{marginInline:r,fontSize:a,lineHeight:i,textAlign:"center",["".concat(t,"-image")]:{height:e.emptyImgHeight,marginBottom:r,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},["".concat(t,"-description")]:{color:e.colorText},["".concat(t,"-footer")]:{marginTop:n},"&-normal":{marginBlock:o,color:e.colorTextDisabled,["".concat(t,"-description")]:{color:e.colorTextDisabled},["".concat(t,"-image")]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:r,color:e.colorTextDisabled,["".concat(t,"-image")]:{height:e.emptyImgHeightSM}}}}};var p=(0,u.I$)("Empty",e=>{let{componentCls:t,controlHeightLG:n,calc:r}=e;return[f((0,d.TS)(e,{emptyImgCls:"".concat(t,"-img"),emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()}))]}),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let g=a.createElement(()=>{let[,e]=(0,s.ZP)(),t=new l.C(e.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return a.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},a.createElement("g",{fill:"none",fillRule:"evenodd"},a.createElement("g",{transform:"translate(24 31.67)"},a.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),a.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),a.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),a.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),a.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),a.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),a.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},a.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),a.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},null),h=a.createElement(()=>{let[,e]=(0,s.ZP)(),{colorFill:t,colorFillTertiary:n,colorFillQuaternary:r,colorBgContainer:o}=e,{borderColor:i,shadowColor:c,contentColor:u}=(0,a.useMemo)(()=>({borderColor:new l.C(t).onBackground(o).toHexShortString(),shadowColor:new l.C(n).onBackground(o).toHexShortString(),contentColor:new l.C(r).onBackground(o).toHexShortString()}),[t,n,r,o]);return a.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},a.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},a.createElement("ellipse",{fill:c,cx:"32",cy:"33",rx:"32",ry:"7"}),a.createElement("g",{fillRule:"nonzero",stroke:i},a.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),a.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:u}))))},null),v=e=>{var{className:t,rootClassName:n,prefixCls:r,image:l=g,description:s,children:u,imageStyle:d,style:f}=e,v=m(e,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);let{getPrefixCls:b,direction:y,empty:w}=a.useContext(i.E_),x=b("empty",r),[E,S,C]=p(x),[Z]=(0,c.Z)("Empty"),O=void 0!==s?s:null==Z?void 0:Z.description,k=null;return k="string"==typeof l?a.createElement("img",{alt:"string"==typeof O?O:"empty",src:l}):l,E(a.createElement("div",Object.assign({className:o()(S,C,x,null==w?void 0:w.className,{["".concat(x,"-normal")]:l===h,["".concat(x,"-rtl")]:"rtl"===y},t,n),style:Object.assign(Object.assign({},null==w?void 0:w.style),f)},v),a.createElement("div",{className:"".concat(x,"-image"),style:d},k),O&&a.createElement("div",{className:"".concat(x,"-description")},O),u&&a.createElement("div",{className:"".concat(x,"-footer")},u)))};v.PRESENTED_IMAGE_DEFAULT=g,v.PRESENTED_IMAGE_SIMPLE=h;var b=v},14605:function(e,t,n){"use strict";var r=n(83145),o=n(36760),a=n.n(o),i=n(47970),c=n(2265),l=n(68710),s=n(39109),u=n(4064),d=n(47713),f=n(64024);let p=[];function m(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{key:"string"==typeof e?e:"".concat(t,"-").concat(r),error:e,errorStatus:n}}t.Z=e=>{let{help:t,helpStatus:n,errors:o=p,warnings:g=p,className:h,fieldId:v,onVisibleChanged:b}=e,{prefixCls:y}=c.useContext(s.Rk),w="".concat(y,"-item-explain"),x=(0,f.Z)(y),[E,S,C]=(0,d.ZP)(y,x),Z=(0,c.useMemo)(()=>(0,l.Z)(y),[y]),O=(0,u.Z)(o),k=(0,u.Z)(g),M=c.useMemo(()=>null!=t?[m(t,"help",n)]:[].concat((0,r.Z)(O.map((e,t)=>m(e,"error","error",t))),(0,r.Z)(k.map((e,t)=>m(e,"warning","warning",t)))),[t,n,O,k]),j={};return v&&(j.id="".concat(v,"_help")),E(c.createElement(i.ZP,{motionDeadline:Z.motionDeadline,motionName:"".concat(y,"-show-help"),visible:!!M.length,onVisibleChanged:b},e=>{let{className:t,style:n}=e;return c.createElement("div",Object.assign({},j,{className:a()(w,t,C,x,h,S),style:n,role:"alert"}),c.createElement(i.V4,Object.assign({keys:M},(0,l.Z)(y),{motionName:"".concat(y,"-show-help-item"),component:!1}),e=>{let{key:t,error:n,errorStatus:r,className:o,style:i}=e;return c.createElement("div",{key:t,className:a()(o,{["".concat(w,"-").concat(r)]:r}),style:i},n)}))}))}},38994:function(e,t,n){"use strict";n.d(t,{Z:function(){return U}});var r=n(83145),o=n(2265),a=n(36760),i=n.n(a),c=n(64834),l=n(69819),s=n(28791),u=n(19722),d=n(13613),f=n(71744),p=n(64024),m=n(39109),g=n(45287);let h=()=>{let{status:e,errors:t=[],warnings:n=[]}=(0,o.useContext)(m.aM);return{status:e,errors:t,warnings:n}};h.Context=m.aM;var v=n(53346),b=n(47713),y=n(13861),w=n(2857),x=n(27380),E=n(18694),S=n(10295),C=n(54998),Z=n(14605),O=n(80669);let k=e=>{let{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{["".concat(t,"-control")]:{display:"flex"}}}};var M=(0,O.bk)(["Form","item-item"],(e,t)=>{let{rootPrefixCls:n}=t;return[k((0,b.B4)(e,n))]}),j=e=>{let{prefixCls:t,status:n,wrapperCol:r,children:a,errors:c,warnings:l,_internalItemRender:s,extra:u,help:d,fieldId:f,marginBottom:p,onErrorVisibleChanged:g}=e,h="".concat(t,"-item"),v=o.useContext(m.q3),b=r||v.wrapperCol||{},y=i()("".concat(h,"-control"),b.className),w=o.useMemo(()=>Object.assign({},v),[v]);delete w.labelCol,delete w.wrapperCol;let x=o.createElement("div",{className:"".concat(h,"-control-input")},o.createElement("div",{className:"".concat(h,"-control-input-content")},a)),E=o.useMemo(()=>({prefixCls:t,status:n}),[t,n]),S=null!==p||c.length||l.length?o.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},o.createElement(m.Rk.Provider,{value:E},o.createElement(Z.Z,{fieldId:f,errors:c,warnings:l,help:d,helpStatus:n,className:"".concat(h,"-explain-connected"),onVisibleChanged:g})),!!p&&o.createElement("div",{style:{width:0,height:p}})):null,O={};f&&(O.id="".concat(f,"_extra"));let k=u?o.createElement("div",Object.assign({},O,{className:"".concat(h,"-extra")}),u):null,j=s&&"pro_table_render"===s.mark&&s.render?s.render(e,{input:x,errorList:S,extra:k}):o.createElement(o.Fragment,null,x,S,k);return o.createElement(m.q3.Provider,{value:w},o.createElement(C.Z,Object.assign({},b,{className:y}),j),o.createElement(M,{prefixCls:t}))},I=n(67187),R=n(13823),N=n(55274),P=n(89970),F=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},T=e=>{var t;let{prefixCls:n,label:r,htmlFor:a,labelCol:c,labelAlign:l,colon:s,required:u,requiredMark:d,tooltip:f}=e,[p]=(0,N.Z)("Form"),{vertical:g,labelAlign:h,labelCol:v,labelWrap:b,colon:y}=o.useContext(m.q3);if(!r)return null;let w=c||v||{},x="".concat(n,"-item-label"),E=i()(x,"left"===(l||h)&&"".concat(x,"-left"),w.className,{["".concat(x,"-wrap")]:!!b}),S=r,Z=!0===s||!1!==y&&!1!==s;Z&&!g&&"string"==typeof r&&""!==r.trim()&&(S=r.replace(/[:|:]\s*$/,""));let O=f?"object"!=typeof f||o.isValidElement(f)?{title:f}:f:null;if(O){let{icon:e=o.createElement(I.Z,null)}=O,t=F(O,["icon"]),r=o.createElement(P.Z,Object.assign({},t),o.cloneElement(e,{className:"".concat(n,"-item-tooltip"),title:"",onClick:e=>{e.preventDefault()},tabIndex:null}));S=o.createElement(o.Fragment,null,S,r)}let k="optional"===d,M="function"==typeof d;M?S=d(S,{required:!!u}):k&&!u&&(S=o.createElement(o.Fragment,null,S,o.createElement("span",{className:"".concat(n,"-item-optional"),title:""},(null==p?void 0:p.optional)||(null===(t=R.Z.Form)||void 0===t?void 0:t.optional))));let j=i()({["".concat(n,"-item-required")]:u,["".concat(n,"-item-required-mark-optional")]:k||M,["".concat(n,"-item-no-colon")]:!Z});return o.createElement(C.Z,Object.assign({},w,{className:E}),o.createElement("label",{htmlFor:a,className:j,title:"string"==typeof r?r:""},S))},A=n(4064),L=n(8900),z=n(39725),_=n(54537),H=n(61935);let B={success:L.Z,warning:_.Z,error:z.Z,validating:H.Z};function D(e){let{children:t,errors:n,warnings:r,hasFeedback:a,validateStatus:c,prefixCls:l,meta:s,noStyle:u}=e,d="".concat(l,"-item"),{feedbackIcons:f}=o.useContext(m.q3),p=(0,y.lR)(n,r,s,null,!!a,c),{isFormItemInput:g,status:h,hasFeedback:v,feedbackIcon:b}=o.useContext(m.aM),w=o.useMemo(()=>{var e;let t;if(a){let c=!0!==a&&a.icons||f,l=p&&(null===(e=null==c?void 0:c({status:p,errors:n,warnings:r}))||void 0===e?void 0:e[p]),s=p&&B[p];t=!1!==l&&s?o.createElement("span",{className:i()("".concat(d,"-feedback-icon"),"".concat(d,"-feedback-icon-").concat(p))},l||o.createElement(s,null)):null}let c={status:p||"",errors:n,warnings:r,hasFeedback:!!a,feedbackIcon:t,isFormItemInput:!0};return u&&(c.status=(null!=p?p:h)||"",c.isFormItemInput=g,c.hasFeedback=!!(null!=a?a:v),c.feedbackIcon=void 0!==a?c.feedbackIcon:b),c},[p,a,u,g,h]);return o.createElement(m.aM.Provider,{value:w},t)}var W=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function V(e){let{prefixCls:t,className:n,rootClassName:r,style:a,help:c,errors:l,warnings:s,validateStatus:u,meta:d,hasFeedback:f,hidden:p,children:g,fieldId:h,required:v,isRequired:b,onSubItemMetaChange:C}=e,Z=W(e,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),O="".concat(t,"-item"),{requiredMark:k}=o.useContext(m.q3),M=o.useRef(null),I=(0,A.Z)(l),R=(0,A.Z)(s),N=null!=c,P=!!(N||l.length||s.length),F=!!M.current&&(0,w.Z)(M.current),[L,z]=o.useState(null);(0,x.Z)(()=>{P&&M.current&&z(parseInt(getComputedStyle(M.current).marginBottom,10))},[P,F]);let _=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?I:d.errors,n=e?R:d.warnings;return(0,y.lR)(t,n,d,"",!!f,u)}(),H=i()(O,n,r,{["".concat(O,"-with-help")]:N||I.length||R.length,["".concat(O,"-has-feedback")]:_&&f,["".concat(O,"-has-success")]:"success"===_,["".concat(O,"-has-warning")]:"warning"===_,["".concat(O,"-has-error")]:"error"===_,["".concat(O,"-is-validating")]:"validating"===_,["".concat(O,"-hidden")]:p});return o.createElement("div",{className:H,style:a,ref:M},o.createElement(S.Z,Object.assign({className:"".concat(O,"-row")},(0,E.Z)(Z,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),o.createElement(T,Object.assign({htmlFor:h},e,{requiredMark:k,required:null!=v?v:b,prefixCls:t})),o.createElement(j,Object.assign({},e,d,{errors:I,warnings:R,prefixCls:t,status:_,help:c,marginBottom:L,onErrorVisibleChanged:e=>{e||z(null)}}),o.createElement(m.qI.Provider,{value:C},o.createElement(D,{prefixCls:t,meta:d,errors:d.errors,warnings:d.warnings,hasFeedback:f,validateStatus:_},g)))),!!L&&o.createElement("div",{className:"".concat(O,"-margin-offset"),style:{marginBottom:-L}}))}let q=o.memo(e=>{let{children:t}=e;return t},(e,t)=>(function(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>{let r=e[n],o=t[n];return r===o||"function"==typeof r||"function"==typeof o})})(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((e,n)=>e===t.childProps[n]));function G(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}let X=function(e){let{name:t,noStyle:n,className:a,dependencies:h,prefixCls:w,shouldUpdate:x,rules:E,children:S,required:C,label:Z,messageVariables:O,trigger:k="onChange",validateTrigger:M,hidden:j,help:I}=e,{getPrefixCls:R}=o.useContext(f.E_),{name:N}=o.useContext(m.q3),P=function(e){if("function"==typeof e)return e;let t=(0,g.Z)(e);return t.length<=1?t[0]:t}(S),F="function"==typeof P,T=o.useContext(m.qI),{validateTrigger:A}=o.useContext(c.zb),L=void 0!==M?M:A,z=null!=t,_=R("form",w),H=(0,p.Z)(_),[B,W,X]=(0,b.ZP)(_,H);(0,d.ln)("Form.Item");let U=o.useContext(c.ZM),$=o.useRef(),[K,Y]=function(e){let[t,n]=o.useState(e),r=(0,o.useRef)(null),a=(0,o.useRef)([]),i=(0,o.useRef)(!1);return o.useEffect(()=>(i.current=!1,()=>{i.current=!0,v.Z.cancel(r.current),r.current=null}),[]),[t,function(e){i.current||(null===r.current&&(a.current=[],r.current=(0,v.Z)(()=>{r.current=null,n(e=>{let t=e;return a.current.forEach(e=>{t=e(t)}),t})})),a.current.push(e))}]}({}),[Q,J]=(0,l.Z)(()=>G()),ee=(e,t)=>{Y(n=>{let o=Object.assign({},n),a=[].concat((0,r.Z)(e.name.slice(0,-1)),(0,r.Z)(t)).join("__SPLIT__");return e.destroy?delete o[a]:o[a]=e,o})},[et,en]=o.useMemo(()=>{let e=(0,r.Z)(Q.errors),t=(0,r.Z)(Q.warnings);return Object.values(K).forEach(n=>{e.push.apply(e,(0,r.Z)(n.errors||[])),t.push.apply(t,(0,r.Z)(n.warnings||[]))}),[e,t]},[K,Q.errors,Q.warnings]),er=function(){let{itemRef:e}=o.useContext(m.q3),t=o.useRef({});return function(n,r){let o=r&&"object"==typeof r&&r.ref,a=n.join("_");return(t.current.name!==a||t.current.originRef!==o)&&(t.current.name=a,t.current.originRef=o,t.current.ref=(0,s.sQ)(e(n),o)),t.current.ref}}();function eo(t,r,c){return n&&!j?o.createElement(D,{prefixCls:_,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:Q,errors:et,warnings:en,noStyle:!0},t):o.createElement(V,Object.assign({key:"row"},e,{className:i()(a,X,H,W),prefixCls:_,fieldId:r,isRequired:c,errors:et,warnings:en,meta:Q,onSubItemMetaChange:ee}),t)}if(!z&&!F&&!h)return B(eo(P));let ea={};return"string"==typeof Z?ea.label=Z:t&&(ea.label=String(t)),O&&(ea=Object.assign(Object.assign({},ea),O)),B(o.createElement(c.gN,Object.assign({},e,{messageVariables:ea,trigger:k,validateTrigger:L,onMetaChange:e=>{let t=null==U?void 0:U.getKey(e.name);if(J(e.destroy?G():e,!0),n&&!1!==I&&T){let n=e.name;if(e.destroy)n=$.current||n;else if(void 0!==t){let[e,o]=t;n=[e].concat((0,r.Z)(o)),$.current=n}T(e,n)}}}),(n,a,i)=>{let c=(0,y.qo)(t).length&&a?a.name:[],l=(0,y.dD)(c,N),d=void 0!==C?C:!!(E&&E.some(e=>{if(e&&"object"==typeof e&&e.required&&!e.warningOnly)return!0;if("function"==typeof e){let t=e(i);return t&&t.required&&!t.warningOnly}return!1})),f=Object.assign({},n),p=null;if(Array.isArray(P)&&z)p=P;else if(F&&(!(x||h)||z));else if(!h||F||z){if((0,u.l$)(P)){let t=Object.assign(Object.assign({},P.props),f);if(t.id||(t.id=l),I||et.length>0||en.length>0||e.extra){let n=[];(I||et.length>0)&&n.push("".concat(l,"_help")),e.extra&&n.push("".concat(l,"_extra")),t["aria-describedby"]=n.join(" ")}et.length>0&&(t["aria-invalid"]="true"),d&&(t["aria-required"]="true"),(0,s.Yr)(P)&&(t.ref=er(c,P)),new Set([].concat((0,r.Z)((0,y.qo)(k)),(0,r.Z)((0,y.qo)(L)))).forEach(e=>{t[e]=function(){for(var t,n,r,o=arguments.length,a=Array(o),i=0;i{}}),c=r.createContext(null),l=e=>{let t=(0,a.Z)(e,["prefixCls"]);return r.createElement(o.RV,Object.assign({},t))},s=r.createContext({prefixCls:""}),u=r.createContext({}),d=e=>{let{children:t,status:n,override:o}=e,a=(0,r.useContext)(u),i=(0,r.useMemo)(()=>{let e=Object.assign({},a);return o&&delete e.isFormItemInput,n&&(delete e.status,delete e.hasFeedback,delete e.feedbackIcon),e},[n,o,a]);return r.createElement(u.Provider,{value:i},t)},f=(0,r.createContext)(void 0)},4064:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e){let[t,n]=r.useState(e);return r.useEffect(()=>{let t=setTimeout(()=>{n(e)},e.length?0:10);return()=>{clearTimeout(t)}},[e]),t}},56250:function(e,t,n){"use strict";var r=n(2265),o=n(39109);let a=["outlined","borderless","filled"];t.Z=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=(0,r.useContext)(o.pg);t=void 0!==e?e:!1===n?"borderless":null!=i?i:"outlined";let c=a.includes(t);return[t,c]}},13634:function(e,t,n){"use strict";n.d(t,{Z:function(){return I}});var r=n(14605),o=n(2265),a=n(36760),i=n.n(a),c=n(64834),l=n(71744),s=n(86586),u=n(64024),d=n(33759),f=n(59189),p=n(39109);let m=e=>"object"==typeof e&&null!=e&&1===e.nodeType,g=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,h=(e,t)=>{if(e.clientHeight{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeightat||a>e&&i=t&&c>=n?a-e-r:i>t&&cn?i-t+o:0,b=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},y=(e,t)=>{var n,r,o,a;if("undefined"==typeof document)return[];let{scrollMode:i,block:c,inline:l,boundary:s,skipOverflowHiddenElements:u}=t,d="function"==typeof s?s:e=>e!==s;if(!m(e))throw TypeError("Invalid target");let f=document.scrollingElement||document.documentElement,p=[],g=e;for(;m(g)&&d(g);){if((g=b(g))===f){p.push(g);break}null!=g&&g===document.body&&h(g)&&!h(document.documentElement)||null!=g&&h(g,u)&&p.push(g)}let y=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,w=null!=(a=null==(o=window.visualViewport)?void 0:o.height)?a:innerHeight,{scrollX:x,scrollY:E}=window,{height:S,width:C,top:Z,right:O,bottom:k,left:M}=e.getBoundingClientRect(),{top:j,right:I,bottom:R,left:N}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),P="start"===c||"nearest"===c?Z-j:"end"===c?k+R:Z+S/2-j+R,F="center"===l?M+C/2-N+I:"end"===l?O+I:M-N,T=[];for(let e=0;e=0&&M>=0&&k<=w&&O<=y&&Z>=o&&k<=s&&M>=u&&O<=a)break;let d=getComputedStyle(t),m=parseInt(d.borderLeftWidth,10),g=parseInt(d.borderTopWidth,10),h=parseInt(d.borderRightWidth,10),b=parseInt(d.borderBottomWidth,10),j=0,I=0,R="offsetWidth"in t?t.offsetWidth-t.clientWidth-m-h:0,N="offsetHeight"in t?t.offsetHeight-t.clientHeight-g-b:0,A="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,L="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)j="start"===c?P:"end"===c?P-w:"nearest"===c?v(E,E+w,w,g,b,E+P,E+P+S,S):P-w/2,I="start"===l?F:"center"===l?F-y/2:"end"===l?F-y:v(x,x+y,y,m,h,x+F,x+F+C,C),j=Math.max(0,j+E),I=Math.max(0,I+x);else{j="start"===c?P-o-g:"end"===c?P-s+b+N:"nearest"===c?v(o,s,n,g,b+N,P,P+S,S):P-(o+n/2)+N/2,I="start"===l?F-u-m:"center"===l?F-(u+r/2)+R/2:"end"===l?F-a+h+R:v(u,a,r,m,h+R,F,F+C,C);let{scrollLeft:e,scrollTop:i}=t;j=0===L?0:Math.max(0,Math.min(i+j/L,t.scrollHeight-n/L+N)),I=0===A?0:Math.max(0,Math.min(e+I/A,t.scrollWidth-r/A+R)),P+=i-j,F+=e-I}T.push({el:t,top:j,left:I})}return T},w=e=>!1===e?{block:"end",inline:"nearest"}:e===Object(e)&&0!==Object.keys(e).length?e:{block:"start",inline:"nearest"};var x=n(13861);function E(e){return(0,x.qo)(e).join("_")}function S(e){let[t]=(0,c.cI)(),n=o.useRef({}),r=o.useMemo(()=>null!=e?e:Object.assign(Object.assign({},t),{__INTERNAL__:{itemRef:e=>t=>{let r=E(e);t?n.current[r]=t:delete n.current[r]}},scrollToField:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,x.qo)(e),o=(0,x.dD)(n,r.__INTERNAL__.name),a=o?document.getElementById(o):null;a&&function(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(y(e,t));let r="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:o,top:a,left:i}of y(e,w(t))){let e=a-n.top+n.bottom,t=i-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}(a,Object.assign({scrollMode:"if-needed",block:"nearest"},t))},getFieldInstance:e=>{let t=E(e);return n.current[t]}}),[e,t]);return[r]}var C=n(47713),Z=n(77360),O=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let k=o.forwardRef((e,t)=>{let n=o.useContext(s.Z),{getPrefixCls:r,direction:a,form:m}=o.useContext(l.E_),{prefixCls:g,className:h,rootClassName:v,size:b,disabled:y=n,form:w,colon:x,labelAlign:E,labelWrap:k,labelCol:M,wrapperCol:j,hideRequiredMark:I,layout:R="horizontal",scrollToFirstError:N,requiredMark:P,onFinishFailed:F,name:T,style:A,feedbackIcons:L,variant:z}=e,_=O(e,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),H=(0,d.Z)(b),B=o.useContext(Z.Z),D=(0,o.useMemo)(()=>void 0!==P?P:!I&&(!m||void 0===m.requiredMark||m.requiredMark),[I,P,m]),W=null!=x?x:null==m?void 0:m.colon,V=r("form",g),q=(0,u.Z)(V),[G,X,U]=(0,C.ZP)(V,q),$=i()(V,"".concat(V,"-").concat(R),{["".concat(V,"-hide-required-mark")]:!1===D,["".concat(V,"-rtl")]:"rtl"===a,["".concat(V,"-").concat(H)]:H},U,q,X,null==m?void 0:m.className,h,v),[K]=S(w),{__INTERNAL__:Y}=K;Y.name=T;let Q=(0,o.useMemo)(()=>({name:T,labelAlign:E,labelCol:M,labelWrap:k,wrapperCol:j,vertical:"vertical"===R,colon:W,requiredMark:D,itemRef:Y.itemRef,form:K,feedbackIcons:L}),[T,E,M,j,R,W,D,K,L]);o.useImperativeHandle(t,()=>K);let J=(e,t)=>{if(e){let n={block:"nearest"};"object"==typeof e&&(n=e),K.scrollToField(t,n)}};return G(o.createElement(p.pg.Provider,{value:z},o.createElement(s.n,{disabled:y},o.createElement(f.Z.Provider,{value:H},o.createElement(p.RV,{validateMessages:B},o.createElement(p.q3.Provider,{value:Q},o.createElement(c.ZP,Object.assign({id:T},_,{name:T,onFinishFailed:e=>{if(null==F||F(e),e.errorFields.length){let t=e.errorFields[0].name;if(void 0!==N){J(N,t);return}m&&void 0!==m.scrollToFirstError&&J(m.scrollToFirstError,t)}},form:K,style:Object.assign(Object.assign({},null==m?void 0:m.style),A),className:$}))))))))});var M=n(38994),j=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};k.Item=M.Z,k.List=e=>{var{prefixCls:t,children:n}=e,r=j(e,["prefixCls","children"]);let{getPrefixCls:a}=o.useContext(l.E_),i=a("form",t),s=o.useMemo(()=>({prefixCls:i,status:"error"}),[i]);return o.createElement(c.aV,Object.assign({},r),(e,t,r)=>o.createElement(p.Rk.Provider,{value:s},n(e.map(e=>Object.assign(Object.assign({},e),{fieldKey:e.key})),t,{errors:r.errors,warnings:r.warnings})))},k.ErrorList=r.Z,k.useForm=S,k.useFormInstance=function(){let{form:e}=(0,o.useContext)(p.q3);return e},k.useWatch=c.qo,k.Provider=p.RV,k.create=()=>{};var I=k},47713:function(e,t,n){"use strict";n.d(t,{ZP:function(){return w},B4:function(){return y}});var r=n(352),o=n(12918),a=n(691),i=n(63074),c=n(3104),l=n(80669),s=e=>{let{componentCls:t}=e,n="".concat(t,"-show-help"),r="".concat(t,"-show-help-item");return{[n]:{transition:"opacity ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut),"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:"hidden",transition:"height ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut,",\n opacity ").concat(e.motionDurationSlow," ").concat(e.motionEaseInOut,",\n transform ").concat(e.motionDurationSlow," ").concat(e.motionEaseInOut," !important"),["&".concat(r,"-appear, &").concat(r,"-enter")]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},["&".concat(r,"-leave-active")]:{transform:"translateY(-5px)"}}}}};let u=e=>({legend:{display:"block",width:"100%",marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:"0 0 0 ".concat((0,r.bf)(e.controlOutlineWidth)," ").concat(e.controlOutline)},output:{display:"block",paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),d=(e,t)=>{let{formItemCls:n}=e;return{[n]:{["".concat(n,"-label > label")]:{height:t},["".concat(n,"-control-input")]:{minHeight:t}}}},f=e=>{let{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),u(e)),{["".concat(t,"-text")]:{display:"inline-block",paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},d(e,e.controlHeightSM)),"&-large":Object.assign({},d(e,e.controlHeightLG))})}},p=e=>{let{formItemCls:t,iconCls:n,componentCls:r,rootPrefixCls:i,labelRequiredMarkColor:c,labelColor:l,labelFontSize:s,labelHeight:u,labelColonMarginInlineStart:d,labelColonMarginInlineEnd:f,itemMarginBottom:p}=e;return{[t]:Object.assign(Object.assign({},(0,o.Wf)(e)),{marginBottom:p,verticalAlign:"top","&-with-help":{transition:"none"},["&-hidden,\n &-hidden.".concat(i,"-row")]:{display:"none"},"&-has-warning":{["".concat(t,"-split")]:{color:e.colorError}},"&-has-error":{["".concat(t,"-split")]:{color:e.colorWarning}},["".concat(t,"-label")]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:e.lineHeight,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:u,color:l,fontSize:s,["> ".concat(n)]:{fontSize:e.fontSize,verticalAlign:"top"},["&".concat(t,"-required:not(").concat(t,"-required-mark-optional)::before")]:{display:"inline-block",marginInlineEnd:e.marginXXS,color:c,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',["".concat(r,"-hide-required-mark &")]:{display:"none"}},["".concat(t,"-optional")]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,["".concat(r,"-hide-required-mark &")]:{display:"none"}},["".concat(t,"-tooltip")]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:d,marginInlineEnd:f},["&".concat(t,"-no-colon::after")]:{content:'"\\a0"'}}},["".concat(t,"-control")]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,["&:first-child:not([class^=\"'".concat(i,"-col-'\"]):not([class*=\"' ").concat(i,"-col-'\"])")]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[t]:{"&-explain, &-extra":{clear:"both",color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:e.controlHeightSM,transition:"color ".concat(e.motionDurationMid," ").concat(e.motionEaseOut)},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},["&-with-help ".concat(t,"-explain")]:{height:"auto",opacity:1},["".concat(t,"-feedback-icon")]:{fontSize:e.fontSize,textAlign:"center",visibility:"visible",animationName:a.kr,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},m=e=>{let{componentCls:t,formItemCls:n}=e;return{["".concat(t,"-horizontal")]:{["".concat(n,"-label")]:{flexGrow:0},["".concat(n,"-control")]:{flex:"1 1 0",minWidth:0},["".concat(n,"-label[class$='-24'], ").concat(n,"-label[class*='-24 ']")]:{["& + ".concat(n,"-control")]:{minWidth:"unset"}}}}},g=e=>{let{componentCls:t,formItemCls:n}=e;return{["".concat(t,"-inline")]:{display:"flex",flexWrap:"wrap",[n]:{flex:"none",marginInlineEnd:e.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},["> ".concat(n,"-label,\n > ").concat(n,"-control")]:{display:"inline-block",verticalAlign:"top"},["> ".concat(n,"-label")]:{flex:"none"},["".concat(t,"-text")]:{display:"inline-block"},["".concat(n,"-has-feedback")]:{display:"inline-block"}}}}},h=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),v=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{["".concat(n," ").concat(n,"-label")]:h(e),["".concat(t,":not(").concat(t,"-inline)")]:{[n]:{flexWrap:"wrap",["".concat(n,"-label, ").concat(n,"-control")]:{['&:not([class*=" '.concat(r,'-col-xs"])')]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},b=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:o}=e;return{["".concat(t,"-vertical")]:{[n]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},["".concat(t,"-item-control")]:{width:"100%"}}},["".concat(t,"-vertical ").concat(n,"-label,\n .").concat(o,"-col-24").concat(n,"-label,\n .").concat(o,"-col-xl-24").concat(n,"-label")]:h(e),["@media (max-width: ".concat((0,r.bf)(e.screenXSMax),")")]:[v(e),{[t]:{[".".concat(o,"-col-xs-24").concat(n,"-label")]:h(e)}}],["@media (max-width: ".concat((0,r.bf)(e.screenSMMax),")")]:{[t]:{[".".concat(o,"-col-sm-24").concat(n,"-label")]:h(e)}},["@media (max-width: ".concat((0,r.bf)(e.screenMDMax),")")]:{[t]:{[".".concat(o,"-col-md-24").concat(n,"-label")]:h(e)}},["@media (max-width: ".concat((0,r.bf)(e.screenLGMax),")")]:{[t]:{[".".concat(o,"-col-lg-24").concat(n,"-label")]:h(e)}}}},y=(e,t)=>(0,c.TS)(e,{formItemCls:"".concat(e.componentCls,"-item"),rootPrefixCls:t});var w=(0,l.I$)("Form",(e,t)=>{let{rootPrefixCls:n}=t,r=y(e,n);return[f(r),p(r),s(r),m(r),g(r),b(r),(0,i.Z)(r),a.kr]},e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:"0 0 ".concat(e.paddingXS,"px"),verticalLabelMargin:0}),{order:-1e3})},13861:function(e,t,n){"use strict";n.d(t,{dD:function(){return a},lR:function(){return i},qo:function(){return o}});let r=["parentNode"];function o(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function a(e,t){if(!e.length)return;let n=e.join("_");return t?"".concat(t,"_").concat(n):r.includes(n)?"".concat("form_item","_").concat(n):n}function i(e,t,n,r,o,a){let i=r;return void 0!==a?i=a:n.validating?i="validating":e.length?i="error":t.length?i="warning":(n.touched||o&&n.validated)&&(i="success"),i}},77360:function(e,t,n){"use strict";var r=n(2265);t.Z=(0,r.createContext)(void 0)},62807:function(e,t,n){"use strict";let r=(0,n(2265).createContext)({});t.Z=r},54998:function(e,t,n){"use strict";var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),c=n(62807),l=n(96776),s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let u=["xs","sm","md","lg","xl","xxl"],d=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:o}=r.useContext(i.E_),{gutter:d,wrap:f}=r.useContext(c.Z),{prefixCls:p,span:m,order:g,offset:h,push:v,pull:b,className:y,children:w,flex:x,style:E}=e,S=s(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),C=n("col",p),[Z,O,k]=(0,l.cG)(C),M={};u.forEach(t=>{let n={},r=e[t];"number"==typeof r?n.span=r:"object"==typeof r&&(n=r||{}),delete S[t],M=Object.assign(Object.assign({},M),{["".concat(C,"-").concat(t,"-").concat(n.span)]:void 0!==n.span,["".concat(C,"-").concat(t,"-order-").concat(n.order)]:n.order||0===n.order,["".concat(C,"-").concat(t,"-offset-").concat(n.offset)]:n.offset||0===n.offset,["".concat(C,"-").concat(t,"-push-").concat(n.push)]:n.push||0===n.push,["".concat(C,"-").concat(t,"-pull-").concat(n.pull)]:n.pull||0===n.pull,["".concat(C,"-").concat(t,"-flex-").concat(n.flex)]:n.flex||"auto"===n.flex,["".concat(C,"-rtl")]:"rtl"===o})});let j=a()(C,{["".concat(C,"-").concat(m)]:void 0!==m,["".concat(C,"-order-").concat(g)]:g,["".concat(C,"-offset-").concat(h)]:h,["".concat(C,"-push-").concat(v)]:v,["".concat(C,"-pull-").concat(b)]:b},y,M,O,k),I={};if(d&&d[0]>0){let e=d[0]/2;I.paddingLeft=e,I.paddingRight=e}return x&&(I.flex="number"==typeof x?"".concat(x," ").concat(x," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(x)?"0 0 ".concat(x):x,!1!==f||I.minWidth||(I.minWidth=0)),Z(r.createElement("div",Object.assign({},S,{style:Object.assign(Object.assign({},I),E),className:j,ref:t}),w))});t.Z=d},10295:function(e,t,n){"use strict";var r=n(2265),o=n(36760),a=n.n(o),i=n(6543),c=n(71744),l=n(62807),s=n(96776),u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function d(e,t){let[n,o]=r.useState("string"==typeof e?e:""),a=()=>{if("string"==typeof e&&o(e),"object"==typeof e)for(let n=0;n{a()},[JSON.stringify(e),t]),n}let f=r.forwardRef((e,t)=>{let{prefixCls:n,justify:o,align:f,className:p,style:m,children:g,gutter:h=0,wrap:v}=e,b=u(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:y,direction:w}=r.useContext(c.E_),[x,E]=r.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[S,C]=r.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),Z=d(f,S),O=d(o,S),k=r.useRef(h),M=(0,i.ZP)();r.useEffect(()=>{let e=M.subscribe(e=>{C(e);let t=k.current||0;(!Array.isArray(t)&&"object"==typeof t||Array.isArray(t)&&("object"==typeof t[0]||"object"==typeof t[1]))&&E(e)});return()=>M.unsubscribe(e)},[]);let j=y("row",n),[I,R,N]=(0,s.VM)(j),P=(()=>{let e=[void 0,void 0];return(Array.isArray(h)?h:[h,void 0]).forEach((t,n)=>{if("object"==typeof t)for(let r=0;r0?-(P[0]/2):void 0;A&&(T.marginLeft=A,T.marginRight=A),[,T.rowGap]=P;let[L,z]=P,_=r.useMemo(()=>({gutter:[L,z],wrap:v}),[L,z,v]);return I(r.createElement(l.Z.Provider,{value:_},r.createElement("div",Object.assign({},b,{className:F,style:Object.assign(Object.assign({},T),m),ref:t}),g)))});t.Z=f},96776:function(e,t,n){"use strict";n.d(t,{VM:function(){return u},cG:function(){return d}});var r=n(352),o=n(80669),a=n(3104);let i=e=>{let{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},c=(e,t)=>{let{componentCls:n,gridColumns:r}=e,o={};for(let e=r;e>=0;e--)0===e?(o["".concat(n).concat(t,"-").concat(e)]={display:"none"},o["".concat(n,"-push-").concat(e)]={insetInlineStart:"auto"},o["".concat(n,"-pull-").concat(e)]={insetInlineEnd:"auto"},o["".concat(n).concat(t,"-push-").concat(e)]={insetInlineStart:"auto"},o["".concat(n).concat(t,"-pull-").concat(e)]={insetInlineEnd:"auto"},o["".concat(n).concat(t,"-offset-").concat(e)]={marginInlineStart:0},o["".concat(n).concat(t,"-order-").concat(e)]={order:0}):(o["".concat(n).concat(t,"-").concat(e)]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:"0 0 ".concat(e/r*100,"%"),maxWidth:"".concat(e/r*100,"%")}],o["".concat(n).concat(t,"-push-").concat(e)]={insetInlineStart:"".concat(e/r*100,"%")},o["".concat(n).concat(t,"-pull-").concat(e)]={insetInlineEnd:"".concat(e/r*100,"%")},o["".concat(n).concat(t,"-offset-").concat(e)]={marginInlineStart:"".concat(e/r*100,"%")},o["".concat(n).concat(t,"-order-").concat(e)]={order:e});return o},l=(e,t)=>c(e,t),s=(e,t,n)=>({["@media (min-width: ".concat((0,r.bf)(t),")")]:Object.assign({},l(e,n))}),u=(0,o.I$)("Grid",e=>{let{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},()=>({})),d=(0,o.I$)("Grid",e=>{let t=(0,a.TS)(e,{gridColumns:24}),n={"-sm":t.screenSMMin,"-md":t.screenMDMin,"-lg":t.screenLGMin,"-xl":t.screenXLMin,"-xxl":t.screenXXLMin};return[i(t),l(t,""),l(t,"-xs"),Object.keys(n).map(e=>s(t,n[e],e)).reduce((e,t)=>Object.assign(Object.assign({},e),t),{})]},()=>({}))},20577:function(e,t,n){"use strict";n.d(t,{Z:function(){return eg}});var r=n(2265),o=n(70464),a=n(1119),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},c=n(55015),l=r.forwardRef(function(e,t){return r.createElement(c.Z,(0,a.Z)({},e,{ref:t,icon:i}))}),s=n(36760),u=n.n(s),d=n(11993),f=n(41154),p=n(26365),m=n(6989),g=n(76405),h=n(25049);function v(){return"function"==typeof BigInt}function b(e){return!e&&0!==e&&!Number.isNaN(e)||!String(e).trim()}function y(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var r=t||"0",o=r.split("."),a=o[0]||"0",i=o[1]||"0";"0"===a&&"0"===i&&(n=!1);var c=n?"-":"";return{negative:n,negativeStr:c,trimStr:r,integerStr:a,decimalStr:i,fullStr:"".concat(c).concat(r)}}function w(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function x(e){var t=String(e);if(w(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return null!=r&&r[1]&&(n+=r[1].length),n}return t.includes(".")&&S(t)?t.length-t.indexOf(".")-1:0}function E(e){var t=String(e);if(w(e)){if(e>Number.MAX_SAFE_INTEGER)return String(v()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":y("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}(),Z=function(){function e(t){if((0,g.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"number",void 0),(0,d.Z)(this,"empty",void 0),b(t)){this.empty=!0;return}this.origin=String(t),this.number=Number(t)}return(0,h.Z)(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(rNumber.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":E(this.number):this.origin}}]),e}();function O(e){return v()?new C(e):new Z(e)}function k(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===e)return"";var o=y(e),a=o.negativeStr,i=o.integerStr,c=o.decimalStr,l="".concat(t).concat(c),s="".concat(a).concat(i);if(n>=0){var u=Number(c[n]);return u>=5&&!r?k(O(e).add("".concat(a,"0.").concat("0".repeat(n)).concat(10-u)).toString(),t,n,r):0===n?s:"".concat(s).concat(t).concat(c.padEnd(n,"0").slice(0,n))}return".0"===l?s:"".concat(s).concat(l)}var M=n(2027),j=n(27380),I=n(28791),R=n(32559),N=n(79267),P=function(){var e=(0,r.useState)(!1),t=(0,p.Z)(e,2),n=t[0],o=t[1];return(0,j.Z)(function(){o((0,N.Z)())},[]),n},F=n(53346);function T(e){var t=e.prefixCls,n=e.upNode,o=e.downNode,i=e.upDisabled,c=e.downDisabled,l=e.onStep,s=r.useRef(),f=r.useRef([]),p=r.useRef();p.current=l;var m=function(){clearTimeout(s.current)},g=function(e,t){e.preventDefault(),m(),p.current(t),s.current=setTimeout(function e(){p.current(t),s.current=setTimeout(e,200)},600)};if(r.useEffect(function(){return function(){m(),f.current.forEach(function(e){return F.Z.cancel(e)})}},[]),P())return null;var h="".concat(t,"-handler"),v=u()(h,"".concat(h,"-up"),(0,d.Z)({},"".concat(h,"-up-disabled"),i)),b=u()(h,"".concat(h,"-down"),(0,d.Z)({},"".concat(h,"-down-disabled"),c)),y=function(){return f.current.push((0,F.Z)(m))},w={unselectable:"on",role:"button",onMouseUp:y,onMouseLeave:y};return r.createElement("div",{className:"".concat(h,"-wrap")},r.createElement("span",(0,a.Z)({},w,{onMouseDown:function(e){g(e,!0)},"aria-label":"Increase Value","aria-disabled":i,className:v}),n||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),r.createElement("span",(0,a.Z)({},w,{onMouseDown:function(e){g(e,!1)},"aria-label":"Decrease Value","aria-disabled":c,className:b}),o||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}function A(e){var t="number"==typeof e?E(e):y(e).fullStr;return t.includes(".")?y(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}var L=n(55041),z=function(){var e=(0,r.useRef)(0),t=function(){F.Z.cancel(e.current)};return(0,r.useEffect)(function(){return t},[]),function(n){t(),e.current=(0,F.Z)(function(){n()})}},_=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","wheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur"],H=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],B=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},D=function(e){var t=O(e);return t.isInvalidate()?null:t},W=r.forwardRef(function(e,t){var n,o,i,c=e.prefixCls,l=void 0===c?"rc-input-number":c,s=e.className,g=e.style,h=e.min,v=e.max,b=e.step,y=void 0===b?1:b,w=e.defaultValue,C=e.value,Z=e.disabled,M=e.readOnly,N=e.upHandler,P=e.downHandler,F=e.keyboard,L=e.wheel,H=e.controls,W=(e.classNames,e.stringMode),V=e.parser,q=e.formatter,G=e.precision,X=e.decimalSeparator,U=e.onChange,$=e.onInput,K=e.onPressEnter,Y=e.onStep,Q=e.changeOnBlur,J=void 0===Q||Q,ee=(0,m.Z)(e,_),et="".concat(l,"-input"),en=r.useRef(null),er=r.useState(!1),eo=(0,p.Z)(er,2),ea=eo[0],ei=eo[1],ec=r.useRef(!1),el=r.useRef(!1),es=r.useRef(!1),eu=r.useState(function(){return O(null!=C?C:w)}),ed=(0,p.Z)(eu,2),ef=ed[0],ep=ed[1],em=r.useCallback(function(e,t){return t?void 0:G>=0?G:Math.max(x(e),x(y))},[G,y]),eg=r.useCallback(function(e){var t=String(e);if(V)return V(t);var n=t;return X&&(n=n.replace(X,".")),n.replace(/[^\w.-]+/g,"")},[V,X]),eh=r.useRef(""),ev=r.useCallback(function(e,t){if(q)return q(e,{userTyping:t,input:String(eh.current)});var n="number"==typeof e?E(e):e;if(!t){var r=em(n,t);S(n)&&(X||r>=0)&&(n=k(n,X||".",r))}return n},[q,em,X]),eb=r.useState(function(){var e=null!=w?w:C;return ef.isInvalidate()&&["string","number"].includes((0,f.Z)(e))?Number.isNaN(e)?"":e:ev(ef.toString(),!1)}),ey=(0,p.Z)(eb,2),ew=ey[0],ex=ey[1];function eE(e,t){ex(ev(e.isInvalidate()?e.toString(!1):e.toString(!t),t))}eh.current=ew;var eS=r.useMemo(function(){return D(v)},[v,G]),eC=r.useMemo(function(){return D(h)},[h,G]),eZ=r.useMemo(function(){return!(!eS||!ef||ef.isInvalidate())&&eS.lessEquals(ef)},[eS,ef]),eO=r.useMemo(function(){return!(!eC||!ef||ef.isInvalidate())&&ef.lessEquals(eC)},[eC,ef]),ek=(n=en.current,o=(0,r.useRef)(null),[function(){try{var e=n.selectionStart,t=n.selectionEnd,r=n.value,a=r.substring(0,e),i=r.substring(t);o.current={start:e,end:t,value:r,beforeTxt:a,afterTxt:i}}catch(e){}},function(){if(n&&o.current&&ea)try{var e=n.value,t=o.current,r=t.beforeTxt,a=t.afterTxt,i=t.start,c=e.length;if(e.endsWith(a))c=e.length-o.current.afterTxt.length;else if(e.startsWith(r))c=r.length;else{var l=r[i-1],s=e.indexOf(l,i-1);-1!==s&&(c=s+1)}n.setSelectionRange(c,c)}catch(e){(0,R.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e.message))}}]),eM=(0,p.Z)(ek,2),ej=eM[0],eI=eM[1],eR=function(e){return eS&&!e.lessEquals(eS)?eS:eC&&!eC.lessEquals(e)?eC:null},eN=function(e){return!eR(e)},eP=function(e,t){var n=e,r=eN(n)||n.isEmpty();if(n.isEmpty()||t||(n=eR(n)||n,r=!0),!M&&!Z&&r){var o,a=n.toString(),i=em(a,t);return i>=0&&!eN(n=O(k(a,".",i)))&&(n=O(k(a,".",i,!0))),n.equals(ef)||(o=n,void 0===C&&ep(o),null==U||U(n.isEmpty()?null:B(W,n)),void 0===C&&eE(n,t)),n}return ef},eF=z(),eT=function e(t){if(ej(),eh.current=t,ex(t),!el.current){var n=O(eg(t));n.isNaN()||eP(n,!0)}null==$||$(t),eF(function(){var n=t;V||(n=t.replace(/。/g,".")),n!==t&&e(n)})},eA=function(e){if((!e||!eZ)&&(e||!eO)){ec.current=!1;var t,n=O(es.current?A(y):y);e||(n=n.negate());var r=eP((ef||O(0)).add(n.toString()),!1);null==Y||Y(B(W,r),{offset:es.current?A(y):y,type:e?"up":"down"}),null===(t=en.current)||void 0===t||t.focus()}},eL=function(e){var t=O(eg(ew)),n=t;n=t.isNaN()?eP(ef,e):eP(t,e),void 0!==C?eE(ef,!1):n.isNaN()||eE(n,!1)};return r.useEffect(function(){var e=function(e){!1!==L&&(eA(e.deltaY<0),e.preventDefault())},t=en.current;if(t)return t.addEventListener("wheel",e),function(){return t.removeEventListener("wheel",e)}},[eA]),(0,j.o)(function(){ef.isInvalidate()||eE(ef,!1)},[G,q]),(0,j.o)(function(){var e=O(C);ep(e);var t=O(eg(ew));e.equals(t)&&ec.current&&!q||eE(e,ec.current)},[C]),(0,j.o)(function(){q&&eI()},[ew]),r.createElement("div",{className:u()(l,s,(i={},(0,d.Z)(i,"".concat(l,"-focused"),ea),(0,d.Z)(i,"".concat(l,"-disabled"),Z),(0,d.Z)(i,"".concat(l,"-readonly"),M),(0,d.Z)(i,"".concat(l,"-not-a-number"),ef.isNaN()),(0,d.Z)(i,"".concat(l,"-out-of-range"),!ef.isInvalidate()&&!eN(ef)),i)),style:g,onFocus:function(){ei(!0)},onBlur:function(){J&&eL(!1),ei(!1),ec.current=!1},onKeyDown:function(e){var t=e.key,n=e.shiftKey;ec.current=!0,es.current=n,"Enter"===t&&(el.current||(ec.current=!1),eL(!1),null==K||K(e)),!1!==F&&!el.current&&["Up","ArrowUp","Down","ArrowDown"].includes(t)&&(eA("Up"===t||"ArrowUp"===t),e.preventDefault())},onKeyUp:function(){ec.current=!1,es.current=!1},onCompositionStart:function(){el.current=!0},onCompositionEnd:function(){el.current=!1,eT(en.current.value)},onBeforeInput:function(){ec.current=!0}},(void 0===H||H)&&r.createElement(T,{prefixCls:l,upNode:N,downNode:P,upDisabled:eZ,downDisabled:eO,onStep:eA}),r.createElement("div",{className:"".concat(et,"-wrap")},r.createElement("input",(0,a.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":h,"aria-valuemax":v,"aria-valuenow":ef.isInvalidate()?null:ef.toString(),step:y},ee,{ref:(0,I.sQ)(en,t),className:et,value:ew,onChange:function(e){eT(e.target.value)},disabled:Z,readOnly:M}))))}),V=r.forwardRef(function(e,t){var n=e.disabled,o=e.style,i=e.prefixCls,c=e.value,l=e.prefix,s=e.suffix,u=e.addonBefore,d=e.addonAfter,f=e.className,p=e.classNames,g=(0,m.Z)(e,H),h=r.useRef(null);return r.createElement(M.Q,{className:f,triggerFocus:function(e){h.current&&(0,L.nH)(h.current,e)},prefixCls:i,value:c,disabled:n,style:o,prefix:l,suffix:s,addonAfter:d,addonBefore:u,classNames:p,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}},r.createElement(W,(0,a.Z)({prefixCls:i,disabled:n,ref:(0,I.sQ)(h,t),className:null==p?void 0:p.input},g)))});V.displayName="InputNumber";var q=n(12757),G=n(71744),X=n(13959),U=n(86586),$=n(64024),K=n(33759),Y=n(39109),Q=n(56250),J=n(65658),ee=n(352),et=n(31282),en=n(37433),er=n(65265),eo=n(12918),ea=n(17691),ei=n(80669),ec=n(3104),el=n(36360);let es=(e,t)=>{let{componentCls:n,borderRadiusSM:r,borderRadiusLG:o}=e,a="lg"===t?o:r;return{["&-".concat(t)]:{["".concat(n,"-handler-wrap")]:{borderStartEndRadius:a,borderEndEndRadius:a},["".concat(n,"-handler-up")]:{borderStartEndRadius:a},["".concat(n,"-handler-down")]:{borderEndEndRadius:a}}}},eu=e=>{let{componentCls:t,lineWidth:n,lineType:r,borderRadius:o,fontSizeLG:a,controlHeightLG:i,controlHeightSM:c,colorError:l,paddingInlineSM:s,paddingBlockSM:u,paddingBlockLG:d,paddingInlineLG:f,colorTextDescription:p,motionDurationMid:m,handleHoverColor:g,paddingInline:h,paddingBlock:v,handleBg:b,handleActiveBg:y,colorTextDisabled:w,borderRadiusSM:x,borderRadiusLG:E,controlWidth:S,handleOpacity:C,handleBorderColor:Z,filledHandleBg:O,lineHeightLG:k,calc:M}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.ik)(e)),{display:"inline-block",width:S,margin:0,padding:0,borderRadius:o}),(0,er.qG)(e,{["".concat(t,"-handler-wrap")]:{background:b,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(Z)}}})),(0,er.H8)(e,{["".concat(t,"-handler-wrap")]:{background:O,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(Z)}},"&:focus-within":{["".concat(t,"-handler-wrap")]:{background:b}}})),(0,er.Mu)(e)),{"&-rtl":{direction:"rtl",["".concat(t,"-input")]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:a,lineHeight:k,borderRadius:E,["input".concat(t,"-input")]:{height:M(i).sub(M(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(d)," ").concat((0,ee.bf)(f))}},"&-sm":{padding:0,borderRadius:x,["input".concat(t,"-input")]:{height:M(c).sub(M(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(u)," ").concat((0,ee.bf)(s))}},"&-out-of-range":{["".concat(t,"-input-wrap")]:{input:{color:l}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.s7)(e)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",["".concat(t,"-affix-wrapper")]:{width:"100%"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:E,fontSize:e.fontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:x}}},(0,er.ir)(e)),(0,er.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),["&-disabled ".concat(t,"-input")]:{cursor:"not-allowed"},[t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),{width:"100%",padding:"".concat((0,ee.bf)(v)," ").concat((0,ee.bf)(h)),textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:"all ".concat(m," linear"),appearance:"textfield",fontSize:"inherit"}),(0,et.nz)(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[t]:Object.assign(Object.assign(Object.assign({["&:hover ".concat(t,"-handler-wrap, &-focused ").concat(t,"-handler-wrap")]:{opacity:1},["".concat(t,"-handler-wrap")]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleWidth,height:"100%",borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,opacity:C,display:"flex",flexDirection:"column",alignItems:"stretch",transition:"opacity ".concat(m," linear ").concat(m),["".concat(t,"-handler")]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},["".concat(t,"-handler")]:{height:"50%",overflow:"hidden",color:p,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(Z),transition:"all ".concat(m," linear"),"&:active":{background:y},"&:hover":{height:"60%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{color:g}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,eo.Ro)()),{color:p,transition:"all ".concat(m," linear"),userSelect:"none"})},["".concat(t,"-handler-up")]:{borderStartEndRadius:o},["".concat(t,"-handler-down")]:{borderEndEndRadius:o}},es(e,"lg")),es(e,"sm")),{"&-disabled, &-readonly":{["".concat(t,"-handler-wrap")]:{display:"none"},["".concat(t,"-input")]:{color:"inherit"}},["\n ".concat(t,"-handler-up-disabled,\n ").concat(t,"-handler-down-disabled\n ")]:{cursor:"not-allowed"},["\n ".concat(t,"-handler-up-disabled:hover &-handler-up-inner,\n ").concat(t,"-handler-down-disabled:hover &-handler-down-inner\n ")]:{color:w}})}]},ed=e=>{let{componentCls:t,paddingBlock:n,paddingInline:r,inputAffixPadding:o,controlWidth:a,borderRadiusLG:i,borderRadiusSM:c,paddingInlineLG:l,paddingInlineSM:s,paddingBlockLG:u,paddingBlockSM:d}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign({["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(n)," 0")}},(0,et.ik)(e)),{position:"relative",display:"inline-flex",width:a,padding:0,paddingInlineStart:r,"&-lg":{borderRadius:i,paddingInlineStart:l,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(u)," 0")}},"&-sm":{borderRadius:c,paddingInlineStart:s,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(d)," 0")}},["&:not(".concat(t,"-disabled):hover")]:{zIndex:1},"&-focused, &:focus":{zIndex:1},["&-disabled > ".concat(t,"-disabled")]:{background:"transparent"},["> div".concat(t)]:{width:"100%",border:"none",outline:"none",["&".concat(t,"-focused")]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t,"-handler-wrap")]:{zIndex:2},[t]:{color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:o},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:r,marginInlineStart:o}}})}};var ef=(0,ei.I$)("InputNumber",e=>{let t=(0,ec.TS)(e,(0,en.e)(e));return[eu(t),ed(t),(0,ea.c)(t)]},e=>{var t;let n=null!==(t=e.handleVisible)&&void 0!==t?t:"auto";return Object.assign(Object.assign({},(0,en.T)(e)),{controlWidth:90,handleWidth:e.controlHeightSM-2*e.lineWidth,handleFontSize:e.fontSize/2,handleVisible:n,handleActiveBg:e.colorFillAlter,handleBg:e.colorBgContainer,filledHandleBg:new el.C(e.colorFillSecondary).onBackground(e.colorBgContainer).toHexString(),handleHoverColor:e.colorPrimary,handleBorderColor:e.colorBorder,handleOpacity:!0===n?1:0})},{unitless:{handleOpacity:!0}}),ep=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let em=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a}=r.useContext(G.E_),i=r.useRef(null);r.useImperativeHandle(t,()=>i.current);let{className:c,rootClassName:s,size:d,disabled:f,prefixCls:p,addonBefore:m,addonAfter:g,prefix:h,bordered:v,readOnly:b,status:y,controls:w,variant:x}=e,E=ep(e,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls","variant"]),S=n("input-number",p),C=(0,$.Z)(S),[Z,O,k]=ef(S,C),{compactSize:M,compactItemClassnames:j}=(0,J.ri)(S,a),I=r.createElement(l,{className:"".concat(S,"-handler-up-inner")}),R=r.createElement(o.Z,{className:"".concat(S,"-handler-down-inner")});"object"==typeof w&&(I=void 0===w.upIcon?I:r.createElement("span",{className:"".concat(S,"-handler-up-inner")},w.upIcon),R=void 0===w.downIcon?R:r.createElement("span",{className:"".concat(S,"-handler-down-inner")},w.downIcon));let{hasFeedback:N,status:P,isFormItemInput:F,feedbackIcon:T}=r.useContext(Y.aM),A=(0,q.F)(P,y),L=(0,K.Z)(e=>{var t;return null!==(t=null!=d?d:M)&&void 0!==t?t:e}),z=r.useContext(U.Z),[_,H]=(0,Q.Z)(x,v),B=N&&r.createElement(r.Fragment,null,T),D=u()({["".concat(S,"-lg")]:"large"===L,["".concat(S,"-sm")]:"small"===L,["".concat(S,"-rtl")]:"rtl"===a,["".concat(S,"-in-form-item")]:F},O),W="".concat(S,"-group");return Z(r.createElement(V,Object.assign({ref:i,disabled:null!=f?f:z,className:u()(k,C,c,s,j),upHandler:I,downHandler:R,prefixCls:S,readOnly:b,controls:"boolean"==typeof w?w:void 0,prefix:h,suffix:B,addonAfter:g&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},g)),addonBefore:m&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},m)),classNames:{input:D,variant:u()({["".concat(S,"-").concat(_)]:H},(0,q.Z)(S,A,N)),affixWrapper:u()({["".concat(S,"-affix-wrapper-sm")]:"small"===L,["".concat(S,"-affix-wrapper-lg")]:"large"===L,["".concat(S,"-affix-wrapper-rtl")]:"rtl"===a},O),wrapper:u()({["".concat(W,"-rtl")]:"rtl"===a},O),groupWrapper:u()({["".concat(S,"-group-wrapper-sm")]:"small"===L,["".concat(S,"-group-wrapper-lg")]:"large"===L,["".concat(S,"-group-wrapper-rtl")]:"rtl"===a,["".concat(S,"-group-wrapper-").concat(_)]:H},(0,q.Z)("".concat(S,"-group-wrapper"),A,N),O)}},E)))});em._InternalPanelDoNotUseOrYouWillBeFired=e=>r.createElement(X.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},r.createElement(em,Object.assign({},e)));var eg=em},65863:function(e,t,n){"use strict";n.d(t,{Z:function(){return E},n:function(){return x}});var r=n(2265),o=n(36760),a=n.n(o),i=n(2027),c=n(28791),l=n(12757),s=n(71744),u=n(86586),d=n(33759),f=n(39109),p=n(65658),m=n(39164),g=n(31282),h=n(64024),v=n(56250),b=n(39725),y=e=>{let t;return"object"==typeof e&&(null==e?void 0:e.clearIcon)?t=e:e&&(t={clearIcon:r.createElement(b.Z,null)}),t},w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function x(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n){let t=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}var E=(0,r.forwardRef)((e,t)=>{var n;let{prefixCls:o,bordered:b=!0,status:x,size:E,disabled:S,onBlur:C,onFocus:Z,suffix:O,allowClear:k,addonAfter:M,addonBefore:j,className:I,style:R,styles:N,rootClassName:P,onChange:F,classNames:T,variant:A}=e,L=w(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:z,direction:_,input:H}=r.useContext(s.E_),B=z("input",o),D=(0,r.useRef)(null),W=(0,h.Z)(B),[V,q,G]=(0,g.ZP)(B,W),{compactSize:X,compactItemClassnames:U}=(0,p.ri)(B,_),$=(0,d.Z)(e=>{var t;return null!==(t=null!=E?E:X)&&void 0!==t?t:e}),K=r.useContext(u.Z),{status:Y,hasFeedback:Q,feedbackIcon:J}=(0,r.useContext)(f.aM),ee=(0,l.F)(Y,x),et=!!(e.prefix||e.suffix||e.allowClear||e.showCount)||!!Q;(0,r.useRef)(et);let en=(0,m.Z)(D,!0),er=(Q||O)&&r.createElement(r.Fragment,null,O,Q&&J),eo=y(k),[ea,ei]=(0,v.Z)(A,b);return V(r.createElement(i.Z,Object.assign({ref:(0,c.sQ)(t,D),prefixCls:B,autoComplete:null==H?void 0:H.autoComplete},L,{disabled:null!=S?S:K,onBlur:e=>{en(),null==C||C(e)},onFocus:e=>{en(),null==Z||Z(e)},style:Object.assign(Object.assign({},null==H?void 0:H.style),R),styles:Object.assign(Object.assign({},null==H?void 0:H.styles),N),suffix:er,allowClear:eo,className:a()(I,P,G,W,U,null==H?void 0:H.className),onChange:e=>{en(),null==F||F(e)},addonAfter:M&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},M)),addonBefore:j&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},j)),classNames:Object.assign(Object.assign(Object.assign({},T),null==H?void 0:H.classNames),{input:a()({["".concat(B,"-sm")]:"small"===$,["".concat(B,"-lg")]:"large"===$,["".concat(B,"-rtl")]:"rtl"===_},null==T?void 0:T.input,null===(n=null==H?void 0:H.classNames)||void 0===n?void 0:n.input,q),variant:a()({["".concat(B,"-").concat(ea)]:ei},(0,l.Z)(B,ee)),affixWrapper:a()({["".concat(B,"-affix-wrapper-sm")]:"small"===$,["".concat(B,"-affix-wrapper-lg")]:"large"===$,["".concat(B,"-affix-wrapper-rtl")]:"rtl"===_},q),wrapper:a()({["".concat(B,"-group-rtl")]:"rtl"===_},q),groupWrapper:a()({["".concat(B,"-group-wrapper-sm")]:"small"===$,["".concat(B,"-group-wrapper-lg")]:"large"===$,["".concat(B,"-group-wrapper-rtl")]:"rtl"===_,["".concat(B,"-group-wrapper-").concat(ea)]:ei},(0,l.Z)("".concat(B,"-group-wrapper"),ee,Q),q)})})))})},90464:function(e,t,n){"use strict";n.d(t,{Z:function(){return z}});var r,o=n(2265),a=n(39725),i=n(36760),c=n.n(i),l=n(1119),s=n(11993),u=n(31686),d=n(83145),f=n(26365),p=n(6989),m=n(2027),g=n(96032),h=n(55041),v=n(50506),b=n(41154),y=n(31474),w=n(27380),x=n(53346),E=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],S={},C=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Z=o.forwardRef(function(e,t){var n=e.prefixCls,a=(e.onPressEnter,e.defaultValue),i=e.value,d=e.autoSize,m=e.onResize,g=e.className,h=e.style,Z=e.disabled,O=e.onChange,k=(e.onInternalAutoSize,(0,p.Z)(e,C)),M=(0,v.Z)(a,{value:i,postState:function(e){return null!=e?e:""}}),j=(0,f.Z)(M,2),I=j[0],R=j[1],N=o.useRef();o.useImperativeHandle(t,function(){return{textArea:N.current}});var P=o.useMemo(function(){return d&&"object"===(0,b.Z)(d)?[d.minRows,d.maxRows]:[]},[d]),F=(0,f.Z)(P,2),T=F[0],A=F[1],L=!!d,z=function(){try{if(document.activeElement===N.current){var e=N.current,t=e.selectionStart,n=e.selectionEnd,r=e.scrollTop;N.current.setSelectionRange(t,n),N.current.scrollTop=r}}catch(e){}},_=o.useState(2),H=(0,f.Z)(_,2),B=H[0],D=H[1],W=o.useState(),V=(0,f.Z)(W,2),q=V[0],G=V[1],X=function(){D(0)};(0,w.Z)(function(){L&&X()},[i,T,A,L]),(0,w.Z)(function(){if(0===B)D(1);else if(1===B){var e=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),e.getAttribute("wrap")?r.setAttribute("wrap",e.getAttribute("wrap")):r.removeAttribute("wrap");var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&S[n])return S[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),i=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),c={sizingStyle:E.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),paddingSize:a,borderSize:i,boxSizing:o};return t&&n&&(S[n]=c),c}(e,n),c=i.paddingSize,l=i.borderSize,s=i.boxSizing,u=i.sizingStyle;r.setAttribute("style","".concat(u,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),r.value=e.value||e.placeholder||"";var d=void 0,f=void 0,p=r.scrollHeight;if("border-box"===s?p+=l:"content-box"===s&&(p-=c),null!==o||null!==a){r.value=" ";var m=r.scrollHeight-c;null!==o&&(d=m*o,"border-box"===s&&(d=d+c+l),p=Math.max(d,p)),null!==a&&(f=m*a,"border-box"===s&&(f=f+c+l),t=p>f?"":"hidden",p=Math.min(f,p))}var g={height:p,overflowY:t,resize:"none"};return d&&(g.minHeight=d),f&&(g.maxHeight=f),g}(N.current,!1,T,A);D(2),G(e)}else z()},[B]);var U=o.useRef(),$=function(){x.Z.cancel(U.current)};o.useEffect(function(){return $},[]);var K=(0,u.Z)((0,u.Z)({},h),L?q:null);return(0===B||1===B)&&(K.overflowY="hidden",K.overflowX="hidden"),o.createElement(y.Z,{onResize:function(e){2===B&&(null==m||m(e),d&&($(),U.current=(0,x.Z)(function(){X()})))},disabled:!(d||m)},o.createElement("textarea",(0,l.Z)({},k,{ref:N,style:K,className:c()(n,g,(0,s.Z)({},"".concat(n,"-disabled"),Z)),disabled:Z,value:I,onChange:function(e){R(e.target.value),null==O||O(e)}})))}),O=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],k=o.forwardRef(function(e,t){var n,r,a,i=e.defaultValue,b=e.value,y=e.onFocus,w=e.onBlur,x=e.onChange,E=e.allowClear,S=e.maxLength,C=e.onCompositionStart,k=e.onCompositionEnd,M=e.suffix,j=e.prefixCls,I=void 0===j?"rc-textarea":j,R=e.showCount,N=e.count,P=e.className,F=e.style,T=e.disabled,A=e.hidden,L=e.classNames,z=e.styles,_=e.onResize,H=(0,p.Z)(e,O),B=(0,v.Z)(i,{value:b,defaultValue:i}),D=(0,f.Z)(B,2),W=D[0],V=D[1],q=null==W?"":String(W),G=o.useState(!1),X=(0,f.Z)(G,2),U=X[0],$=X[1],K=o.useRef(!1),Y=o.useState(null),Q=(0,f.Z)(Y,2),J=Q[0],ee=Q[1],et=(0,o.useRef)(null),en=function(){var e;return null===(e=et.current)||void 0===e?void 0:e.textArea},er=function(){en().focus()};(0,o.useImperativeHandle)(t,function(){return{resizableTextArea:et.current,focus:er,blur:function(){en().blur()}}}),(0,o.useEffect)(function(){$(function(e){return!T&&e})},[T]);var eo=o.useState(null),ea=(0,f.Z)(eo,2),ei=ea[0],ec=ea[1];o.useEffect(function(){if(ei){var e;(e=en()).setSelectionRange.apply(e,(0,d.Z)(ei))}},[ei]);var el=(0,g.Z)(N,R),es=null!==(n=el.max)&&void 0!==n?n:S,eu=Number(es)>0,ed=el.strategy(q),ef=!!es&&ed>es,ep=function(e,t){var n=t;!K.current&&el.exceedFormatter&&el.max&&el.strategy(t)>el.max&&(n=el.exceedFormatter(t,{max:el.max}),t!==n&&ec([en().selectionStart||0,en().selectionEnd||0])),V(n),(0,h.rJ)(e.currentTarget,e,x,n)},em=M;el.show&&(a=el.showFormatter?el.showFormatter({value:q,count:ed,maxLength:es}):"".concat(ed).concat(eu?" / ".concat(es):""),em=o.createElement(o.Fragment,null,em,o.createElement("span",{className:c()("".concat(I,"-data-count"),null==L?void 0:L.count),style:null==z?void 0:z.count},a)));var eg=!H.autoSize&&!R&&!E;return o.createElement(m.Q,{value:q,allowClear:E,handleReset:function(e){V(""),er(),(0,h.rJ)(en(),e,x)},suffix:em,prefixCls:I,classNames:(0,u.Z)((0,u.Z)({},L),{},{affixWrapper:c()(null==L?void 0:L.affixWrapper,(r={},(0,s.Z)(r,"".concat(I,"-show-count"),R),(0,s.Z)(r,"".concat(I,"-textarea-allow-clear"),E),r))}),disabled:T,focused:U,className:c()(P,ef&&"".concat(I,"-out-of-range")),style:(0,u.Z)((0,u.Z)({},F),J&&!eg?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof a?a:void 0}},hidden:A},o.createElement(Z,(0,l.Z)({},H,{maxLength:S,onKeyDown:function(e){var t=H.onPressEnter,n=H.onKeyDown;"Enter"===e.key&&t&&t(e),null==n||n(e)},onChange:function(e){ep(e,e.target.value)},onFocus:function(e){$(!0),null==y||y(e)},onBlur:function(e){$(!1),null==w||w(e)},onCompositionStart:function(e){K.current=!0,null==C||C(e)},onCompositionEnd:function(e){K.current=!1,ep(e,e.currentTarget.value),null==k||k(e)},className:c()(null==L?void 0:L.textarea),style:(0,u.Z)((0,u.Z)({},null==z?void 0:z.textarea),{},{resize:null==F?void 0:F.resize}),disabled:T,prefixCls:I,onResize:function(e){var t;null==_||_(e),null!==(t=en())&&void 0!==t&&t.style.height&&ee(!0)},ref:et})))}),M=n(12757),j=n(71744),I=n(86586),R=n(33759),N=n(39109),P=n(65863),F=n(31282),T=n(64024),A=n(56250),L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},z=(0,o.forwardRef)((e,t)=>{var n;let r;let{prefixCls:i,bordered:l=!0,size:s,disabled:u,status:d,allowClear:f,classNames:p,rootClassName:m,className:g,variant:h}=e,v=L(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:b,direction:y}=o.useContext(j.E_),w=(0,R.Z)(s),x=o.useContext(I.Z),{status:E,hasFeedback:S,feedbackIcon:C}=o.useContext(N.aM),Z=(0,M.F)(E,d),O=o.useRef(null);o.useImperativeHandle(t,()=>{var e;return{resizableTextArea:null===(e=O.current)||void 0===e?void 0:e.resizableTextArea,focus:e=>{var t,n;(0,P.n)(null===(n=null===(t=O.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:()=>{var e;return null===(e=O.current)||void 0===e?void 0:e.blur()}}});let z=b("input",i);"object"==typeof f&&(null==f?void 0:f.clearIcon)?r=f:f&&(r={clearIcon:o.createElement(a.Z,null)});let _=(0,T.Z)(z),[H,B,D]=(0,F.ZP)(z,_),[W,V]=(0,A.Z)(h,l);return H(o.createElement(k,Object.assign({},v,{disabled:null!=u?u:x,allowClear:r,className:c()(D,_,g,m),classNames:Object.assign(Object.assign({},p),{textarea:c()({["".concat(z,"-sm")]:"small"===w,["".concat(z,"-lg")]:"large"===w},B,null==p?void 0:p.textarea),variant:c()({["".concat(z,"-").concat(W)]:V},(0,M.Z)(z,Z)),affixWrapper:c()("".concat(z,"-textarea-affix-wrapper"),{["".concat(z,"-affix-wrapper-rtl")]:"rtl"===y,["".concat(z,"-affix-wrapper-sm")]:"small"===w,["".concat(z,"-affix-wrapper-lg")]:"large"===w,["".concat(z,"-textarea-show-count")]:e.showCount||(null===(n=e.count)||void 0===n?void 0:n.show)},B)}),prefixCls:z,suffix:S&&o.createElement("span",{className:"".concat(z,"-textarea-suffix")},C),ref:O})))})},39164:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e,t){let n=(0,r.useRef)([]),o=()=>{n.current.push(setTimeout(()=>{var t,n,r,o;(null===(t=e.current)||void 0===t?void 0:t.input)&&(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))==="password"&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(o=e.current)||void 0===o||o.input.removeAttribute("value"))}))};return(0,r.useEffect)(()=>(t&&o(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[]),o}},64482:function(e,t,n){"use strict";n.d(t,{default:function(){return M}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),c=n(39109),l=n(31282),s=n(65863),u=n(97416),d=n(6520),f=n(18694),p=n(28791),m=n(39164),g=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let h=e=>e?r.createElement(d.Z,null):r.createElement(u.Z,null),v={click:"onClick",hover:"onMouseOver"},b=r.forwardRef((e,t)=>{let{visibilityToggle:n=!0}=e,o="object"==typeof n&&void 0!==n.visible,[c,l]=(0,r.useState)(()=>!!o&&n.visible),u=(0,r.useRef)(null);r.useEffect(()=>{o&&l(n.visible)},[o,n]);let d=(0,m.Z)(u),b=()=>{let{disabled:t}=e;t||(c&&d(),l(e=>{var t;let r=!e;return"object"==typeof n&&(null===(t=n.onVisibleChange)||void 0===t||t.call(n,r)),r}))},{className:y,prefixCls:w,inputPrefixCls:x,size:E}=e,S=g(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:C}=r.useContext(i.E_),Z=C("input",x),O=C("input-password",w),k=n&&(t=>{let{action:n="click",iconRender:o=h}=e,a=v[n]||"",i=o(c);return r.cloneElement(r.isValidElement(i)?i:r.createElement("span",null,i),{[a]:b,className:"".concat(t,"-icon"),key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}})})(O),M=a()(O,y,{["".concat(O,"-").concat(E)]:!!E}),j=Object.assign(Object.assign({},(0,f.Z)(S,["suffix","iconRender","visibilityToggle"])),{type:c?"text":"password",className:M,prefixCls:Z,suffix:k});return E&&(j.size=E),r.createElement(s.Z,Object.assign({ref:(0,p.sQ)(t,u)},j))});var y=n(29436),w=n(19722),x=n(73002),E=n(33759),S=n(65658),C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let Z=r.forwardRef((e,t)=>{let n;let{prefixCls:o,inputPrefixCls:c,className:l,size:u,suffix:d,enterButton:f=!1,addonAfter:m,loading:g,disabled:h,onSearch:v,onChange:b,onCompositionStart:Z,onCompositionEnd:O}=e,k=C(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:M,direction:j}=r.useContext(i.E_),I=r.useRef(!1),R=M("input-search",o),N=M("input",c),{compactSize:P}=(0,S.ri)(R,j),F=(0,E.Z)(e=>{var t;return null!==(t=null!=u?u:P)&&void 0!==t?t:e}),T=r.useRef(null),A=e=>{var t;document.activeElement===(null===(t=T.current)||void 0===t?void 0:t.input)&&e.preventDefault()},L=e=>{var t,n;v&&v(null===(n=null===(t=T.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},z="boolean"==typeof f?r.createElement(y.Z,null):null,_="".concat(R,"-button"),H=f||{},B=H.type&&!0===H.type.__ANT_BUTTON;n=B||"button"===H.type?(0,w.Tm)(H,Object.assign({onMouseDown:A,onClick:e=>{var t,n;null===(n=null===(t=null==H?void 0:H.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),L(e)},key:"enterButton"},B?{className:_,size:F}:{})):r.createElement(x.ZP,{className:_,type:f?"primary":void 0,size:F,disabled:h,key:"enterButton",onMouseDown:A,onClick:L,loading:g,icon:z},f),m&&(n=[n,(0,w.Tm)(m,{key:"addonAfter"})]);let D=a()(R,{["".concat(R,"-rtl")]:"rtl"===j,["".concat(R,"-").concat(F)]:!!F,["".concat(R,"-with-button")]:!!f},l);return r.createElement(s.Z,Object.assign({ref:(0,p.sQ)(T,t),onPressEnter:e=>{I.current||g||L(e)}},k,{size:F,onCompositionStart:e=>{I.current=!0,null==Z||Z(e)},onCompositionEnd:e=>{I.current=!1,null==O||O(e)},prefixCls:N,addonAfter:n,suffix:d,onChange:e=>{e&&e.target&&"click"===e.type&&v&&v(e.target.value,e,{source:"clear"}),b&&b(e)},className:D,disabled:h}))});var O=n(90464);let k=s.Z;k.Group=e=>{let{getPrefixCls:t,direction:n}=(0,r.useContext)(i.E_),{prefixCls:o,className:s}=e,u=t("input-group",o),d=t("input"),[f,p]=(0,l.ZP)(d),m=a()(u,{["".concat(u,"-lg")]:"large"===e.size,["".concat(u,"-sm")]:"small"===e.size,["".concat(u,"-compact")]:e.compact,["".concat(u,"-rtl")]:"rtl"===n},p,s),g=(0,r.useContext)(c.aM),h=(0,r.useMemo)(()=>Object.assign(Object.assign({},g),{isFormItemInput:!1}),[g]);return f(r.createElement("span",{className:m,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},r.createElement(c.aM.Provider,{value:h},e.children)))},k.Search=Z,k.TextArea=O.Z,k.Password=b;var M=k},31282:function(e,t,n){"use strict";n.d(t,{ik:function(){return p},nz:function(){return u},s7:function(){return m},x0:function(){return f}});var r=n(352),o=n(12918),a=n(17691),i=n(80669),c=n(3104),l=n(37433),s=n(65265);let u=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),d=e=>{let{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:o,paddingInlineLG:a}=e;return{padding:"".concat((0,r.bf)(t)," ").concat((0,r.bf)(a)),fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:o}},f=e=>({padding:"".concat((0,r.bf)(e.paddingBlockSM)," ").concat((0,r.bf)(e.paddingInlineSM)),fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),p=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:"".concat((0,r.bf)(e.paddingBlock)," ").concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationMid)},u(e.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:"all ".concat(e.motionDurationSlow,", height 0s"),resize:"vertical"},"&-lg":Object.assign({},d(e)),"&-sm":Object.assign({},f(e)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),m=e=>{let{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},["&-lg ".concat(t,", &-lg > ").concat(t,"-group-addon")]:Object.assign({},d(e)),["&-sm ".concat(t,", &-sm > ").concat(t,"-group-addon")]:Object.assign({},f(e)),["&-lg ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightLG},["&-sm ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightSM},["> ".concat(t)]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},["".concat(t,"-group")]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:"0 ".concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationSlow),lineHeight:1,["".concat(n,"-select")]:{margin:"".concat((0,r.bf)(e.calc(e.paddingBlock).add(1).mul(-1).equal())," ").concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),["&".concat(n,"-select-single:not(").concat(n,"-select-customize-input):not(").concat(n,"-pagination-size-changer)")]:{["".concat(n,"-select-selector")]:{backgroundColor:"inherit",border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),boxShadow:"none"}},"&-open, &-focused":{["".concat(n,"-select-selector")]:{color:e.colorPrimary}}},["".concat(n,"-cascader-picker")]:{margin:"-9px ".concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),backgroundColor:"transparent",["".concat(n,"-cascader-input")]:{textAlign:"start",border:0,boxShadow:"none"}}}},["".concat(t)]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,["".concat(t,"-search-with-button &")]:{zIndex:0}}},["> ".concat(t,":first-child, ").concat(t,"-group-addon:first-child")]:{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,"-affix-wrapper")]:{["&:not(:first-child) ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0},["&:not(:last-child) ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,":last-child, ").concat(t,"-group-addon:last-child")]:{borderStartStartRadius:0,borderEndStartRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["".concat(t,"-affix-wrapper")]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(t,"-search &")]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},["&:not(:first-child), ".concat(t,"-search &:not(:first-child)")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["&".concat(t,"-group-compact")]:Object.assign(Object.assign({display:"block"},(0,o.dF)()),{["".concat(t,"-group-addon, ").concat(t,"-group-wrap, > ").concat(t)]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},["\n & > ".concat(t,"-affix-wrapper,\n & > ").concat(t,"-number-affix-wrapper,\n & > ").concat(n,"-picker-range\n ")]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},["".concat(t)]:{float:"none"},["& > ".concat(n,"-select > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete ").concat(t,",\n & > ").concat(n,"-cascader-picker ").concat(t,",\n & > ").concat(t,"-group-wrapper ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},["& > ".concat(n,"-select-focused")]:{zIndex:1},["& > ".concat(n,"-select > ").concat(n,"-select-arrow")]:{zIndex:1},["& > *:first-child,\n & > ".concat(n,"-select:first-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete:first-child ").concat(t,",\n & > ").concat(n,"-cascader-picker:first-child ").concat(t)]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},["& > *:last-child,\n & > ".concat(n,"-select:last-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-cascader-picker:last-child ").concat(t,",\n & > ").concat(n,"-cascader-picker-focused:last-child ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},["& > ".concat(n,"-select-auto-complete ").concat(t)]:{verticalAlign:"top"},["".concat(t,"-group-wrapper + ").concat(t,"-group-wrapper")]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),["".concat(t,"-affix-wrapper")]:{borderRadius:0}},["".concat(t,"-group-wrapper:not(:last-child)")]:{["&".concat(t,"-search > ").concat(t,"-group")]:{["& > ".concat(t,"-group-addon > ").concat(t,"-search-button")]:{borderRadius:0},["& > ".concat(t)]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},g=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:a}=e,i=a(n).sub(a(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),p(e)),(0,s.qG)(e)),(0,s.H8)(e)),(0,s.Mu)(e)),{'&[type="color"]':{height:e.controlHeight,["&".concat(t,"-lg")]:{height:e.controlHeightLG},["&".concat(t,"-sm")]:{height:n,paddingTop:i,paddingBottom:i}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},h=e=>{let{componentCls:t}=e;return{["".concat(t,"-clear-icon")]:{margin:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"&:hover":{color:e.colorTextTertiary},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:"0 ".concat((0,r.bf)(e.inputAffixPadding))}}}},v=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:o,colorIcon:a,colorIconHover:i,iconCls:c}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign(Object.assign(Object.assign({},p(e)),{display:"inline-flex",["&:not(".concat(t,"-disabled):hover")]:{zIndex:1,["".concat(t,"-search-with-button &")]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},["> input".concat(t)]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t)]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),h(e)),{["".concat(c).concat(t,"-password-icon")]:{color:a,cursor:"pointer",transition:"all ".concat(o),"&:hover":{color:i}}})}},b=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{["".concat(t,"-group")]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),m(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:r}}},(0,s.ir)(e)),(0,s.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},y=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-search");return{[r]:{["".concat(t)]:{"&:hover, &:focus":{borderColor:e.colorPrimaryHover,["+ ".concat(t,"-group-addon ").concat(r,"-button:not(").concat(n,"-btn-primary)")]:{borderInlineStartColor:e.colorPrimaryHover}}},["".concat(t,"-affix-wrapper")]:{borderRadius:0},["".concat(t,"-lg")]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal({unit:!1})},["> ".concat(t,"-group")]:{["> ".concat(t,"-group-addon:last-child")]:{insetInlineStart:-1,padding:0,border:0,["".concat(r,"-button")]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius,borderEndStartRadius:0,boxShadow:"none"},["".concat(r,"-button:not(").concat(n,"-btn-primary)")]:{color:e.colorTextDescription,"&:hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},["&".concat(n,"-btn-loading::before")]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},["".concat(r,"-button")]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},["&-large ".concat(r,"-button")]:{height:e.controlHeightLG},["&-small ".concat(r,"-button")]:{height:e.controlHeightSM},"&-rtl":{direction:"rtl"},["&".concat(t,"-compact-item")]:{["&:not(".concat(t,"-compact-last-item)")]:{["".concat(t,"-group-addon")]:{["".concat(t,"-search-button")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},["&:not(".concat(t,"-compact-first-item)")]:{["".concat(t,",").concat(t,"-affix-wrapper")]:{borderRadius:0}},["> ".concat(t,"-group-addon ").concat(t,"-search-button,\n > ").concat(t,",\n ").concat(t,"-affix-wrapper")]:{"&:hover,&:focus,&:active":{zIndex:2}},["> ".concat(t,"-affix-wrapper-focused")]:{zIndex:2}}}}},w=e=>{let{componentCls:t,paddingLG:n}=e,r="".concat(t,"-textarea");return{[r]:{position:"relative","&-show-count":{["> ".concat(t)]:{height:"100%"},["".concat(t,"-data-count")]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{["> ".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(r,"-has-feedback")]:{["".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(t,"-affix-wrapper")]:{padding:0,["> textarea".concat(t)]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},["".concat(t,"-suffix")]:{margin:0,"> *:not(:last-child)":{marginInline:0},["".concat(t,"-clear-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,insetBlockStart:e.paddingXS},["".concat(r,"-suffix")]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},x=e=>{let{componentCls:t}=e;return{["".concat(t,"-out-of-range")]:{["&, & input, & textarea, ".concat(t,"-show-count-suffix, ").concat(t,"-data-count")]:{color:e.colorError}}}};t.ZP=(0,i.I$)("Input",e=>{let t=(0,c.TS)(e,(0,l.e)(e));return[g(t),w(t),v(t),b(t),y(t),x(t),(0,a.c)(t)]},l.T)},37433:function(e,t,n){"use strict";n.d(t,{T:function(){return a},e:function(){return o}});var r=n(3104);function o(e){return(0,r.TS)(e,{inputAffixPadding:e.paddingXXS})}let a=e=>{let{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:o,controlHeightSM:a,controlHeightLG:i,fontSizeLG:c,lineHeightLG:l,paddingSM:s,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:m,controlOutlineWidth:g,controlOutline:h,colorErrorOutline:v,colorWarningOutline:b,colorBgContainer:y}=e;return{paddingBlock:Math.max(Math.round((t-n*r)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((a-n*r)/2*10)/10-o,0),paddingBlockLG:Math.ceil((i-c*l)/2*10)/10-o,paddingInline:s-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:f,activeBorderColor:m,hoverBorderColor:p,activeShadow:"0 0 0 ".concat(g,"px ").concat(h),errorActiveShadow:"0 0 0 ".concat(g,"px ").concat(v),warningActiveShadow:"0 0 0 ".concat(g,"px ").concat(b),hoverBg:y,activeBg:y,inputFontSize:n,inputFontSizeLG:c,inputFontSizeSM:n}}},65265:function(e,t,n){"use strict";n.d(t,{$U:function(){return c},H8:function(){return g},Mu:function(){return f},S5:function(){return v},Xy:function(){return i},ir:function(){return d},qG:function(){return s}});var r=n(352),o=n(3104);let a=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),i=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover:not([disabled])":Object.assign({},a((0,o.TS)(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),c=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),l=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},c(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),s=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),l(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),l(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),u=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),d=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.addonBg,border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},u(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),u(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group-addon")]:Object.assign({},i(e))}})}),f=(e,t)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},["&".concat(e.componentCls,"-disabled, &[disabled]")]:{color:e.colorTextDisabled}},t)}),p=(e,t)=>({background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:null==t?void 0:t.inputColor},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}),m=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},p(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),g=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.colorPrimary})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),m(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),m(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),h=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{background:t.addonBg,color:t.addonColor}}}),v=e=>({"&-filled":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary},["".concat(e.componentCls,"-filled:not(:focus):not(:focus-within)")]:{"&:not(:first-child)":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)},"&:not(:last-child)":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)}}}},h(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),h(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:last-child":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)}}}})})},91325:function(e,t,n){"use strict";let r=(0,n(2265).createContext)(void 0);t.Z=r},13823:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(96257),o={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};let a={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"}),timePickerLocale:Object.assign({},o)},i="${label} is not a valid ${type}";var c={locale:"en",Pagination:r.Z,DatePicker:a,TimePicker:o,Calendar:a,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},PageHeader:{back:"Back"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:i,method:i,array:i,object:i,number:i,date:i,boolean:i,integer:i,float:i,regexp:i,email:i,url:i,hex:i},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty"}}},55274:function(e,t,n){"use strict";var r=n(2265),o=n(91325),a=n(13823);t.Z=(e,t)=>{let n=r.useContext(o.Z);return[r.useMemo(()=>{var r;let o=t||a.Z[e],i=null!==(r=null==n?void 0:n[e])&&void 0!==r?r:{};return Object.assign(Object.assign({},"function"==typeof o?o():o),i||{})},[e,t,n]),r.useMemo(()=>{let e=null==n?void 0:n.locale;return(null==n?void 0:n.exist)&&!e?a.Z.locale:e},[n])]}},42264:function(e,t,n){"use strict";n.d(t,{ZP:function(){return G}});var r=n(83145),o=n(2265),a=n(18404),i=n(52402),c=n(71744),l=n(13959),s=n(8900),u=n(39725),d=n(54537),f=n(55726),p=n(61935),m=n(36760),g=n.n(m),h=n(49283),v=n(352),b=n(62236),y=n(12918),w=n(80669),x=n(3104);let E=e=>{let{componentCls:t,iconCls:n,boxShadow:r,colorText:o,colorSuccess:a,colorError:i,colorWarning:c,colorInfo:l,fontSizeLG:s,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:f,paddingXS:p,borderRadiusLG:m,zIndexPopup:g,contentPadding:h,contentBg:b}=e,w="".concat(t,"-notice"),x=new v.E4("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:p,transform:"translateY(0)",opacity:1}}),E=new v.E4("MessageMoveOut",{"0%":{maxHeight:e.height,padding:p,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),S={padding:p,textAlign:"center",["".concat(t,"-custom-content > ").concat(n)]:{verticalAlign:"text-bottom",marginInlineEnd:f,fontSize:s},["".concat(w,"-content")]:{display:"inline-block",padding:h,background:b,borderRadius:m,boxShadow:r,pointerEvents:"all"},["".concat(t,"-success > ").concat(n)]:{color:a},["".concat(t,"-error > ").concat(n)]:{color:i},["".concat(t,"-warning > ").concat(n)]:{color:c},["".concat(t,"-info > ").concat(n,",\n ").concat(t,"-loading > ").concat(n)]:{color:l}};return[{[t]:Object.assign(Object.assign({},(0,y.Wf)(e)),{color:o,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:g,["".concat(t,"-move-up")]:{animationFillMode:"forwards"},["\n ".concat(t,"-move-up-appear,\n ").concat(t,"-move-up-enter\n ")]:{animationName:x,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},["\n ".concat(t,"-move-up-appear").concat(t,"-move-up-appear-active,\n ").concat(t,"-move-up-enter").concat(t,"-move-up-enter-active\n ")]:{animationPlayState:"running"},["".concat(t,"-move-up-leave")]:{animationName:E,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},["".concat(t,"-move-up-leave").concat(t,"-move-up-leave-active")]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{["".concat(w,"-wrapper")]:Object.assign({},S)}},{["".concat(t,"-notice-pure-panel")]:Object.assign(Object.assign({},S),{padding:0,textAlign:"start"})}]};var S=(0,w.I$)("Message",e=>[E((0,x.TS)(e,{height:150}))],e=>({zIndexPopup:e.zIndexPopupBase+b.u6+10,contentBg:e.colorBgElevated,contentPadding:"".concat((e.controlHeightLG-e.fontSize*e.lineHeight)/2,"px ").concat(e.paddingSM,"px")})),C=n(64024),Z=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O={info:o.createElement(f.Z,null),success:o.createElement(s.Z,null),error:o.createElement(u.Z,null),warning:o.createElement(d.Z,null),loading:o.createElement(p.Z,null)},k=e=>{let{prefixCls:t,type:n,icon:r,children:a}=e;return o.createElement("div",{className:g()("".concat(t,"-custom-content"),"".concat(t,"-").concat(n))},r||O[n],o.createElement("span",null,a))};var M=n(49638),j=n(13613);function I(e){let t;let n=new Promise(n=>{t=e(()=>{n(!0)})}),r=()=>{null==t||t()};return r.then=(e,t)=>n.then(e,t),r.promise=n,r}var R=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=e=>{let{children:t,prefixCls:n}=e,r=(0,C.Z)(n),[a,i,c]=S(n,r);return a(o.createElement(h.JB,{classNames:{list:g()(i,c,r)}},t))},P=(e,t)=>{let{prefixCls:n,key:r}=t;return o.createElement(N,{prefixCls:n,key:r},e)},F=o.forwardRef((e,t)=>{let{top:n,prefixCls:r,getContainer:a,maxCount:i,duration:l=3,rtl:s,transitionName:u,onAllRemoved:d}=e,{getPrefixCls:f,getPopupContainer:p,message:m,direction:v}=o.useContext(c.E_),b=r||f("message"),y=o.createElement("span",{className:"".concat(b,"-close-x")},o.createElement(M.Z,{className:"".concat(b,"-close-icon")})),[w,x]=(0,h.lm)({prefixCls:b,style:()=>({left:"50%",transform:"translateX(-50%)",top:null!=n?n:8}),className:()=>g()({["".concat(b,"-rtl")]:null!=s?s:"rtl"===v}),motion:()=>({motionName:null!=u?u:"".concat(b,"-move-up")}),closable:!1,closeIcon:y,duration:l,getContainer:()=>(null==a?void 0:a())||(null==p?void 0:p())||document.body,maxCount:i,onAllRemoved:d,renderNotifications:P});return o.useImperativeHandle(t,()=>Object.assign(Object.assign({},w),{prefixCls:b,message:m})),x}),T=0;function A(e){let t=o.useRef(null);return(0,j.ln)("Message"),[o.useMemo(()=>{let e=e=>{var n;null===(n=t.current)||void 0===n||n.close(e)},n=n=>{if(!t.current){let e=()=>{};return e.then=()=>{},e}let{open:r,prefixCls:a,message:i}=t.current,c="".concat(a,"-notice"),{content:l,icon:s,type:u,key:d,className:f,style:p,onClose:m}=n,h=R(n,["content","icon","type","key","className","style","onClose"]),v=d;return null==v&&(T+=1,v="antd-message-".concat(T)),I(t=>(r(Object.assign(Object.assign({},h),{key:v,content:o.createElement(k,{prefixCls:a,type:u,icon:s},l),placement:"top",className:g()(u&&"".concat(c,"-").concat(u),f,null==i?void 0:i.className),style:Object.assign(Object.assign({},null==i?void 0:i.style),p),onClose:()=>{null==m||m(),t()}})),()=>{e(v)}))},r={open:n,destroy:n=>{var r;void 0!==n?e(n):null===(r=t.current)||void 0===r||r.destroy()}};return["info","success","warning","error","loading"].forEach(e=>{r[e]=(t,r,o)=>{let a,i,c;return a=t&&"object"==typeof t&&"content"in t?t:{content:t},"function"==typeof r?c=r:(i=r,c=o),n(Object.assign(Object.assign({onClose:c,duration:i},a),{type:e}))}}),r},[]),o.createElement(F,Object.assign({key:"message-holder"},e,{ref:t}))]}let L=null,z=e=>e(),_=[],H={};function B(){let{getContainer:e,duration:t,rtl:n,maxCount:r,top:o}=H,a=(null==e?void 0:e())||document.body;return{getContainer:()=>a,duration:t,rtl:n,maxCount:r,top:o}}let D=o.forwardRef((e,t)=>{let{messageConfig:n,sync:r}=e,{getPrefixCls:a}=(0,o.useContext)(c.E_),l=H.prefixCls||a("message"),s=(0,o.useContext)(i.J),[u,d]=A(Object.assign(Object.assign(Object.assign({},n),{prefixCls:l}),s.message));return o.useImperativeHandle(t,()=>{let e=Object.assign({},u);return Object.keys(e).forEach(t=>{e[t]=function(){return r(),u[t].apply(u,arguments)}}),{instance:e,sync:r}}),d}),W=o.forwardRef((e,t)=>{let[n,r]=o.useState(B),a=()=>{r(B)};o.useEffect(a,[]);let i=(0,l.w6)(),c=i.getRootPrefixCls(),s=i.getIconPrefixCls(),u=i.getTheme(),d=o.createElement(D,{ref:t,sync:a,messageConfig:n});return o.createElement(l.ZP,{prefixCls:c,iconPrefixCls:s,theme:u},i.holderRender?i.holderRender(d):d)});function V(){if(!L){let e=document.createDocumentFragment(),t={fragment:e};L=t,z(()=>{(0,a.s)(o.createElement(W,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,V())})}}),e)});return}L.instance&&(_.forEach(e=>{let{type:t,skipped:n}=e;if(!n)switch(t){case"open":z(()=>{let t=L.instance.open(Object.assign(Object.assign({},H),e.config));null==t||t.then(e.resolve),e.setCloseFn(t)});break;case"destroy":z(()=>{null==L||L.instance.destroy(e.key)});break;default:z(()=>{var n;let o=(n=L.instance)[t].apply(n,(0,r.Z)(e.args));null==o||o.then(e.resolve),e.setCloseFn(o)})}}),_=[])}let q={open:function(e){let t=I(t=>{let n;let r={type:"open",config:e,resolve:t,setCloseFn:e=>{n=e}};return _.push(r),()=>{n?z(()=>{n()}):r.skipped=!0}});return V(),t},destroy:function(e){_.push({type:"destroy",key:e}),V()},config:function(e){H=Object.assign(Object.assign({},H),e),z(()=>{var e;null===(e=null==L?void 0:L.sync)||void 0===e||e.call(L)})},useMessage:function(e){return A(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,type:r,icon:a,content:i}=e,l=Z(e,["prefixCls","className","type","icon","content"]),{getPrefixCls:s}=o.useContext(c.E_),u=t||s("message"),d=(0,C.Z)(u),[f,p,m]=S(u,d);return f(o.createElement(h.qX,Object.assign({},l,{prefixCls:u,className:g()(n,p,"".concat(u,"-notice-pure-panel"),m,d),eventKey:"pure",duration:null,content:o.createElement(k,{prefixCls:u,type:r,icon:a},i)})))}};["success","info","warning","error","loading"].forEach(e=>{q[e]=function(){for(var t=arguments.length,n=Array(t),r=0;r{let r;let o={type:e,args:t,resolve:n,setCloseFn:e=>{r=e}};return _.push(o),()=>{r?z(()=>{r()}):o.skipped=!0}});return V(),n}(e,n)}});var G=q},92246:function(e,t,n){"use strict";n.d(t,{A:function(){return l},f:function(){return c}});var r=n(13823);let o=Object.assign({},r.Z.Modal),a=[],i=()=>a.reduce((e,t)=>Object.assign(Object.assign({},e),t),r.Z.Modal);function c(e){if(e){let t=Object.assign({},e);return a.push(t),o=i(),()=>{a=a.filter(e=>e!==t),o=i()}}o=Object.assign({},r.Z.Modal)}function l(){return o}},57271:function(e,t,n){"use strict";n.d(t,{ZP:function(){return er}});var r=n(2265),o=n(18404),a=n(52402),i=n(71744),c=n(13959),l=n(8900),s=n(39725),u=n(49638),d=n(54537),f=n(55726),p=n(61935),m=n(36760),g=n.n(m),h=n(49283),v=n(64024),b=n(352),y=n(62236),w=n(12918),x=n(3104),E=n(80669),S=e=>{let{componentCls:t,notificationMarginEdge:n,animationMaxHeight:r}=e,o="".concat(t,"-notice"),a=new b.E4("antNotificationFadeIn",{"0%":{transform:"translate3d(100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}}),i=new b.E4("antNotificationTopFadeIn",{"0%":{top:-r,opacity:0},"100%":{top:0,opacity:1}}),c=new b.E4("antNotificationBottomFadeIn",{"0%":{bottom:e.calc(r).mul(-1).equal(),opacity:0},"100%":{bottom:0,opacity:1}}),l=new b.E4("antNotificationLeftFadeIn",{"0%":{transform:"translate3d(-100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}});return{[t]:{["&".concat(t,"-top, &").concat(t,"-bottom")]:{marginInline:0,[o]:{marginInline:"auto auto"}},["&".concat(t,"-top")]:{["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:i}},["&".concat(t,"-bottom")]:{["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:c}},["&".concat(t,"-topRight, &").concat(t,"-bottomRight")]:{["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:a}},["&".concat(t,"-topLeft, &").concat(t,"-bottomLeft")]:{marginRight:{value:0,_skip_check_:!0},marginLeft:{value:n,_skip_check_:!0},[o]:{marginInlineEnd:"auto",marginInlineStart:0},["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:l}}}}};let C=["top","topLeft","topRight","bottom","bottomLeft","bottomRight"],Z={topLeft:"left",topRight:"right",bottomLeft:"left",bottomRight:"right",top:"left",bottom:"left"},O=(e,t)=>{let{componentCls:n}=e;return{["".concat(n,"-").concat(t)]:{["&".concat(n,"-stack > ").concat(n,"-notice-wrapper")]:{[t.startsWith("top")?"top":"bottom"]:0,[Z[t]]:{value:0,_skip_check_:!0}}}}},k=e=>{let t={};for(let n=1;n ".concat(e.componentCls,"-notice")]:{opacity:0,transition:"opacity ".concat(e.motionDurationMid)}};return Object.assign({["&:not(:nth-last-child(-n+".concat(e.notificationStackLayer,"))")]:{opacity:0,overflow:"hidden",color:"transparent",pointerEvents:"none"}},t)},M=e=>{let t={};for(let n=1;n{let{componentCls:t}=e;return Object.assign({["".concat(t,"-stack")]:{["& > ".concat(t,"-notice-wrapper")]:Object.assign({transition:"all ".concat(e.motionDurationSlow,", backdrop-filter 0s"),position:"absolute"},k(e))},["".concat(t,"-stack:not(").concat(t,"-stack-expanded)")]:{["& > ".concat(t,"-notice-wrapper")]:Object.assign({},M(e))},["".concat(t,"-stack").concat(t,"-stack-expanded")]:{["& > ".concat(t,"-notice-wrapper")]:{"&:not(:nth-last-child(-n + 1))":{opacity:1,overflow:"unset",color:"inherit",pointerEvents:"auto",["& > ".concat(e.componentCls,"-notice")]:{opacity:1}},"&:after":{content:'""',position:"absolute",height:e.margin,width:"100%",insetInline:0,bottom:e.calc(e.margin).mul(-1).equal(),background:"transparent",pointerEvents:"auto"}}}},C.map(t=>O(e,t)).reduce((e,t)=>Object.assign(Object.assign({},e),t),{}))};let I=e=>{let{iconCls:t,componentCls:n,boxShadow:r,fontSizeLG:o,notificationMarginBottom:a,borderRadiusLG:i,colorSuccess:c,colorInfo:l,colorWarning:s,colorError:u,colorTextHeading:d,notificationBg:f,notificationPadding:p,notificationMarginEdge:m,fontSize:g,lineHeight:h,width:v,notificationIconSize:y,colorText:w}=e,x="".concat(n,"-notice");return{position:"relative",marginBottom:a,marginInlineStart:"auto",background:f,borderRadius:i,boxShadow:r,[x]:{padding:p,width:v,maxWidth:"calc(100vw - ".concat((0,b.bf)(e.calc(m).mul(2).equal()),")"),overflow:"hidden",lineHeight:h,wordWrap:"break-word"},["".concat(n,"-close-icon")]:{fontSize:g,cursor:"pointer"},["".concat(x,"-message")]:{marginBottom:e.marginXS,color:d,fontSize:o,lineHeight:e.lineHeightLG},["".concat(x,"-description")]:{fontSize:g,color:w},["".concat(x,"-closable ").concat(x,"-message")]:{paddingInlineEnd:e.paddingLG},["".concat(x,"-with-icon ").concat(x,"-message")]:{marginBottom:e.marginXS,marginInlineStart:e.calc(e.marginSM).add(y).equal(),fontSize:o},["".concat(x,"-with-icon ").concat(x,"-description")]:{marginInlineStart:e.calc(e.marginSM).add(y).equal(),fontSize:g},["".concat(x,"-icon")]:{position:"absolute",fontSize:y,lineHeight:1,["&-success".concat(t)]:{color:c},["&-info".concat(t)]:{color:l},["&-warning".concat(t)]:{color:s},["&-error".concat(t)]:{color:u}},["".concat(x,"-close")]:{position:"absolute",top:e.notificationPaddingVertical,insetInlineEnd:e.notificationPaddingHorizontal,color:e.colorIcon,outline:"none",width:e.notificationCloseButtonSize,height:e.notificationCloseButtonSize,borderRadius:e.borderRadiusSM,transition:"background-color ".concat(e.motionDurationMid,", color ").concat(e.motionDurationMid),display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:e.colorIconHover,backgroundColor:e.closeBtnHoverBg}},["".concat(x,"-btn")]:{float:"right",marginTop:e.marginSM}}},R=e=>{let{componentCls:t,notificationMarginBottom:n,notificationMarginEdge:r,motionDurationMid:o,motionEaseInOut:a}=e,i="".concat(t,"-notice"),c=new b.E4("antNotificationFadeOut",{"0%":{maxHeight:e.animationMaxHeight,marginBottom:n},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}});return[{[t]:Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"fixed",zIndex:e.zIndexPopup,marginRight:{value:r,_skip_check_:!0},["".concat(t,"-hook-holder")]:{position:"relative"},["".concat(t,"-fade-appear-prepare")]:{opacity:"0 !important"},["".concat(t,"-fade-enter, ").concat(t,"-fade-appear")]:{animationDuration:e.motionDurationMid,animationTimingFunction:a,animationFillMode:"both",opacity:0,animationPlayState:"paused"},["".concat(t,"-fade-leave")]:{animationTimingFunction:a,animationFillMode:"both",animationDuration:o,animationPlayState:"paused"},["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationPlayState:"running"},["".concat(t,"-fade-leave").concat(t,"-fade-leave-active")]:{animationName:c,animationPlayState:"running"},"&-rtl":{direction:"rtl",["".concat(i,"-btn")]:{float:"left"}}})},{[t]:{["".concat(i,"-wrapper")]:Object.assign({},I(e))}}]},N=e=>({zIndexPopup:e.zIndexPopupBase+y.u6+50,width:384,closeBtnHoverBg:e.wireframe?"transparent":e.colorFillContent}),P=e=>{let t=e.paddingMD,n=e.paddingLG;return(0,x.TS)(e,{notificationBg:e.colorBgElevated,notificationPaddingVertical:t,notificationPaddingHorizontal:n,notificationIconSize:e.calc(e.fontSizeLG).mul(e.lineHeightLG).equal(),notificationCloseButtonSize:e.calc(e.controlHeightLG).mul(.55).equal(),notificationMarginBottom:e.margin,notificationPadding:"".concat((0,b.bf)(e.paddingMD)," ").concat((0,b.bf)(e.paddingContentHorizontalLG)),notificationMarginEdge:e.marginLG,animationMaxHeight:150,notificationStackLayer:3})};var F=(0,E.I$)("Notification",e=>{let t=P(e);return[R(t),S(t),j(t)]},N),T=(0,E.bk)(["Notification","PurePanel"],e=>{let t="".concat(e.componentCls,"-notice"),n=P(e);return{["".concat(t,"-pure-panel")]:Object.assign(Object.assign({},I(n)),{width:n.width,maxWidth:"calc(100vw - ".concat((0,b.bf)(e.calc(n.notificationMarginEdge).mul(2).equal()),")"),margin:0})}},N),A=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function L(e,t){return null===t||!1===t?null:t||r.createElement("span",{className:"".concat(e,"-close-x")},r.createElement(u.Z,{className:"".concat(e,"-close-icon")}))}f.Z,l.Z,s.Z,d.Z,p.Z;let z={success:l.Z,info:f.Z,error:s.Z,warning:d.Z},_=e=>{let{prefixCls:t,icon:n,type:o,message:a,description:i,btn:c,role:l="alert"}=e,s=null;return n?s=r.createElement("span",{className:"".concat(t,"-icon")},n):o&&(s=r.createElement(z[o]||null,{className:g()("".concat(t,"-icon"),"".concat(t,"-icon-").concat(o))})),r.createElement("div",{className:g()({["".concat(t,"-with-icon")]:s}),role:l},s,r.createElement("div",{className:"".concat(t,"-message")},a),r.createElement("div",{className:"".concat(t,"-description")},i),c&&r.createElement("div",{className:"".concat(t,"-btn")},c))};var H=n(13613),B=n(29961),D=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let W=e=>{let{children:t,prefixCls:n}=e,o=(0,v.Z)(n),[a,i,c]=F(n,o);return a(r.createElement(h.JB,{classNames:{list:g()(i,c,o)}},t))},V=(e,t)=>{let{prefixCls:n,key:o}=t;return r.createElement(W,{prefixCls:n,key:o},e)},q=r.forwardRef((e,t)=>{let{top:n,bottom:o,prefixCls:a,getContainer:c,maxCount:l,rtl:s,onAllRemoved:u,stack:d}=e,{getPrefixCls:f,getPopupContainer:p,notification:m,direction:v}=(0,r.useContext)(i.E_),[,b]=(0,B.ZP)(),y=a||f("notification"),[w,x]=(0,h.lm)({prefixCls:y,style:e=>(function(e,t,n){let r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n}}return r})(e,null!=n?n:24,null!=o?o:24),className:()=>g()({["".concat(y,"-rtl")]:null!=s?s:"rtl"===v}),motion:()=>({motionName:"".concat(y,"-fade")}),closable:!0,closeIcon:L(y),duration:4.5,getContainer:()=>(null==c?void 0:c())||(null==p?void 0:p())||document.body,maxCount:l,onAllRemoved:u,renderNotifications:V,stack:!1!==d&&{threshold:"object"==typeof d?null==d?void 0:d.threshold:void 0,offset:8,gap:b.margin}});return r.useImperativeHandle(t,()=>Object.assign(Object.assign({},w),{prefixCls:y,notification:m})),x});function G(e){let t=r.useRef(null);return(0,H.ln)("Notification"),[r.useMemo(()=>{let n=n=>{var o;if(!t.current)return;let{open:a,prefixCls:i,notification:c}=t.current,l="".concat(i,"-notice"),{message:s,description:u,icon:d,type:f,btn:p,className:m,style:h,role:v="alert",closeIcon:b}=n,y=D(n,["message","description","icon","type","btn","className","style","role","closeIcon"]),w=L(l,b);return a(Object.assign(Object.assign({placement:null!==(o=null==e?void 0:e.placement)&&void 0!==o?o:"topRight"},y),{content:r.createElement(_,{prefixCls:l,icon:d,type:f,message:s,description:u,btn:p,role:v}),className:g()(f&&"".concat(l,"-").concat(f),m,null==c?void 0:c.className),style:Object.assign(Object.assign({},null==c?void 0:c.style),h),closeIcon:w,closable:!!w}))},o={open:n,destroy:e=>{var n,r;void 0!==e?null===(n=t.current)||void 0===n||n.close(e):null===(r=t.current)||void 0===r||r.destroy()}};return["success","info","warning","error"].forEach(e=>{o[e]=t=>n(Object.assign(Object.assign({},t),{type:e}))}),o},[]),r.createElement(q,Object.assign({key:"notification-holder"},e,{ref:t}))]}let X=null,U=e=>e(),$=[],K={};function Y(){let{getContainer:e,rtl:t,maxCount:n,top:r,bottom:o}=K,a=(null==e?void 0:e())||document.body;return{getContainer:()=>a,rtl:t,maxCount:n,top:r,bottom:o}}let Q=r.forwardRef((e,t)=>{let{notificationConfig:n,sync:o}=e,{getPrefixCls:c}=(0,r.useContext)(i.E_),l=K.prefixCls||c("notification"),s=(0,r.useContext)(a.J),[u,d]=G(Object.assign(Object.assign(Object.assign({},n),{prefixCls:l}),s.notification));return r.useEffect(o,[]),r.useImperativeHandle(t,()=>{let e=Object.assign({},u);return Object.keys(e).forEach(t=>{e[t]=function(){return o(),u[t].apply(u,arguments)}}),{instance:e,sync:o}}),d}),J=r.forwardRef((e,t)=>{let[n,o]=r.useState(Y),a=()=>{o(Y)};r.useEffect(a,[]);let i=(0,c.w6)(),l=i.getRootPrefixCls(),s=i.getIconPrefixCls(),u=i.getTheme(),d=r.createElement(Q,{ref:t,sync:a,notificationConfig:n});return r.createElement(c.ZP,{prefixCls:l,iconPrefixCls:s,theme:u},i.holderRender?i.holderRender(d):d)});function ee(){if(!X){let e=document.createDocumentFragment(),t={fragment:e};X=t,U(()=>{(0,o.s)(r.createElement(J,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,ee())})}}),e)});return}X.instance&&($.forEach(e=>{switch(e.type){case"open":U(()=>{X.instance.open(Object.assign(Object.assign({},K),e.config))});break;case"destroy":U(()=>{null==X||X.instance.destroy(e.key)})}}),$=[])}function et(e){(0,c.w6)(),$.push({type:"open",config:e}),ee()}let en={open:et,destroy:function(e){$.push({type:"destroy",key:e}),ee()},config:function(e){K=Object.assign(Object.assign({},K),e),U(()=>{var e;null===(e=null==X?void 0:X.sync)||void 0===e||e.call(X)})},useNotification:function(e){return G(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,icon:o,type:a,message:c,description:l,btn:s,closable:u=!0,closeIcon:d,className:f}=e,p=A(e,["prefixCls","className","icon","type","message","description","btn","closable","closeIcon","className"]),{getPrefixCls:m}=r.useContext(i.E_),b=t||m("notification"),y="".concat(b,"-notice"),w=(0,v.Z)(b),[x,E,S]=F(b,w);return x(r.createElement("div",{className:g()("".concat(y,"-pure-panel"),E,n,S,w)},r.createElement(T,{prefixCls:b}),r.createElement(h.qX,Object.assign({},p,{prefixCls:b,eventKey:"pure",duration:null,closable:u,className:g()({notificationClassName:f}),closeIcon:L(b,d),content:r.createElement(_,{prefixCls:y,icon:o,type:a,message:c,description:l,btn:s})}))))}};["success","info","warning","error"].forEach(e=>{en[e]=t=>et(Object.assign(Object.assign({},t),{type:e}))});var er=en},52787:function(e,t,n){"use strict";n.d(t,{default:function(){return tt}});var r=n(2265),o=n(36760),a=n.n(o),i=n(1119),c=n(83145),l=n(11993),s=n(31686),u=n(26365),d=n(6989),f=n(41154),p=n(50506),m=n(32559),g=n(27380),h=n(79267),v=n(95814),b=n(28791),y=function(e){var t=e.className,n=e.customizeIcon,o=e.customizeIconProps,i=e.children,c=e.onMouseDown,l=e.onClick,s="function"==typeof n?n(o):n;return r.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),null==c||c(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:l,"aria-hidden":!0},void 0!==s?s:r.createElement("span",{className:a()(t.split(/\s+/).map(function(e){return"".concat(e,"-icon")}))},i))},w=function(e,t,n,o,a){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,s=r.useMemo(function(){return"object"===(0,f.Z)(o)?o.clearIcon:a||void 0},[o,a]);return{allowClear:r.useMemo(function(){return!i&&!!o&&(!!n.length||!!c)&&!("combobox"===l&&""===c)},[o,i,n.length,c,l]),clearIcon:r.createElement(y,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:s},"\xd7")}},x=r.createContext(null);function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=r.useRef(null),n=r.useRef(null);return r.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]),[function(){return t.current},function(r){(r||null===t.current)&&(t.current=r),window.clearTimeout(n.current),n.current=window.setTimeout(function(){t.current=null},e)}]}var S=n(18242),C=n(1699),Z=r.forwardRef(function(e,t){var n,o=e.prefixCls,i=e.id,c=e.inputElement,l=e.disabled,u=e.tabIndex,d=e.autoFocus,f=e.autoComplete,p=e.editable,g=e.activeDescendantId,h=e.value,v=e.maxLength,y=e.onKeyDown,w=e.onMouseDown,x=e.onChange,E=e.onPaste,S=e.onCompositionStart,C=e.onCompositionEnd,Z=e.open,O=e.attrs,k=c||r.createElement("input",null),M=k,j=M.ref,I=M.props,R=I.onKeyDown,N=I.onChange,P=I.onMouseDown,F=I.onCompositionStart,T=I.onCompositionEnd,A=I.style;return(0,m.Kp)(!("maxLength"in k.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),k=r.cloneElement(k,(0,s.Z)((0,s.Z)((0,s.Z)({type:"search"},I),{},{id:i,ref:(0,b.sQ)(t,j),disabled:l,tabIndex:u,autoComplete:f||"off",autoFocus:d,className:a()("".concat(o,"-selection-search-input"),null===(n=k)||void 0===n||null===(n=n.props)||void 0===n?void 0:n.className),role:"combobox","aria-expanded":Z||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":Z?g:void 0},O),{},{value:p?h:"",maxLength:v,readOnly:!p,unselectable:p?null:"on",style:(0,s.Z)((0,s.Z)({},A),{},{opacity:p?null:0}),onKeyDown:function(e){y(e),R&&R(e)},onMouseDown:function(e){w(e),P&&P(e)},onChange:function(e){x(e),N&&N(e)},onCompositionStart:function(e){S(e),F&&F(e)},onCompositionEnd:function(e){C(e),T&&T(e)},onPaste:E}))});function O(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var k="undefined"!=typeof window&&window.document&&window.document.documentElement;function M(e){return["string","number"].includes((0,f.Z)(e))}function j(e){var t=void 0;return e&&(M(e.title)?t=e.title.toString():M(e.label)&&(t=e.label.toString())),t}function I(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var R=function(e){e.preventDefault(),e.stopPropagation()},N=function(e){var t,n,o=e.id,i=e.prefixCls,c=e.values,s=e.open,d=e.searchValue,f=e.autoClearSearchValue,p=e.inputRef,m=e.placeholder,g=e.disabled,h=e.mode,v=e.showSearch,b=e.autoFocus,w=e.autoComplete,x=e.activeDescendantId,E=e.tabIndex,O=e.removeIcon,M=e.maxTagCount,N=e.maxTagTextLength,P=e.maxTagPlaceholder,F=void 0===P?function(e){return"+ ".concat(e.length," ...")}:P,T=e.tagRender,A=e.onToggleOpen,L=e.onRemove,z=e.onInputChange,_=e.onInputPaste,H=e.onInputKeyDown,B=e.onInputMouseDown,D=e.onInputCompositionStart,W=e.onInputCompositionEnd,V=r.useRef(null),q=(0,r.useState)(0),G=(0,u.Z)(q,2),X=G[0],U=G[1],$=(0,r.useState)(!1),K=(0,u.Z)($,2),Y=K[0],Q=K[1],J="".concat(i,"-selection"),ee=s||"multiple"===h&&!1===f||"tags"===h?d:"",et="tags"===h||"multiple"===h&&!1===f||v&&(s||Y);t=function(){U(V.current.scrollWidth)},n=[ee],k?r.useLayoutEffect(t,n):r.useEffect(t,n);var en=function(e,t,n,o,i){return r.createElement("span",{title:j(e),className:a()("".concat(J,"-item"),(0,l.Z)({},"".concat(J,"-item-disabled"),n))},r.createElement("span",{className:"".concat(J,"-item-content")},t),o&&r.createElement(y,{className:"".concat(J,"-item-remove"),onMouseDown:R,onClick:i,customizeIcon:O},"\xd7"))},er=r.createElement("div",{className:"".concat(J,"-search"),style:{width:X},onFocus:function(){Q(!0)},onBlur:function(){Q(!1)}},r.createElement(Z,{ref:p,open:s,prefixCls:i,id:o,inputElement:null,disabled:g,autoFocus:b,autoComplete:w,editable:et,activeDescendantId:x,value:ee,onKeyDown:H,onMouseDown:B,onChange:z,onPaste:_,onCompositionStart:D,onCompositionEnd:W,tabIndex:E,attrs:(0,S.Z)(e,!0)}),r.createElement("span",{ref:V,className:"".concat(J,"-search-mirror"),"aria-hidden":!0},ee,"\xa0")),eo=r.createElement(C.Z,{prefixCls:"".concat(J,"-overflow"),data:c,renderItem:function(e){var t,n=e.disabled,o=e.label,a=e.value,i=!g&&!n,c=o;if("number"==typeof N&&("string"==typeof o||"number"==typeof o)){var l=String(c);l.length>N&&(c="".concat(l.slice(0,N),"..."))}var u=function(t){t&&t.stopPropagation(),L(e)};return"function"==typeof T?(t=c,r.createElement("span",{onMouseDown:function(e){R(e),A(!s)}},T({label:t,value:a,disabled:n,closable:i,onClose:u}))):en(e,c,n,i,u)},renderRest:function(e){var t="function"==typeof F?F(e):F;return en({title:t},t,!1)},suffix:er,itemKey:I,maxCount:M});return r.createElement(r.Fragment,null,eo,!c.length&&!ee&&r.createElement("span",{className:"".concat(J,"-placeholder")},m))},P=function(e){var t=e.inputElement,n=e.prefixCls,o=e.id,a=e.inputRef,i=e.disabled,c=e.autoFocus,l=e.autoComplete,s=e.activeDescendantId,d=e.mode,f=e.open,p=e.values,m=e.placeholder,g=e.tabIndex,h=e.showSearch,v=e.searchValue,b=e.activeValue,y=e.maxLength,w=e.onInputKeyDown,x=e.onInputMouseDown,E=e.onInputChange,C=e.onInputPaste,O=e.onInputCompositionStart,k=e.onInputCompositionEnd,M=e.title,I=r.useState(!1),R=(0,u.Z)(I,2),N=R[0],P=R[1],F="combobox"===d,T=F||h,A=p[0],L=v||"";F&&b&&!N&&(L=b),r.useEffect(function(){F&&P(!1)},[F,b]);var z=("combobox"===d||!!f||!!h)&&!!L,_=void 0===M?j(A):M,H=r.useMemo(function(){return A?null:r.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:z?{visibility:"hidden"}:void 0},m)},[A,z,m,n]);return r.createElement(r.Fragment,null,r.createElement("span",{className:"".concat(n,"-selection-search")},r.createElement(Z,{ref:a,prefixCls:n,id:o,open:f,inputElement:t,disabled:i,autoFocus:c,autoComplete:l,editable:T,activeDescendantId:s,value:L,onKeyDown:w,onMouseDown:x,onChange:function(e){P(!0),E(e)},onPaste:C,onCompositionStart:O,onCompositionEnd:k,tabIndex:g,attrs:(0,S.Z)(e,!0),maxLength:F?y:void 0})),!F&&A?r.createElement("span",{className:"".concat(n,"-selection-item"),title:_,style:z?{visibility:"hidden"}:void 0},A.label):null,H)},F=r.forwardRef(function(e,t){var n=(0,r.useRef)(null),o=(0,r.useRef)(!1),a=e.prefixCls,c=e.open,l=e.mode,s=e.showSearch,d=e.tokenWithEnter,f=e.autoClearSearchValue,p=e.onSearch,m=e.onSearchSubmit,g=e.onToggleOpen,h=e.onInputKeyDown,b=e.domRef;r.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var y=E(0),w=(0,u.Z)(y,2),x=w[0],S=w[1],C=(0,r.useRef)(null),Z=function(e){!1!==p(e,!0,o.current)&&g(!0)},O={inputRef:n,onInputKeyDown:function(e){var t=e.which;(t===v.Z.UP||t===v.Z.DOWN)&&e.preventDefault(),h&&h(e),t!==v.Z.ENTER||"tags"!==l||o.current||c||null==m||m(e.target.value),[v.Z.ESC,v.Z.SHIFT,v.Z.BACKSPACE,v.Z.TAB,v.Z.WIN_KEY,v.Z.ALT,v.Z.META,v.Z.WIN_KEY_RIGHT,v.Z.CTRL,v.Z.SEMICOLON,v.Z.EQUALS,v.Z.CAPS_LOCK,v.Z.CONTEXT_MENU,v.Z.F1,v.Z.F2,v.Z.F3,v.Z.F4,v.Z.F5,v.Z.F6,v.Z.F7,v.Z.F8,v.Z.F9,v.Z.F10,v.Z.F11,v.Z.F12].includes(t)||g(!0)},onInputMouseDown:function(){S(!0)},onInputChange:function(e){var t=e.target.value;if(d&&C.current&&/[\r\n]/.test(C.current)){var n=C.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,C.current)}C.current=null,Z(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");C.current=n||""},onInputCompositionStart:function(){o.current=!0},onInputCompositionEnd:function(e){o.current=!1,"combobox"!==l&&Z(e.target.value)}},k="multiple"===l||"tags"===l?r.createElement(N,(0,i.Z)({},e,O)):r.createElement(P,(0,i.Z)({},e,O));return r.createElement("div",{ref:b,className:"".concat(a,"-selector"),onClick:function(e){e.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout(function(){n.current.focus()}):n.current.focus())},onMouseDown:function(e){var t=x();e.target===n.current||t||"combobox"===l||e.preventDefault(),("combobox"===l||s&&t)&&c||(c&&!1!==f&&p("",!0,!1),g())}},k)}),T=n(97821),A=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],L=function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}},z=r.forwardRef(function(e,t){var n=e.prefixCls,o=(e.disabled,e.visible),c=e.children,u=e.popupElement,f=e.animation,p=e.transitionName,m=e.dropdownStyle,g=e.dropdownClassName,h=e.direction,v=e.placement,b=e.builtinPlacements,y=e.dropdownMatchSelectWidth,w=e.dropdownRender,x=e.dropdownAlign,E=e.getPopupContainer,S=e.empty,C=e.getTriggerDOMNode,Z=e.onPopupVisibleChange,O=e.onPopupMouseEnter,k=(0,d.Z)(e,A),M="".concat(n,"-dropdown"),j=u;w&&(j=w(u));var I=r.useMemo(function(){return b||L(y)},[b,y]),R=f?"".concat(M,"-").concat(f):p,N="number"==typeof y,P=r.useMemo(function(){return N?null:!1===y?"minWidth":"width"},[y,N]),F=m;N&&(F=(0,s.Z)((0,s.Z)({},F),{},{width:y}));var z=r.useRef(null);return r.useImperativeHandle(t,function(){return{getPopupElement:function(){return z.current}}}),r.createElement(T.Z,(0,i.Z)({},k,{showAction:Z?["click"]:[],hideAction:Z?["click"]:[],popupPlacement:v||("rtl"===(void 0===h?"ltr":h)?"bottomRight":"bottomLeft"),builtinPlacements:I,prefixCls:M,popupTransitionName:R,popup:r.createElement("div",{ref:z,onMouseEnter:O},j),stretch:P,popupAlign:x,popupVisible:o,getPopupContainer:E,popupClassName:a()(g,(0,l.Z)({},"".concat(M,"-empty"),S)),popupStyle:F,getTriggerDOMNode:C,onPopupVisibleChange:Z}),c)}),_=n(87099);function H(e,t){var n,r=e.key;return("value"in e&&(n=e.value),null!=r)?r:void 0!==n?n:"rc-index-key-".concat(t)}function B(e,t){var n=e||{},r=n.label,o=n.value,a=n.options,i=n.groupLabel,c=r||(t?"children":"label");return{label:c,value:o||"value",options:a||"options",groupLabel:i||c}}function D(e){var t=(0,s.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,m.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var W=function(e,t,n){if(!t||!t.length)return null;var r=!1,o=function e(t,n){var o=(0,_.Z)(n),a=o[0],i=o.slice(1);if(!a)return[t];var l=t.split(a);return r=r||l.length>1,l.reduce(function(t,n){return[].concat((0,c.Z)(t),(0,c.Z)(e(n,i)))},[]).filter(Boolean)}(e,t);return r?void 0!==n?o.slice(0,n):o:null},V=r.createContext(null),q=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],G=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],X=function(e){return"tags"===e||"multiple"===e},U=r.forwardRef(function(e,t){var n,o,m,S,C,Z,O,k,M=e.id,j=e.prefixCls,I=e.className,R=e.showSearch,N=e.tagRender,P=e.direction,T=e.omitDomProps,A=e.displayValues,L=e.onDisplayValuesChange,_=e.emptyOptions,H=e.notFoundContent,B=void 0===H?"Not Found":H,D=e.onClear,U=e.mode,$=e.disabled,K=e.loading,Y=e.getInputElement,Q=e.getRawInputElement,J=e.open,ee=e.defaultOpen,et=e.onDropdownVisibleChange,en=e.activeValue,er=e.onActiveValueChange,eo=e.activeDescendantId,ea=e.searchValue,ei=e.autoClearSearchValue,ec=e.onSearch,el=e.onSearchSplit,es=e.tokenSeparators,eu=e.allowClear,ed=e.suffixIcon,ef=e.clearIcon,ep=e.OptionList,em=e.animation,eg=e.transitionName,eh=e.dropdownStyle,ev=e.dropdownClassName,eb=e.dropdownMatchSelectWidth,ey=e.dropdownRender,ew=e.dropdownAlign,ex=e.placement,eE=e.builtinPlacements,eS=e.getPopupContainer,eC=e.showAction,eZ=void 0===eC?[]:eC,eO=e.onFocus,ek=e.onBlur,eM=e.onKeyUp,ej=e.onKeyDown,eI=e.onMouseDown,eR=(0,d.Z)(e,q),eN=X(U),eP=(void 0!==R?R:eN)||"combobox"===U,eF=(0,s.Z)({},eR);G.forEach(function(e){delete eF[e]}),null==T||T.forEach(function(e){delete eF[e]});var eT=r.useState(!1),eA=(0,u.Z)(eT,2),eL=eA[0],ez=eA[1];r.useEffect(function(){ez((0,h.Z)())},[]);var e_=r.useRef(null),eH=r.useRef(null),eB=r.useRef(null),eD=r.useRef(null),eW=r.useRef(null),eV=r.useRef(!1),eq=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=r.useState(!1),n=(0,u.Z)(t,2),o=n[0],a=n[1],i=r.useRef(null),c=function(){window.clearTimeout(i.current)};return r.useEffect(function(){return c},[]),[o,function(t,n){c(),i.current=window.setTimeout(function(){a(t),n&&n()},e)},c]}(),eG=(0,u.Z)(eq,3),eX=eG[0],eU=eG[1],e$=eG[2];r.useImperativeHandle(t,function(){var e,t;return{focus:null===(e=eD.current)||void 0===e?void 0:e.focus,blur:null===(t=eD.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=eW.current)||void 0===t?void 0:t.scrollTo(e)}}});var eK=r.useMemo(function(){if("combobox"!==U)return ea;var e,t=null===(e=A[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""},[ea,U,A]),eY="combobox"===U&&"function"==typeof Y&&Y()||null,eQ="function"==typeof Q&&Q(),eJ=(0,b.x1)(eH,null==eQ||null===(S=eQ.props)||void 0===S?void 0:S.ref),e0=r.useState(!1),e1=(0,u.Z)(e0,2),e2=e1[0],e6=e1[1];(0,g.Z)(function(){e6(!0)},[]);var e5=(0,p.Z)(!1,{defaultValue:ee,value:J}),e4=(0,u.Z)(e5,2),e3=e4[0],e8=e4[1],e9=!!e2&&e3,e7=!B&&_;($||e7&&e9&&"combobox"===U)&&(e9=!1);var te=!e7&&e9,tt=r.useCallback(function(e){var t=void 0!==e?e:!e9;$||(e8(t),e9!==t&&(null==et||et(t)))},[$,e9,e8,et]),tn=r.useMemo(function(){return(es||[]).some(function(e){return["\n","\r\n"].includes(e)})},[es]),tr=r.useContext(V)||{},to=tr.maxCount,ta=tr.rawValues,ti=function(e,t,n){if(!((null==ta?void 0:ta.size)>=to)){var r=!0,o=e;null==er||er(null);var a=W(e,es,to&&to-ta.size),i=n?null:a;return"combobox"!==U&&i&&(o="",null==el||el(i),tt(!1),r=!1),ec&&eK!==o&&ec(o,{source:t?"typing":"effect"}),r}};r.useEffect(function(){e9||eN||"combobox"===U||ti("",!1,!1)},[e9]),r.useEffect(function(){e3&&$&&e8(!1),$&&!eV.current&&eU(!1)},[$]);var tc=E(),tl=(0,u.Z)(tc,2),ts=tl[0],tu=tl[1],td=r.useRef(!1),tf=[];r.useEffect(function(){return function(){tf.forEach(function(e){return clearTimeout(e)}),tf.splice(0,tf.length)}},[]);var tp=r.useState({}),tm=(0,u.Z)(tp,2)[1];eQ&&(Z=function(e){tt(e)}),n=function(){var e;return[e_.current,null===(e=eB.current)||void 0===e?void 0:e.getPopupElement()]},o=!!eQ,(m=r.useRef(null)).current={open:te,triggerOpen:tt,customizedTrigger:o},r.useEffect(function(){function e(e){if(null===(t=m.current)||void 0===t||!t.customizedTrigger){var t,r=e.target;r.shadowRoot&&e.composed&&(r=e.composedPath()[0]||r),m.current.open&&n().filter(function(e){return e}).every(function(e){return!e.contains(r)&&e!==r})&&m.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}},[]);var tg=r.useMemo(function(){return(0,s.Z)((0,s.Z)({},e),{},{notFoundContent:B,open:e9,triggerOpen:te,id:M,showSearch:eP,multiple:eN,toggleOpen:tt})},[e,B,te,e9,M,eP,eN,tt]),th=!!ed||K;th&&(O=r.createElement(y,{className:a()("".concat(j,"-arrow"),(0,l.Z)({},"".concat(j,"-arrow-loading"),K)),customizeIcon:ed,customizeIconProps:{loading:K,searchValue:eK,open:e9,focused:eX,showSearch:eP}}));var tv=w(j,function(){var e;null==D||D(),null===(e=eD.current)||void 0===e||e.focus(),L([],{type:"clear",values:A}),ti("",!1,!1)},A,eu,ef,$,eK,U),tb=tv.allowClear,ty=tv.clearIcon,tw=r.createElement(ep,{ref:eW}),tx=a()(j,I,(C={},(0,l.Z)(C,"".concat(j,"-focused"),eX),(0,l.Z)(C,"".concat(j,"-multiple"),eN),(0,l.Z)(C,"".concat(j,"-single"),!eN),(0,l.Z)(C,"".concat(j,"-allow-clear"),eu),(0,l.Z)(C,"".concat(j,"-show-arrow"),th),(0,l.Z)(C,"".concat(j,"-disabled"),$),(0,l.Z)(C,"".concat(j,"-loading"),K),(0,l.Z)(C,"".concat(j,"-open"),e9),(0,l.Z)(C,"".concat(j,"-customize-input"),eY),(0,l.Z)(C,"".concat(j,"-show-search"),eP),C)),tE=r.createElement(z,{ref:eB,disabled:$,prefixCls:j,visible:te,popupElement:tw,animation:em,transitionName:eg,dropdownStyle:eh,dropdownClassName:ev,direction:P,dropdownMatchSelectWidth:eb,dropdownRender:ey,dropdownAlign:ew,placement:ex,builtinPlacements:eE,getPopupContainer:eS,empty:_,getTriggerDOMNode:function(){return eH.current},onPopupVisibleChange:Z,onPopupMouseEnter:function(){tm({})}},eQ?r.cloneElement(eQ,{ref:eJ}):r.createElement(F,(0,i.Z)({},e,{domRef:eH,prefixCls:j,inputElement:eY,ref:eD,id:M,showSearch:eP,autoClearSearchValue:ei,mode:U,activeDescendantId:eo,tagRender:N,values:A,open:e9,onToggleOpen:tt,activeValue:en,searchValue:eK,onSearch:ti,onSearchSubmit:function(e){e&&e.trim()&&ec(e,{source:"submit"})},onRemove:function(e){L(A.filter(function(t){return t!==e}),{type:"remove",values:[e]})},tokenWithEnter:tn})));return k=eQ?tE:r.createElement("div",(0,i.Z)({className:tx},eF,{ref:e_,onMouseDown:function(e){var t,n=e.target,r=null===(t=eB.current)||void 0===t?void 0:t.getPopupElement();if(r&&r.contains(n)){var o=setTimeout(function(){var e,t=tf.indexOf(o);-1!==t&&tf.splice(t,1),e$(),eL||r.contains(document.activeElement)||null===(e=eD.current)||void 0===e||e.focus()});tf.push(o)}for(var a=arguments.length,i=Array(a>1?a-1:0),c=1;c=0;i-=1){var l=o[i];if(!l.disabled){o.splice(i,1),a=l;break}}a&&L(o,{type:"remove",values:[a]})}for(var s=arguments.length,u=Array(s>1?s-1:0),d=1;d1?n-1:0),o=1;o=C},[p,C,null==I?void 0:I.size]),B=function(e){e.preventDefault()},D=function(e){var t;null===(t=_.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},W=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=z.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];U(e);var n={source:t?"keyboard":"mouse"},r=z[e];if(!r){O(null,-1,n);return}O(r.value,e,n)};(0,r.useEffect)(function(){$(!1!==k?W(0):-1)},[z.length,g]);var K=r.useCallback(function(e){return I.has(e)&&"combobox"!==m},[m,(0,c.Z)(I).toString(),I.size]);(0,r.useEffect)(function(){var e,t=setTimeout(function(){if(!p&&f&&1===I.size){var e=Array.from(I)[0],t=z.findIndex(function(t){return t.data.value===e});-1!==t&&($(t),D(t))}});return f&&(null===(e=_.current)||void 0===e||e.scrollTo(void 0)),function(){return clearTimeout(t)}},[f,g]);var en=function(e){void 0!==e&&M(e,{selected:!I.has(e)}),p||h(!1)};if(r.useImperativeHandle(t,function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case v.Z.N:case v.Z.P:case v.Z.UP:case v.Z.DOWN:var r=0;if(t===v.Z.UP?r=-1:t===v.Z.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===v.Z.N?r=1:t===v.Z.P&&(r=-1)),0!==r){var o=W(X+r,r);D(o),$(o,!0)}break;case v.Z.ENTER:var a,i=z[X];!i||null!=i&&null!==(a=i.data)&&void 0!==a&&a.disabled||H?en(void 0):en(i.value),f&&e.preventDefault();break;case v.Z.ESC:h(!1),f&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){D(e)}}}),0===z.length)return r.createElement("div",{role:"listbox",id:"".concat(s,"_list"),className:"".concat(L,"-empty"),onMouseDown:B},b);var er=Object.keys(R).map(function(e){return R[e]}),eo=function(e){return e.label};function ea(e,t){return{role:e.group?"presentation":"option",id:"".concat(s,"_list_").concat(t)}}var ei=function(e){var t=z[e];if(!t)return null;var n=t.data||{},o=n.value,a=t.group,c=(0,S.Z)(n,!0),l=eo(t);return t?r.createElement("div",(0,i.Z)({"aria-label":"string"!=typeof l||a?null:l},c,{key:e},ea(t,e),{"aria-selected":K(o)}),o):null},ec={role:"listbox",id:"".concat(s,"_list")};return r.createElement(r.Fragment,null,N&&r.createElement("div",(0,i.Z)({},ec,{style:{height:0,width:0,overflow:"hidden"}}),ei(X-1),ei(X),ei(X+1)),r.createElement(J.Z,{itemKey:"key",ref:_,data:z,height:F,itemHeight:T,fullHeight:!1,onMouseDown:B,onScroll:w,virtual:N,direction:P,innerProps:N?null:ec},function(e,t){var n=e.group,o=e.groupOption,c=e.data,s=e.label,u=e.value,f=c.key;if(n){var p,m,g=null!==(m=c.title)&&void 0!==m?m:et(s)?s.toString():void 0;return r.createElement("div",{className:a()(L,"".concat(L,"-group")),title:g},void 0!==s?s:f)}var h=c.disabled,v=c.title,b=(c.children,c.style),w=c.className,x=(0,d.Z)(c,ee),E=(0,Q.Z)(x,er),C=K(u),Z=h||!C&&H,O="".concat(L,"-option"),k=a()(L,O,w,(p={},(0,l.Z)(p,"".concat(O,"-grouped"),o),(0,l.Z)(p,"".concat(O,"-active"),X===t&&!Z),(0,l.Z)(p,"".concat(O,"-disabled"),Z),(0,l.Z)(p,"".concat(O,"-selected"),C),p)),M=eo(e),I=!j||"function"==typeof j||C,R="number"==typeof M?M:M||u,P=et(R)?R.toString():void 0;return void 0!==v&&(P=v),r.createElement("div",(0,i.Z)({},(0,S.Z)(E),N?{}:ea(e,t),{"aria-selected":C,className:k,title:P,onMouseMove:function(){X===t||Z||$(t)},onClick:function(){Z||en(u)},style:b}),r.createElement("div",{className:"".concat(O,"-content")},"function"==typeof A?A(e,{index:t}):R),r.isValidElement(j)||C,I&&r.createElement(y,{className:"".concat(L,"-option-state"),customizeIcon:j,customizeIconProps:{value:u,disabled:Z,isSelected:C}},C?"✓":null))}))}),er=function(e,t){var n=r.useRef({values:new Map,options:new Map});return[r.useMemo(function(){var r=n.current,o=r.values,a=r.options,i=e.map(function(e){if(void 0===e.label){var t;return(0,s.Z)((0,s.Z)({},e),{},{label:null===(t=o.get(e.value))||void 0===t?void 0:t.label})}return e}),c=new Map,l=new Map;return i.forEach(function(e){c.set(e.value,e),l.set(e.value,t.get(e.value)||a.get(e.value))}),n.current.values=c,n.current.options=l,i},[e,t]),r.useCallback(function(e){return t.get(e)||n.current.options.get(e)},[t])]};function eo(e,t){return O(e).join("").toUpperCase().includes(t)}var ea=n(94981),ei=0,ec=(0,ea.Z)(),el=n(45287),es=["children","value"],eu=["children"];function ed(e){var t=r.useRef();return t.current=e,r.useCallback(function(){return t.current.apply(t,arguments)},[])}var ef=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange","maxCount"],ep=["inputValue"],em=r.forwardRef(function(e,t){var n,o,a,m,g,h=e.id,v=e.mode,b=e.prefixCls,y=e.backfill,w=e.fieldNames,x=e.inputValue,E=e.searchValue,S=e.onSearch,C=e.autoClearSearchValue,Z=void 0===C||C,k=e.onSelect,M=e.onDeselect,j=e.dropdownMatchSelectWidth,I=void 0===j||j,R=e.filterOption,N=e.filterSort,P=e.optionFilterProp,F=e.optionLabelProp,T=e.options,A=e.optionRender,L=e.children,z=e.defaultActiveFirstOption,_=e.menuItemSelectedIcon,W=e.virtual,q=e.direction,G=e.listHeight,$=void 0===G?200:G,K=e.listItemHeight,Y=void 0===K?20:K,Q=e.value,J=e.defaultValue,ee=e.labelInValue,et=e.onChange,ea=e.maxCount,em=(0,d.Z)(e,ef),eg=(n=r.useState(),a=(o=(0,u.Z)(n,2))[0],m=o[1],r.useEffect(function(){var e;m("rc_select_".concat((ec?(e=ei,ei+=1):e="TEST_OR_SSR",e)))},[]),h||a),eh=X(v),ev=!!(!T&&L),eb=r.useMemo(function(){return(void 0!==R||"combobox"!==v)&&R},[R,v]),ey=r.useMemo(function(){return B(w,ev)},[JSON.stringify(w),ev]),ew=(0,p.Z)("",{value:void 0!==E?E:x,postState:function(e){return e||""}}),ex=(0,u.Z)(ew,2),eE=ex[0],eS=ex[1],eC=r.useMemo(function(){var e=T;T||(e=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,el.Z)(t).map(function(t,o){if(!r.isValidElement(t)||!t.type)return null;var a,i,c,l,u,f=t.type.isSelectOptGroup,p=t.key,m=t.props,g=m.children,h=(0,d.Z)(m,eu);return n||!f?(a=t.key,c=(i=t.props).children,l=i.value,u=(0,d.Z)(i,es),(0,s.Z)({key:a,value:void 0!==l?l:a,children:c},u)):(0,s.Z)((0,s.Z)({key:"__RC_SELECT_GRP__".concat(null===p?o:p,"__"),label:p},h),{},{options:e(g)})}).filter(function(e){return e})}(L));var t=new Map,n=new Map,o=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(r){for(var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,o=[],a=B(n,!1),i=a.label,c=a.value,l=a.options,s=a.groupLabel;return!function e(t,n){Array.isArray(t)&&t.forEach(function(t){if(!n&&l in t){var a=t[s];void 0===a&&r&&(a=t.label),o.push({key:H(t,o.length),group:!0,data:t,label:a}),e(t[l],!0)}else{var u=t[c];o.push({key:H(t,o.length),groupOption:n,data:t,label:t[i],value:u})}})}(e,!1),o}(eD,{fieldNames:ey,childrenAsData:ev})},[eD,ey,ev]),eV=function(e){var t=eM(e);if(eN(t),et&&(t.length!==eT.length||t.some(function(e,t){var n;return(null===(n=eT[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)}))){var n=ee?t:t.map(function(e){return e.value}),r=t.map(function(e){return D(eA(e.value))});et(eh?n:n[0],eh?r:r[0])}},eq=r.useState(null),eG=(0,u.Z)(eq,2),eX=eG[0],eU=eG[1],e$=r.useState(0),eK=(0,u.Z)(e$,2),eY=eK[0],eQ=eK[1],eJ=void 0!==z?z:"combobox"!==v,e0=r.useCallback(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.source;eQ(t),y&&"combobox"===v&&null!==e&&"keyboard"===(void 0===r?"keyboard":r)&&eU(String(e))},[y,v]),e1=function(e,t,n){var r=function(){var t,n=eA(e);return[ee?{label:null==n?void 0:n[ey.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,D(n)]};if(t&&k){var o=r(),a=(0,u.Z)(o,2);k(a[0],a[1])}else if(!t&&M&&"clear"!==n){var i=r(),c=(0,u.Z)(i,2);M(c[0],c[1])}},e2=ed(function(e,t){var n=!eh||t.selected;eV(n?eh?[].concat((0,c.Z)(eT),[e]):[e]:eT.filter(function(t){return t.value!==e})),e1(e,n),"combobox"===v?eU(""):(!X||Z)&&(eS(""),eU(""))}),e6=r.useMemo(function(){var e=!1!==W&&!1!==I;return(0,s.Z)((0,s.Z)({},eC),{},{flattenOptions:eW,onActiveValue:e0,defaultActiveFirstOption:eJ,onSelect:e2,menuItemSelectedIcon:_,rawValues:ez,fieldNames:ey,virtual:e,direction:q,listHeight:$,listItemHeight:Y,childrenAsData:ev,maxCount:ea,optionRender:A})},[ea,eC,eW,e0,eJ,e2,_,ez,ey,W,I,q,$,Y,ev,A]);return r.createElement(V.Provider,{value:e6},r.createElement(U,(0,i.Z)({},em,{id:eg,prefixCls:void 0===b?"rc-select":b,ref:t,omitDomProps:ep,mode:v,displayValues:eL,onDisplayValuesChange:function(e,t){eV(e);var n=t.type,r=t.values;("remove"===n||"clear"===n)&&r.forEach(function(e){e1(e.value,!1,n)})},direction:q,searchValue:eE,onSearch:function(e,t){if(eS(e),eU(null),"submit"===t.source){var n=(e||"").trim();n&&(eV(Array.from(new Set([].concat((0,c.Z)(ez),[n])))),e1(n,!0),eS(""));return}"blur"!==t.source&&("combobox"===v&&eV(e),null==S||S(e))},autoClearSearchValue:Z,onSearchSplit:function(e){var t=e;"tags"!==v&&(t=e.map(function(e){var t=eO.get(e);return null==t?void 0:t.value}).filter(function(e){return void 0!==e}));var n=Array.from(new Set([].concat((0,c.Z)(ez),(0,c.Z)(t))));eV(n),n.forEach(function(e){e1(e,!0)})},dropdownMatchSelectWidth:I,OptionList:en,emptyOptions:!eW.length,activeValue:eX,activeDescendantId:"".concat(eg,"_list_").concat(eY)})))});em.Option=K,em.OptGroup=$;var eg=n(62236),eh=n(68710),ev=n(93942),eb=n(12757),ey=n(71744),ew=n(91086),ex=n(86586),eE=n(64024),eS=n(33759),eC=n(39109),eZ=n(56250),eO=n(65658),ek=n(29961);let eM=e=>{let t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"scroll"===e?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}};var ej=n(12918),eI=n(17691),eR=n(80669),eN=n(3104),eP=n(18544),eF=n(29382);let eT=e=>{let{optionHeight:t,optionFontSize:n,optionLineHeight:r,optionPadding:o}=e;return{position:"relative",display:"block",minHeight:t,padding:o,color:e.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}};var eA=e=>{let{antCls:t,componentCls:n}=e,r="".concat(n,"-item"),o="&".concat(t,"-slide-up-enter").concat(t,"-slide-up-enter-active"),a="&".concat(t,"-slide-up-appear").concat(t,"-slide-up-appear-active"),i="&".concat(t,"-slide-up-leave").concat(t,"-slide-up-leave-active"),c="".concat(n,"-dropdown-placement-");return[{["".concat(n,"-dropdown")]:Object.assign(Object.assign({},(0,ej.Wf)(e)),{position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,["\n ".concat(o).concat(c,"bottomLeft,\n ").concat(a).concat(c,"bottomLeft\n ")]:{animationName:eP.fJ},["\n ".concat(o).concat(c,"topLeft,\n ").concat(a).concat(c,"topLeft,\n ").concat(o).concat(c,"topRight,\n ").concat(a).concat(c,"topRight\n ")]:{animationName:eP.Qt},["".concat(i).concat(c,"bottomLeft")]:{animationName:eP.Uw},["\n ".concat(i).concat(c,"topLeft,\n ").concat(i).concat(c,"topRight\n ")]:{animationName:eP.ly},"&-hidden":{display:"none"},["".concat(r)]:Object.assign(Object.assign({},eT(e)),{cursor:"pointer",transition:"background ".concat(e.motionDurationSlow," ease"),borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},ej.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},["&-active:not(".concat(r,"-option-disabled)")]:{backgroundColor:e.optionActiveBg},["&-selected:not(".concat(r,"-option-disabled)")]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,["".concat(r,"-option-state")]:{color:e.colorPrimary},["&:has(+ ".concat(r,"-option-selected:not(").concat(r,"-option-disabled))")]:{borderEndStartRadius:0,borderEndEndRadius:0,["& + ".concat(r,"-option-selected:not(").concat(r,"-option-disabled)")]:{borderStartStartRadius:0,borderStartEndRadius:0}}},"&-disabled":{["&".concat(r,"-option-selected")]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}}}),"&-rtl":{direction:"rtl"}})},(0,eP.oN)(e,"slide-up"),(0,eP.oN)(e,"slide-down"),(0,eF.Fm)(e,"move-up"),(0,eF.Fm)(e,"move-down")]},eL=n(352);let ez=e=>{let{multipleSelectItemHeight:t,selectHeight:n,lineWidth:r}=e;return e.calc(n).sub(t).div(2).sub(r).equal()};function e_(e,t){let{componentCls:n,iconCls:r}=e,o="".concat(n,"-selection-overflow"),a=e.multipleSelectItemHeight,i=ez(e),c=t?"".concat(n,"-").concat(t):"";return{["".concat(n,"-multiple").concat(c)]:{fontSize:e.fontSize,[o]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},["".concat(n,"-selector")]:{display:"flex",flexWrap:"wrap",alignItems:"center",height:"100%",paddingInline:e.calc(2).mul(2).equal(),paddingBlock:e.calc(i).sub(2).equal(),borderRadius:e.borderRadius,["".concat(n,"-show-search&")]:{cursor:"text"},["".concat(n,"-disabled&")]:{background:e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:"".concat((0,eL.bf)(2)," 0"),lineHeight:(0,eL.bf)(a),visibility:"hidden",content:'"\\a0"'}},["\n &".concat(n,"-show-arrow ").concat(n,"-selector,\n &").concat(n,"-allow-clear ").concat(n,"-selector\n ")]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()},["".concat(n,"-selection-item")]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:a,marginTop:2,marginBottom:2,lineHeight:(0,eL.bf)(e.calc(a).sub(e.calc(e.lineWidth).mul(2)).equal()),borderRadius:e.borderRadiusSM,cursor:"default",transition:"font-size ".concat(e.motionDurationSlow,", line-height ").concat(e.motionDurationSlow,", height ").concat(e.motionDurationSlow),marginInlineEnd:e.calc(2).mul(2).equal(),paddingInlineStart:e.paddingXS,paddingInlineEnd:e.calc(e.paddingXS).div(2).equal(),["".concat(n,"-disabled&")]:{color:e.multipleItemColorDisabled,borderColor:e.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:e.calc(e.paddingXS).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,ej.Ro)()),{display:"inline-flex",alignItems:"center",color:e.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",["> ".concat(r)]:{verticalAlign:"-0.2em"},"&:hover":{color:e.colorIconHover}})},["".concat(o,"-item + ").concat(o,"-item")]:{["".concat(n,"-selection-search")]:{marginInlineStart:0}},["".concat(o,"-item-suffix")]:{height:"100%"},["".concat(n,"-selection-search")]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(i).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:(0,eL.bf)(a),transition:"all ".concat(e.motionDurationSlow)},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},["".concat(n,"-selection-placeholder")]:{position:"absolute",top:"50%",insetInlineStart:e.inputPaddingHorizontalBase,insetInlineEnd:e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:"all ".concat(e.motionDurationSlow)}}}}var eH=e=>{let{componentCls:t}=e,n=(0,eN.TS)(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.controlHeightXS,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),r=(0,eN.TS)(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[e_(e),e_(n,"sm"),{["".concat(t,"-multiple").concat(t,"-sm")]:{["".concat(t,"-selection-placeholder")]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},["".concat(t,"-selection-search")]:{marginInlineStart:2}}},e_(r,"lg")]};function eB(e,t){let{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:o}=e,a=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),i=t?"".concat(n,"-").concat(t):"";return{["".concat(n,"-single").concat(i)]:{fontSize:e.fontSize,height:e.controlHeight,["".concat(n,"-selector")]:Object.assign(Object.assign({},(0,ej.Wf)(e,!0)),{display:"flex",borderRadius:o,["".concat(n,"-selection-search")]:{position:"absolute",top:0,insetInlineStart:r,insetInlineEnd:r,bottom:0,"&-input":{width:"100%",WebkitAppearance:"textfield"}},["\n ".concat(n,"-selection-item,\n ").concat(n,"-selection-placeholder\n ")]:{padding:0,lineHeight:(0,eL.bf)(a),transition:"all ".concat(e.motionDurationSlow,", visibility 0s"),alignSelf:"center"},["".concat(n,"-selection-placeholder")]:{transition:"none",pointerEvents:"none"},[["&:after","".concat(n,"-selection-item:empty:after"),"".concat(n,"-selection-placeholder:empty:after")].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),["\n &".concat(n,"-show-arrow ").concat(n,"-selection-item,\n &").concat(n,"-show-arrow ").concat(n,"-selection-placeholder\n ")]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},["&".concat(n,"-open ").concat(n,"-selection-item")]:{color:e.colorTextPlaceholder},["&:not(".concat(n,"-customize-input)")]:{["".concat(n,"-selector")]:{width:"100%",height:"100%",padding:"0 ".concat((0,eL.bf)(r)),["".concat(n,"-selection-search-input")]:{height:a},"&:after":{lineHeight:(0,eL.bf)(a)}}},["&".concat(n,"-customize-input")]:{["".concat(n,"-selector")]:{"&:after":{display:"none"},["".concat(n,"-selection-search")]:{position:"static",width:"100%"},["".concat(n,"-selection-placeholder")]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:"0 ".concat((0,eL.bf)(r)),"&:after":{display:"none"}}}}}}}let eD=(e,t)=>{let{componentCls:n,antCls:r,controlOutlineWidth:o}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(t.borderColor),background:e.selectorBg},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(r,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{borderColor:t.hoverBorderHover},["".concat(n,"-focused& ").concat(n,"-selector")]:{borderColor:t.activeBorderColor,boxShadow:"0 0 0 ".concat((0,eL.bf)(o)," ").concat(t.activeShadowColor),outline:0}}}},eW=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},eD(e,t))}),eV=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},eD(e,{borderColor:e.colorBorder,hoverBorderHover:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadowColor:e.controlOutline})),eW(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeShadowColor:e.colorErrorOutline})),eW(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeShadowColor:e.colorWarningOutline})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)}})}),eq=(e,t)=>{let{componentCls:n,antCls:r}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{background:t.bg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),color:t.color},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(r,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{background:t.hoverBg},["".concat(n,"-focused& ").concat(n,"-selector")]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},eG=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},eq(e,t))}),eX=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},eq(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.colorPrimary,color:e.colorText})),eG(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),eG(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.colorBgContainer,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)}})}),eU=e=>({"&-borderless":{["".concat(e.componentCls,"-selector")]:{background:"transparent",borderColor:"transparent"},["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)}}});var e$=e=>({[e.componentCls]:Object.assign(Object.assign(Object.assign({},eV(e)),eX(e)),eU(e))});let eK=e=>{let{componentCls:t}=e;return{position:"relative",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut),input:{cursor:"pointer"},["".concat(t,"-show-search&")]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},["".concat(t,"-disabled&")]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},eY=e=>{let{componentCls:t}=e;return{["".concat(t,"-selection-search-input")]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},eQ=e=>{let{antCls:t,componentCls:n,inputPaddingHorizontalBase:r,iconCls:o}=e;return{[n]:Object.assign(Object.assign({},(0,ej.Wf)(e)),{position:"relative",display:"inline-block",cursor:"pointer",["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:Object.assign(Object.assign({},eK(e)),eY(e)),["".concat(n,"-selection-item")]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},ej.vS),{["> ".concat(t,"-typography")]:{display:"inline"}}),["".concat(n,"-selection-placeholder")]:Object.assign(Object.assign({},ej.vS),{flex:1,color:e.colorTextPlaceholder,pointerEvents:"none"}),["".concat(n,"-arrow")]:Object.assign(Object.assign({},(0,ej.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:"opacity ".concat(e.motionDurationSlow," ease"),[o]:{verticalAlign:"top",transition:"transform ".concat(e.motionDurationSlow),"> svg":{verticalAlign:"top"},["&:not(".concat(n,"-suffix)")]:{pointerEvents:"auto"}},["".concat(n,"-disabled &")]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),["".concat(n,"-clear")]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:"color ".concat(e.motionDurationMid," ease, opacity ").concat(e.motionDurationSlow," ease"),textRendering:"auto","&:before":{display:"block"},"&:hover":{color:e.colorTextTertiary}},"&:hover":{["".concat(n,"-clear")]:{opacity:1},["".concat(n,"-arrow:not(:last-child)")]:{opacity:0}}}),["".concat(n,"-has-feedback")]:{["".concat(n,"-clear")]:{insetInlineEnd:e.calc(r).add(e.fontSize).add(e.paddingXS).equal()}}}},eJ=e=>{let{componentCls:t}=e;return[{[t]:{["&".concat(t,"-in-form-item")]:{width:"100%"}}},eQ(e),function(e){let{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[eB(e),eB((0,eN.TS)(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),"sm"),{["".concat(t,"-single").concat(t,"-sm")]:{["&:not(".concat(t,"-customize-input)")]:{["".concat(t,"-selection-search")]:{insetInlineStart:n,insetInlineEnd:n},["".concat(t,"-selector")]:{padding:"0 ".concat((0,eL.bf)(n))},["&".concat(t,"-show-arrow ").concat(t,"-selection-search")]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},["\n &".concat(t,"-show-arrow ").concat(t,"-selection-item,\n &").concat(t,"-show-arrow ").concat(t,"-selection-placeholder\n ")]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},eB((0,eN.TS)(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),"lg")]}(e),eH(e),eA(e),{["".concat(t,"-rtl")]:{direction:"rtl"}},(0,eI.c)(e,{borderElCls:"".concat(t,"-selector"),focusElCls:"".concat(t,"-focused")})]};var e0=(0,eR.I$)("Select",(e,t)=>{let{rootPrefixCls:n}=t,r=(0,eN.TS)(e,{rootPrefixCls:n,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(1).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[eJ(r),e$(r)]},e=>{let{fontSize:t,lineHeight:n,controlHeight:r,controlPaddingHorizontal:o,zIndexPopupBase:a,colorText:i,fontWeightStrong:c,controlItemBgActive:l,controlItemBgHover:s,colorBgContainer:u,colorFillSecondary:d,controlHeightLG:f,controlHeightSM:p,colorBgContainerDisabled:m,colorTextDisabled:g}=e;return{zIndexPopup:a+50,optionSelectedColor:i,optionSelectedFontWeight:c,optionSelectedBg:l,optionActiveBg:s,optionPadding:"".concat((r-t*n)/2,"px ").concat(o,"px"),optionFontSize:t,optionLineHeight:n,optionHeight:r,selectorBg:u,clearBg:u,singleItemHeightLG:f,multipleItemBg:d,multipleItemBorderColor:"transparent",multipleItemHeight:p,multipleItemHeightLG:r,multipleSelectorBgDisabled:m,multipleItemColorDisabled:g,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(1.25*e.fontSize)}},{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),e1=n(9738),e2=n(39725),e6=n(49638),e5=n(70464),e4=n(61935),e3=n(29436),e8=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let e9="SECRET_COMBOBOX_MODE_DO_NOT_USE",e7=r.forwardRef((e,t)=>{var n,o,i;let c;let{prefixCls:l,bordered:s,className:u,rootClassName:d,getPopupContainer:f,popupClassName:p,dropdownClassName:m,listHeight:g=256,placement:h,listItemHeight:v,size:b,disabled:y,notFoundContent:w,status:x,builtinPlacements:E,dropdownMatchSelectWidth:S,popupMatchSelectWidth:C,direction:Z,style:O,allowClear:k,variant:M,dropdownStyle:j,transitionName:I,tagRender:R,maxCount:N}=e,P=e8(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount"]),{getPopupContainer:F,getPrefixCls:T,renderEmpty:A,direction:L,virtual:z,popupMatchSelectWidth:_,popupOverflow:H,select:B}=r.useContext(ey.E_),[,D]=(0,ek.ZP)(),W=null!=v?v:null==D?void 0:D.controlHeight,V=T("select",l),q=T(),G=null!=Z?Z:L,{compactSize:X,compactItemClassnames:U}=(0,eO.ri)(V,G),[$,K]=(0,eZ.Z)(M,s),Y=(0,eE.Z)(V),[J,ee,et]=e0(V,Y),en=r.useMemo(()=>{let{mode:t}=e;return"combobox"===t?void 0:t===e9?"combobox":t},[e.mode]),er="multiple"===en||"tags"===en,eo=(o=e.suffixIcon,void 0!==(i=e.showArrow)?i:null!==o),ea=null!==(n=null!=C?C:S)&&void 0!==n?n:_,{status:ei,hasFeedback:ec,isFormItemInput:el,feedbackIcon:es}=r.useContext(eC.aM),eu=(0,eb.F)(ei,x);c=void 0!==w?w:"combobox"===en?null:(null==A?void 0:A("Select"))||r.createElement(ew.Z,{componentName:"Select"});let{suffixIcon:ed,itemIcon:ef,removeIcon:ep,clearIcon:ev}=function(e){let{suffixIcon:t,clearIcon:n,menuItemSelectedIcon:o,removeIcon:a,loading:i,multiple:c,hasFeedback:l,prefixCls:s,showSuffixIcon:u,feedbackIcon:d,showArrow:f,componentName:p}=e,m=null!=n?n:r.createElement(e2.Z,null),g=e=>null!==t||l||f?r.createElement(r.Fragment,null,!1!==u&&e,l&&d):null,h=null;if(void 0!==t)h=g(t);else if(i)h=g(r.createElement(e4.Z,{spin:!0}));else{let e="".concat(s,"-suffix");h=t=>{let{open:n,showSearch:o}=t;return n&&o?g(r.createElement(e3.Z,{className:e})):g(r.createElement(e5.Z,{className:e}))}}let v=null;return v=void 0!==o?o:c?r.createElement(e1.Z,null):null,{clearIcon:m,suffixIcon:h,itemIcon:v,removeIcon:void 0!==a?a:r.createElement(e6.Z,null)}}(Object.assign(Object.assign({},P),{multiple:er,hasFeedback:ec,feedbackIcon:es,showSuffixIcon:eo,prefixCls:V,componentName:"Select"})),ej=(0,Q.Z)(P,["suffixIcon","itemIcon"]),eI=a()(p||m,{["".concat(V,"-dropdown-").concat(G)]:"rtl"===G},d,et,Y,ee),eR=(0,eS.Z)(e=>{var t;return null!==(t=null!=b?b:X)&&void 0!==t?t:e}),eN=r.useContext(ex.Z),eP=a()({["".concat(V,"-lg")]:"large"===eR,["".concat(V,"-sm")]:"small"===eR,["".concat(V,"-rtl")]:"rtl"===G,["".concat(V,"-").concat($)]:K,["".concat(V,"-in-form-item")]:el},(0,eb.Z)(V,eu,ec),U,null==B?void 0:B.className,u,d,et,Y,ee),eF=r.useMemo(()=>void 0!==h?h:"rtl"===G?"bottomRight":"bottomLeft",[h,G]),[eT]=(0,eg.Cn)("SelectLike",null==j?void 0:j.zIndex);return J(r.createElement(em,Object.assign({ref:t,virtual:z,showSearch:null==B?void 0:B.showSearch},ej,{style:Object.assign(Object.assign({},null==B?void 0:B.style),O),dropdownMatchSelectWidth:ea,transitionName:(0,eh.m)(q,"slide-up",I),builtinPlacements:E||eM(H),listHeight:g,listItemHeight:W,mode:en,prefixCls:V,placement:eF,direction:G,suffixIcon:ed,menuItemSelectedIcon:ef,removeIcon:ep,allowClear:!0===k?{clearIcon:ev}:k,notFoundContent:c,className:eP,getPopupContainer:f||F,dropdownClassName:eI,disabled:null!=y?y:eN,dropdownStyle:Object.assign(Object.assign({},j),{zIndex:eT}),maxCount:er?N:void 0,tagRender:er?R:void 0})))}),te=(0,ev.Z)(e7);e7.SECRET_COMBOBOX_MODE_DO_NOT_USE=e9,e7.Option=K,e7.OptGroup=$,e7._InternalPanelDoNotUseOrYouWillBeFired=te;var tt=e7},65658:function(e,t,n){"use strict";n.d(t,{BR:function(){return p},ri:function(){return f}});var r=n(36760),o=n.n(r),a=n(45287),i=n(2265),c=n(71744),l=n(33759),s=n(4924),u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let d=i.createContext(null),f=(e,t)=>{let n=i.useContext(d),r=i.useMemo(()=>{if(!n)return"";let{compactDirection:r,isFirstItem:a,isLastItem:i}=n,c="vertical"===r?"-vertical-":"-";return o()("".concat(e,"-compact").concat(c,"item"),{["".concat(e,"-compact").concat(c,"first-item")]:a,["".concat(e,"-compact").concat(c,"last-item")]:i,["".concat(e,"-compact").concat(c,"item-rtl")]:"rtl"===t})},[e,t,n]);return{compactSize:null==n?void 0:n.compactSize,compactDirection:null==n?void 0:n.compactDirection,compactItemClassnames:r}},p=e=>{let{children:t}=e;return i.createElement(d.Provider,{value:null},t)},m=e=>{var{children:t}=e,n=u(e,["children"]);return i.createElement(d.Provider,{value:n},t)};t.ZP=e=>{let{getPrefixCls:t,direction:n}=i.useContext(c.E_),{size:r,direction:f,block:p,prefixCls:g,className:h,rootClassName:v,children:b}=e,y=u(e,["size","direction","block","prefixCls","className","rootClassName","children"]),w=(0,l.Z)(e=>null!=r?r:e),x=t("space-compact",g),[E,S]=(0,s.Z)(x),C=o()(x,S,{["".concat(x,"-rtl")]:"rtl"===n,["".concat(x,"-block")]:p,["".concat(x,"-vertical")]:"vertical"===f},h,v),Z=i.useContext(d),O=(0,a.Z)(b),k=i.useMemo(()=>O.map((e,t)=>{let n=e&&e.key||"".concat(x,"-item-").concat(t);return i.createElement(m,{key:n,compactSize:w,compactDirection:f,isFirstItem:0===t&&(!Z||(null==Z?void 0:Z.isFirstItem)),isLastItem:t===O.length-1&&(!Z||(null==Z?void 0:Z.isLastItem))},e)}),[r,O,Z]);return 0===O.length?null:E(i.createElement("div",Object.assign({className:C},y),k))}},4924:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(80669),o=n(3104),a=e=>{let{componentCls:t}=e;return{[t]:{"&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}};let i=e=>{let{componentCls:t}=e;return{[t]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},["".concat(t,"-item:empty")]:{display:"none"}}}},c=e=>{let{componentCls:t}=e;return{[t]:{"&-gap-row-small":{rowGap:e.spaceGapSmallSize},"&-gap-row-middle":{rowGap:e.spaceGapMiddleSize},"&-gap-row-large":{rowGap:e.spaceGapLargeSize},"&-gap-col-small":{columnGap:e.spaceGapSmallSize},"&-gap-col-middle":{columnGap:e.spaceGapMiddleSize},"&-gap-col-large":{columnGap:e.spaceGapLargeSize}}}};var l=(0,r.I$)("Space",e=>{let t=(0,o.TS)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[i(t),c(t),a(t)]},()=>({}),{resetStyle:!1})},17691:function(e,t,n){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{focus:!0},{componentCls:n}=e,r="".concat(n,"-compact");return{[r]:Object.assign(Object.assign({},function(e,t,n){let{focusElCls:r,focus:o,borderElCls:a}=n,i=a?"> *":"",c=["hover",o?"focus":null,"active"].filter(Boolean).map(e=>"&:".concat(e," ").concat(i)).join(",");return{["&-item:not(".concat(t,"-last-item)")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[c]:{zIndex:2}},r?{["&".concat(r)]:{zIndex:2}}:{}),{["&[disabled] ".concat(i)]:{zIndex:0}})}}(e,r,t)),function(e,t,n){let{borderElCls:r}=n,o=r?"> ".concat(r):"";return{["&-item:not(".concat(t,"-first-item):not(").concat(t,"-last-item) ").concat(o)]:{borderRadius:0},["&-item:not(".concat(t,"-last-item)").concat(t,"-first-item")]:{["& ".concat(o,", &").concat(e,"-sm ").concat(o,", &").concat(e,"-lg ").concat(o)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&-item:not(".concat(t,"-first-item)").concat(t,"-last-item")]:{["& ".concat(o,", &").concat(e,"-sm ").concat(o,", &").concat(e,"-lg ").concat(o)]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}(n,r,t))}}n.d(t,{c:function(){return r}})},12918:function(e,t,n){"use strict";n.d(t,{Lx:function(){return l},Qy:function(){return d},Ro:function(){return i},Wf:function(){return a},dF:function(){return c},du:function(){return s},oN:function(){return u},vS:function(){return o}});var r=n(352);let o={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}},i=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),c=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),l=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active,\n &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),s=(e,t)=>{let{fontFamily:n,fontSize:r}=e,o='[class^="'.concat(t,'"], [class*=" ').concat(t,'"]');return{[o]:{fontFamily:n,fontSize:r,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},u=e=>({outline:"".concat((0,r.bf)(e.lineWidthFocus)," solid ").concat(e.colorPrimaryBorder),outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),d=e=>({"&:focus-visible":Object.assign({},u(e))})},63074:function(e,t){"use strict";t.Z=e=>({[e.componentCls]:{["".concat(e.antCls,"-motion-collapse-legacy")]:{overflow:"hidden","&-active":{transition:"height ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut,",\n opacity ").concat(e.motionDurationMid," ").concat(e.motionEaseInOut," !important")}},["".concat(e.antCls,"-motion-collapse")]:{overflow:"hidden",transition:"height ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut,",\n opacity ").concat(e.motionDurationMid," ").concat(e.motionEaseInOut," !important")}}})},37133:function(e,t,n){"use strict";n.d(t,{R:function(){return a}});let r=e=>({animationDuration:e,animationFillMode:"both"}),o=e=>({animationDuration:e,animationFillMode:"both"}),a=function(e,t,n,a){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=i?"&":"";return{["\n ".concat(c).concat(e,"-enter,\n ").concat(c).concat(e,"-appear\n ")]:Object.assign(Object.assign({},r(a)),{animationPlayState:"paused"}),["".concat(c).concat(e,"-leave")]:Object.assign(Object.assign({},o(a)),{animationPlayState:"paused"}),["\n ".concat(c).concat(e,"-enter").concat(e,"-enter-active,\n ").concat(c).concat(e,"-appear").concat(e,"-appear-active\n ")]:{animationName:t,animationPlayState:"running"},["".concat(c).concat(e,"-leave").concat(e,"-leave-active")]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}}},29382:function(e,t,n){"use strict";n.d(t,{Fm:function(){return f}});var r=n(352),o=n(37133);let a=new r.E4("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),i=new r.E4("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),c=new r.E4("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),l=new r.E4("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),s=new r.E4("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),u=new r.E4("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),d={"move-up":{inKeyframes:new r.E4("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),outKeyframes:new r.E4("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}})},"move-down":{inKeyframes:a,outKeyframes:i},"move-left":{inKeyframes:c,outKeyframes:l},"move-right":{inKeyframes:s,outKeyframes:u}},f=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:a,outKeyframes:i}=d[t];return[(0,o.R)(r,a,i,e.motionDurationMid),{["\n ".concat(r,"-enter,\n ").concat(r,"-appear\n ")]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},["".concat(r,"-leave")]:{animationTimingFunction:e.motionEaseInOutCirc}}]}},18544:function(e,t,n){"use strict";n.d(t,{Qt:function(){return c},Uw:function(){return i},fJ:function(){return a},ly:function(){return l},oN:function(){return d}});var r=n(352),o=n(37133);let a=new r.E4("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),i=new r.E4("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),c=new r.E4("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),l=new r.E4("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),s=new r.E4("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),u={"slide-up":{inKeyframes:a,outKeyframes:i},"slide-down":{inKeyframes:c,outKeyframes:l},"slide-left":{inKeyframes:s,outKeyframes:new r.E4("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}})},"slide-right":{inKeyframes:new r.E4("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),outKeyframes:new r.E4("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}})}},d=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:a,outKeyframes:i}=u[t];return[(0,o.R)(r,a,i,e.motionDurationMid),{["\n ".concat(r,"-enter,\n ").concat(r,"-appear\n ")]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},["".concat(r,"-leave")]:{animationTimingFunction:e.motionEaseInQuint}}]}},691:function(e,t,n){"use strict";n.d(t,{_y:function(){return g},kr:function(){return a}});var r=n(352),o=n(37133);let a=new r.E4("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),i=new r.E4("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),c=new r.E4("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),l=new r.E4("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),s=new r.E4("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),u=new r.E4("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),d=new r.E4("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),f=new r.E4("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),p=new r.E4("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),m={zoom:{inKeyframes:a,outKeyframes:i},"zoom-big":{inKeyframes:c,outKeyframes:l},"zoom-big-fast":{inKeyframes:c,outKeyframes:l},"zoom-left":{inKeyframes:d,outKeyframes:f},"zoom-right":{inKeyframes:p,outKeyframes:new r.E4("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}})},"zoom-up":{inKeyframes:s,outKeyframes:u},"zoom-down":{inKeyframes:new r.E4("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),outKeyframes:new r.E4("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}})}},g=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:a,outKeyframes:i}=m[t];return[(0,o.R)(r,a,i,"zoom-big-fast"===t?e.motionDurationFast:e.motionDurationMid),{["\n ".concat(r,"-enter,\n ").concat(r,"-appear\n ")]:{transform:"scale(0)",opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:"none"}},["".concat(r,"-leave")]:{animationTimingFunction:e.motionEaseInOutCirc}}]}},88260:function(e,t,n){"use strict";n.d(t,{ZP:function(){return i},qN:function(){return o},wZ:function(){return a}});var r=n(34442);let o=8;function a(e){let{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?o:r}}function i(e,t,n){var o,a,i,c,l,s,u,d;let{componentCls:f,boxShadowPopoverArrow:p,arrowOffsetVertical:m,arrowOffsetHorizontal:g}=e,{arrowDistance:h=0,arrowPlacement:v={left:!0,right:!0,top:!0,bottom:!0}}=n||{};return{[f]:Object.assign(Object.assign(Object.assign(Object.assign({["".concat(f,"-arrow")]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,r.W)(e,t,p)),{"&:before":{background:t}})]},(o=!!v.top,a={[["&-placement-top > ".concat(f,"-arrow"),"&-placement-topLeft > ".concat(f,"-arrow"),"&-placement-topRight > ".concat(f,"-arrow")].join(",")]:{bottom:h,transform:"translateY(100%) rotate(180deg)"},["&-placement-top > ".concat(f,"-arrow")]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},["&-placement-topLeft > ".concat(f,"-arrow")]:{left:{_skip_check_:!0,value:g}},["&-placement-topRight > ".concat(f,"-arrow")]:{right:{_skip_check_:!0,value:g}}},o?a:{})),(i=!!v.bottom,c={[["&-placement-bottom > ".concat(f,"-arrow"),"&-placement-bottomLeft > ".concat(f,"-arrow"),"&-placement-bottomRight > ".concat(f,"-arrow")].join(",")]:{top:h,transform:"translateY(-100%)"},["&-placement-bottom > ".concat(f,"-arrow")]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},["&-placement-bottomLeft > ".concat(f,"-arrow")]:{left:{_skip_check_:!0,value:g}},["&-placement-bottomRight > ".concat(f,"-arrow")]:{right:{_skip_check_:!0,value:g}}},i?c:{})),(l=!!v.left,s={[["&-placement-left > ".concat(f,"-arrow"),"&-placement-leftTop > ".concat(f,"-arrow"),"&-placement-leftBottom > ".concat(f,"-arrow")].join(",")]:{right:{_skip_check_:!0,value:h},transform:"translateX(100%) rotate(90deg)"},["&-placement-left > ".concat(f,"-arrow")]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},["&-placement-leftTop > ".concat(f,"-arrow")]:{top:m},["&-placement-leftBottom > ".concat(f,"-arrow")]:{bottom:m}},l?s:{})),(u=!!v.right,d={[["&-placement-right > ".concat(f,"-arrow"),"&-placement-rightTop > ".concat(f,"-arrow"),"&-placement-rightBottom > ".concat(f,"-arrow")].join(",")]:{left:{_skip_check_:!0,value:h},transform:"translateX(-100%) rotate(-90deg)"},["&-placement-right > ".concat(f,"-arrow")]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},["&-placement-rightTop > ".concat(f,"-arrow")]:{top:m},["&-placement-rightBottom > ".concat(f,"-arrow")]:{bottom:m}},u?d:{}))}}},34442:function(e,t,n){"use strict";n.d(t,{W:function(){return a},w:function(){return o}});var r=n(352);function o(e){let{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,o=t/2,a=1*r/Math.sqrt(2),i=o-r*(1-1/Math.sqrt(2)),c=o-1/Math.sqrt(2)*n,l=r*(Math.sqrt(2)-1)+1/Math.sqrt(2)*n,s=2*o-c,u=2*o-a,d=2*o-0,f=o*Math.sqrt(2)+r*(Math.sqrt(2)-2),p=r*(Math.sqrt(2)-1),m="polygon(".concat(p,"px 100%, 50% ").concat(p,"px, ").concat(2*o-p,"px 100%, ").concat(p,"px 100%)");return{arrowShadowWidth:f,arrowPath:"path('M ".concat(0," ").concat(o," A ").concat(r," ").concat(r," 0 0 0 ").concat(a," ").concat(i," L ").concat(c," ").concat(l," A ").concat(n," ").concat(n," 0 0 1 ").concat(s," ").concat(l," L ").concat(u," ").concat(i," A ").concat(r," ").concat(r," 0 0 0 ").concat(d," ").concat(o," Z')"),arrowPolygon:m}}let a=(e,t,n)=>{let{sizePopupArrow:o,arrowPolygon:a,arrowPath:i,arrowShadowWidth:c,borderRadiusXS:l,calc:s}=e;return{pointerEvents:"none",width:o,height:o,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:o,height:s(o).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[a,i]},content:'""'},"&::after":{content:'""',position:"absolute",width:c,height:c,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:"0 0 ".concat((0,r.bf)(l)," 0")},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}}},37516:function(e,t,n){"use strict";n.d(t,{Mj:function(){return b},u_:function(){return v},uH:function(){return h}});var r=n(2265),o=n(352),a=n(31373),i=e=>{let{controlHeight:t}=e;return{controlHeightSM:.75*t,controlHeightXS:.5*t,controlHeightLG:1.25*t}},c=n(70774),l=n(36360),s=e=>{let t=e,n=e,r=e,o=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?o=4:e>=8&&(o=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:o}};let u=(e,t)=>new l.C(e).setAlpha(t).toRgbString(),d=(e,t)=>new l.C(e).darken(t).toHexString(),f=e=>{let t=(0,a.R_)(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},p=(e,t)=>{let n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:u(r,.88),colorTextSecondary:u(r,.65),colorTextTertiary:u(r,.45),colorTextQuaternary:u(r,.25),colorFill:u(r,.15),colorFillSecondary:u(r,.06),colorFillTertiary:u(r,.04),colorFillQuaternary:u(r,.02),colorBgLayout:d(n,4),colorBgContainer:d(n,0),colorBgElevated:d(n,0),colorBgSpotlight:u(r,.85),colorBgBlur:"transparent",colorBorder:d(n,15),colorBorderSecondary:d(n,6)}};var m=n(1319),g=e=>{let t=(0,m.Z)(e),n=t.map(e=>e.size),r=t.map(e=>e.lineHeight),o=n[1],a=n[0],i=n[2],c=r[1],l=r[0],s=r[2];return{fontSizeSM:a,fontSize:o,fontSizeLG:i,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:c,lineHeightLG:s,lineHeightSM:l,fontHeight:Math.round(c*o),fontHeightLG:Math.round(s*i),fontHeightSM:Math.round(l*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};let h=(0,o.jG)(function(e){let t=Object.keys(c.M).map(t=>{let n=(0,a.R_)(e[t]);return Array(10).fill(1).reduce((e,r,o)=>(e["".concat(t,"-").concat(o+1)]=n[o],e["".concat(t).concat(o+1)]=n[o],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),function(e,t){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=t,{colorSuccess:o,colorWarning:a,colorError:i,colorInfo:c,colorPrimary:s,colorBgBase:u,colorTextBase:d}=e,f=n(s),p=n(o),m=n(a),g=n(i),h=n(c),v=r(u,d),b=n(e.colorLink||e.colorInfo);return Object.assign(Object.assign({},v),{colorPrimaryBg:f[1],colorPrimaryBgHover:f[2],colorPrimaryBorder:f[3],colorPrimaryBorderHover:f[4],colorPrimaryHover:f[5],colorPrimary:f[6],colorPrimaryActive:f[7],colorPrimaryTextHover:f[8],colorPrimaryText:f[9],colorPrimaryTextActive:f[10],colorSuccessBg:p[1],colorSuccessBgHover:p[2],colorSuccessBorder:p[3],colorSuccessBorderHover:p[4],colorSuccessHover:p[4],colorSuccess:p[6],colorSuccessActive:p[7],colorSuccessTextHover:p[8],colorSuccessText:p[9],colorSuccessTextActive:p[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:m[1],colorWarningBgHover:m[2],colorWarningBorder:m[3],colorWarningBorderHover:m[4],colorWarningHover:m[4],colorWarning:m[6],colorWarningActive:m[7],colorWarningTextHover:m[8],colorWarningText:m[9],colorWarningTextActive:m[10],colorInfoBg:h[1],colorInfoBgHover:h[2],colorInfoBorder:h[3],colorInfoBorderHover:h[4],colorInfoHover:h[4],colorInfo:h[6],colorInfoActive:h[7],colorInfoTextHover:h[8],colorInfoText:h[9],colorInfoTextActive:h[10],colorLinkHover:b[4],colorLink:b[6],colorLinkActive:b[7],colorBgMask:new l.C("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}(e,{generateColorPalettes:f,generateNeutralColorPalettes:p})),g(e.fontSize)),function(e){let{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}(e)),i(e)),function(e){let{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:o}=e;return Object.assign({motionDurationFast:"".concat((n+t).toFixed(1),"s"),motionDurationMid:"".concat((n+2*t).toFixed(1),"s"),motionDurationSlow:"".concat((n+3*t).toFixed(1),"s"),lineWidthBold:o+1},s(r))}(e))}),v={token:c.Z,override:{override:c.Z},hashed:!0},b=r.createContext(v)},53454:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});let r=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},70774:function(e,t,n){"use strict";n.d(t,{M:function(){return r}});let r={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},o=Object.assign(Object.assign({},r),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n'Noto Color Emoji'",fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});t.Z=o},1319:function(e,t,n){"use strict";function r(e){return(e+8)/e}function o(e){let t=Array(10).fill(null).map((t,n)=>{let r=e*Math.pow(2.71828,(n-1)/5);return 2*Math.floor((n>1?Math.floor(r):Math.ceil(r))/2)});return t[1]=e,t.map(e=>({size:e,lineHeight:r(e)}))}n.d(t,{D:function(){return r},Z:function(){return o}})},29961:function(e,t,n){"use strict";n.d(t,{ZP:function(){return v},ID:function(){return m},NJ:function(){return p}});var r=n(2265),o=n(352),a=n(37516),i=n(70774),c=n(36360);function l(e){return e>=0&&e<=255}var s=function(e,t){let{r:n,g:r,b:o,a:a}=new c.C(e).toRgb();if(a<1)return e;let{r:i,g:s,b:u}=new c.C(t).toRgb();for(let e=.01;e<=1;e+=.01){let t=Math.round((n-i*(1-e))/e),a=Math.round((r-s*(1-e))/e),d=Math.round((o-u*(1-e))/e);if(l(t)&&l(a)&&l(d))return new c.C({r:t,g:a,b:d,a:Math.round(100*e)/100}).toRgbString()}return new c.C({r:n,g:r,b:o,a:1}).toRgbString()},u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function d(e){let{override:t}=e,n=u(e,["override"]),r=Object.assign({},t);Object.keys(i.Z).forEach(e=>{delete r[e]});let o=Object.assign(Object.assign({},n),r);return!1===o.motion&&(o.motionDurationFast="0s",o.motionDurationMid="0s",o.motionDurationSlow="0s"),Object.assign(Object.assign(Object.assign({},o),{colorFillContent:o.colorFillSecondary,colorFillContentHover:o.colorFill,colorFillAlter:o.colorFillQuaternary,colorBgContainerDisabled:o.colorFillTertiary,colorBorderBg:o.colorBgContainer,colorSplit:s(o.colorBorderSecondary,o.colorBgContainer),colorTextPlaceholder:o.colorTextQuaternary,colorTextDisabled:o.colorTextQuaternary,colorTextHeading:o.colorText,colorTextLabel:o.colorTextSecondary,colorTextDescription:o.colorTextTertiary,colorTextLightSolid:o.colorWhite,colorHighlight:o.colorError,colorBgTextHover:o.colorFillSecondary,colorBgTextActive:o.colorFill,colorIcon:o.colorTextTertiary,colorIconHover:o.colorText,colorErrorOutline:s(o.colorErrorBg,o.colorBgContainer),colorWarningOutline:s(o.colorWarningBg,o.colorBgContainer),fontSizeIcon:o.fontSizeSM,lineWidthFocus:4*o.lineWidth,lineWidth:o.lineWidth,controlOutlineWidth:2*o.lineWidth,controlInteractiveSize:o.controlHeight/2,controlItemBgHover:o.colorFillTertiary,controlItemBgActive:o.colorPrimaryBg,controlItemBgActiveHover:o.colorPrimaryBgHover,controlItemBgActiveDisabled:o.colorFill,controlTmpOutline:o.colorFillQuaternary,controlOutline:s(o.colorPrimaryBg,o.colorBgContainer),lineType:o.lineType,borderRadius:o.borderRadius,borderRadiusXS:o.borderRadiusXS,borderRadiusSM:o.borderRadiusSM,borderRadiusLG:o.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:o.sizeXXS,paddingXS:o.sizeXS,paddingSM:o.sizeSM,padding:o.size,paddingMD:o.sizeMD,paddingLG:o.sizeLG,paddingXL:o.sizeXL,paddingContentHorizontalLG:o.sizeLG,paddingContentVerticalLG:o.sizeMS,paddingContentHorizontal:o.sizeMS,paddingContentVertical:o.sizeSM,paddingContentHorizontalSM:o.size,paddingContentVerticalSM:o.sizeXS,marginXXS:o.sizeXXS,marginXS:o.sizeXS,marginSM:o.sizeSM,margin:o.size,marginMD:o.sizeMD,marginLG:o.sizeLG,marginXL:o.sizeXL,marginXXL:o.sizeXXL,boxShadow:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowSecondary:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTertiary:"\n 0 1px 2px 0 rgba(0, 0, 0, 0.03),\n 0 1px 6px -1px rgba(0, 0, 0, 0.02),\n 0 2px 4px 0 rgba(0, 0, 0, 0.02)\n ",screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:1199,screenXL:1200,screenXLMin:1200,screenXLMax:1599,screenXXL:1600,screenXXLMin:1600,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:"\n 0 1px 2px -2px ".concat(new c.C("rgba(0, 0, 0, 0.16)").toRgbString(),",\n 0 3px 6px 0 ").concat(new c.C("rgba(0, 0, 0, 0.12)").toRgbString(),",\n 0 5px 12px 4px ").concat(new c.C("rgba(0, 0, 0, 0.09)").toRgbString(),"\n "),boxShadowDrawerRight:"\n -6px 0 16px 0 rgba(0, 0, 0, 0.08),\n -3px 0 6px -4px rgba(0, 0, 0, 0.12),\n -9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerLeft:"\n 6px 0 16px 0 rgba(0, 0, 0, 0.08),\n 3px 0 6px -4px rgba(0, 0, 0, 0.12),\n 9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerUp:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerDown:"\n 0 -6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 -3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 -9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let p={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0},m={size:!0,sizeSM:!0,sizeLG:!0,sizeMD:!0,sizeXS:!0,sizeXXS:!0,sizeMS:!0,sizeXL:!0,sizeXXL:!0,sizeUnit:!0,sizeStep:!0,motionBase:!0,motionUnit:!0},g={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},h=(e,t,n)=>{let r=n.getDerivativeToken(e),{override:o}=t,a=f(t,["override"]),i=Object.assign(Object.assign({},r),{override:o});return i=d(i),a&&Object.entries(a).forEach(e=>{let[t,n]=e,{theme:r}=n,o=f(n,["theme"]),a=o;r&&(a=h(Object.assign(Object.assign({},i),o),{override:o},r)),i[t]=a}),i};function v(){let{token:e,hashed:t,theme:n,override:c,cssVar:l}=r.useContext(a.Mj),s="".concat("5.13.2","-").concat(t||""),u=n||a.uH,[f,v,b]=(0,o.fp)(u,[i.Z,e],{salt:s,override:c,getComputedToken:h,formatToken:d,cssVar:l&&{prefix:l.prefix,key:l.key,unitless:p,ignore:m,preserve:g}});return[u,b,t?v:"",f,l]}},80669:function(e,t,n){"use strict";n.d(t,{ZP:function(){return Z},I$:function(){return M},bk:function(){return O}});var r=n(2265),o=n(352);n(74126);var a=n(71744),i=n(12918),c=n(29961),l=n(76405),s=n(25049),u=n(37977),d=n(63929),f=n(24995),p=n(15354);let m=(0,s.Z)(function e(){(0,l.Z)(this,e)}),g=function(e){function t(e){var n,r,o;return(0,l.Z)(this,t),r=t,r=(0,f.Z)(r),(n=(0,u.Z)(this,(0,d.Z)()?Reflect.construct(r,[],(0,f.Z)(this).constructor):r.apply(this,o))).result=0,e instanceof t?n.result=e.result:"number"==typeof e&&(n.result=e),n}return(0,p.Z)(t,e),(0,s.Z)(t,[{key:"add",value:function(e){return e instanceof t?this.result+=e.result:"number"==typeof e&&(this.result+=e),this}},{key:"sub",value:function(e){return e instanceof t?this.result-=e.result:"number"==typeof e&&(this.result-=e),this}},{key:"mul",value:function(e){return e instanceof t?this.result*=e.result:"number"==typeof e&&(this.result*=e),this}},{key:"div",value:function(e){return e instanceof t?this.result/=e.result:"number"==typeof e&&(this.result/=e),this}},{key:"equal",value:function(){return this.result}}]),t}(m),h="CALC_UNIT";function v(e){return"number"==typeof e?"".concat(e).concat(h):e}let b=function(e){function t(e){var n,r,o;return(0,l.Z)(this,t),r=t,r=(0,f.Z)(r),(n=(0,u.Z)(this,(0,d.Z)()?Reflect.construct(r,[],(0,f.Z)(this).constructor):r.apply(this,o))).result="",e instanceof t?n.result="(".concat(e.result,")"):"number"==typeof e?n.result=v(e):"string"==typeof e&&(n.result=e),n}return(0,p.Z)(t,e),(0,s.Z)(t,[{key:"add",value:function(e){return e instanceof t?this.result="".concat(this.result," + ").concat(e.getResult()):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," + ").concat(v(e))),this.lowPriority=!0,this}},{key:"sub",value:function(e){return e instanceof t?this.result="".concat(this.result," - ").concat(e.getResult()):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," - ").concat(v(e))),this.lowPriority=!0,this}},{key:"mul",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof t?this.result="".concat(this.result," * ").concat(e.getResult(!0)):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," * ").concat(e)),this.lowPriority=!1,this}},{key:"div",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof t?this.result="".concat(this.result," / ").concat(e.getResult(!0)):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," / ").concat(e)),this.lowPriority=!1,this}},{key:"getResult",value:function(e){return this.lowPriority||e?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(e){let{unit:t=!0}=e||{},n=RegExp("".concat(h),"g");return(this.result=this.result.replace(n,t?"px":""),void 0!==this.lowPriority)?"calc(".concat(this.result,")"):this.result}}]),t}(m);var y=e=>{let t="css"===e?b:g;return e=>new t(e)},w=n(3104),x=n(36198);let E=(e,t,n)=>{var r;return"function"==typeof n?n((0,w.TS)(t,null!==(r=t[e])&&void 0!==r?r:{})):null!=n?n:{}},S=(e,t,n,r)=>{let o=Object.assign({},t[e]);if(null==r?void 0:r.deprecatedTokens){let{deprecatedTokens:e}=r;e.forEach(e=>{var t;let[n,r]=e;((null==o?void 0:o[n])||(null==o?void 0:o[r]))&&(null!==(t=o[r])&&void 0!==t||(o[r]=null==o?void 0:o[n]))})}let a=Object.assign(Object.assign({},n),o);return Object.keys(a).forEach(e=>{a[e]===t[e]&&delete a[e]}),a},C=(e,t)=>"".concat([t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"));function Z(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=Array.isArray(e)?e:[e,e],[u]=s,d=s.join("-");return e=>{let[s,f,p,m,g]=(0,c.ZP)(),{getPrefixCls:h,iconPrefixCls:v,csp:b}=(0,r.useContext)(a.E_),Z=h(),O=g?"css":"js",k=y(O),{max:M,min:j}="js"===O?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=Array(e),n=0;n(0,o.bf)(e)).join(","),")")},min:function(){for(var e=arguments.length,t=Array(e),n=0;n(0,o.bf)(e)).join(","),")")}},I={theme:s,token:m,hashId:p,nonce:()=>null==b?void 0:b.nonce,clientOnly:l.clientOnly,order:l.order||-999};return(0,o.xy)(Object.assign(Object.assign({},I),{clientOnly:!1,path:["Shared",Z]}),()=>[{"&":(0,i.Lx)(m)}]),(0,x.Z)(v,b),[(0,o.xy)(Object.assign(Object.assign({},I),{path:[d,e,v]}),()=>{if(!1===l.injectStyle)return[];let{token:r,flush:a}=(0,w.ZP)(m),c=E(u,f,n),s=".".concat(e),d=S(u,f,c,{deprecatedTokens:l.deprecatedTokens});g&&Object.keys(c).forEach(e=>{c[e]="var(".concat((0,o.ks)(e,C(u,g.prefix)),")")});let h=(0,w.TS)(r,{componentCls:s,prefixCls:e,iconCls:".".concat(v),antCls:".".concat(Z),calc:k,max:M,min:j},g?c:d),b=t(h,{hashId:p,prefixCls:e,rootPrefixCls:Z,iconPrefixCls:v});return a(u,d),[!1===l.resetStyle?null:(0,i.du)(h,e),b]}),p]}}let O=(e,t,n,r)=>{let o=Z(e,t,n,Object.assign({resetStyle:!1,order:-998},r));return e=>{let{prefixCls:t}=e;return o(t),null}},k=(e,t,n)=>{function a(t){return"".concat(e).concat(t.slice(0,1).toUpperCase()).concat(t.slice(1))}let{unitless:i={},injectStyle:l=!0}=null!=n?n:{},s={[a("zIndexPopup")]:!0};Object.keys(i).forEach(e=>{s[a(e)]=i[e]});let u=r=>{let{rootCls:i,cssVar:l}=r,[,u]=(0,c.ZP)();return(0,o.CI)({path:[e],prefix:l.prefix,key:null==l?void 0:l.key,unitless:Object.assign(Object.assign({},c.NJ),s),ignore:c.ID,token:u,scope:i},()=>{let r=E(e,u,t),o=S(e,u,r,{deprecatedTokens:null==n?void 0:n.deprecatedTokens});return Object.keys(r).forEach(e=>{o[a(e)]=o[e],delete o[e]}),o}),null};return t=>{let[,,,,n]=(0,c.ZP)();return[o=>l&&n?r.createElement(r.Fragment,null,r.createElement(u,{rootCls:t,cssVar:n,component:e}),o):o,null==n?void 0:n.key]}},M=(e,t,n,r)=>{let o=Z(e,t,n,r),a=k(Array.isArray(e)?e[0]:e,n,r);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,[,n]=o(e),[r,i]=a(t);return[r,n,i]}}},18536:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(53454);function o(e,t){return r.i.reduce((n,r)=>{let o=e["".concat(r,"1")],a=e["".concat(r,"3")],i=e["".concat(r,"6")],c=e["".concat(r,"7")];return Object.assign(Object.assign({},n),t(r,{lightColor:o,lightBorderColor:a,darkColor:i,textColor:c}))},{})}},3104:function(e,t,n){"use strict";n.d(t,{TS:function(){return a}});let r="undefined"!=typeof CSSINJS_STATISTIC,o=!0;function a(){for(var e=arguments.length,t=Array(e),n=0;n{Object.keys(e).forEach(t=>{Object.defineProperty(a,t,{configurable:!0,enumerable:!0,get:()=>e[t]})})}),o=!0,a}let i={};function c(){}t.ZP=e=>{let t;let n=e,a=c;return r&&"undefined"!=typeof Proxy&&(t=new Set,n=new Proxy(e,{get:(e,n)=>(o&&t.add(n),e[n])}),a=(e,n)=>{var r;i[e]={global:Array.from(t),component:Object.assign(Object.assign({},null===(r=i[e])||void 0===r?void 0:r.component),n)}}),{token:n,keys:t,flush:a}}},36198:function(e,t,n){"use strict";var r=n(352),o=n(12918),a=n(29961);t.Z=(e,t)=>{let[n,i]=(0,a.ZP)();return(0,r.xy)({theme:n,token:i,hashId:"",path:["ant-design-icons",e],nonce:()=>null==t?void 0:t.nonce},()=>[{[".".concat(e)]:Object.assign(Object.assign({},(0,o.Ro)()),{[".".concat(e," .").concat(e,"-icon")]:{display:"block"}})}])}},89970:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});var r=n(2265),o=n(36760),a=n.n(o),i=n(5769),c=n(50506),l=n(62236),s=n(68710),u=n(92736),d=n(19722),f=n(13613),p=n(95140),m=n(71744),g=n(65658),h=n(29961),v=n(12918),b=n(691),y=n(88260),w=n(18536),x=n(3104),E=n(80669),S=n(352),C=n(34442);let Z=e=>{let{componentCls:t,tooltipMaxWidth:n,tooltipColor:r,tooltipBg:o,tooltipBorderRadius:a,zIndexPopup:i,controlHeight:c,boxShadowSecondary:l,paddingSM:s,paddingXS:u}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,v.Wf)(e)),{position:"absolute",zIndex:i,display:"block",width:"max-content",maxWidth:n,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":o,["".concat(t,"-inner")]:{minWidth:c,minHeight:c,padding:"".concat((0,S.bf)(e.calc(s).div(2).equal())," ").concat((0,S.bf)(u)),color:r,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:o,borderRadius:a,boxShadow:l,boxSizing:"border-box"},"&-placement-left,&-placement-leftTop,&-placement-leftBottom,&-placement-right,&-placement-rightTop,&-placement-rightBottom":{["".concat(t,"-inner")]:{borderRadius:e.min(a,y.qN)}},["".concat(t,"-content")]:{position:"relative"}}),(0,w.Z)(e,(e,n)=>{let{darkColor:r}=n;return{["&".concat(t,"-").concat(e)]:{["".concat(t,"-inner")]:{backgroundColor:r},["".concat(t,"-arrow")]:{"--antd-arrow-background-color":r}}}})),{"&-rtl":{direction:"rtl"}})},(0,y.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(t,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},O=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},(0,y.wZ)({contentRadius:e.borderRadius,limitVerticalRadius:!0})),(0,C.w)((0,x.TS)(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)})));function k(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return(0,E.I$)("Tooltip",e=>{let{borderRadius:t,colorTextLightSolid:n,colorBgSpotlight:r}=e;return[Z((0,x.TS)(e,{tooltipMaxWidth:250,tooltipColor:n,tooltipBorderRadius:t,tooltipBg:r})),(0,b._y)(e,"zoom-big-fast")]},O,{resetStyle:!1,injectStyle:t})(e)}var M=n(93350);function j(e,t){let n=(0,M.o2)(t),r=a()({["".concat(e,"-").concat(t)]:t&&n}),o={},i={};return t&&!n&&(o.background=t,i["--antd-arrow-background-color"]=t),{className:r,overlayStyle:o,arrowStyle:i}}var I=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let R=r.forwardRef((e,t)=>{var n,o;let{prefixCls:v,openClassName:b,getTooltipContainer:y,overlayClassName:w,color:x,overlayInnerStyle:E,children:S,afterOpenChange:C,afterVisibleChange:Z,destroyTooltipOnHide:O,arrow:M=!0,title:R,overlay:N,builtinPlacements:P,arrowPointAtCenter:F=!1,autoAdjustOverflow:T=!0}=e,A=!!M,[,L]=(0,h.ZP)(),{getPopupContainer:z,getPrefixCls:_,direction:H}=r.useContext(m.E_),B=(0,f.ln)("Tooltip"),D=r.useRef(null),W=()=>{var e;null===(e=D.current)||void 0===e||e.forceAlign()};r.useImperativeHandle(t,()=>({forceAlign:W,forcePopupAlign:()=>{B.deprecated(!1,"forcePopupAlign","forceAlign"),W()}}));let[V,q]=(0,c.Z)(!1,{value:null!==(n=e.open)&&void 0!==n?n:e.visible,defaultValue:null!==(o=e.defaultOpen)&&void 0!==o?o:e.defaultVisible}),G=!R&&!N&&0!==R,X=r.useMemo(()=>{var e,t;let n=F;return"object"==typeof M&&(n=null!==(t=null!==(e=M.pointAtCenter)&&void 0!==e?e:M.arrowPointAtCenter)&&void 0!==t?t:F),P||(0,u.Z)({arrowPointAtCenter:n,autoAdjustOverflow:T,arrowWidth:A?L.sizePopupArrow:0,borderRadius:L.borderRadius,offset:L.marginXXS,visibleFirst:!0})},[F,M,P,L]),U=r.useMemo(()=>0===R?R:N||R||"",[N,R]),$=r.createElement(g.BR,null,"function"==typeof U?U():U),{getPopupContainer:K,placement:Y="top",mouseEnterDelay:Q=.1,mouseLeaveDelay:J=.1,overlayStyle:ee,rootClassName:et}=e,en=I(e,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),er=_("tooltip",v),eo=_(),ea=e["data-popover-inject"],ei=V;"open"in e||"visible"in e||!G||(ei=!1);let ec=(0,d.l$)(S)&&!(0,d.M2)(S)?S:r.createElement("span",null,S),el=ec.props,es=el.className&&"string"!=typeof el.className?el.className:a()(el.className,b||"".concat(er,"-open")),[eu,ed,ef]=k(er,!ea),ep=j(er,x),em=ep.arrowStyle,eg=Object.assign(Object.assign({},E),ep.overlayStyle),eh=a()(w,{["".concat(er,"-rtl")]:"rtl"===H},ep.className,et,ed,ef),[ev,eb]=(0,l.Cn)("Tooltip",en.zIndex),ey=r.createElement(i.Z,Object.assign({},en,{zIndex:ev,showArrow:A,placement:Y,mouseEnterDelay:Q,mouseLeaveDelay:J,prefixCls:er,overlayClassName:eh,overlayStyle:Object.assign(Object.assign({},em),ee),getTooltipContainer:K||y||z,ref:D,builtinPlacements:X,overlay:$,visible:ei,onVisibleChange:t=>{var n,r;q(!G&&t),G||(null===(n=e.onOpenChange)||void 0===n||n.call(e,t),null===(r=e.onVisibleChange)||void 0===r||r.call(e,t))},afterVisibleChange:null!=C?C:Z,overlayInnerStyle:eg,arrowContent:r.createElement("span",{className:"".concat(er,"-arrow-content")}),motion:{motionName:(0,s.m)(eo,"zoom-big-fast",e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!O}),ei?(0,d.Tm)(ec,{className:es}):ec);return eu(r.createElement(p.Z.Provider,{value:eb},ey))});R._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,className:n,placement:o="top",title:c,color:l,overlayInnerStyle:s}=e,{getPrefixCls:u}=r.useContext(m.E_),d=u("tooltip",t),[f,p,g]=k(d),h=j(d,l),v=h.arrowStyle,b=Object.assign(Object.assign({},s),h.overlayStyle),y=a()(p,g,d,"".concat(d,"-pure"),"".concat(d,"-placement-").concat(o),n,h.className);return f(r.createElement("div",{className:y,style:v},r.createElement("div",{className:"".concat(d,"-arrow")}),r.createElement(i.G,Object.assign({},e,{className:p,prefixCls:d,overlayInnerStyle:b}),c)))};var N=R},99376:function(e,t,n){"use strict";var r=n(35475);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},40257:function(e,t,n){"use strict";var r,o;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(o=n.g.process)?void 0:o.env)?n.g.process:n(44227)},44227:function(e){!function(){var t={229:function(e){var t,n,r,o=e.exports={};function a(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===a||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:a}catch(e){t=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var l=[],s=!1,u=-1;function d(){s&&r&&(s=!1,r.length?l=r.concat(l):u=-1,l.length&&f())}function f(){if(!s){var e=c(d);s=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;n1?t-1:0),r=1;r=a)return e;switch(e){case"%s":return String(n[o++]);case"%d":return Number(n[o++]);case"%j":try{return JSON.stringify(n[o++])}catch(e){return"[Circular]"}break;default:return e}}):e}function F(e,t){return!!(null==e||"array"===t&&Array.isArray(e)&&!e.length)||("string"===t||"url"===t||"hex"===t||"email"===t||"date"===t||"pattern"===t)&&"string"==typeof e&&!e}function T(e,t,n){var r=0,o=e.length;!function a(i){if(i&&i.length){n(i);return}var c=r;r+=1,c()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},D={integer:function(e){return D.number(e)&&parseInt(e,10)===e},float:function(e){return D.number(e)&&!D.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return new RegExp(e),!0}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"==typeof e&&!D.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(B.email)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(H())},hex:function(e){return"string"==typeof e&&!!e.match(B.hex)}},W="enum",V={required:_,whitespace:function(e,t,n,r,o){(/^\s+$/.test(t)||""===t)&&r.push(P(o.messages.whitespace,e.fullField))},type:function(e,t,n,r,o){if(e.required&&void 0===t){_(e,t,n,r,o);return}var a=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(a)>-1?D[a](t)||r.push(P(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&r.push(P(o.messages.types[a],e.fullField,e.type))},range:function(e,t,n,r,o){var a="number"==typeof e.len,i="number"==typeof e.min,c="number"==typeof e.max,l=t,s=null,u="number"==typeof t,d="string"==typeof t,f=Array.isArray(t);if(u?s="number":d?s="string":f&&(s="array"),!s)return!1;f&&(l=t.length),d&&(l=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),a?l!==e.len&&r.push(P(o.messages[s].len,e.fullField,e.len)):i&&!c&&le.max?r.push(P(o.messages[s].max,e.fullField,e.max)):i&&c&&(le.max)&&r.push(P(o.messages[s].range,e.fullField,e.min,e.max))},enum:function(e,t,n,r,o){e[W]=Array.isArray(e[W])?e[W]:[],-1===e[W].indexOf(t)&&r.push(P(o.messages[W],e.fullField,e[W].join(", ")))},pattern:function(e,t,n,r,o){!e.pattern||(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(P(o.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"!=typeof e.pattern||new RegExp(e.pattern).test(t)||r.push(P(o.messages.pattern.mismatch,e.fullField,t,e.pattern)))}},q=function(e,t,n,r,o){var a=e.type,i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t,a)&&!e.required)return n();V.required(e,t,r,i,o,a),F(t,a)||V.type(e,t,r,i,o)}n(i)},G={string:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t,"string")&&!e.required)return n();V.required(e,t,r,a,o,"string"),F(t,"string")||(V.type(e,t,r,a,o),V.range(e,t,r,a,o),V.pattern(e,t,r,a,o),!0===e.whitespace&&V.whitespace(e,t,r,a,o))}n(a)},method:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t)&&!e.required)return n();V.required(e,t,r,a,o),void 0!==t&&V.type(e,t,r,a,o)}n(a)},number:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(""===t&&(t=void 0),F(t)&&!e.required)return n();V.required(e,t,r,a,o),void 0!==t&&(V.type(e,t,r,a,o),V.range(e,t,r,a,o))}n(a)},boolean:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t)&&!e.required)return n();V.required(e,t,r,a,o),void 0!==t&&V.type(e,t,r,a,o)}n(a)},regexp:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t)&&!e.required)return n();V.required(e,t,r,a,o),F(t)||V.type(e,t,r,a,o)}n(a)},integer:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t)&&!e.required)return n();V.required(e,t,r,a,o),void 0!==t&&(V.type(e,t,r,a,o),V.range(e,t,r,a,o))}n(a)},float:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t)&&!e.required)return n();V.required(e,t,r,a,o),void 0!==t&&(V.type(e,t,r,a,o),V.range(e,t,r,a,o))}n(a)},array:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();V.required(e,t,r,a,o,"array"),null!=t&&(V.type(e,t,r,a,o),V.range(e,t,r,a,o))}n(a)},object:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t)&&!e.required)return n();V.required(e,t,r,a,o),void 0!==t&&V.type(e,t,r,a,o)}n(a)},enum:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t)&&!e.required)return n();V.required(e,t,r,a,o),void 0!==t&&V.enum(e,t,r,a,o)}n(a)},pattern:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t,"string")&&!e.required)return n();V.required(e,t,r,a,o),F(t,"string")||V.pattern(e,t,r,a,o)}n(a)},date:function(e,t,n,r,o){var a,i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t,"date")&&!e.required)return n();V.required(e,t,r,i,o),!F(t,"date")&&(a=t instanceof Date?t:new Date(t),V.type(e,a,r,i,o),a&&V.range(e,a.getTime(),r,i,o))}n(i)},url:q,hex:q,email:q,required:function(e,t,n,r,o){var a=[],i=Array.isArray(t)?"array":typeof t;V.required(e,t,r,a,o,i),n(a)},any:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(F(t)&&!e.required)return n();V.required(e,t,r,a,o)}n(a)}};function X(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var U=X(),$=function(){function e(e){this.rules=null,this._messages=U,this.define(e)}var t=e.prototype;return t.define=function(e){var t=this;if(!e)throw Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw Error("Rules must be an object");this.rules={},Object.keys(e).forEach(function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]})},t.messages=function(e){return e&&(this._messages=z(X(),e)),this._messages},t.validate=function(t,n,r){var o=this;void 0===n&&(n={}),void 0===r&&(r=function(){});var a=t,i=n,c=r;if("function"==typeof i&&(c=i,i={}),!this.rules||0===Object.keys(this.rules).length)return c&&c(null,a),Promise.resolve(a);if(i.messages){var l=this.messages();l===U&&(l=X()),z(l,i.messages),i.messages=l}else i.messages=this.messages();var s={};(i.keys||Object.keys(this.rules)).forEach(function(e){var n=o.rules[e],r=a[e];n.forEach(function(n){var i=n;"function"==typeof i.transform&&(a===t&&(a=O({},a)),r=a[e]=i.transform(r)),(i="function"==typeof i?{validator:i}:O({},i)).validator=o.getValidationMethod(i),i.validator&&(i.field=e,i.fullField=i.fullField||e,i.type=o.getType(i),s[e]=s[e]||[],s[e].push({rule:i,value:r,source:a,field:e}))})});var u={};return function(e,t,n,r,o){if(t.first){var a=new Promise(function(t,a){var i;T((i=[],Object.keys(e).forEach(function(t){i.push.apply(i,e[t]||[])}),i),n,function(e){return r(e),e.length?a(new A(e,N(e))):t(o)})});return a.catch(function(e){return e}),a}var i=!0===t.firstFields?Object.keys(e):t.firstFields||[],c=Object.keys(e),l=c.length,s=0,u=[],d=new Promise(function(t,a){var d=function(e){if(u.push.apply(u,e),++s===l)return r(u),u.length?a(new A(u,N(u))):t(o)};c.length||(r(u),t(o)),c.forEach(function(t){var r=e[t];-1!==i.indexOf(t)?T(r,n,d):function(e,t,n){var r=[],o=0,a=e.length;function i(e){r.push.apply(r,e||[]),++o===a&&n(r)}e.forEach(function(e){t(e,i)})}(r,n,d)})});return d.catch(function(e){return e}),d}(s,i,function(t,n){var r,o=t.rule,c=("object"===o.type||"array"===o.type)&&("object"==typeof o.fields||"object"==typeof o.defaultField);function l(e,t){return O({},t,{fullField:o.fullField+"."+e,fullFields:o.fullFields?[].concat(o.fullFields,[e]):[e]})}function s(r){void 0===r&&(r=[]);var s=Array.isArray(r)?r:[r];!i.suppressWarning&&s.length&&e.warning("async-validator:",s),s.length&&void 0!==o.message&&(s=[].concat(o.message));var d=s.map(L(o,a));if(i.first&&d.length)return u[o.field]=1,n(d);if(c){if(o.required&&!t.value)return void 0!==o.message?d=[].concat(o.message).map(L(o,a)):i.error&&(d=[i.error(o,P(i.messages.required,o.field))]),n(d);var f={};o.defaultField&&Object.keys(t.value).map(function(e){f[e]=o.defaultField});var p={};Object.keys(f=O({},f,t.rule.fields)).forEach(function(e){var t=f[e],n=Array.isArray(t)?t:[t];p[e]=n.map(l.bind(null,e))});var m=new e(p);m.messages(i.messages),t.rule.options&&(t.rule.options.messages=i.messages,t.rule.options.error=i.error),m.validate(t.value,t.rule.options||i,function(e){var t=[];d&&d.length&&t.push.apply(t,d),e&&e.length&&t.push.apply(t,e),n(t.length?t:null)})}else n(d)}if(c=c&&(o.required||!o.required&&t.value),o.field=t.field,o.asyncValidator)r=o.asyncValidator(o,t.value,s,t.source,i);else if(o.validator){try{r=o.validator(o,t.value,s,t.source,i)}catch(e){null==console.error||console.error(e),i.suppressValidatorError||setTimeout(function(){throw e},0),s(e.message)}!0===r?s():!1===r?s("function"==typeof o.message?o.message(o.fullField||o.field):o.message||(o.fullField||o.field)+" fails"):r instanceof Array?s(r):r instanceof Error&&s(r.message)}r&&r.then&&r.then(function(){return s()},function(e){return s(e)})},function(e){!function(e){for(var t=[],n={},r=0;r2&&void 0!==arguments[2]&&arguments[2];return e&&e.some(function(e){return es(t,e,n)})}function es(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!e&&!!t&&(!!n||e.length===t.length)&&t.every(function(t,n){return e[n]===t})}function eu(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&"object"===(0,eo.Z)(t.target)&&e in t.target?t.target[e]:t}function ed(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var o=e[t],a=t-n;return a>0?[].concat((0,u.Z)(e.slice(0,n)),[o],(0,u.Z)(e.slice(n,t)),(0,u.Z)(e.slice(t+1,r))):a<0?[].concat((0,u.Z)(e.slice(0,t)),(0,u.Z)(e.slice(t+1,n+1)),[o],(0,u.Z)(e.slice(n+1,r))):e}var ef=["name"],ep=[];function em(e,t,n,r,o,a){return"function"==typeof e?e(t,n,"source"in a?{source:a.source}:{}):r!==o}var eg=function(e){(0,m.Z)(n,e);var t=(0,g.Z)(n);function n(e){var r;return(0,d.Z)(this,n),r=t.call(this,e),(0,h.Z)((0,p.Z)(r),"state",{resetCount:0}),(0,h.Z)((0,p.Z)(r),"cancelRegisterFunc",null),(0,h.Z)((0,p.Z)(r),"mounted",!1),(0,h.Z)((0,p.Z)(r),"touched",!1),(0,h.Z)((0,p.Z)(r),"dirty",!1),(0,h.Z)((0,p.Z)(r),"validatePromise",void 0),(0,h.Z)((0,p.Z)(r),"prevValidating",void 0),(0,h.Z)((0,p.Z)(r),"errors",ep),(0,h.Z)((0,p.Z)(r),"warnings",ep),(0,h.Z)((0,p.Z)(r),"cancelRegister",function(){var e=r.props,t=e.preserve,n=e.isListField,o=e.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(n,t,ei(o)),r.cancelRegisterFunc=null}),(0,h.Z)((0,p.Z)(r),"getNamePath",function(){var e=r.props,t=e.name,n=e.fieldContext.prefixName;return void 0!==t?[].concat((0,u.Z)(void 0===n?[]:n),(0,u.Z)(t)):[]}),(0,h.Z)((0,p.Z)(r),"getRules",function(){var e=r.props,t=e.rules,n=e.fieldContext;return(void 0===t?[]:t).map(function(e){return"function"==typeof e?e(n):e})}),(0,h.Z)((0,p.Z)(r),"refresh",function(){r.mounted&&r.setState(function(e){return{resetCount:e.resetCount+1}})}),(0,h.Z)((0,p.Z)(r),"metaCache",null),(0,h.Z)((0,p.Z)(r),"triggerMetaEvent",function(e){var t=r.props.onMetaChange;if(t){var n=(0,s.Z)((0,s.Z)({},r.getMeta()),{},{destroy:e});(0,b.Z)(r.metaCache,n)||t(n),r.metaCache=n}else r.metaCache=null}),(0,h.Z)((0,p.Z)(r),"onStoreChange",function(e,t,n){var o=r.props,a=o.shouldUpdate,i=o.dependencies,c=void 0===i?[]:i,l=o.onReset,s=n.store,u=r.getNamePath(),d=r.getValue(e),f=r.getValue(s),p=t&&el(t,u);switch("valueUpdate"===n.type&&"external"===n.source&&d!==f&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=ep,r.warnings=ep,r.triggerMetaEvent()),n.type){case"reset":if(!t||p){r.touched=!1,r.dirty=!1,r.validatePromise=void 0,r.errors=ep,r.warnings=ep,r.triggerMetaEvent(),null==l||l(),r.refresh();return}break;case"remove":if(a){r.reRender();return}break;case"setField":var m=n.data;if(p){"touched"in m&&(r.touched=m.touched),"validating"in m&&!("originRCField"in m)&&(r.validatePromise=m.validating?Promise.resolve([]):null),"errors"in m&&(r.errors=m.errors||ep),"warnings"in m&&(r.warnings=m.warnings||ep),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}if("value"in m&&el(t,u,!0)||a&&!u.length&&em(a,e,s,d,f,n)){r.reRender();return}break;case"dependenciesUpdate":if(c.map(ei).some(function(e){return el(n.relatedFields,e)})){r.reRender();return}break;default:if(p||(!c.length||u.length||a)&&em(a,e,s,d,f,n)){r.reRender();return}}!0===a&&r.reRender()}),(0,h.Z)((0,p.Z)(r),"validateRules",function(e){var t=r.getNamePath(),n=r.getValue(),o=e||{},a=o.triggerName,i=o.validateOnly,d=Promise.resolve().then((0,l.Z)((0,c.Z)().mark(function o(){var i,f,p,m,g,h,v;return(0,c.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r.mounted){o.next=2;break}return o.abrupt("return",[]);case 2:if(p=void 0!==(f=(i=r.props).validateFirst)&&f,m=i.messageVariables,g=i.validateDebounce,h=r.getRules(),a&&(h=h.filter(function(e){return e}).filter(function(e){var t=e.validateTrigger;return!t||C(t).includes(a)})),!(g&&a)){o.next=10;break}return o.next=8,new Promise(function(e){setTimeout(e,g)});case 8:if(!(r.validatePromise!==d)){o.next=10;break}return o.abrupt("return",[]);case 10:return(v=function(e,t,n,r,o,a){var i,u,d=e.join("."),f=n.map(function(e,t){var n=e.validator,r=(0,s.Z)((0,s.Z)({},e),{},{ruleIndex:t});return n&&(r.validator=function(e,t,r){var o=!1,a=n(e,t,function(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:ep;if(r.validatePromise===d){r.validatePromise=null;var t,n=[],o=[];null===(t=e.forEach)||void 0===t||t.call(e,function(e){var t=e.rule.warningOnly,r=e.errors,a=void 0===r?ep:r;t?o.push.apply(o,(0,u.Z)(a)):n.push.apply(n,(0,u.Z)(a))}),r.errors=n,r.warnings=o,r.triggerMetaEvent(),r.reRender()}}),o.abrupt("return",v);case 13:case"end":return o.stop()}},o)})));return void 0!==i&&i||(r.validatePromise=d,r.dirty=!0,r.errors=ep,r.warnings=ep,r.triggerMetaEvent(),r.reRender()),d}),(0,h.Z)((0,p.Z)(r),"isFieldValidating",function(){return!!r.validatePromise}),(0,h.Z)((0,p.Z)(r),"isFieldTouched",function(){return r.touched}),(0,h.Z)((0,p.Z)(r),"isFieldDirty",function(){return!!r.dirty||void 0!==r.props.initialValue||void 0!==(0,r.props.fieldContext.getInternalHooks(w).getInitialValue)(r.getNamePath())}),(0,h.Z)((0,p.Z)(r),"getErrors",function(){return r.errors}),(0,h.Z)((0,p.Z)(r),"getWarnings",function(){return r.warnings}),(0,h.Z)((0,p.Z)(r),"isListField",function(){return r.props.isListField}),(0,h.Z)((0,p.Z)(r),"isList",function(){return r.props.isList}),(0,h.Z)((0,p.Z)(r),"isPreserve",function(){return r.props.preserve}),(0,h.Z)((0,p.Z)(r),"getMeta",function(){return r.prevValidating=r.isFieldValidating(),{touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath(),validated:null===r.validatePromise}}),(0,h.Z)((0,p.Z)(r),"getOnlyChild",function(e){if("function"==typeof e){var t=r.getMeta();return(0,s.Z)((0,s.Z)({},r.getOnlyChild(e(r.getControlled(),t,r.props.fieldContext))),{},{isFunction:!0})}var n=(0,v.Z)(e);return 1===n.length&&o.isValidElement(n[0])?{child:n[0],isFunction:!1}:{child:n,isFunction:!1}}),(0,h.Z)((0,p.Z)(r),"getValue",function(e){var t=r.props.fieldContext.getFieldsValue,n=r.getNamePath();return(0,ea.Z)(e||t(!0),n)}),(0,h.Z)((0,p.Z)(r),"getControlled",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r.props,n=t.trigger,o=t.validateTrigger,a=t.getValueFromEvent,i=t.normalize,c=t.valuePropName,l=t.getValueProps,u=t.fieldContext,d=void 0!==o?o:u.validateTrigger,f=r.getNamePath(),p=u.getInternalHooks,m=u.getFieldsValue,g=p(w).dispatch,v=r.getValue(),b=l||function(e){return(0,h.Z)({},c,e)},y=e[n],x=(0,s.Z)((0,s.Z)({},e),b(v));return x[n]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var e,t=arguments.length,n=Array(t),o=0;o=0&&t<=n.length?(f.keys=[].concat((0,u.Z)(f.keys.slice(0,t)),[f.id],(0,u.Z)(f.keys.slice(t))),o([].concat((0,u.Z)(n.slice(0,t)),[e],(0,u.Z)(n.slice(t))))):(f.keys=[].concat((0,u.Z)(f.keys),[f.id]),o([].concat((0,u.Z)(n),[e]))),f.id+=1},remove:function(e){var t=i(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(f.keys=f.keys.filter(function(e,t){return!n.has(t)}),o(t.filter(function(e,t){return!n.has(t)})))},move:function(e,t){if(e!==t){var n=i();e<0||e>=n.length||t<0||t>=n.length||(f.keys=ed(f.keys,e,t),o(ed(n,e,t)))}}},t)})))},eb=n(26365),ey="__@field_split__";function ew(e){return e.map(function(e){return"".concat((0,eo.Z)(e),":").concat(e)}).join(ey)}var ex=function(){function e(){(0,d.Z)(this,e),(0,h.Z)(this,"kvs",new Map)}return(0,f.Z)(e,[{key:"set",value:function(e,t){this.kvs.set(ew(e),t)}},{key:"get",value:function(e){return this.kvs.get(ew(e))}},{key:"update",value:function(e,t){var n=t(this.get(e));n?this.set(e,n):this.delete(e)}},{key:"delete",value:function(e){this.kvs.delete(ew(e))}},{key:"map",value:function(e){return(0,u.Z)(this.kvs.entries()).map(function(t){var n=(0,eb.Z)(t,2),r=n[0],o=n[1];return e({key:r.split(ey).map(function(e){var t=e.match(/^([^:]*):(.*)$/),n=(0,eb.Z)(t,3),r=n[1],o=n[2];return"number"===r?Number(o):o}),value:o})})}},{key:"toJSON",value:function(){var e={};return this.map(function(t){var n=t.key,r=t.value;return e[n.join(".")]=r,null}),e}}]),e}(),eE=["name"],eS=(0,f.Z)(function e(t){var n=this;(0,d.Z)(this,e),(0,h.Z)(this,"formHooked",!1),(0,h.Z)(this,"forceRootUpdate",void 0),(0,h.Z)(this,"subscribable",!0),(0,h.Z)(this,"store",{}),(0,h.Z)(this,"fieldEntities",[]),(0,h.Z)(this,"initialValues",{}),(0,h.Z)(this,"callbacks",{}),(0,h.Z)(this,"validateMessages",null),(0,h.Z)(this,"preserve",null),(0,h.Z)(this,"lastValidatePromise",null),(0,h.Z)(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),(0,h.Z)(this,"getInternalHooks",function(e){return e===w?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):((0,y.ZP)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),(0,h.Z)(this,"useSubscribe",function(e){n.subscribable=e}),(0,h.Z)(this,"prevWithoutPreserves",null),(0,h.Z)(this,"setInitialValues",function(e,t){if(n.initialValues=e||{},t){var r,o=(0,Q.T)(e,n.store);null===(r=n.prevWithoutPreserves)||void 0===r||r.map(function(t){var n=t.key;o=(0,Q.Z)(o,n,(0,ea.Z)(e,n))}),n.prevWithoutPreserves=null,n.updateStore(o)}}),(0,h.Z)(this,"destroyForm",function(){var e=new ex;n.getFieldEntities(!0).forEach(function(t){n.isMergedPreserve(t.isPreserve())||e.set(t.getNamePath(),!0)}),n.prevWithoutPreserves=e}),(0,h.Z)(this,"getInitialValue",function(e){var t=(0,ea.Z)(n.initialValues,e);return e.length?(0,Q.T)(t):t}),(0,h.Z)(this,"setCallbacks",function(e){n.callbacks=e}),(0,h.Z)(this,"setValidateMessages",function(e){n.validateMessages=e}),(0,h.Z)(this,"setPreserve",function(e){n.preserve=e}),(0,h.Z)(this,"watchList",[]),(0,h.Z)(this,"registerWatch",function(e){return n.watchList.push(e),function(){n.watchList=n.watchList.filter(function(t){return t!==e})}}),(0,h.Z)(this,"notifyWatch",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(n.watchList.length){var t=n.getFieldsValue(),r=n.getFieldsValue(!0);n.watchList.forEach(function(n){n(t,r,e)})}}),(0,h.Z)(this,"timeoutId",null),(0,h.Z)(this,"warningUnhooked",function(){}),(0,h.Z)(this,"updateStore",function(e){n.store=e}),(0,h.Z)(this,"getFieldEntities",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?n.fieldEntities.filter(function(e){return e.getNamePath().length}):n.fieldEntities}),(0,h.Z)(this,"getFieldsMap",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new ex;return n.getFieldEntities(e).forEach(function(e){var n=e.getNamePath();t.set(n,e)}),t}),(0,h.Z)(this,"getFieldEntitiesForNamePathList",function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map(function(e){var n=ei(e);return t.get(n)||{INVALIDATE_NAME_PATH:ei(e)}})}),(0,h.Z)(this,"getFieldsValue",function(e,t){if(n.warningUnhooked(),!0===e||Array.isArray(e)?(r=e,o=t):e&&"object"===(0,eo.Z)(e)&&(a=e.strict,o=e.filter),!0===r&&!o)return n.store;var r,o,a,i=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),c=[];return i.forEach(function(e){var t,n,i,l="INVALIDATE_NAME_PATH"in e?e.INVALIDATE_NAME_PATH:e.getNamePath();if(a){if(null!==(i=e.isList)&&void 0!==i&&i.call(e))return}else if(!r&&null!==(t=(n=e).isListField)&&void 0!==t&&t.call(n))return;if(o){var s="getMeta"in e?e.getMeta():null;o(s)&&c.push(l)}else c.push(l)}),ec(n.store,c.map(ei))}),(0,h.Z)(this,"getFieldValue",function(e){n.warningUnhooked();var t=ei(e);return(0,ea.Z)(n.store,t)}),(0,h.Z)(this,"getFieldsError",function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map(function(t,n){return!t||"INVALIDATE_NAME_PATH"in t?{name:ei(e[n]),errors:[],warnings:[]}:{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}})}),(0,h.Z)(this,"getFieldError",function(e){n.warningUnhooked();var t=ei(e);return n.getFieldsError([t])[0].errors}),(0,h.Z)(this,"getFieldWarning",function(e){n.warningUnhooked();var t=ei(e);return n.getFieldsError([t])[0].warnings}),(0,h.Z)(this,"isFieldsTouched",function(){n.warningUnhooked();for(var e,t=arguments.length,r=Array(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},r=new ex,o=n.getFieldEntities(!0);o.forEach(function(e){var t=e.props.initialValue,n=e.getNamePath();if(void 0!==t){var o=r.get(n)||new Set;o.add({entity:e,value:t}),r.set(n,o)}}),t.entities?e=t.entities:t.namePathList?(e=[],t.namePathList.forEach(function(t){var n,o=r.get(t);o&&(n=e).push.apply(n,(0,u.Z)((0,u.Z)(o).map(function(e){return e.entity})))})):e=o,function(e){e.forEach(function(e){if(void 0!==e.props.initialValue){var o=e.getNamePath();if(void 0!==n.getInitialValue(o))(0,y.ZP)(!1,"Form already set 'initialValues' with path '".concat(o.join("."),"'. Field can not overwrite it."));else{var a=r.get(o);if(a&&a.size>1)(0,y.ZP)(!1,"Multiple Field with path '".concat(o.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(a){var i=n.getFieldValue(o);e.isListField()||t.skipExist&&void 0!==i||n.updateStore((0,Q.Z)(n.store,o,(0,u.Z)(a)[0].value))}}}})}(e)}),(0,h.Z)(this,"resetFields",function(e){n.warningUnhooked();var t=n.store;if(!e){n.updateStore((0,Q.T)(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(t,null,{type:"reset"}),n.notifyWatch();return}var r=e.map(ei);r.forEach(function(e){var t=n.getInitialValue(e);n.updateStore((0,Q.Z)(n.store,e,t))}),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(t,r,{type:"reset"}),n.notifyWatch(r)}),(0,h.Z)(this,"setFields",function(e){n.warningUnhooked();var t=n.store,r=[];e.forEach(function(e){var o=e.name,a=(0,i.Z)(e,eE),c=ei(o);r.push(c),"value"in a&&n.updateStore((0,Q.Z)(n.store,c,a.value)),n.notifyObservers(t,[c],{type:"setField",data:e})}),n.notifyWatch(r)}),(0,h.Z)(this,"getFields",function(){return n.getFieldEntities(!0).map(function(e){var t=e.getNamePath(),r=e.getMeta(),o=(0,s.Z)((0,s.Z)({},r),{},{name:t,value:n.getFieldValue(t)});return Object.defineProperty(o,"originRCField",{value:!0}),o})}),(0,h.Z)(this,"initEntityValue",function(e){var t=e.props.initialValue;if(void 0!==t){var r=e.getNamePath();void 0===(0,ea.Z)(n.store,r)&&n.updateStore((0,Q.Z)(n.store,r,t))}}),(0,h.Z)(this,"isMergedPreserve",function(e){var t=void 0!==e?e:n.preserve;return null==t||t}),(0,h.Z)(this,"registerField",function(e){n.fieldEntities.push(e);var t=e.getNamePath();if(n.notifyWatch([t]),void 0!==e.props.initialValue){var r=n.store;n.resetWithFieldInitialValue({entities:[e],skipExist:!0}),n.notifyObservers(r,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(r,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(t){return t!==e}),!n.isMergedPreserve(o)&&(!r||a.length>1)){var i=r?void 0:n.getInitialValue(t);if(t.length&&n.getFieldValue(t)!==i&&n.fieldEntities.every(function(e){return!es(e.getNamePath(),t)})){var c=n.store;n.updateStore((0,Q.Z)(c,t,i,!0)),n.notifyObservers(c,[t],{type:"remove"}),n.triggerDependenciesUpdate(c,t)}}n.notifyWatch([t])}}),(0,h.Z)(this,"dispatch",function(e){switch(e.type){case"updateValue":var t=e.namePath,r=e.value;n.updateValue(t,r);break;case"validateField":var o=e.namePath,a=e.triggerName;n.validateFields([o],{triggerName:a})}}),(0,h.Z)(this,"notifyObservers",function(e,t,r){if(n.subscribable){var o=(0,s.Z)((0,s.Z)({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(n){(0,n.onStoreChange)(e,t,o)})}else n.forceRootUpdate()}),(0,h.Z)(this,"triggerDependenciesUpdate",function(e,t){var r=n.getDependencyChildrenFields(t);return r.length&&n.validateFields(r),n.notifyObservers(e,r,{type:"dependenciesUpdate",relatedFields:[t].concat((0,u.Z)(r))}),r}),(0,h.Z)(this,"updateValue",function(e,t){var r=ei(e),o=n.store;n.updateStore((0,Q.Z)(n.store,r,t)),n.notifyObservers(o,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var a=n.triggerDependenciesUpdate(o,r),i=n.callbacks.onValuesChange;i&&i(ec(n.store,[r]),n.getFieldsValue()),n.triggerOnFieldsChange([r].concat((0,u.Z)(a)))}),(0,h.Z)(this,"setFieldsValue",function(e){n.warningUnhooked();var t=n.store;if(e){var r=(0,Q.T)(n.store,e);n.updateStore(r)}n.notifyObservers(t,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),(0,h.Z)(this,"setFieldValue",function(e,t){n.setFields([{name:e,value:t}])}),(0,h.Z)(this,"getDependencyChildrenFields",function(e){var t=new Set,r=[],o=new ex;return n.getFieldEntities().forEach(function(e){(e.props.dependencies||[]).forEach(function(t){var n=ei(t);o.update(n,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t})})}),function e(n){(o.get(n)||new Set).forEach(function(n){if(!t.has(n)){t.add(n);var o=n.getNamePath();n.isFieldDirty()&&o.length&&(r.push(o),e(o))}})}(e),r}),(0,h.Z)(this,"triggerOnFieldsChange",function(e,t){var r=n.callbacks.onFieldsChange;if(r){var o=n.getFields();if(t){var a=new ex;t.forEach(function(e){var t=e.name,n=e.errors;a.set(t,n)}),o.forEach(function(e){e.errors=a.get(e.name)||e.errors})}var i=o.filter(function(t){return el(e,t.name)});i.length&&r(i,o)}}),(0,h.Z)(this,"validateFields",function(e,t){n.warningUnhooked(),Array.isArray(e)||"string"==typeof e||"string"==typeof t?(i=e,c=t):c=e;var r,o,a,i,c,l=!!i,d=l?i.map(ei):[],f=[],p=String(Date.now()),m=new Set,g=c||{},h=g.recursive,v=g.dirty;n.getFieldEntities(!0).forEach(function(e){if(l||d.push(e.getNamePath()),e.props.rules&&e.props.rules.length&&(!v||e.isFieldDirty())){var t=e.getNamePath();if(m.add(t.join(p)),!l||el(d,t,h)){var r=e.validateRules((0,s.Z)({validateMessages:(0,s.Z)((0,s.Z)({},Y),n.validateMessages)},c));f.push(r.then(function(){return{name:t,errors:[],warnings:[]}}).catch(function(e){var n,r=[],o=[];return(null===(n=e.forEach)||void 0===n||n.call(e,function(e){var t=e.rule.warningOnly,n=e.errors;t?o.push.apply(o,(0,u.Z)(n)):r.push.apply(r,(0,u.Z)(n))}),r.length)?Promise.reject({name:t,errors:r,warnings:o}):{name:t,errors:r,warnings:o}}))}}});var b=(r=!1,o=f.length,a=[],f.length?new Promise(function(e,t){f.forEach(function(n,i){n.catch(function(e){return r=!0,e}).then(function(n){o-=1,a[i]=n,o>0||(r&&t(a),e(a))})})}):Promise.resolve([]));n.lastValidatePromise=b,b.catch(function(e){return e}).then(function(e){var t=e.map(function(e){return e.name});n.notifyObservers(n.store,t,{type:"validateFinish"}),n.triggerOnFieldsChange(t,e)});var y=b.then(function(){return n.lastValidatePromise===b?Promise.resolve(n.getFieldsValue(d)):Promise.reject([])}).catch(function(e){var t=e.filter(function(e){return e&&e.errors.length});return Promise.reject({values:n.getFieldsValue(d),errorFields:t,outOfDate:n.lastValidatePromise!==b})});y.catch(function(e){return e});var w=d.filter(function(e){return m.has(e.join(p))});return n.triggerOnFieldsChange(w),y}),(0,h.Z)(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(e){var t=n.callbacks.onFinish;if(t)try{t(e)}catch(e){console.error(e)}}).catch(function(e){var t=n.callbacks.onFinishFailed;t&&t(e)})}),this.forceRootUpdate=t}),eC=function(e){var t=o.useRef(),n=o.useState({}),r=(0,eb.Z)(n,2)[1];if(!t.current){if(e)t.current=e;else{var a=new eS(function(){r({})});t.current=a.getForm()}}return[t.current]},eZ=o.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),eO=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,a=e.children,i=o.useContext(eZ),c=o.useRef({});return o.createElement(eZ.Provider,{value:(0,s.Z)((0,s.Z)({},i),{},{validateMessages:(0,s.Z)((0,s.Z)({},i.validateMessages),t),triggerFormChange:function(e,t){n&&n(e,{changedFields:t,forms:c.current}),i.triggerFormChange(e,t)},triggerFormFinish:function(e,t){r&&r(e,{values:t,forms:c.current}),i.triggerFormFinish(e,t)},registerForm:function(e,t){e&&(c.current=(0,s.Z)((0,s.Z)({},c.current),{},(0,h.Z)({},e,t))),i.registerForm(e,t)},unregisterForm:function(e){var t=(0,s.Z)({},c.current);delete t[e],c.current=t,i.unregisterForm(e)}})},a)},ek=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"];function eM(e){try{return JSON.stringify(e)}catch(e){return Math.random()}}var ej=function(){},eI=function(){for(var e=arguments.length,t=Array(e),n=0;n1?t-1:0),o=1;oen;(0,s.useImperativeHandle)(t,function(){return{focus:q,blur:function(){var e;null===(e=V.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=V.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=V.current)||void 0===e||e.select()},input:V.current}}),(0,s.useEffect)(function(){D(function(e){return(!e||!Z)&&e})},[Z]);var ea=function(e,t,n){var r,o,a=t;if(!W.current&&et.exceedFormatter&&et.max&&et.strategy(t)>et.max)a=et.exceedFormatter(t,{max:et.max}),t!==a&&ee([(null===(r=V.current)||void 0===r?void 0:r.selectionStart)||0,(null===(o=V.current)||void 0===o?void 0:o.selectionEnd)||0]);else if("compositionEnd"===n.source)return;$(a),V.current&&(0,u.rJ)(V.current,e,c,a)};(0,s.useEffect)(function(){if(J){var e;null===(e=V.current)||void 0===e||e.setSelectionRange.apply(e,(0,f.Z)(J))}},[J]);var ei=eo&&"".concat(C,"-out-of-range");return s.createElement(d,(0,o.Z)({},z,{prefixCls:C,className:l()(k,ei),handleReset:function(e){$(""),q(),V.current&&(0,u.rJ)(V.current,e,c)},value:K,focused:B,triggerFocus:q,suffix:function(){var e=Number(en)>0;if(j||et.show){var t=et.showFormatter?et.showFormatter({value:K,count:er,maxLength:en}):"".concat(er).concat(e?" / ".concat(en):"");return s.createElement(s.Fragment,null,et.show&&s.createElement("span",{className:l()("".concat(C,"-show-count-suffix"),(0,a.Z)({},"".concat(C,"-show-count-has-suffix"),!!j),null==F?void 0:F.count),style:(0,r.Z)({},null==T?void 0:T.count)},t),j)}return null}(),disabled:Z,classes:P,classNames:F,styles:T}),(n=(0,h.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]),s.createElement("input",(0,o.Z)({autoComplete:i},n,{onChange:function(e){ea(e,e.target.value,{source:"change"})},onFocus:function(e){D(!0),null==y||y(e)},onBlur:function(e){D(!1),null==w||w(e)},onKeyDown:function(e){x&&"Enter"===e.key&&x(e),null==E||E(e)},className:l()(C,(0,a.Z)({},"".concat(C,"-disabled"),Z),null==F?void 0:F.input),style:null==T?void 0:T.input,ref:V,size:O,type:void 0===N?"text":N,onCompositionStart:function(e){W.current=!0,null==A||A(e)},onCompositionEnd:function(e){W.current=!1,ea(e,e.currentTarget.value,{source:"compositionEnd"}),null==L||L(e)}}))))})},55041:function(e,t,n){"use strict";function r(e){return!!(e.addonBefore||e.addonAfter)}function o(e){return!!(e.prefix||e.suffix||e.allowClear)}function a(e,t,n,r){if(n){var o=t;if("click"===t.type){var a=e.cloneNode(!0);o=Object.create(t,{target:{value:a},currentTarget:{value:a}}),a.value="",n(o);return}if("file"!==e.type&&void 0!==r){var i=e.cloneNode(!0);o=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value=r,n(o);return}n(o)}}function i(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}n.d(t,{He:function(){return r},X3:function(){return o},nH:function(){return i},rJ:function(){return a}})},47970:function(e,t,n){"use strict";n.d(t,{V4:function(){return ep},zt:function(){return w},ZP:function(){return em}});var r,o,a,i,c,l=n(11993),s=n(31686),u=n(26365),d=n(41154),f=n(36760),p=n.n(f),m=n(2868),g=n(28791),h=n(2265),v=n(6989),b=["children"],y=h.createContext({});function w(e){var t=e.children,n=(0,v.Z)(e,b);return h.createElement(y.Provider,{value:n},t)}var x=n(76405),E=n(25049),S=n(15354),C=n(15900),Z=function(e){(0,S.Z)(n,e);var t=(0,C.Z)(n);function n(){return(0,x.Z)(this,n),t.apply(this,arguments)}return(0,E.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(h.Component),O=n(69819),k="none",M="appear",j="enter",I="leave",R="none",N="prepare",P="start",F="active",T="prepared",A=n(94981);function L(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var z=(r=(0,A.Z)(),o="undefined"!=typeof window?window:{},a={animationend:L("Animation","AnimationEnd"),transitionend:L("Transition","TransitionEnd")},!r||("AnimationEvent"in o||delete a.animationend.animation,"TransitionEvent"in o||delete a.transitionend.transition),a),_={};(0,A.Z)()&&(_=document.createElement("div").style);var H={};function B(e){if(H[e])return H[e];var t=z[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o1&&void 0!==arguments[1]?arguments[1]:2;t();var a=(0,K.Z)(function(){o<=1?r({isCanceled:function(){return a!==e.current}}):n(r,o-1)});e.current=a},t]},Q=[N,P,F,"end"],J=[N,T];function ee(e){return e===F||"end"===e}var et=function(e,t,n){var r=(0,O.Z)(R),o=(0,u.Z)(r,2),a=o[0],i=o[1],c=Y(),l=(0,u.Z)(c,2),s=l[0],d=l[1],f=t?J:Q;return $(function(){if(a!==R&&"end"!==a){var e=f.indexOf(a),t=f[e+1],r=n(a);!1===r?i(t,!0):t&&s(function(e){function n(){e.isCanceled()||i(t,!0)}!0===r?n():Promise.resolve(r).then(n)})}},[e,a]),h.useEffect(function(){return function(){d()}},[]),[function(){i(N,!0)},a]},en=(i=V,"object"===(0,d.Z)(V)&&(i=V.transitionSupport),(c=h.forwardRef(function(e,t){var n=e.visible,r=void 0===n||n,o=e.removeOnLeave,a=void 0===o||o,c=e.forceRender,d=e.children,f=e.motionName,v=e.leavedClassName,b=e.eventProps,w=h.useContext(y).motion,x=!!(e.motionName&&i&&!1!==w),E=(0,h.useRef)(),S=(0,h.useRef)(),C=function(e,t,n,r){var o=r.motionEnter,a=void 0===o||o,i=r.motionAppear,c=void 0===i||i,d=r.motionLeave,f=void 0===d||d,p=r.motionDeadline,m=r.motionLeaveImmediately,g=r.onAppearPrepare,v=r.onEnterPrepare,b=r.onLeavePrepare,y=r.onAppearStart,w=r.onEnterStart,x=r.onLeaveStart,E=r.onAppearActive,S=r.onEnterActive,C=r.onLeaveActive,Z=r.onAppearEnd,R=r.onEnterEnd,A=r.onLeaveEnd,L=r.onVisibleChanged,z=(0,O.Z)(),_=(0,u.Z)(z,2),H=_[0],B=_[1],D=(0,O.Z)(k),W=(0,u.Z)(D,2),V=W[0],q=W[1],G=(0,O.Z)(null),X=(0,u.Z)(G,2),K=X[0],Y=X[1],Q=(0,h.useRef)(!1),J=(0,h.useRef)(null),en=(0,h.useRef)(!1);function er(){q(k,!0),Y(null,!0)}function eo(e){var t,r=n();if(!e||e.deadline||e.target===r){var o=en.current;V===M&&o?t=null==Z?void 0:Z(r,e):V===j&&o?t=null==R?void 0:R(r,e):V===I&&o&&(t=null==A?void 0:A(r,e)),V!==k&&o&&!1!==t&&er()}}var ea=U(eo),ei=(0,u.Z)(ea,1)[0],ec=function(e){var t,n,r;switch(e){case M:return t={},(0,l.Z)(t,N,g),(0,l.Z)(t,P,y),(0,l.Z)(t,F,E),t;case j:return n={},(0,l.Z)(n,N,v),(0,l.Z)(n,P,w),(0,l.Z)(n,F,S),n;case I:return r={},(0,l.Z)(r,N,b),(0,l.Z)(r,P,x),(0,l.Z)(r,F,C),r;default:return{}}},el=h.useMemo(function(){return ec(V)},[V]),es=et(V,!e,function(e){if(e===N){var t,r=el[N];return!!r&&r(n())}return ef in el&&Y((null===(t=el[ef])||void 0===t?void 0:t.call(el,n(),null))||null),ef===F&&(ei(n()),p>0&&(clearTimeout(J.current),J.current=setTimeout(function(){eo({deadline:!0})},p))),ef===T&&er(),!0}),eu=(0,u.Z)(es,2),ed=eu[0],ef=eu[1],ep=ee(ef);en.current=ep,$(function(){B(t);var n,r=Q.current;Q.current=!0,!r&&t&&c&&(n=M),r&&t&&a&&(n=j),(r&&!t&&f||!r&&m&&!t&&f)&&(n=I);var o=ec(n);n&&(e||o[N])?(q(n),ed()):q(k)},[t]),(0,h.useEffect)(function(){(V!==M||c)&&(V!==j||a)&&(V!==I||f)||q(k)},[c,a,f]),(0,h.useEffect)(function(){return function(){Q.current=!1,clearTimeout(J.current)}},[]);var em=h.useRef(!1);(0,h.useEffect)(function(){H&&(em.current=!0),void 0!==H&&V===k&&((em.current||H)&&(null==L||L(H)),em.current=!0)},[H,V]);var eg=K;return el[N]&&ef===P&&(eg=(0,s.Z)({transition:"none"},eg)),[V,ef,eg,null!=H?H:t]}(x,r,function(){try{return E.current instanceof HTMLElement?E.current:(0,m.Z)(S.current)}catch(e){return null}},e),R=(0,u.Z)(C,4),A=R[0],L=R[1],z=R[2],_=R[3],H=h.useRef(_);_&&(H.current=!0);var B=h.useCallback(function(e){E.current=e,(0,g.mH)(t,e)},[t]),D=(0,s.Z)((0,s.Z)({},b),{},{visible:r});if(d){if(A===k)W=_?d((0,s.Z)({},D),B):!a&&H.current&&v?d((0,s.Z)((0,s.Z)({},D),{},{className:v}),B):!c&&(a||v)?null:d((0,s.Z)((0,s.Z)({},D),{},{style:{display:"none"}}),B);else{L===N?q="prepare":ee(L)?q="active":L===P&&(q="start");var W,V,q,G=X(f,"".concat(A,"-").concat(q));W=d((0,s.Z)((0,s.Z)({},D),{},{className:p()(X(f,A),(V={},(0,l.Z)(V,G,G&&q),(0,l.Z)(V,f,"string"==typeof f),V)),style:z}),B)}}else W=null;return h.isValidElement(W)&&(0,g.Yr)(W)&&!W.ref&&(W=h.cloneElement(W,{ref:B})),h.createElement(Z,{ref:S},W)})).displayName="CSSMotion",c),er=n(1119),eo=n(63496),ea="keep",ei="remove",ec="removed";function el(e){var t;return t=e&&"object"===(0,d.Z)(e)&&"key"in e?e:{key:e},(0,s.Z)((0,s.Z)({},t),{},{key:String(t.key)})}function es(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(el)}var eu=["component","children","onVisibleChanged","onAllRemoved"],ed=["status"],ef=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"],ep=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en,n=function(e){(0,S.Z)(r,e);var n=(0,C.Z)(r);function r(){var e;(0,x.Z)(this,r);for(var t=arguments.length,o=Array(t),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,a=es(e),i=es(t);a.forEach(function(e){for(var t=!1,a=r;a1}).forEach(function(e){(n=n.filter(function(t){var n=t.key,r=t.status;return n!==e||r!==ei})).forEach(function(t){t.key===e&&(t.status=ea)})}),n})(r,es(n)).filter(function(e){var t=r.find(function(t){var n=t.key;return e.key===n});return!t||t.status!==ec||e.status!==ei})}}}]),r}(h.Component);return(0,l.Z)(n,"defaultProps",{component:"div"}),n}(V),em=en},49283:function(e,t,n){"use strict";n.d(t,{qX:function(){return g},JB:function(){return v},lm:function(){return O}});var r=n(83145),o=n(26365),a=n(6989),i=n(2265),c=n(31686),l=n(54887),s=n(1119),u=n(11993),d=n(36760),f=n.n(d),p=n(47970),m=n(95814),g=i.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,a=e.className,c=e.duration,l=void 0===c?4.5:c,d=e.eventKey,p=e.content,g=e.closable,h=e.closeIcon,v=e.props,b=e.onClick,y=e.onNoticeClose,w=e.times,x=e.hovering,E=i.useState(!1),S=(0,o.Z)(E,2),C=S[0],Z=S[1],O=x||C,k=function(){y(d)};i.useEffect(function(){if(!O&&l>0){var e=setTimeout(function(){k()},1e3*l);return function(){clearTimeout(e)}}},[l,O,w]);var M="".concat(n,"-notice");return i.createElement("div",(0,s.Z)({},v,{ref:t,className:f()(M,a,(0,u.Z)({},"".concat(M,"-closable"),g)),style:r,onMouseEnter:function(e){var t;Z(!0),null==v||null===(t=v.onMouseEnter)||void 0===t||t.call(v,e)},onMouseLeave:function(e){var t;Z(!1),null==v||null===(t=v.onMouseLeave)||void 0===t||t.call(v,e)},onClick:b}),i.createElement("div",{className:"".concat(M,"-content")},p),g&&i.createElement("a",{tabIndex:0,className:"".concat(M,"-close"),onKeyDown:function(e){("Enter"===e.key||"Enter"===e.code||e.keyCode===m.Z.ENTER)&&k()},onClick:function(e){e.preventDefault(),e.stopPropagation(),k()}},void 0===h?"x":h))}),h=i.createContext({}),v=function(e){var t=e.children,n=e.classNames;return i.createElement(h.Provider,{value:{classNames:n}},t)},b=n(41154),y=function(e){var t,n,r,o={offset:8,threshold:3,gap:16};return e&&"object"===(0,b.Z)(e)&&(o.offset=null!==(t=e.offset)&&void 0!==t?t:8,o.threshold=null!==(n=e.threshold)&&void 0!==n?n:3,o.gap=null!==(r=e.gap)&&void 0!==r?r:16),[!!e,o]},w=["className","style","classNames","styles"],x=function(e){var t,n=e.configList,l=e.placement,d=e.prefixCls,m=e.className,v=e.style,b=e.motion,x=e.onAllNoticeRemoved,E=e.onNoticeClose,S=e.stack,C=(0,i.useContext)(h).classNames,Z=(0,i.useRef)({}),O=(0,i.useState)(null),k=(0,o.Z)(O,2),M=k[0],j=k[1],I=(0,i.useState)([]),R=(0,o.Z)(I,2),N=R[0],P=R[1],F=n.map(function(e){return{config:e,key:String(e.key)}}),T=y(S),A=(0,o.Z)(T,2),L=A[0],z=A[1],_=z.offset,H=z.threshold,B=z.gap,D=L&&(N.length>0||F.length<=H),W="function"==typeof b?b(l):b;return(0,i.useEffect)(function(){L&&N.length>1&&P(function(e){return e.filter(function(e){return F.some(function(t){return e===t.key})})})},[N,F,L]),(0,i.useEffect)(function(){var e,t;L&&Z.current[null===(e=F[F.length-1])||void 0===e?void 0:e.key]&&j(Z.current[null===(t=F[F.length-1])||void 0===t?void 0:t.key])},[F,L]),i.createElement(p.V4,(0,s.Z)({key:l,className:f()(d,"".concat(d,"-").concat(l),null==C?void 0:C.list,m,(t={},(0,u.Z)(t,"".concat(d,"-stack"),!!L),(0,u.Z)(t,"".concat(d,"-stack-expanded"),D),t)),style:v,keys:F,motionAppear:!0},W,{onAllRemoved:function(){x(l)}}),function(e,t){var n=e.config,o=e.className,u=e.style,p=e.index,m=n.key,h=n.times,v=String(m),b=n.className,y=n.style,x=n.classNames,S=n.styles,O=(0,a.Z)(n,w),k=F.findIndex(function(e){return e.key===v}),j={};if(L){var I=F.length-1-(k>-1?k:p-1),R="top"===l||"bottom"===l?"-50%":"0";if(I>0){j.height=D?null===(T=Z.current[v])||void 0===T?void 0:T.offsetHeight:null==M?void 0:M.offsetHeight;for(var T,A,z,H,W=0,V=0;V-1?Z.current[v]=e:delete Z.current[v]},prefixCls:d,classNames:x,styles:S,className:f()(b,null==C?void 0:C.notice),style:y,times:h,key:m,eventKey:m,onNoticeClose:E,hovering:L&&N.length>0})))})},E=i.forwardRef(function(e,t){var n=e.prefixCls,a=void 0===n?"rc-notification":n,s=e.container,u=e.motion,d=e.maxCount,f=e.className,p=e.style,m=e.onAllRemoved,g=e.stack,h=e.renderNotifications,v=i.useState([]),b=(0,o.Z)(v,2),y=b[0],w=b[1],E=function(e){var t,n=y.find(function(t){return t.key===e});null==n||null===(t=n.onClose)||void 0===t||t.call(n),w(function(t){return t.filter(function(t){return t.key!==e})})};i.useImperativeHandle(t,function(){return{open:function(e){w(function(t){var n,o=(0,r.Z)(t),a=o.findIndex(function(t){return t.key===e.key}),i=(0,c.Z)({},e);return a>=0?(i.times=((null===(n=t[a])||void 0===n?void 0:n.times)||0)+1,o[a]=i):(i.times=0,o.push(i)),d>0&&o.length>d&&(o=o.slice(-d)),o})},close:function(e){E(e)},destroy:function(){w([])}}});var S=i.useState({}),C=(0,o.Z)(S,2),Z=C[0],O=C[1];i.useEffect(function(){var e={};y.forEach(function(t){var n=t.placement,r=void 0===n?"topRight":n;r&&(e[r]=e[r]||[],e[r].push(t))}),Object.keys(Z).forEach(function(t){e[t]=e[t]||[]}),O(e)},[y]);var k=function(e){O(function(t){var n=(0,c.Z)({},t);return(n[e]||[]).length||delete n[e],n})},M=i.useRef(!1);if(i.useEffect(function(){Object.keys(Z).length>0?M.current=!0:M.current&&(null==m||m(),M.current=!1)},[Z]),!s)return null;var j=Object.keys(Z);return(0,l.createPortal)(i.createElement(i.Fragment,null,j.map(function(e){var t=Z[e],n=i.createElement(x,{key:e,configList:t,placement:e,prefixCls:a,className:null==f?void 0:f(e),style:null==p?void 0:p(e),motion:u,onNoticeClose:E,onAllNoticeRemoved:k,stack:g});return h?h(n,{prefixCls:a,key:e}):n})),s)}),S=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],C=function(){return document.body},Z=0;function O(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getContainer,n=void 0===t?C:t,c=e.motion,l=e.prefixCls,s=e.maxCount,u=e.className,d=e.style,f=e.onAllRemoved,p=e.stack,m=e.renderNotifications,g=(0,a.Z)(e,S),h=i.useState(),v=(0,o.Z)(h,2),b=v[0],y=v[1],w=i.useRef(),x=i.createElement(E,{container:b,ref:w,prefixCls:l,motion:c,maxCount:s,className:u,style:d,onAllRemoved:f,stack:p,renderNotifications:m}),O=i.useState([]),k=(0,o.Z)(O,2),M=k[0],j=k[1],I=i.useMemo(function(){return{open:function(e){var t=function(){for(var e={},t=arguments.length,n=Array(t),r=0;rP,ej=(0,c.useMemo)(function(){var e=w;return eO?e=null===q&&B?w:w.slice(0,Math.min(w.length,X/j)):"number"==typeof P&&(e=w.slice(0,P)),e},[w,j,q,P,eO]),eI=(0,c.useMemo)(function(){return eO?w.slice(eb+1):w.slice(ej.length)},[w,ej,eO,eb]),eR=(0,c.useCallback)(function(e,t){var n;return"function"==typeof S?S(e):null!==(n=S&&(null==e?void 0:e[S]))&&void 0!==n?n:t},[S]),eN=(0,c.useCallback)(x||function(e){return e},[x]);function eP(e,t,n){(eh!==e||void 0!==t&&t!==ef)&&(ev(e),n||(eE(eX){eP(r-1,e-o-el+eo);break}}A&&eT(0)+el>X&&ep(null)}},[X,K,eo,el,eR,ej]);var eA=ex&&!!eI.length,eL={};null!==ef&&eO&&(eL={position:"absolute",left:ef,top:0});var ez={prefixCls:eS,responsive:eO,component:z,invalidate:ek},e_=E?function(e,t){var n=eR(e,t);return c.createElement(y.Provider,{key:n,value:(0,o.Z)((0,o.Z)({},ez),{},{order:t,item:e,itemKey:n,registerSize:eF,display:t<=eb})},E(e,t))}:function(e,t){var n=eR(e,t);return c.createElement(m,(0,r.Z)({},ez,{order:t,key:n,item:e,renderItem:eN,itemKey:n,registerSize:eF,display:t<=eb}))},eH={order:eA?eb:Number.MAX_SAFE_INTEGER,className:"".concat(eS,"-rest"),registerSize:function(e,t){ea(t),et(eo)},display:eA};if(T)T&&(l=c.createElement(y.Provider,{value:(0,o.Z)((0,o.Z)({},ez),eH)},T(eI)));else{var eB=F||k;l=c.createElement(m,(0,r.Z)({},ez,eH),"function"==typeof eB?eB(eI):eB)}var eD=c.createElement(void 0===L?"div":L,(0,r.Z)({className:s()(!ek&&p,N),style:R,ref:t},H),ej.map(e_),eM?l:null,A&&c.createElement(m,(0,r.Z)({},ez,{responsive:eZ,responsiveDisabled:!eO,order:eb,className:"".concat(eS,"-suffix"),registerSize:function(e,t){es(t)},display:!0,style:eL}),A));return eZ&&(eD=c.createElement(u.Z,{onResize:function(e,t){G(t.clientWidth)},disabled:!eO},eD)),eD});M.displayName="Overflow",M.Item=S,M.RESPONSIVE=Z,M.INVALIDATE=O;var j=M},96257:function(e,t){"use strict";t.Z={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"}},31474:function(e,t,n){"use strict";n.d(t,{Z:function(){return H}});var r=n(1119),o=n(2265),a=n(45287);n(32559);var i=n(31686),c=n(41154),l=n(2868),s=n(28791),u=o.createContext(null),d=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){f&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),h?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){f&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;g.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),b=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),M="undefined"!=typeof WeakMap?new WeakMap:new d,j=function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var n=new k(t,v.getInstance(),this);M.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){j.prototype[e]=function(){var t;return(t=M.get(this))[e].apply(t,arguments)}});var I=void 0!==p.ResizeObserver?p.ResizeObserver:j,R=new Map,N=new I(function(e){e.forEach(function(e){var t,n=e.target;null===(t=R.get(n))||void 0===t||t.forEach(function(e){return e(n)})})}),P=n(76405),F=n(25049),T=n(15354),A=n(15900),L=function(e){(0,T.Z)(n,e);var t=(0,A.Z)(n);function n(){return(0,P.Z)(this,n),t.apply(this,arguments)}return(0,F.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(o.Component),z=o.forwardRef(function(e,t){var n=e.children,r=e.disabled,a=o.useRef(null),d=o.useRef(null),f=o.useContext(u),p="function"==typeof n,m=p?n(a):n,g=o.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),h=!p&&o.isValidElement(m)&&(0,s.Yr)(m),v=h?m.ref:null,b=(0,s.x1)(v,a),y=function(){var e;return(0,l.Z)(a.current)||(a.current&&"object"===(0,c.Z)(a.current)?(0,l.Z)(null===(e=a.current)||void 0===e?void 0:e.nativeElement):null)||(0,l.Z)(d.current)};o.useImperativeHandle(t,function(){return y()});var w=o.useRef(e);w.current=e;var x=o.useCallback(function(e){var t=w.current,n=t.onResize,r=t.data,o=e.getBoundingClientRect(),a=o.width,c=o.height,l=e.offsetWidth,s=e.offsetHeight,u=Math.floor(a),d=Math.floor(c);if(g.current.width!==u||g.current.height!==d||g.current.offsetWidth!==l||g.current.offsetHeight!==s){var p={width:u,height:d,offsetWidth:l,offsetHeight:s};g.current=p;var m=(0,i.Z)((0,i.Z)({},p),{},{offsetWidth:l===Math.round(a)?a:l,offsetHeight:s===Math.round(c)?c:s});null==f||f(m,e,r),n&&Promise.resolve().then(function(){n(m,e)})}},[]);return o.useEffect(function(){var e=y();return e&&!r&&(R.has(e)||(R.set(e,new Set),N.observe(e)),R.get(e).add(x)),function(){R.has(e)&&(R.get(e).delete(x),R.get(e).size||(N.unobserve(e),R.delete(e)))}},[a.current,r]),o.createElement(L,{ref:d},h?o.cloneElement(m,{ref:b}):m)}),_=o.forwardRef(function(e,t){var n=e.children;return("function"==typeof n?[n]:(0,a.Z)(n)).map(function(n,a){var i=(null==n?void 0:n.key)||"".concat("rc-observer-key","-").concat(a);return o.createElement(z,(0,r.Z)({},e,{key:i,ref:0===a?t:void 0}),n)})});_.Collection=function(e){var t=e.children,n=e.onBatchResize,r=o.useRef(0),a=o.useRef([]),i=o.useContext(u),c=o.useCallback(function(e,t,o){r.current+=1;var c=r.current;a.current.push({size:e,element:t,data:o}),Promise.resolve().then(function(){c===r.current&&(null==n||n(a.current),a.current=[])}),null==i||i(e,t,o)},[n,i]);return o.createElement(u.Provider,{value:c},t)};var H=_},5769:function(e,t,n){"use strict";n.d(t,{G:function(){return i},Z:function(){return h}});var r=n(36760),o=n.n(r),a=n(2265);function i(e){var t=e.children,n=e.prefixCls,r=e.id,i=e.overlayInnerStyle,c=e.className,l=e.style;return a.createElement("div",{className:o()("".concat(n,"-content"),c),style:l},a.createElement("div",{className:"".concat(n,"-inner"),id:r,role:"tooltip",style:i},"function"==typeof t?t():t))}var c=n(1119),l=n(31686),s=n(6989),u=n(97821),d={shiftX:64,adjustY:1},f={adjustX:1,shiftY:!0},p=[0,0],m={left:{points:["cr","cl"],overflow:f,offset:[-4,0],targetOffset:p},right:{points:["cl","cr"],overflow:f,offset:[4,0],targetOffset:p},top:{points:["bc","tc"],overflow:d,offset:[0,-4],targetOffset:p},bottom:{points:["tc","bc"],overflow:d,offset:[0,4],targetOffset:p},topLeft:{points:["bl","tl"],overflow:d,offset:[0,-4],targetOffset:p},leftTop:{points:["tr","tl"],overflow:f,offset:[-4,0],targetOffset:p},topRight:{points:["br","tr"],overflow:d,offset:[0,-4],targetOffset:p},rightTop:{points:["tl","tr"],overflow:f,offset:[4,0],targetOffset:p},bottomRight:{points:["tr","br"],overflow:d,offset:[0,4],targetOffset:p},rightBottom:{points:["bl","br"],overflow:f,offset:[4,0],targetOffset:p},bottomLeft:{points:["tl","bl"],overflow:d,offset:[0,4],targetOffset:p},leftBottom:{points:["br","bl"],overflow:f,offset:[-4,0],targetOffset:p}},g=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],h=(0,a.forwardRef)(function(e,t){var n=e.overlayClassName,r=e.trigger,o=e.mouseEnterDelay,d=e.mouseLeaveDelay,f=e.overlayStyle,p=e.prefixCls,h=void 0===p?"rc-tooltip":p,v=e.children,b=e.onVisibleChange,y=e.afterVisibleChange,w=e.transitionName,x=e.animation,E=e.motion,S=e.placement,C=e.align,Z=e.destroyTooltipOnHide,O=e.defaultVisible,k=e.getTooltipContainer,M=e.overlayInnerStyle,j=(e.arrowContent,e.overlay),I=e.id,R=e.showArrow,N=(0,s.Z)(e,g),P=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,function(){return P.current});var F=(0,l.Z)({},N);return"visible"in e&&(F.popupVisible=e.visible),a.createElement(u.Z,(0,c.Z)({popupClassName:n,prefixCls:h,popup:function(){return a.createElement(i,{key:"content",prefixCls:h,id:I,overlayInnerStyle:M},j)},action:void 0===r?["hover"]:r,builtinPlacements:m,popupPlacement:void 0===S?"right":S,ref:P,popupAlign:void 0===C?{}:C,getPopupContainer:k,onPopupVisibleChange:b,afterPopupVisibleChange:y,popupTransitionName:w,popupAnimation:x,popupMotion:E,defaultPopupVisible:O,autoDestroy:void 0!==Z&&Z,mouseLeaveDelay:void 0===d?.1:d,popupStyle:f,mouseEnterDelay:void 0===o?0:o,arrow:void 0===R||R},F),v)})},45287:function(e,t,n){"use strict";n.d(t,{Z:function(){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=[];return r.Children.forEach(t,function(t){(null!=t||n.keepEmpty)&&(Array.isArray(t)?a=a.concat(e(t)):(0,o.isFragment)(t)&&t.props?a=a.concat(e(t.props.children,n)):a.push(t))}),a}}});var r=n(2265),o=n(93754)},94981:function(e,t,n){"use strict";function r(){return!!("undefined"!=typeof window&&window.document&&window.document.createElement)}n.d(t,{Z:function(){return r}})},2161:function(e,t,n){"use strict";function r(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}n.d(t,{Z:function(){return r}})},21717:function(e,t,n){"use strict";n.d(t,{hq:function(){return m},jL:function(){return p}});var r=n(94981),o=n(2161),a="data-rc-order",i="data-rc-priority",c=new Map;function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):"rc-util-key"}function s(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function u(e){return Array.from((c.get(e)||e).children).filter(function(e){return"STYLE"===e.tagName})}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,r.Z)())return null;var n=t.csp,o=t.prepend,c=t.priority,l=void 0===c?0:c,d="queue"===o?"prependQueue":o?"prepend":"append",f="prependQueue"===d,p=document.createElement("style");p.setAttribute(a,d),f&&l&&p.setAttribute(i,"".concat(l)),null!=n&&n.nonce&&(p.nonce=null==n?void 0:n.nonce),p.innerHTML=e;var m=s(t),g=m.firstChild;if(o){if(f){var h=u(m).filter(function(e){return!!["prepend","prependQueue"].includes(e.getAttribute(a))&&l>=Number(e.getAttribute(i)||0)});if(h.length)return m.insertBefore(p,h[h.length-1].nextSibling),p}m.insertBefore(p,g)}else m.appendChild(p);return p}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(s(t)).find(function(n){return n.getAttribute(l(t))===e})}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=f(e,t);n&&s(t).removeChild(n)}function m(e,t){var n,r,a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){var n=c.get(e);if(!n||!(0,o.Z)(document,n)){var r=d("",t),a=r.parentNode;c.set(e,a),e.removeChild(r)}}(s(i),i);var u=f(t,i);if(u)return null!==(n=i.csp)&&void 0!==n&&n.nonce&&u.nonce!==(null===(r=i.csp)||void 0===r?void 0:r.nonce)&&(u.nonce=null===(a=i.csp)||void 0===a?void 0:a.nonce),u.innerHTML!==e&&(u.innerHTML=e),u;var p=d(e,i);return p.setAttribute(l(i),t),p}},2868:function(e,t,n){"use strict";n.d(t,{S:function(){return a},Z:function(){return i}});var r=n(2265),o=n(54887);function a(e){return e instanceof HTMLElement||e instanceof SVGElement}function i(e){return a(e)?e:e instanceof r.Component?o.findDOMNode(e):null}},2857:function(e,t){"use strict";t.Z=function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var o=e.getBoundingClientRect(),a=o.width,i=o.height;if(a||i)return!0}}return!1}},13211:function(e,t,n){"use strict";function r(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}function o(e){return r(e) instanceof ShadowRoot?r(e):null}n.d(t,{A:function(){return o}})},95814:function(e,t){"use strict";var n={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=n.F1&&t<=n.F12)return!1;switch(t){case n.ALT:case n.CAPS_LOCK:case n.CONTEXT_MENU:case n.CTRL:case n.DOWN:case n.END:case n.ESC:case n.HOME:case n.INSERT:case n.LEFT:case n.MAC_FF_META:case n.META:case n.NUMLOCK:case n.NUM_CENTER:case n.PAGE_DOWN:case n.PAGE_UP:case n.PAUSE:case n.PRINT_SCREEN:case n.RIGHT:case n.SHIFT:case n.UP:case n.WIN_KEY:case n.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=n.ZERO&&e<=n.NINE||e>=n.NUM_ZERO&&e<=n.NUM_MULTIPLY||e>=n.A&&e<=n.Z||-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case n.SPACE:case n.QUESTION_MARK:case n.NUM_PLUS:case n.NUM_MINUS:case n.NUM_PERIOD:case n.NUM_DIVISION:case n.SEMICOLON:case n.DASH:case n.EQUALS:case n.COMMA:case n.PERIOD:case n.SLASH:case n.APOSTROPHE:case n.SINGLE_QUOTE:case n.OPEN_SQUARE_BRACKET:case n.BACKSLASH:case n.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};t.Z=n},18404:function(e,t,n){"use strict";n.d(t,{s:function(){return h},v:function(){return b}});var r,o,a=n(73129),i=n(54580),c=n(41154),l=n(31686),s=n(54887),u=(0,l.Z)({},r||(r=n.t(s,2))),d=u.version,f=u.render,p=u.unmountComponentAtNode;try{Number((d||"").split(".")[0])>=18&&(o=u.createRoot)}catch(e){}function m(e){var t=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===(0,c.Z)(t)&&(t.usingClientEntryPoint=e)}var g="__rc_react_root__";function h(e,t){if(o){var n;m(!0),n=t[g]||o(t),m(!1),n.render(e),t[g]=n;return}f(e,t)}function v(){return(v=(0,i.Z)((0,a.Z)().mark(function e(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then(function(){var e;null===(e=t[g])||void 0===e||e.unmount(),delete t[g]}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function b(e){return y.apply(this,arguments)}function y(){return(y=(0,i.Z)((0,a.Z)().mark(function e(t){return(0,a.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(void 0!==o)){e.next=2;break}return e.abrupt("return",function(e){return v.apply(this,arguments)}(t));case 2:p(t);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}},3208:function(e,t,n){"use strict";var r;function o(e){if("undefined"==typeof document)return 0;if(e||void 0===r){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),o=n.style;o.position="absolute",o.top="0",o.left="0",o.pointerEvents="none",o.visibility="hidden",o.width="200px",o.height="150px",o.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var a=t.offsetWidth;n.style.overflow="scroll";var i=t.offsetWidth;a===i&&(i=n.clientWidth),document.body.removeChild(n),r=a-i}return r}function a(e){var t=e.match(/^(.*)px$/),n=Number(null==t?void 0:t[1]);return Number.isNaN(n)?o():n}function i(e){if("undefined"==typeof document||!e||!(e instanceof Element))return{width:0,height:0};var t=getComputedStyle(e,"::-webkit-scrollbar"),n=t.width,r=t.height;return{width:a(n),height:a(r)}}n.d(t,{Z:function(){return o},o:function(){return i}})},58525:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e){var t=r.useRef();return t.current=e,r.useCallback(function(){for(var e,n=arguments.length,r=Array(n),o=0;o2&&void 0!==arguments[2]&&arguments[2],a=new Set;return function e(t,i){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=a.has(t);if((0,o.ZP)(!l,"Warning: There may be circular references"),l)return!1;if(t===i)return!0;if(n&&c>1)return!1;a.add(t);var s=c+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var u=0;u