From 03804cb1d29b1fc930c64089e03f7a08e17156f7 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Sun, 5 Oct 2025 16:01:20 -0700 Subject: [PATCH 01/48] preliminary virtual-keys refactor simplifies handleCreate function for CreateKeyModal moved hooks, components, files where I want them moved virtual-key page to (console) for common layout added layout for refactored console file structure, sidebar wired teams to refactored components fixing type issue wired new top level hook useAuthorized Adds routing to unrefactored pages Update leftnav.tsx Update useAuthorized.ts useAuthorized in virtual-keys/page and deprecation notices prelim VirtualKeyViewPage, removed old comment Delete page.tsx --- .../src/app/(console)/components/Sidebar.tsx | 291 ++++++++ .../components/modals/CreateUserModal.tsx | 345 +++++++++ .../src/app/(console)/hooks/useAuthorized.ts | 23 + .../src/app/(console)/layout.tsx | 46 ++ .../virtual-keys/components/CreateKey.tsx | 108 +++ .../CreateKeyForm/KeyDetailsSection.tsx | 148 ++++ .../CreateKeyForm/OptionalSettingsSection.tsx | 458 ++++++++++++ .../CreateKeyForm/OwnershipSection.tsx | 130 ++++ .../CreateKeyModal/CreateKeyModal.tsx | 233 ++++++ .../components/CreateKeyModal/hooks/index.ts | 5 + .../hooks/useGuardrailsAndPrompts.ts | 24 + .../hooks/useMcpAccessGroups.ts | 21 + .../CreateKeyModal/hooks/useTeamModels.ts | 26 + .../CreateKeyModal/hooks/useUserModels.ts | 21 + .../CreateKeyModal/hooks/useUserSearch.ts | 41 ++ .../components/CreateKeyModal/networking.ts | 84 +++ .../components/CreateKeyModal/types.ts | 17 + .../components/CreateKeyModal/utils.ts | 187 +++++ .../virtual-keys/components/KeyInfoView.tsx | 697 ++++++++++++++++++ .../virtual-keys/components/SaveKeyModal.tsx | 58 ++ .../VirtualKeysTable/VirtualKeysTable.tsx | 666 +++++++++++++++++ .../VirtualKeysTable/hooks/useFilterLogic.ts | 189 +++++ .../(console)/virtual-keys/hooks/useTeams.tsx | 20 + .../app/(console)/virtual-keys/networking.ts | 17 + .../src/app/(console)/virtual-keys/page.tsx | 52 ++ ui/litellm-dashboard/src/app/page.tsx | 2 - .../src/components/leftnav.tsx | 50 +- .../organisms/create_key_button.tsx | 8 + .../components/templates/view_key_table.tsx | 7 + ui/litellm-dashboard/src/utils/roles.ts | 2 +- 30 files changed, 3941 insertions(+), 35 deletions(-) create mode 100644 ui/litellm-dashboard/src/app/(console)/components/Sidebar.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/components/modals/CreateUserModal.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/hooks/useAuthorized.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/layout.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKey.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/index.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/networking.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/types.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/utils.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/KeyInfoView.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/SaveKeyModal.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/hooks/useTeams.tsx create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/networking.ts create mode 100644 ui/litellm-dashboard/src/app/(console)/virtual-keys/page.tsx diff --git a/ui/litellm-dashboard/src/app/(console)/components/Sidebar.tsx b/ui/litellm-dashboard/src/app/(console)/components/Sidebar.tsx new file mode 100644 index 0000000000..ad60ba626a --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/components/Sidebar.tsx @@ -0,0 +1,291 @@ +import React from "react"; +import Link from "next/link"; +import { usePathname, useSearchParams } from "next/navigation"; +import { Layout, Menu, ConfigProvider } from "antd"; +import { + KeyOutlined, + PlayCircleOutlined, + BlockOutlined, + BarChartOutlined, + TeamOutlined, + BankOutlined, + UserOutlined, + SettingOutlined, + ApiOutlined, + AppstoreOutlined, + DatabaseOutlined, + FileTextOutlined, + LineChartOutlined, + SafetyOutlined, + ExperimentOutlined, + ToolOutlined, + TagsOutlined, + BgColorsOutlined, +} from "@ant-design/icons"; +import { all_admin_roles, internalUserRoles, isAdminRole, rolesWithWriteAccess } from "@/utils/roles"; +import UsageIndicator from "@/components/usage_indicator"; + +const { Sider } = Layout; + +interface SidebarProps { + accessToken: string | null; + userRole: string; + /** Used to highlight a menu item when pathname doesn't match (e.g., on non-routed pages) */ + defaultSelectedKey?: string; + collapsed?: boolean; +} + +interface MenuItem { + key: string; + page: string; + label: string; + roles?: string[]; + children?: MenuItem[]; + icon?: React.ReactNode; +} + +const Sidebar: React.FC = ({ accessToken, userRole, defaultSelectedKey, collapsed = false }) => { + const menuItems: MenuItem[] = [ + { key: "1", page: "api-keys", label: "Virtual Keys", icon: }, + { + key: "3", + page: "llm-playground", + label: "Test Key", + icon: , + roles: rolesWithWriteAccess, + }, + { + key: "2", + page: "models", + label: "Models + Endpoints", + icon: , + roles: rolesWithWriteAccess, + }, + { + key: "12", + page: "new_usage", + label: "Usage", + icon: , + roles: [...all_admin_roles, ...internalUserRoles], + }, + { key: "6", page: "teams", label: "Teams", icon: }, + { + key: "17", + page: "organizations", + label: "Organizations", + icon: , + roles: all_admin_roles, + }, + { + key: "5", + page: "users", + label: "Internal Users", + icon: , + roles: all_admin_roles, + }, + { key: "14", page: "api_ref", label: "API Reference", icon: }, + { key: "16", page: "model-hub-table", label: "Model Hub", icon: }, + { key: "15", page: "logs", label: "Logs", icon: }, + { + key: "11", + page: "guardrails", + label: "Guardrails", + icon: , + roles: all_admin_roles, + }, + { + key: "26", + page: "tools", + label: "Tools", + icon: , + children: [ + { key: "18", page: "mcp-servers", label: "MCP Servers", icon: }, + { + key: "21", + page: "vector-stores", + label: "Vector Stores", + icon: , + roles: all_admin_roles, + }, + ], + }, + { + key: "experimental", + page: "experimental", + label: "Experimental", + icon: , + children: [ + { + key: "9", + page: "caching", + label: "Caching", + icon: , + roles: all_admin_roles, + }, + { + key: "25", + page: "prompts", + label: "Prompts", + icon: , + roles: all_admin_roles, + }, + { + key: "10", + page: "budgets", + label: "Budgets", + icon: , + roles: all_admin_roles, + }, + { + key: "20", + page: "transform-request", + label: "API Playground", + icon: , + roles: [...all_admin_roles, ...internalUserRoles], + }, + { + key: "19", + page: "tag-management", + label: "Tag Management", + icon: , + roles: all_admin_roles, + }, + { key: "4", page: "usage", label: "Old Usage", icon: }, + ], + }, + { + key: "settings", + page: "settings", + label: "Settings", + icon: , + roles: all_admin_roles, + children: [ + { + key: "11", + page: "general-settings", + label: "Router Settings", + icon: , + roles: all_admin_roles, + }, + { + key: "8", + page: "settings", + label: "Logging & Alerts", + icon: , + roles: all_admin_roles, + }, + { + key: "13", + page: "admin-panel", + label: "Admin Settings", + icon: , + roles: all_admin_roles, + }, + { + key: "14", + page: "ui-theme", + label: "UI Theme", + icon: , + roles: all_admin_roles, + }, + ], + }, + ]; + + // Role filtering (preserves original visibility behavior) + const filteredMenuItems: MenuItem[] = menuItems + .filter((item) => !item.roles || item.roles.includes(userRole)) + .map((item) => ({ + ...item, + children: item.children?.filter((child) => !child.roles || child.roles.includes(userRole)), + })); + + // Highlight selection based on pathname or ?page= + const pathname = usePathname(); + const searchParams = useSearchParams(); + const pageParam = searchParams.get("page") || undefined; + + const findMenuItemKey = (page: string): string => { + const top = filteredMenuItems.find((i) => i.page === page); + if (top) return top.key; + for (const i of filteredMenuItems) { + const child = i.children?.find((c) => c.page === page); + if (child) return child.key; + } + return "1"; + }; + + const selectedMenuKey = + pathname === "/virtual-keys" + ? "1" + : pageParam + ? findMenuItemKey(pageParam) + : defaultSelectedKey + ? findMenuItemKey(defaultSelectedKey) + : "1"; + + // Root-only routing helper: always replace everything after the domain + const rootWithPage = (p: string) => ({ pathname: "/", query: { page: p } }); + + // Convert to AntD Menu items: + // - "Virtual Keys" still routes to /virtual-keys + // - All other items (and children) route to "/?page=" + const antdItems = filteredMenuItems.map((item) => { + const isVirtualKeys = item.key === "1"; + const label = isVirtualKeys ? ( + Virtual Keys + ) : ( + {item.label} + ); + + return { + key: item.key, + icon: item.icon, + label, + children: item.children?.map((child) => ({ + key: child.key, + icon: child.icon, + label: {child.label}, + })), + }; + }); + + return ( + + + + + + + {isAdminRole(userRole) && !collapsed && } + + + ); +}; + +export default Sidebar; diff --git a/ui/litellm-dashboard/src/app/(console)/components/modals/CreateUserModal.tsx b/ui/litellm-dashboard/src/app/(console)/components/modals/CreateUserModal.tsx new file mode 100644 index 0000000000..4caaceb662 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/components/modals/CreateUserModal.tsx @@ -0,0 +1,345 @@ +// TODO: refactor +import React, { useState, useEffect } from "react"; +import { Button, Modal, Form, Input, message, Select, InputNumber, Select as Select2 } from "antd"; +import { + Button as Button2, + Text, + TextInput, + SelectItem, + Accordion, + AccordionHeader, + AccordionBody, + Title, +} from "@tremor/react"; +import NotificationsManager from "@/components/molecules/notifications_manager"; +const { Option } = Select; +import { Tooltip } from "antd"; +import { InfoCircleOutlined } from "@ant-design/icons"; +import { useQueryClient } from "@tanstack/react-query"; +import OnboardingModal, { InvitationLink } from "@/components/onboarding_link"; +import { + getProxyBaseUrl, + getProxyUISettings, + invitationCreateCall, + modelAvailableCall, + Team, + userCreateCall, +} from "@/components/networking"; +import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; +import BulkCreateUsersButton from "@/components/bulk_create_users_button"; +import { fetchTeams } from "@/app/(console)/virtual-keys/networking"; +import useTeams from "@/app/(console)/virtual-keys/hooks/useTeams"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +// Helper function to generate UUID compatible across all environments +const generateUUID = (): string => { + if (typeof crypto !== "undefined" && crypto.randomUUID) { + return crypto.randomUUID(); + } + // Fallback UUID generation for environments without crypto.randomUUID + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { + const r = (Math.random() * 16) | 0; + const v = c == "x" ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); +}; + +interface CreateUserModalProps { + possibleUIRoles: null | Record>; + onUserCreated?: (userId: string) => void; + isEmbedded?: boolean; +} + +interface UISettings { + PROXY_BASE_URL: string | null; + PROXY_LOGOUT_URL: string | null; + DEFAULT_TEAM_DISABLED: boolean; + SSO_ENABLED: boolean; +} + +const CreateUserModal: React.FC = ({ possibleUIRoles, onUserCreated, isEmbedded = false }) => { + const { userId: userID, accessToken } = useAuthorized(); + const queryClient = useQueryClient(); + const [uiSettings, setUISettings] = useState(null); + const [form] = Form.useForm(); + const [isModalVisible, setIsModalVisible] = useState(false); + const [apiuser, setApiuser] = useState(false); + const [userModels, setUserModels] = useState([]); + const [isInvitationLinkModalVisible, setIsInvitationLinkModalVisible] = useState(false); + const [invitationLinkData, setInvitationLinkData] = useState(null); + const [baseUrl, setBaseUrl] = useState(null); + const teams = useTeams(); + + // get all models + useEffect(() => { + const fetchData = async () => { + try { + const userRole = "any"; // You may need to get the user role dynamically + const modelDataResponse = await modelAvailableCall(accessToken, userID, userRole); + // Assuming modelDataResponse.data contains an array of model objects with a 'model_name' property + const availableModels = []; + for (let i = 0; i < modelDataResponse.data.length; i++) { + const model = modelDataResponse.data[i]; + availableModels.push(model.id); + } + console.log("Model data response:", modelDataResponse.data); + console.log("Available models:", availableModels); + + // Assuming modelDataResponse.data contains an array of model names + setUserModels(availableModels); + + // get ui settings + const uiSettingsResponse = await getProxyUISettings(accessToken); + console.log("uiSettingsResponse:", uiSettingsResponse); + + setUISettings(uiSettingsResponse); + } catch (error) { + console.error("Error fetching model data:", error); + } + }; + + setBaseUrl(getProxyBaseUrl()); + + fetchData(); // Call the function to fetch model data when the component mounts + }, []); // Empty dependency array to run only once + + const handleOk = () => { + setIsModalVisible(false); + form.resetFields(); + }; + + const handleCancel = () => { + setIsModalVisible(false); + setApiuser(false); + form.resetFields(); + }; + + const handleCreate = async (formValues: { user_id: string; models?: string[]; user_role: string }) => { + try { + NotificationsManager.info("Making API Call"); + if (!isEmbedded) { + setIsModalVisible(true); + } + if ((!formValues.models || formValues.models.length === 0) && formValues.user_role !== "proxy_admin") { + console.log("formValues.user_role", formValues.user_role); + // If models is empty or undefined, set it to "no-default-models" + formValues.models = ["no-default-models"]; + } + console.log("formValues in create user:", formValues); + const response = await userCreateCall(accessToken, null, formValues); + await queryClient.invalidateQueries({ queryKey: ["userList"] }); + console.log("user create Response:", response); + setApiuser(true); + const user_id = response.data?.user_id || response.user_id; + + // Call the callback if provided (for embedded mode) + if (onUserCreated && isEmbedded) { + onUserCreated(user_id); + form.resetFields(); + return; // Skip the invitation flow when embedded + } + + // only do invite link flow if sso is not enabled + if (!uiSettings?.SSO_ENABLED) { + invitationCreateCall(accessToken, user_id).then((data) => { + data.has_user_setup_sso = false; + setInvitationLinkData(data); + setIsInvitationLinkModalVisible(true); + }); + } else { + // create an InvitationLink Object for this user for the SSO flow + // for SSO the invite link is the proxy base url since the User just needs to login + const invitationLink: InvitationLink = { + id: generateUUID(), // Generate a unique ID + user_id: user_id, + is_accepted: false, + accepted_at: null, + expires_at: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // Set expiry to 7 days from now + created_at: new Date(), + created_by: userID, // Assuming userID is the current user creating the invitation + updated_at: new Date(), + updated_by: userID, + has_user_setup_sso: true, + }; + setInvitationLinkData(invitationLink); + setIsInvitationLinkModalVisible(true); + } + + NotificationsManager.success("API user Created"); + form.resetFields(); + localStorage.removeItem("userData" + userID); + } catch (error: any) { + const errorMessage = error.response?.data?.detail || error?.message || "Error creating the user"; + NotificationsManager.fromBackend(errorMessage); + console.error("Error creating the user:", error); + } + }; + + // Modify the return statement to handle embedded mode + if (isEmbedded) { + return ( +
+ + + + + + {possibleUIRoles && + Object.entries(possibleUIRoles).map(([role, { ui_label, description }]) => ( + +
+ {ui_label}{" "} +

+ {description} +

+
+
+ ))} +
+
+ + + + + + + + +
+ +
+
+ ); + } + + // Original return for standalone mode + return ( +
+ setIsModalVisible(true)}> + + Invite User + + + + Create a User who can own keys +
+ + + + + Global Proxy Role{" "} + + + + + } + name="user_role" + > + + {possibleUIRoles && + Object.entries(possibleUIRoles).map(([role, { ui_label, description }]) => ( + +
+ {ui_label}{" "} +

+ {description} +

+
+
+ ))} +
+
+ + + + + + + + + + + Personal Key Creation + + + + Models{" "} + + + + + } + name="models" + help="Models user has access to, outside of team scope." + > + + + All Proxy Models + + {userModels.map((model) => ( + + {getModelDisplayName(model)} + + ))} + + + + +
+ +
+
+
+ {apiuser && ( + + )} +
+ ); +}; + +export default CreateUserModal; diff --git a/ui/litellm-dashboard/src/app/(console)/hooks/useAuthorized.ts b/ui/litellm-dashboard/src/app/(console)/hooks/useAuthorized.ts new file mode 100644 index 0000000000..45f5ee92ea --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/hooks/useAuthorized.ts @@ -0,0 +1,23 @@ +import { Router } from "next/router"; +import { getCookie } from "@/utils/cookieUtils"; +import { useRouter } from "next/navigation"; +import { jwtDecode } from "jwt-decode"; + +const useAuthorized = () => { + const token = getCookie("token"); + const router = useRouter(); + + if (!token) { + router.replace("/sso/key/generate"); + } + + const decoded = jwtDecode(token as string) as { [key: string]: any }; + const accessToken = decoded.key; + const userId = decoded.user_id; + const userRole = decoded.user_role; + const premiumUser = decoded.premium_user; + + return { accessToken, userId, userRole, premiumUser }; +}; + +export default useAuthorized; diff --git a/ui/litellm-dashboard/src/app/(console)/layout.tsx b/ui/litellm-dashboard/src/app/(console)/layout.tsx new file mode 100644 index 0000000000..cbfb5bdcb5 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/layout.tsx @@ -0,0 +1,46 @@ +"use client"; + +import React from "react"; +import Navbar from "@/components/navbar"; +import { ThemeProvider } from "@/contexts/ThemeContext"; +import Sidebar from "@/app/(console)/components/Sidebar"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +export default function Layout({ children }: { children: React.ReactNode }) { + const { accessToken, userRole } = useAuthorized(); + const [sidebarCollapsed, setSidebarCollapsed] = React.useState(false); + + const toggleSidebar = () => setSidebarCollapsed((v) => !v); + + return ( + +
+ +
+
+ +
+
{children}
+
+
+
+ ); +} diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKey.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKey.tsx new file mode 100644 index 0000000000..c8e0b1d8ce --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKey.tsx @@ -0,0 +1,108 @@ +"use client"; + +import React, { useState, useEffect } from "react"; +import { Button } from "@tremor/react"; +import { Modal, Form } from "antd"; +import { getPossibleUserRoles, Organization } from "@/components/networking"; +import { rolesWithWriteAccess } from "@/utils/roles"; +import { Team } from "@/components/key_team_helpers/key_list"; +import CreateKeyModal from "@/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyModal"; +import CreateUserModal from "@/app/(console)/components/modals/CreateUserModal"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +interface CreateKeyProps { + team: Team | null; + userRole: string | null; + data: any[] | null; + addKey: (data: any) => void; +} + +interface User { + user_id: string; + user_email: string; + role?: string; +} + +interface UserOption { + label: string; + value: string; + user: User; +} +const CreateKey: React.FC = ({ team, userRole, data, addKey }) => { + const { accessToken } = useAuthorized(); + const [form] = Form.useForm(); + const [isModalVisible, setIsModalVisible] = useState(false); + const [isCreateUserModalVisible, setIsCreateUserModalVisible] = useState(false); + const [newlyCreatedUserId, setNewlyCreatedUserId] = useState(null); + const [possibleUIRoles, setPossibleUIRoles] = useState>>({}); + + useEffect(() => { + const fetchPossibleRoles = async () => { + try { + if (accessToken) { + // Check if roles are cached in session storage + const cachedRoles = sessionStorage.getItem("possibleUserRoles"); + if (cachedRoles) { + setPossibleUIRoles(JSON.parse(cachedRoles)); + } else { + const availableUserRoles = await getPossibleUserRoles(accessToken); + sessionStorage.setItem("possibleUserRoles", JSON.stringify(availableUserRoles)); + setPossibleUIRoles(availableUserRoles); + } + } + } catch (error) { + console.error("Error fetching possible user roles:", error); + } + }; + + fetchPossibleRoles(); + }, [accessToken]); + + // Add a callback function to handle user creation + const handleUserCreated = (userId: string) => { + setNewlyCreatedUserId(userId); + form.setFieldsValue({ user_id: userId }); + setIsCreateUserModalVisible(false); + }; + + const handleUserSelect = (_value: string, option: UserOption): void => { + const selectedUser = option.user; + form.setFieldsValue({ + user_id: selectedUser.user_id, + }); + }; + + return ( +
+ {userRole && rolesWithWriteAccess.includes(userRole) && ( + + )} + + + {isCreateUserModalVisible && ( + setIsCreateUserModalVisible(false)} + footer={null} + width={800} + > + + + )} +
+ ); +}; + +export default CreateKey; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx new file mode 100644 index 0000000000..54e9aaefed --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx @@ -0,0 +1,148 @@ +import { TextInput, Title } from "@tremor/react"; +import { Form, FormInstance, Select, Tooltip } from "antd"; +import { InfoCircleOutlined } from "@ant-design/icons"; +import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; +import React from "react"; + +export interface KeyDetailsSectionProps { + form: FormInstance; + keyOwner: string; + modelsToPick: string[]; + keyType: string; + setKeyType: (keyType: string) => void; +} + +const { Option } = Select; + +const KeyDetailsSection = ({ form, keyOwner, keyType, modelsToPick, setKeyType }: KeyDetailsSectionProps) => { + return ( +
+ Key Details + + {keyOwner === "you" || keyOwner === "another_user" ? "Key Name" : "Service Account ID"}{" "} + + + + + } + name="key_alias" + rules={[ + { + required: true, + message: `Please input a ${keyOwner === "you" ? "key name" : "service account ID"}`, + }, + ]} + help="required" + > + + + + + Models{" "} + + + + + } + name="models" + rules={ + keyType === "management" || keyType === "read_only" + ? [] + : [{ required: true, message: "Please select a model" }] + } + help={ + keyType === "management" || keyType === "read_only" + ? "Models field is disabled for this key type" + : "required" + } + className="mt-4" + > + + + + + Key Type{" "} + + + + + } + name="key_type" + initialValue="default" + className="mt-4" + > + + +
+ ); +}; + +export default KeyDetailsSection; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx new file mode 100644 index 0000000000..c879cdf595 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx @@ -0,0 +1,458 @@ +import { Accordion, AccordionBody, AccordionHeader, Text, Title } from "@tremor/react"; +import { Form, FormInstance, Input, Select, Tooltip } from "antd"; +import { InfoCircleOutlined } from "@ant-design/icons"; +import { formatNumberWithCommas } from "@/utils/dataUtils"; +import NumericalInput from "@/components/shared/numerical_input"; +import BudgetDurationDropdown from "@/components/common_components/budget_duration_dropdown"; +import RateLimitTypeFormItem from "@/components/common_components/RateLimitTypeFormItem"; +import VectorStoreSelector from "@/components/vector_store_management/VectorStoreSelector"; +import MCPServerSelector from "@/components/mcp_server_management/MCPServerSelector"; +import PremiumLoggingSettings from "@/components/common_components/PremiumLoggingSettings"; +import ModelAliasManager from "@/components/common_components/ModelAliasManager"; +import KeyLifecycleSettings from "@/components/common_components/KeyLifecycleSettings"; +import { proxyBaseUrl } from "@/components/networking"; +import SchemaFormFields from "@/components/common_components/check_openapi_schema"; +import { Team } from "@/components/key_team_helpers/key_list"; +import React from "react"; +import { DefaultOptionType } from "rc-select/lib/Select"; +import { ModelAliases } from "@/app/(console)/virtual-keys/components/CreateKeyModal/types"; + +export interface OptionalSettingsSectionProps { + form: FormInstance; + team: Team | null; + premiumUser: boolean; + guardrails: string[]; + prompts: string[]; + accessToken: string; + predefinedTags: DefaultOptionType[]; + loggingSettings: any; + setLoggingSettings: (settings: any) => void; + disabledCallbacks: string[]; + setDisabledCallbacks: (disabledCallbacks: string[]) => void; + modelAliases: ModelAliases; + setModelAliases: (aliases: ModelAliases) => void; + autoRotationEnabled: boolean; + setAutoRotationEnabled: (enabled: boolean) => void; + rotationInterval: string; + setRotationInterval: (interval: string) => void; +} + +// TODO: break apart this component into smaller sections +const OptionalSettingsSection = ({ + form, + team, + premiumUser, + guardrails, + prompts, + accessToken, + predefinedTags, + loggingSettings, + setLoggingSettings, + disabledCallbacks, + setDisabledCallbacks, + modelAliases, + setModelAliases, + autoRotationEnabled, + setAutoRotationEnabled, + rotationInterval, + setRotationInterval, +}: OptionalSettingsSectionProps) => { + return ( +
+ + + Optional Settings + + + + Max Budget (USD){" "} + + + + + } + name="max_budget" + help={`Budget cannot exceed team max budget: $${team?.max_budget !== null && team?.max_budget !== undefined ? team?.max_budget : "unlimited"}`} + rules={[ + { + validator: async (_, value) => { + if (value && team && team.max_budget !== null && value > team.max_budget) { + throw new Error( + `Budget cannot exceed team max budget: $${formatNumberWithCommas(team.max_budget, 4)}`, + ); + } + }, + }, + ]} + > + + + + Reset Budget{" "} + + + + + } + name="budget_duration" + help={`Team Reset Budget: ${team?.budget_duration !== null && team?.budget_duration !== undefined ? team?.budget_duration : "None"}`} + > + form.setFieldValue("budget_duration", value)} /> + + + Tokens per minute Limit (TPM){" "} + + + + + } + name="tpm_limit" + help={`TPM cannot exceed team TPM limit: ${team?.tpm_limit !== null && team?.tpm_limit !== undefined ? team?.tpm_limit : "unlimited"}`} + rules={[ + { + validator: async (_, value) => { + if (value && team && team.tpm_limit !== null && value > team.tpm_limit) { + throw new Error(`TPM limit cannot exceed team TPM limit: ${team.tpm_limit}`); + } + }, + }, + ]} + > + + + + + Requests per minute Limit (RPM){" "} + + + + + } + name="rpm_limit" + help={`RPM cannot exceed team RPM limit: ${team?.rpm_limit !== null && team?.rpm_limit !== undefined ? team?.rpm_limit : "unlimited"}`} + rules={[ + { + validator: async (_, value) => { + if (value && team && team.rpm_limit !== null && value > team.rpm_limit) { + throw new Error(`RPM limit cannot exceed team RPM limit: ${team.rpm_limit}`); + } + }, + }, + ]} + > + + + + + Guardrails{" "} + + e.stopPropagation()} // Prevent accordion from collapsing when clicking link + > + + + + + } + name="guardrails" + className="mt-4" + help={ + premiumUser + ? "Select existing guardrails or enter new ones" + : "Premium feature - Upgrade to set guardrails by key" + } + > + ({ value: name, label: name }))} + /> + + + Allowed Vector Stores{" "} + + + + + } + name="allowed_vector_store_ids" + className="mt-4" + help="Select vector stores this key can access. Leave empty for access to all vector stores" + > + form.setFieldValue("allowed_vector_store_ids", values)} + value={form.getFieldValue("allowed_vector_store_ids")} + accessToken={accessToken} + placeholder="Select vector stores (optional)" + /> + + + + Allowed MCP Servers{" "} + + + + + } + name="allowed_mcp_servers_and_groups" + className="mt-4" + help="Select MCP servers or access groups this key can access. " + > + form.setFieldValue("allowed_mcp_servers_and_groups", val)} + value={form.getFieldValue("allowed_mcp_servers_and_groups")} + accessToken={accessToken} + placeholder="Select MCP servers or access groups (optional)" + /> + + + + Metadata{" "} + + + + + } + name="metadata" + className="mt-4" + > + + + + Tags{" "} + + + + + } + name="tags" + className="mt-4" + help={`Tags for tracking spend and/or doing tag-based routing.`} + > + handleUserSelect(value, option as UserOption)} + options={userOptions} + loading={userSearchLoading} + allowClear + style={{ width: "100%" }} + notFoundContent={userSearchLoading ? "Searching..." : "No users found"} + /> + setIsCreateUserModalVisible(true)} style={{ marginLeft: "8px" }}> + Create User + +
+
Search by email to find users
+ + + )} + + Team{" "} + + + + + } + name="team_id" + initialValue={team ? team.team_id : null} + className="mt-4" + rules={[ + { + required: keyOwner === "service_account", + message: "Please select a team for the service account", + }, + ]} + help={keyOwner === "service_account" ? "required" : ""} + > + { + const selectedTeam = teams?.find((t) => t.team_id === teamId) || null; + setSelectedCreateKeyTeam(selectedTeam); + }} + /> + + + ); +}; + +export default OwnershipSection; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx new file mode 100644 index 0000000000..9f4d7528a8 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx @@ -0,0 +1,233 @@ +import { Button as Button2, Form, FormInstance, Modal } from "antd"; +import { Text } from "@tremor/react"; +import { keyCreateCall, keyCreateServiceAccountCall } from "@/components/networking"; +import React, { useEffect, useState } from "react"; +import { Team } from "@/components/key_team_helpers/key_list"; +import SaveKeyModal from "@/app/(console)/virtual-keys/components/SaveKeyModal"; +import NotificationsManager from "@/components/molecules/notifications_manager"; +import { + useGuardrailsAndPrompts, + useMcpAccessGroups, + useTeamModels, + useUserModels, + useUserSearch, +} from "@/app/(console)/virtual-keys/components/CreateKeyModal/hooks"; +import OwnershipSection from "@/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection"; +import KeyDetailsSection from "@/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection"; +import OptionalSettingsSection from "@/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection"; +import { ModelAliases } from "@/app/(console)/virtual-keys/components/CreateKeyModal/types"; +import { getPredefinedTags, prepareFormValues } from "@/app/(console)/virtual-keys/components/CreateKeyModal/utils"; +import { fetchTeams } from "@/app/(console)/virtual-keys/networking"; +import useTeams from "@/app/(console)/virtual-keys/hooks/useTeams"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +export interface CreateKeyModalProps { + isModalVisible: boolean; + setIsModalVisible: (isModalVisible: boolean) => void; + form: FormInstance; + handleUserSelect: (_value: string, option: UserOption) => void; + setIsCreateUserModalVisible: (visible: boolean) => void; + team: Team | null; + data: any[] | null; + addKey: (data: any) => void; +} + +interface User { + user_id: string; + user_email: string; + role?: string; +} + +interface UserOption { + label: string; + value: string; + user: User; +} + +const CreateKeyModal = ({ + isModalVisible, + setIsModalVisible, + form, + handleUserSelect, + setIsCreateUserModalVisible, + team, + data, + addKey, +}: CreateKeyModalProps) => { + const { userId: userID, userRole, accessToken, premiumUser } = useAuthorized(); + const [apiKey, setApiKey] = useState(null); + const [keyOwner, setKeyOwner] = useState("you"); + const [keyType, setKeyType] = useState("default"); + + const [selectedCreateKeyTeam, setSelectedCreateKeyTeam] = useState(team); + + const [softBudget, setSoftBudget] = useState(null); + const [loggingSettings, setLoggingSettings] = useState([]); + const [disabledCallbacks, setDisabledCallbacks] = useState([]); + const [autoRotationEnabled, setAutoRotationEnabled] = useState(false); + const [rotationInterval, setRotationInterval] = useState("30d"); + const [modelAliases, setModelAliases] = useState({}); + const predefinedTags = getPredefinedTags(data); + + const { options: userOptions, loading: userSearchLoading, onSearch: handleUserSearch } = useUserSearch(); + const { guardrails, prompts } = useGuardrailsAndPrompts(); + const teams = useTeams(); + const mcpAccessGroups = useMcpAccessGroups(); + const userModels = useUserModels(); + const modelsToPick = useTeamModels(selectedCreateKeyTeam); + + const isTeamSelectionRequired = modelsToPick.includes("no-default-models"); + const isFormDisabled = isTeamSelectionRequired && !selectedCreateKeyTeam; + + const handleCancel = () => { + setIsModalVisible(false); + setApiKey(null); + setSelectedCreateKeyTeam(null); + form.resetFields(); + setLoggingSettings([]); + setDisabledCallbacks([]); + setKeyType("default"); + setModelAliases({}); + setAutoRotationEnabled(false); + setRotationInterval("30d"); + }; + + const handleOk = () => { + setIsModalVisible(false); + form.resetFields(); + setLoggingSettings([]); + setDisabledCallbacks([]); + setKeyType("default"); + setModelAliases({}); + setAutoRotationEnabled(false); + setRotationInterval("30d"); + }; + + const handleCreate = async (formValues: Record) => { + try { + const newKeyAlias = formValues?.key_alias ?? ""; + const newKeyTeamId = formValues?.team_id ?? null; + + const existingKeyAliases = data?.filter((k) => k.team_id === newKeyTeamId).map((k) => k.key_alias) ?? []; + + if (existingKeyAliases.includes(newKeyAlias)) { + throw new Error( + `Key alias ${newKeyAlias} already exists for team with ID ${newKeyTeamId}, please provide another key alias`, + ); + } + + NotificationsManager.info("Making API Call"); + setIsModalVisible(true); + + const prepared = prepareFormValues(formValues, { + keyOwner, + userID, + loggingSettings, + disabledCallbacks, + autoRotationEnabled, + rotationInterval, + modelAliases, + }); + + let response; + if (keyOwner === "service_account") { + response = await keyCreateServiceAccountCall(accessToken, prepared); + } else { + response = await keyCreateCall(accessToken, userID, prepared); + } + + // TODO: change logic to trigger API call in parent component + addKey(response); + + setApiKey(response["key"]); + setSoftBudget(response["soft_budget"]); + NotificationsManager.success("API Key Created"); + form.resetFields(); + localStorage.removeItem("userData" + userID); + } catch (error) { + console.log("error in create key:", error); + NotificationsManager.fromBackend(`Error creating the key: ${error}`); + } + }; + + useEffect(() => { + form.setFieldValue("models", []); + }, [selectedCreateKeyTeam, accessToken, userID, userRole, form]); + + return ( +
+ +
+ + + {/* Show message when team selection is required */} + {isFormDisabled && ( +
+ + 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. + +
+ )} + + {/* Section 2: Key Details */} + {!isFormDisabled && ( + + )} + + {/* Section 3: Optional Settings */} + {!isFormDisabled && ( + + )} + +
+ + Create Key + +
+ +
+ {apiKey && ( + + )} +
+ ); +}; + +export default CreateKeyModal; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/index.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/index.ts new file mode 100644 index 0000000000..ca3c4a663b --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/index.ts @@ -0,0 +1,5 @@ +export * from "./useGuardrailsAndPrompts"; +export * from "./useMcpAccessGroups"; +export * from "./useUserModels"; +export * from "./useTeamModels"; +export * from "./useUserSearch"; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts new file mode 100644 index 0000000000..d092219f70 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts @@ -0,0 +1,24 @@ +import { useEffect, useState } from "react"; +import { fetchGuardrails, fetchPrompts } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +export const useGuardrailsAndPrompts = () => { + const [guardrails, setGuardrails] = useState([]); + const [prompts, setPrompts] = useState([]); + const { accessToken } = useAuthorized(); + + useEffect(() => { + if (!accessToken) { + setGuardrails([]); + setPrompts([]); + return; + } + (async () => { + const [g, p] = await Promise.all([fetchGuardrails(accessToken), fetchPrompts(accessToken)]); + setGuardrails(g || []); + setPrompts(p || []); + })(); + }, [accessToken]); + + return { guardrails, prompts }; +}; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts new file mode 100644 index 0000000000..8313f6e8d6 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts @@ -0,0 +1,21 @@ +import { useEffect, useState } from "react"; +import { getMCPAccessGroups } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +export const useMcpAccessGroups = () => { + const [mcpAccessGroups, setMcpAccessGroups] = useState([]); + const { accessToken } = useAuthorized(); + + useEffect(() => { + if (!accessToken) { + setMcpAccessGroups([]); + return; + } + (async () => { + const groups = await getMCPAccessGroups(accessToken); + setMcpAccessGroups(groups || []); + })(); + }, [accessToken]); + + return mcpAccessGroups; +}; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts new file mode 100644 index 0000000000..c28ef0ecdb --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts @@ -0,0 +1,26 @@ +import { useEffect, useMemo, useState } from "react"; +import type { Team } from "@/components/key_team_helpers/key_list"; +import { fetchTeamModels } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +export const useTeamModels = (selectedTeam: Team | null) => { + const { userId: userID, userRole, accessToken } = useAuthorized(); + const [modelsToPick, setModelsToPick] = useState([]); + + // turn array into a stable dep so it only re-runs when contents change + const selectedTeamModelsKey = useMemo(() => (selectedTeam?.models ?? []).join("|"), [selectedTeam?.models]); + + useEffect(() => { + if (!userID || !userRole || !accessToken) { + setModelsToPick([]); + return; + } + (async () => { + const fetched = await fetchTeamModels(userID, userRole, accessToken, selectedTeam?.team_id ?? null); + const union = Array.from(new Set([...(selectedTeam?.models ?? []), ...(fetched || [])])); + setModelsToPick(union); + })(); + }, [userID, userRole, accessToken, selectedTeam?.team_id, selectedTeamModelsKey, selectedTeam?.models]); + + return modelsToPick; +}; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts new file mode 100644 index 0000000000..ddba6879cc --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts @@ -0,0 +1,21 @@ +import { useEffect, useState } from "react"; +import { getUserModelNames } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +export const useUserModels = () => { + const { userId: userID, userRole, accessToken } = useAuthorized(); + const [userModels, setUserModels] = useState([]); + + useEffect(() => { + if (!userID || !userRole || !accessToken) { + setUserModels([]); + return; + } + (async () => { + const modelNames = await getUserModelNames(userID, userRole, accessToken); + setUserModels(modelNames || []); + })(); + }, [userID, userRole, accessToken]); + + return userModels; +}; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts new file mode 100644 index 0000000000..782beccf48 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts @@ -0,0 +1,41 @@ +import { useEffect, useMemo, useState } from "react"; +import { debounce } from "lodash"; +import { searchUserOptionsByEmail } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +type User = { user_id: string; user_email: string; role?: string }; +export interface UserOption { + label: string; + value: string; + user: User; +} + +export const useUserSearch = (delay = 300) => { + const { accessToken } = useAuthorized(); + const [options, setOptions] = useState([]); + const [loading, setLoading] = useState(false); + + const doSearch = async (raw: string) => { + const q = raw?.trim(); + if (!q || !accessToken) { + setOptions([]); + setLoading(false); + return; + } + setLoading(true); + try { + const res = await searchUserOptionsByEmail(accessToken, q); + setOptions(res || []); + } finally { + setLoading(false); + } + }; + + const onSearch = useMemo(() => debounce(doSearch, delay), [accessToken, delay]); + + useEffect(() => { + return () => onSearch.cancel(); + }, [onSearch]); + + return { options, loading, onSearch }; +}; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/networking.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/networking.ts new file mode 100644 index 0000000000..6cb4e2f7f0 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/networking.ts @@ -0,0 +1,84 @@ +import { + fetchMCPAccessGroups, + getGuardrailsList, + getPromptsList, + modelAvailableCall, + User, + userFilterUICall, +} from "@/components/networking"; +import { ModelAvailableResponse, UserOption } from "@/app/(console)/virtual-keys/components/CreateKeyModal/types"; + +export const fetchGuardrails = async (accessToken: string) => { + try { + const response = await getGuardrailsList(accessToken); + return response.guardrails.map((g: { guardrail_name: string }) => g.guardrail_name); + } catch (error) { + console.error("Failed to fetch guardrails:", error); + return []; + } +}; + +export const fetchPrompts = async (accessToken: string) => { + try { + const response = await getPromptsList(accessToken); + return response.prompts.map((prompt) => prompt.prompt_id); + } catch (error) { + console.error("Failed to fetch prompts:", error); + return []; + } +}; + +export const searchUserOptionsByEmail = async (accessToken: string, emailQuery: string): Promise => { + const params = new URLSearchParams(); + params.append("user_email", emailQuery); + + const response = await userFilterUICall(accessToken, params); + const users: User[] = response; + + return users.map((user) => ({ + label: `${user.user_email} (${user.user_id})`, + value: user.user_id, + user, + })); +}; + +export const getUserModelNames = async (userID: string, userRole: string, accessToken: string): Promise => { + const res: ModelAvailableResponse = await modelAvailableCall(accessToken, userID, userRole); + return (res?.data ?? []).map((m) => m.id); +}; + +export const fetchTeamModels = async ( + userID: string, + userRole: string, + accessToken: string, + teamID: string | null, +): Promise => { + try { + if (userID === null || userRole === null) { + return []; + } + + if (accessToken !== null) { + const model_available = await modelAvailableCall(accessToken, userID, userRole, true, teamID, true); + let available_model_names = model_available["data"].map((element: { id: string }) => element.id); + console.log("available_model_names:", available_model_names); + return available_model_names; + } + return []; + } catch (error) { + console.error("Error fetching user models:", error); + return []; + } +}; + +export const getMCPAccessGroups = async (accessToken: string): Promise => { + try { + if (accessToken == null) { + return []; + } + return await fetchMCPAccessGroups(accessToken); + } catch (error) { + console.error("Failed to fetch MCP access groups:", error); + return []; + } +}; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/types.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/types.ts new file mode 100644 index 0000000000..4d48df82d4 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/types.ts @@ -0,0 +1,17 @@ +export interface User { + user_id: string; + user_email: string; + role?: string; +} + +export interface UserOption { + label: string; + value: string; + user: User; +} + +export type Model = { id: string }; + +export type ModelAvailableResponse = { data: Model[] }; + +export type ModelAliases = { [key: string]: string }; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/utils.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/utils.ts new file mode 100644 index 0000000000..066770cf46 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/utils.ts @@ -0,0 +1,187 @@ +import { mapDisplayToInternalNames } from "@/components/callback_info_helpers"; +import { ModelAliases } from "@/app/(console)/virtual-keys/components/CreateKeyModal/types"; + +export const getPredefinedTags = (data: any[] | null) => { + let allTags = []; + + console.log("data:", JSON.stringify(data)); + + if (data) { + for (let key of data) { + if (key["metadata"] && key["metadata"]["tags"]) { + allTags.push(...key["metadata"]["tags"]); + } + } + } + + const uniqueTags = Array.from(new Set(allTags)).map((tag) => ({ + value: tag, + label: tag, + })); + + console.log("uniqueTags:", uniqueTags); + return uniqueTags; +}; + +type AnyObj = Record; + +type PrepareOptions = { + keyOwner: string; + userID: string; + loggingSettings: any[]; + disabledCallbacks: string[]; + autoRotationEnabled: boolean; + rotationInterval: string; + modelAliases: ModelAliases; +}; + +export function safeParseMetadata(metadataStr: string | undefined): AnyObj { + try { + return JSON.parse(metadataStr || "{}"); + } catch (error) { + console.error("Error parsing metadata:", error); + return {}; + } +} + +export function withOwnerAssignments( + values: AnyObj, + { keyOwner, userID }: Pick, +): AnyObj { + // If owned by "you", set user_id + const base = keyOwner === "you" ? { ...values, user_id: userID } : { ...values }; + return base; +} + +export function enrichMetadata( + metadata: AnyObj, + values: AnyObj, + { + keyOwner, + loggingSettings, + disabledCallbacks, + }: Pick, +): AnyObj { + let next = { ...metadata }; + + // If it's a service account, add the service_account_id to the metadata + if (keyOwner === "service_account") { + next = { ...next, service_account_id: values.key_alias }; + } + + // Add logging settings to the metadata + if (Array.isArray(loggingSettings) && loggingSettings.length > 0) { + next = { ...next, logging: loggingSettings.filter((config: any) => config?.callback_name) }; + } + + // Add disabled callbacks to the metadata + if (Array.isArray(disabledCallbacks) && disabledCallbacks.length > 0) { + const mappedDisabledCallbacks = mapDisplayToInternalNames(disabledCallbacks); + next = { ...next, litellm_disabled_callbacks: mappedDisabledCallbacks }; + } + + return next; +} + +export function withAutoRotation( + values: AnyObj, + { autoRotationEnabled, rotationInterval }: Pick, +): AnyObj { + if (!autoRotationEnabled) return { ...values }; + return { ...values, auto_rotate: true, rotation_interval: rotationInterval }; +} + +export function withDurationNoop(values: AnyObj): AnyObj { + // Preserve the original no-op logic: if duration exists, set it to itself + if (values.duration) { + return { ...values, duration: values.duration }; + } + return { ...values }; +} + +export function mergeObjectPermission(values: AnyObj, patch: AnyObj): AnyObj { + const object_permission = { ...(values.object_permission || {}), ...patch }; + return { ...values, object_permission }; +} + +export function withVectorStores(values: AnyObj): AnyObj { + const { allowed_vector_store_ids, ...rest } = values; + if (Array.isArray(allowed_vector_store_ids) && allowed_vector_store_ids.length > 0) { + const patched = mergeObjectPermission(rest, { vector_stores: allowed_vector_store_ids }); + return patched; // original field removed by destructuring + } + return { ...values }; +} + +export function withMcpServersAndGroups(values: AnyObj): AnyObj { + const { allowed_mcp_servers_and_groups, ...rest } = values; + const servers = allowed_mcp_servers_and_groups?.servers; + const accessGroups = allowed_mcp_servers_and_groups?.accessGroups; + + const hasServers = Array.isArray(servers) && servers.length > 0; + const hasAccessGroups = Array.isArray(accessGroups) && accessGroups.length > 0; + + if (!hasServers && !hasAccessGroups) return { ...values }; + + let patched = { ...rest }; + if (hasServers) patched = mergeObjectPermission(patched, { mcp_servers: servers }); + if (hasAccessGroups) patched = mergeObjectPermission(patched, { mcp_access_groups: accessGroups }); + + // original field removed by destructuring + return patched; +} + +export function withMcpAccessGroups(values: AnyObj): AnyObj { + const { allowed_mcp_access_groups, ...rest } = values; + if (Array.isArray(allowed_mcp_access_groups) && allowed_mcp_access_groups.length > 0) { + const patched = mergeObjectPermission(rest, { mcp_access_groups: allowed_mcp_access_groups }); + return patched; // original field removed by destructuring + } + return { ...values }; +} + +function withAliases(values: AnyObj, modelAliases: ModelAliases): AnyObj { + if (modelAliases && Object.keys(modelAliases).length > 0) { + return { ...values, aliases: JSON.stringify(modelAliases) }; + } + return { ...values }; +} + +function withMetadataString(values: AnyObj, metadata: AnyObj): AnyObj { + return { ...values, metadata: JSON.stringify(metadata) }; +} + +export function prepareFormValues(initialValues: AnyObj, opts: PrepareOptions): AnyObj { + // Step 1: assign user id if needed + let values = withOwnerAssignments(initialValues, { keyOwner: opts.keyOwner, userID: opts.userID }); + + // Step 2: metadata parse & enrichment + const parsedMetadata = safeParseMetadata(values.metadata); + const enrichedMetadata = enrichMetadata(parsedMetadata, values, { + keyOwner: opts.keyOwner, + loggingSettings: opts.loggingSettings, + disabledCallbacks: opts.disabledCallbacks, + }); + + // Step 3: auto-rotation + values = withAutoRotation(values, { + autoRotationEnabled: opts.autoRotationEnabled, + rotationInterval: opts.rotationInterval, + }); + + // Step 4: duration (no-op preservation) + values = withDurationNoop(values); + + // Step 5: commit metadata string + values = withMetadataString(values, enrichedMetadata); + + // Step 6: object_permission transformations + values = withVectorStores(values); + values = withMcpServersAndGroups(values); + values = withMcpAccessGroups(values); + + // Step 7: aliases + values = withAliases(values, opts.modelAliases); + + return values; +} diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/KeyInfoView.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/KeyInfoView.tsx new file mode 100644 index 0000000000..1c7185f1dc --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/KeyInfoView.tsx @@ -0,0 +1,697 @@ +import React, { useEffect, useState } from "react"; +import { + Card, + Text, + Button, + Grid, + Tab, + TabList, + TabGroup, + TabPanel, + TabPanels, + Title, + Badge, +} from "@tremor/react"; +import { ArrowLeftIcon, TrashIcon, RefreshIcon } from "@heroicons/react/outline"; +import { Form, Tooltip, Button as AntdButton } from "antd"; +import { copyToClipboard as utilCopyToClipboard, formatNumberWithCommas } from "@/utils/dataUtils"; +import { CopyIcon, CheckIcon } from "lucide-react"; +import { KeyResponse } from "@/components/key_team_helpers/key_list" +import { mapDisplayToInternalNames, mapInternalToDisplayNames } from "@/components/callback_info_helpers" +import NotificationManager from "@/components/molecules/notifications_manager" +import { keyDeleteCall, keyUpdateCall } from "@/components/networking" +import { parseErrorMessage } from "@/components/shared/errorUtils" +import { rolesWithWriteAccess } from "@/utils/roles" +import { RegenerateKeyModal } from "@/components/organisms/regenerate_key_modal" +import ObjectPermissionsView from "@/components/object_permissions_view" +import LoggingSettingsView from "@/components/logging_settings_view" +import { extractLoggingSettings, formatMetadataForDisplay } from "@/components/key_info_utils" +import AutoRotationView from "@/components/common_components/AutoRotationView" +import { KeyEditView } from "@/components/templates/key_edit_view" + + +interface KeyInfoViewProps { + keyId: string; + onClose: () => void; + keyData: KeyResponse | undefined; + onKeyDataUpdate?: (data: Partial) => void; + onDelete?: () => void; + accessToken: string | null; + userID: string | null; + userRole: string | null; + teams: any[] | null; + premiumUser: boolean; + setAccessToken?: (token: string) => void; + backButtonText?: string; +} + +const KeyInfoView = ({ + keyId, + onClose, + keyData, + accessToken, + userID, + userRole, + teams, + onKeyDataUpdate, + onDelete, + premiumUser, + setAccessToken, + backButtonText = "Back to Keys", + }: KeyInfoViewProps) => { + const [isEditing, setIsEditing] = useState(false); + const [form] = Form.useForm(); + const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); + const [deleteConfirmInput, setDeleteConfirmInput] = useState(""); + const [isRegenerateModalOpen, setIsRegenerateModalOpen] = useState(false); + const [copiedStates, setCopiedStates] = useState>({}); + + // Add local state to maintain key data and track regeneration + const [currentKeyData, setCurrentKeyData] = useState(keyData); + const [lastRegeneratedAt, setLastRegeneratedAt] = useState(null); + const [isRecentlyRegenerated, setIsRecentlyRegenerated] = useState(false); + + // Update local state when keyData prop changes (but don't reset to undefined) + useEffect(() => { + if (keyData) { + setCurrentKeyData(keyData); + } + }, [keyData]); + + // Reset recent regeneration indicator after 5 seconds + useEffect(() => { + if (isRecentlyRegenerated) { + const timer = setTimeout(() => { + setIsRecentlyRegenerated(false); + }, 5000); + return () => clearTimeout(timer); + } + }, [isRecentlyRegenerated]); + + // Use currentKeyData instead of keyData throughout the component + if (!currentKeyData) { + return ( +
+ + Key not found +
+ ); + } + + const handleKeyUpdate = async (formValues: Record) => { + try { + if (!accessToken) return; + + const currentKey = formValues.token; + formValues.key = currentKey; + + // Guard premium features + if (!premiumUser) { + delete formValues.guardrails; + delete formValues.prompts; + } + + // Handle object_permission updates + if (formValues.vector_stores !== undefined) { + formValues.object_permission = { + ...currentKeyData.object_permission, + vector_stores: formValues.vector_stores || [], + }; + // Remove vector_stores from the top level as it should be in object_permission + delete formValues.vector_stores; + } + + if (formValues.mcp_servers_and_groups !== undefined) { + const { servers, accessGroups } = formValues.mcp_servers_and_groups || { servers: [], accessGroups: [] }; + formValues.object_permission = { + ...currentKeyData.object_permission, + mcp_servers: servers || [], + mcp_access_groups: accessGroups || [], + }; + // Remove mcp_servers_and_groups from the top level as it should be in object_permission + delete formValues.mcp_servers_and_groups; + } + + // Convert metadata back to an object if it exists and is a string + if (formValues.metadata && typeof formValues.metadata === "string") { + try { + const parsedMetadata = JSON.parse(formValues.metadata); + formValues.metadata = { + ...parsedMetadata, + ...(formValues.guardrails?.length > 0 ? { guardrails: formValues.guardrails } : {}), + ...(formValues.logging_settings ? { logging: formValues.logging_settings } : {}), + ...(formValues.disabled_callbacks?.length > 0 + ? { + litellm_disabled_callbacks: mapDisplayToInternalNames(formValues.disabled_callbacks), + } + : {}), + }; + } catch (error) { + console.error("Error parsing metadata JSON:", error); + NotificationManager.error("Invalid metadata JSON"); + return; + } + } else { + formValues.metadata = { + ...(formValues.metadata || {}), + ...(formValues.guardrails?.length > 0 ? { guardrails: formValues.guardrails } : {}), + ...(formValues.logging_settings ? { logging: formValues.logging_settings } : {}), + ...(formValues.disabled_callbacks?.length > 0 + ? { + litellm_disabled_callbacks: mapDisplayToInternalNames(formValues.disabled_callbacks), + } + : {}), + }; + } + + delete formValues.logging_settings; + + // Convert budget_duration to API format + if (formValues.budget_duration) { + const durationMap: Record = { + daily: "24h", + weekly: "7d", + monthly: "30d", + }; + formValues.budget_duration = durationMap[formValues.budget_duration]; + } + + const newKeyValues = await keyUpdateCall(accessToken, formValues); + + // Update local state + setCurrentKeyData((prevData) => (prevData ? { ...prevData, ...newKeyValues } : undefined)); + + if (onKeyDataUpdate) { + onKeyDataUpdate(newKeyValues); + } + NotificationManager.success("Key updated successfully"); + setIsEditing(false); + // Refresh key data here if needed + } catch (error) { + NotificationManager.fromBackend(parseErrorMessage(error)); + console.error("Error updating key:", error); + } + }; + + const handleDelete = async () => { + try { + if (!accessToken) return; + await keyDeleteCall(accessToken as string, currentKeyData.token || currentKeyData.token_id); + NotificationManager.success("Key deleted successfully"); + if (onDelete) { + onDelete(); + } + onClose(); + } catch (error) { + console.error("Error deleting the key:", error); + NotificationManager.fromBackend(error); + } + // Reset the confirmation input + setDeleteConfirmInput(""); + }; + + const copyToClipboard = async (text: string, key: string) => { + const success = await utilCopyToClipboard(text); + if (success) { + setCopiedStates((prev) => ({ ...prev, [key]: true })); + setTimeout(() => { + setCopiedStates((prev) => ({ ...prev, [key]: false })); + }, 2000); + } + }; + + const handleRegenerateKeyUpdate = (updatedKeyData: Partial) => { + // Update local state immediately with ALL the new data + setCurrentKeyData((prevData) => { + if (!prevData) return undefined; + const newData = { + ...prevData, + ...updatedKeyData, // This should include the new token (key-id) + // Update the created_at to show when it was regenerated + created_at: new Date().toLocaleString(), + }; + return newData; + }); + + // Track regeneration timestamp + setLastRegeneratedAt(new Date()); + setIsRecentlyRegenerated(true); + + if (onKeyDataUpdate) { + onKeyDataUpdate({ + ...updatedKeyData, + created_at: new Date().toLocaleString(), + }); + } + }; + + // Update the formatTimestamp function to use the desired date format + const formatTimestamp = (timestamp: string | Date) => { + const date = new Date(timestamp); + const dateStr = date.toLocaleDateString("en-US", { + year: "numeric", + month: "short", + day: "numeric", + }); + const timeStr = date.toLocaleTimeString("en-US", { + hour: "numeric", + minute: "2-digit", + hour12: true, + }); + return `${dateStr} at ${timeStr}`; + }; + + return ( +
+
+
+ + {currentKeyData.key_alias || "API Key"} + +
+
+ Key ID + {currentKeyData.token_id || currentKeyData.token} +
+ : } + onClick={() => copyToClipboard(currentKeyData.token_id || currentKeyData.token, "key-id")} + className={`ml-2 transition-all duration-200${ + copiedStates["key-id"] + ? "text-green-600 bg-green-50 border-green-200" + : "text-gray-500 hover:text-gray-700 hover:bg-gray-100" + }`} + /> +
+ + {/* Add timestamp and regeneration indicator */} +
+ + {currentKeyData.updated_at && currentKeyData.updated_at !== currentKeyData.created_at + ? `Updated: ${formatTimestamp(currentKeyData.updated_at)}` + : `Created: ${formatTimestamp(currentKeyData.created_at)}`} + + + {isRecentlyRegenerated && ( + + Recently Regenerated + + )} + + {lastRegeneratedAt && ( + + Regenerated + + )} +
+
+ {userRole && rolesWithWriteAccess.includes(userRole) && ( +
+ + + + + + +
+ )} +
+ + {/* Add RegenerateKeyModal */} + setIsRegenerateModalOpen(false)} + accessToken={accessToken} + premiumUser={premiumUser} + setAccessToken={setAccessToken} + onKeyUpdate={handleRegenerateKeyUpdate} + /> + + {/* Delete Confirmation Modal */} + {isDeleteModalOpen && + (() => { + const keyName = currentKeyData?.key_alias || currentKeyData?.token_id || "API Key"; + const isValid = deleteConfirmInput === keyName; + return ( +
+
+
+
+

Delete Key

+ +
+
+
+
+ + + +
+
+

+ Warning: You are about to delete this API key. +

+

+ This action is irreversible and will immediately revoke access for any applications using this + key. +

+
+
+

Are you sure you want to delete this API key?

+
+ + setDeleteConfirmInput(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 + /> +
+
+
+
+ + +
+
+
+ ); + })()} + + + + Overview + Settings + + + + {/* Overview Panel */} + + + + Spend +
+ ${formatNumberWithCommas(currentKeyData.spend, 4)} + + of{" "} + {currentKeyData.max_budget !== null + ? `$${formatNumberWithCommas(currentKeyData.max_budget)}` + : "Unlimited"} + +
+
+ + + Rate Limits +
+ TPM: {currentKeyData.tpm_limit !== null ? currentKeyData.tpm_limit : "Unlimited"} + RPM: {currentKeyData.rpm_limit !== null ? currentKeyData.rpm_limit : "Unlimited"} +
+
+ + + Models +
+ {currentKeyData.models && currentKeyData.models.length > 0 ? ( + currentKeyData.models.map((model, index) => ( + + {model} + + )) + ) : ( + No models specified + )} +
+
+ + + + + + + + +
+
+ + {/* Settings Panel */} + + +
+ Key Settings + {!isEditing && userRole && rolesWithWriteAccess.includes(userRole) && ( + + )} +
+ + {isEditing ? ( + setIsEditing(false)} + onSubmit={handleKeyUpdate} + teams={teams} + accessToken={accessToken} + userID={userID} + userRole={userRole} + premiumUser={premiumUser} + /> + ) : ( +
+
+ Key ID + {currentKeyData.token_id || currentKeyData.token} +
+ +
+ Key Alias + {currentKeyData.key_alias || "Not Set"} +
+ +
+ Secret Key + {currentKeyData.key_name} +
+ +
+ Team ID + {currentKeyData.team_id || "Not Set"} +
+ +
+ Organization + {currentKeyData.organization_id || "Not Set"} +
+ +
+ Created + {formatTimestamp(currentKeyData.created_at)} +
+ + {lastRegeneratedAt && ( +
+ Last Regenerated +
+ {formatTimestamp(lastRegeneratedAt)} + + Recent + +
+
+ )} + +
+ Expires + {currentKeyData.expires ? formatTimestamp(currentKeyData.expires) : "Never"} +
+ + + +
+ Spend + ${formatNumberWithCommas(currentKeyData.spend, 4)} USD +
+ +
+ Budget + + {currentKeyData.max_budget !== null + ? `$${formatNumberWithCommas(currentKeyData.max_budget, 2)}` + : "Unlimited"} + +
+ +
+ Prompts + + {Array.isArray(currentKeyData.metadata?.prompts) && currentKeyData.metadata.prompts.length > 0 + ? currentKeyData.metadata.prompts.map((prompt, index) => ( + + {prompt} + + )) + : "No prompts specified"} + +
+ +
+ Models +
+ {currentKeyData.models && currentKeyData.models.length > 0 ? ( + currentKeyData.models.map((model, index) => ( + + {model} + + )) + ) : ( + No models specified + )} +
+
+ +
+ Rate Limits + TPM: {currentKeyData.tpm_limit !== null ? currentKeyData.tpm_limit : "Unlimited"} + RPM: {currentKeyData.rpm_limit !== null ? currentKeyData.rpm_limit : "Unlimited"} + + Max Parallel Requests:{" "} + {currentKeyData.max_parallel_requests !== null + ? currentKeyData.max_parallel_requests + : "Unlimited"} + + + Model TPM Limits:{" "} + {currentKeyData.metadata?.model_tpm_limit + ? JSON.stringify(currentKeyData.metadata.model_tpm_limit) + : "Unlimited"} + + + Model RPM Limits:{" "} + {currentKeyData.metadata?.model_rpm_limit + ? JSON.stringify(currentKeyData.metadata.model_rpm_limit) + : "Unlimited"} + +
+ +
+ Metadata +
+                      {formatMetadataForDisplay(currentKeyData.metadata)}
+                    
+
+ + + + +
+ )} +
+
+
+
+
+ ); +} + +export default KeyInfoView; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/SaveKeyModal.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/SaveKeyModal.tsx new file mode 100644 index 0000000000..bd0d425c46 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/SaveKeyModal.tsx @@ -0,0 +1,58 @@ +import { Button, Col, Grid, Text, Title } from "@tremor/react"; +import { CopyToClipboard } from "react-copy-to-clipboard"; +import { Modal } from "antd"; +import React from "react"; +import NotificationsManager from "@/components/molecules/notifications_manager"; + +export interface SaveKeyModalProps { + apiKey: string; + isModalVisible: boolean; + handleOk: () => void; + handleCancel: () => void; +} + +const SaveKeyModal = ({ apiKey, isModalVisible, handleOk, handleCancel }: SaveKeyModalProps) => { + const handleCopy = () => { + NotificationsManager.success("API Key copied to clipboard"); + }; + + return ( + + + Save your Key + +

+ Please save this secret key somewhere safe and accessible. For security reasons,{" "} + 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. +

+ + + {apiKey != null ? ( +
+ API Key: +
+
{apiKey}
+
+ + + + +
+ ) : ( + Key being created, this might take 30s + )} + +
+
+ ); +}; + +export default SaveKeyModal; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx new file mode 100644 index 0000000000..5c32a736ae --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx @@ -0,0 +1,666 @@ +// TODO: refactor +"use client"; + +import React, { useEffect, useState } from "react"; +import { ColumnDef } from "@tanstack/react-table"; +import { Button } from "@tremor/react"; +import { Tooltip } from "antd"; +import { updateExistingKeys } from "@/utils/dataUtils"; +import { flexRender, getCoreRowModel, getSortedRowModel, SortingState, useReactTable } from "@tanstack/react-table"; +import { Table, TableHead, TableHeaderCell, TableBody, TableRow, TableCell, Icon } from "@tremor/react"; +import { SwitchVerticalIcon, ChevronUpIcon, ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/outline"; +import { Badge, Text } from "@tremor/react"; +import { formatNumberWithCommas } from "@/utils/dataUtils"; +import { KeyResponse, Team } from "@/components/key_team_helpers/key_list"; +import { Organization, userListCall } from "@/components/networking"; +import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; +import FilterComponent, { FilterOption } from "@/components/molecules/filter"; +import KeyInfoView from "@/components/templates/key_info_view"; +import { useFilterLogic } from "@/components/key_team_helpers/filter_logic"; +import useTeams from "@/app/(console)/virtual-keys/hooks/useTeams"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +interface AllKeysTableProps { + keys: KeyResponse[]; + setKeys: (keys: KeyResponse[] | ((prev: KeyResponse[]) => KeyResponse[])) => void; + isLoading?: boolean; + pagination: { + currentPage: number; + totalPages: number; + totalCount: number; + }; + onPageChange: (page: number) => void; + pageSize?: number; + organizations: Organization[] | null; + refresh?: () => void; + onSortChange?: (sortBy: string, sortOrder: "asc" | "desc") => void; + currentSort?: { + sortBy: string; + sortOrder: "asc" | "desc"; + }; + setAccessToken?: (token: string) => void; +} + +interface UserResponse { + user_id: string; + user_email: string; + user_role: string; +} + +const VirtualKeysTable = ({ + keys, + setKeys, + isLoading = false, + pagination, + onPageChange, + pageSize = 50, + organizations, + refresh, + onSortChange, + currentSort, + setAccessToken, +}: AllKeysTableProps) => { + const { userId: userID, userRole, accessToken, premiumUser } = useAuthorized(); + const teams = useTeams(); + const [selectedKeyId, setSelectedKeyId] = useState(null); + const [userList, setUserList] = useState([]); + const [sorting, setSorting] = React.useState(() => { + if (currentSort) { + return [ + { + id: currentSort.sortBy, + desc: currentSort.sortOrder === "desc", + }, + ]; + } + return [ + { + id: "created_at", + desc: true, + }, + ]; + }); + const [expandedAccordions, setExpandedAccordions] = useState>({}); + + // Use the filter logic hook + + const { filters, filteredKeys, allKeyAliases, allTeams, allOrganizations, handleFilterChange, handleFilterReset } = + useFilterLogic({ + keys, + teams, + organizations, + accessToken, + }); + + useEffect(() => { + if (accessToken) { + const user_IDs = keys.map((key) => key.user_id).filter((id) => id !== null); + const fetchUserList = async () => { + const userListData = await userListCall(accessToken, user_IDs, 1, 100); + setUserList(userListData.users); + }; + fetchUserList(); + } + }, [accessToken, keys]); + + // Add a useEffect to call refresh when a key is created + useEffect(() => { + if (refresh) { + const handleStorageChange = () => { + refresh(); + }; + + // Listen for storage events that might indicate a key was created + window.addEventListener("storage", handleStorageChange); + + return () => { + window.removeEventListener("storage", handleStorageChange); + }; + } + }, [refresh]); + + const columns: ColumnDef[] = [ + { + id: "expander", + header: () => null, + cell: ({ row }) => + row.getCanExpand() ? ( + + ) : null, + }, + { + id: "token", + accessorKey: "token", + header: "Key ID", + cell: (info) => ( +
+ + + +
+ ), + }, + { + id: "key_alias", + accessorKey: "key_alias", + header: "Key Alias", + cell: (info) => { + const value = info.getValue() as string; + return ( + {value ? (value.length > 20 ? `${value.slice(0, 20)}...` : value) : "-"} + ); + }, + }, + { + id: "key_name", + accessorKey: "key_name", + header: "Secret Key", + cell: (info) => {info.getValue() as string}, + }, + { + id: "team_alias", + accessorKey: "team_id", + header: "Team Alias", + cell: ({ row, getValue }) => { + const teamId = getValue() as string; + const team = teams?.find((t) => t.team_id === teamId); + return team?.team_alias || "Unknown"; + }, + }, + { + id: "team_id", + accessorKey: "team_id", + header: "Team ID", + cell: (info) => ( + + {info.getValue() ? `${(info.getValue() as string).slice(0, 7)}...` : "-"} + + ), + }, + { + id: "organization_id", + accessorKey: "organization_id", + header: "Organization ID", + cell: (info) => (info.getValue() ? info.renderValue() : "-"), + }, + { + id: "user_email", + accessorKey: "user_id", + header: "User Email", + cell: (info) => { + const userId = info.getValue() as string; + const user = userList.find((u) => u.user_id === userId); + return user?.user_email ? ( + + {user?.user_email.slice(0, 20)}... + + ) : ( + "-" + ); + }, + }, + { + id: "user_id", + accessorKey: "user_id", + header: "User ID", + cell: (info) => { + const userId = info.getValue() as string | null; + if (userId && userId.length > 15) { + return ( + + {userId.slice(0, 7)}... + + ); + } + return userId ? userId : "-"; + }, + }, + { + id: "created_at", + accessorKey: "created_at", + header: "Created At", + cell: (info) => { + const value = info.getValue(); + return value ? new Date(value as string).toLocaleDateString() : "-"; + }, + }, + { + id: "created_by", + accessorKey: "created_by", + header: "Created By", + cell: (info) => { + const value = info.getValue() as string | null; + if (value && value.length > 15) { + return ( + + {value.slice(0, 7)}... + + ); + } + return value; + }, + }, + { + id: "updated_at", + accessorKey: "updated_at", + header: "Updated At", + cell: (info) => { + const value = info.getValue(); + return value ? new Date(value as string).toLocaleDateString() : "Never"; + }, + }, + { + id: "expires", + accessorKey: "expires", + header: "Expires", + cell: (info) => { + const value = info.getValue(); + return value ? new Date(value as string).toLocaleDateString() : "Never"; + }, + }, + { + id: "spend", + accessorKey: "spend", + header: "Spend (USD)", + cell: (info) => formatNumberWithCommas(info.getValue() as number, 4), + }, + { + id: "max_budget", + accessorKey: "max_budget", + header: "Budget (USD)", + cell: (info) => { + const maxBudget = info.getValue() as number | null; + if (maxBudget === null) { + return "Unlimited"; + } + return `$${formatNumberWithCommas(maxBudget)}`; + }, + }, + { + id: "budget_reset_at", + accessorKey: "budget_reset_at", + header: "Budget Reset", + cell: (info) => { + const value = info.getValue(); + return value ? new Date(value as string).toLocaleString() : "Never"; + }, + }, + { + id: "models", + accessorKey: "models", + header: "Models", + cell: (info) => { + const models = info.getValue() as string[]; + return ( +
+ {Array.isArray(models) ? ( +
+ {models.length === 0 ? ( + + All Proxy Models + + ) : ( + <> +
+ {models.length > 3 && ( +
+ { + setExpandedAccordions((prev) => ({ + ...prev, + [info.row.id]: !prev[info.row.id], + })); + }} + /> +
+ )} +
+ {models.slice(0, 3).map((model, index) => + model === "all-proxy-models" ? ( + + All Proxy Models + + ) : ( + + + {model.length > 30 + ? `${getModelDisplayName(model).slice(0, 30)}...` + : getModelDisplayName(model)} + + + ), + )} + {models.length > 3 && !expandedAccordions[info.row.id] && ( + + + +{models.length - 3} {models.length - 3 === 1 ? "more model" : "more models"} + + + )} + {expandedAccordions[info.row.id] && ( +
+ {models.slice(3).map((model, index) => + model === "all-proxy-models" ? ( + + All Proxy Models + + ) : ( + + + {model.length > 30 + ? `${getModelDisplayName(model).slice(0, 30)}...` + : getModelDisplayName(model)} + + + ), + )} +
+ )} +
+
+ + )} +
+ ) : null} +
+ ); + }, + }, + { + id: "rate_limits", + header: "Rate Limits", + cell: ({ row }) => { + const key = row.original; + return ( +
+
TPM: {key.tpm_limit !== null ? key.tpm_limit : "Unlimited"}
+
RPM: {key.rpm_limit !== null ? key.rpm_limit : "Unlimited"}
+
+ ); + }, + }, + ]; + + const filterOptions: FilterOption[] = [ + { + name: "Team ID", + label: "Team ID", + isSearchable: true, + searchFn: async (searchText: string) => { + if (!allTeams || allTeams.length === 0) return []; + + const filteredTeams = allTeams.filter( + (team) => + team.team_id.toLowerCase().includes(searchText.toLowerCase()) || + (team.team_alias && team.team_alias.toLowerCase().includes(searchText.toLowerCase())), + ); + + return filteredTeams.map((team) => ({ + label: `${team.team_alias || team.team_id} (${team.team_id})`, + value: team.team_id, + })); + }, + }, + { + name: "Organization ID", + label: "Organization ID", + isSearchable: true, + searchFn: async (searchText: string) => { + if (!allOrganizations || allOrganizations.length === 0) return []; + + const filteredOrgs = allOrganizations.filter( + (org) => org.organization_id?.toLowerCase().includes(searchText.toLowerCase()) ?? false, + ); + + return filteredOrgs + .filter((org) => org.organization_id !== null && org.organization_id !== undefined) + .map((org) => ({ + label: `${org.organization_id || "Unknown"} (${org.organization_id})`, + value: org.organization_id as string, + })); + }, + }, + { + name: "Key Alias", + label: "Key Alias", + isSearchable: true, + searchFn: async (searchText) => { + const filteredKeyAliases = allKeyAliases.filter((key) => { + return key.toLowerCase().includes(searchText.toLowerCase()); + }); + + return filteredKeyAliases.map((key) => { + return { + label: key, + value: key, + }; + }); + }, + }, + { + name: "User ID", + label: "User ID", + isSearchable: false, + }, + { + name: "Key Hash", + label: "Key Hash", + isSearchable: false, + }, + ]; + + console.log(`keys: ${JSON.stringify(keys)}`); + + const table = useReactTable({ + data: filteredKeys, + columns: columns.filter((col) => col.id !== "expander"), + state: { + sorting, + }, + onSortingChange: (updaterOrValue) => { + const newSorting = typeof updaterOrValue === "function" ? updaterOrValue(sorting) : updaterOrValue; + console.log(`newSorting: ${JSON.stringify(newSorting)}`); + setSorting(newSorting); + if (newSorting && newSorting.length > 0) { + const sortState = newSorting[0]; + const sortBy = sortState.id; + const sortOrder = sortState.desc ? "desc" : "asc"; + console.log(`sortBy: ${sortBy}, sortOrder: ${sortOrder}`); + handleFilterChange({ + ...filters, + "Sort By": sortBy, + "Sort Order": sortOrder, + }); + onSortChange?.(sortBy, sortOrder); + } + }, + getCoreRowModel: getCoreRowModel(), + getSortedRowModel: getSortedRowModel(), + enableSorting: true, + manualSorting: false, + }); + + // Update local sorting state when currentSort prop changes + React.useEffect(() => { + if (currentSort) { + setSorting([ + { + id: currentSort.sortBy, + desc: currentSort.sortOrder === "desc", + }, + ]); + } + }, [currentSort]); + + return ( +
+ {selectedKeyId ? ( + setSelectedKeyId(null)} + keyData={filteredKeys.find((k) => k.token === selectedKeyId)} + onKeyDataUpdate={(updatedKeyData) => { + setKeys((keys) => + keys.map((key) => { + if (key.token === updatedKeyData.token) { + return updateExistingKeys(key, updatedKeyData); + } + return key; + }), + ); + if (refresh) refresh(); // Minimal fix: refresh the full key list after an update + }} + onDelete={() => { + setKeys((keys) => keys.filter((key) => key.token !== selectedKeyId)); + if (refresh) refresh(); // Minimal fix: refresh the full key list after a delete + }} + accessToken={accessToken} + userID={userID} + userRole={userRole} + teams={allTeams} + premiumUser={premiumUser} + setAccessToken={setAccessToken} + /> + ) : ( +
+
+ +
+ +
+ + Showing{" "} + {isLoading + ? "..." + : `${(pagination.currentPage - 1) * pageSize + 1} - ${Math.min(pagination.currentPage * pageSize, pagination.totalCount)}`}{" "} + of {isLoading ? "..." : pagination.totalCount} results + + +
+ + Page {isLoading ? "..." : pagination.currentPage} of {isLoading ? "..." : pagination.totalPages} + + + + + +
+
+
+
+
+ + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + +
+
+ {header.isPlaceholder + ? null + : flexRender(header.column.columnDef.header, header.getContext())} +
+ {header.id !== "actions" && ( +
+ {header.column.getIsSorted() ? ( + { + asc: , + desc: , + }[header.column.getIsSorted() as string] + ) : ( + + )} +
+ )} +
+
+ ))} +
+ ))} +
+ + {isLoading ? ( + + +
+

🚅 Loading keys...

+
+
+
+ ) : filteredKeys.length > 0 ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + 3 ? "px-0" : ""}`} + > + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + )) + ) : ( + + +
+

No keys found

+
+
+
+ )} +
+
+
+
+
+
+ )} +
+ ); +}; + +export default VirtualKeysTable; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts new file mode 100644 index 0000000000..ac174a554e --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts @@ -0,0 +1,189 @@ +import { useCallback, useEffect, useState, useRef } from "react"; +import { useQuery } from "@tanstack/react-query"; +import { debounce } from "lodash"; +import { KeyResponse, Team } from "@/components/key_team_helpers/key_list"; +import { keyListCall, Organization } from "@/components/networking"; +import { defaultPageSize } from "@/components/constants"; +import { fetchAllKeyAliases, fetchAllOrganizations, fetchAllTeams } from "@/components/key_team_helpers/filter_helpers"; + +export interface FilterState { + "Team ID": string; + "Organization ID": string; + "Key Alias": string; + [key: string]: string; + "User ID": string; + "Sort By": string; + "Sort Order": string; +} + +export function useFilterLogic({ + keys, + teams, + organizations, + accessToken, +}: { + keys: KeyResponse[]; + teams: Team[] | null; + organizations: Organization[] | null; + accessToken: string | null; +}) { + const defaultFilters: FilterState = { + "Team ID": "", + "Organization ID": "", + "Key Alias": "", + "User ID": "", + "Sort By": "created_at", + "Sort Order": "desc", + }; + const [filters, setFilters] = useState(defaultFilters); + const [allTeams, setAllTeams] = useState(teams || []); + const [allOrganizations, setAllOrganizations] = useState(organizations || []); + const [filteredKeys, setFilteredKeys] = useState(keys); + const lastSearchTimestamp = useRef(0); + const debouncedSearch = useCallback( + debounce(async (filters: FilterState) => { + if (!accessToken) { + return; + } + + const currentTimestamp = Date.now(); + lastSearchTimestamp.current = currentTimestamp; + + try { + // Make the API call using userListCall with all filter parameters + const data = await keyListCall( + accessToken, + filters["Organization ID"] || null, + filters["Team ID"] || null, + filters["Key Alias"] || null, + filters["User ID"] || null, + filters["Key Hash"] || null, + 1, // Reset to first page when searching + defaultPageSize, + filters["Sort By"] || null, + filters["Sort Order"] || null, + ); + + // Only update state if this is the most recent search + if (currentTimestamp === lastSearchTimestamp.current) { + if (data) { + setFilteredKeys(data.keys); + console.log("called from debouncedSearch filters:", JSON.stringify(filters)); + console.log("called from debouncedSearch data:", JSON.stringify(data)); + } + } + } catch (error) { + console.error("Error searching users:", error); + } + }, 300), + [accessToken], + ); + // Apply filters to keys whenever keys or filters change + useEffect(() => { + if (!keys) { + setFilteredKeys([]); + return; + } + + let result = [...keys]; + + // Apply Team ID filter + if (filters["Team ID"]) { + result = result.filter((key) => key.team_id === filters["Team ID"]); + } + + // Apply Organization ID filter + if (filters["Organization ID"]) { + result = result.filter((key) => key.organization_id === filters["Organization ID"]); + } + + setFilteredKeys(result); + }, [keys, filters]); + + // Fetch all data for filters when component mounts + useEffect(() => { + const loadAllFilterData = async () => { + // Load all teams - no organization filter needed here + const teamsData = await fetchAllTeams(accessToken); + if (teamsData.length > 0) { + setAllTeams(teamsData); + } + + // Load all organizations + const orgsData = await fetchAllOrganizations(accessToken); + if (orgsData.length > 0) { + setAllOrganizations(orgsData); + } + }; + + if (accessToken) { + loadAllFilterData(); + } + }, [accessToken]); + + const queryAllKeysQuery = useQuery({ + queryKey: ["allKeys"], + queryFn: async () => { + if (!accessToken) throw new Error("Access token required"); + return await fetchAllKeyAliases(accessToken); + }, + enabled: !!accessToken, + }); + const allKeyAliases = queryAllKeysQuery.data || []; + + // Update teams and organizations when props change + useEffect(() => { + if (teams && teams.length > 0) { + setAllTeams((prevTeams) => { + // Only update if we don't already have a larger set of teams + return prevTeams.length < teams.length ? teams : prevTeams; + }); + } + }, [teams]); + + useEffect(() => { + if (organizations && organizations.length > 0) { + setAllOrganizations((prevOrgs) => { + // Only update if we don't already have a larger set of organizations + return prevOrgs.length < organizations.length ? organizations : prevOrgs; + }); + } + }, [organizations]); + + const handleFilterChange = (newFilters: Record) => { + // Update filters state + setFilters({ + "Team ID": newFilters["Team ID"] || "", + "Organization ID": newFilters["Organization ID"] || "", + "Key Alias": newFilters["Key Alias"] || "", + "User ID": newFilters["User ID"] || "", + "Sort By": newFilters["Sort By"] || "created_at", + "Sort Order": newFilters["Sort Order"] || "desc", + }); + + // Fetch keys based on new filters + const updatedFilters = { + ...filters, + ...newFilters, + }; + debouncedSearch(updatedFilters); + }; + + const handleFilterReset = () => { + // Reset filters state + setFilters(defaultFilters); + + // Reset selections + debouncedSearch(defaultFilters); + }; + + return { + filters, + filteredKeys, + allKeyAliases, + allTeams, + allOrganizations, + handleFilterChange, + handleFilterReset, + }; +} diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/hooks/useTeams.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/hooks/useTeams.tsx new file mode 100644 index 0000000000..d1208737ec --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/hooks/useTeams.tsx @@ -0,0 +1,20 @@ +import { useEffect, useState } from "react"; +import { fetchTeams } from "@/app/(console)/virtual-keys/networking"; +import { Team } from "@/components/key_team_helpers/key_list"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +const useTeams = () => { + const [teams, setTeams] = useState([]); + const { accessToken, userId: userID, userRole } = useAuthorized(); + + useEffect(() => { + (async () => { + const fetched = await fetchTeams(accessToken, userID, userRole, null); + setTeams(fetched); + })(); + }, [accessToken, userID, userRole]); + + return teams; +}; + +export default useTeams; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/networking.ts b/ui/litellm-dashboard/src/app/(console)/virtual-keys/networking.ts new file mode 100644 index 0000000000..7fb09d61a5 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/networking.ts @@ -0,0 +1,17 @@ +import { Organization, teamListCall } from "@/components/networking"; + +export const fetchTeams = async ( + accessToken: string, + userID: string | null, + userRole: string | null, + currentOrg: Organization | null, +) => { + let givenTeams; + if (userRole != "Admin" && userRole != "Admin Viewer") { + givenTeams = await teamListCall(accessToken, currentOrg?.organization_id || null, userID); + } else { + givenTeams = await teamListCall(accessToken, currentOrg?.organization_id || null); + } + + return givenTeams; +}; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/page.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/page.tsx new file mode 100644 index 0000000000..9554905088 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/page.tsx @@ -0,0 +1,52 @@ +"use client"; + +import VirtualKeysTable from "@/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable"; +import { getCookie } from "@/utils/cookieUtils"; +import { jwtDecode } from "jwt-decode"; +import { useState } from "react"; +import useKeyList from "@/components/key_team_helpers/key_list"; +import { useRouter } from "next/navigation"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { Col, Grid } from "@tremor/react"; +import CreateKey from "@/app/(console)/virtual-keys/components/CreateKey"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized" + +const VirtualKeysPage = () => { + const {accessToken, userRole} = useAuthorized(); + const [createClicked, setCreateClicked] = useState(false); + + const queryClient = new QueryClient(); + + const { keys, isLoading, error, pagination, refresh, setKeys } = useKeyList({ + selectedKeyAlias: null, + currentOrg: null, + accessToken: accessToken || "", + createClicked, + }); + + const addKey = (data: any) => { + setKeys((prevData) => (prevData ? [...prevData, data] : [data])); + setCreateClicked(() => !createClicked); + }; + + return ( + +
+ + + + {}} + organizations={null} + /> + + +
+
+ ); +}; + +export default VirtualKeysPage; diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index 579e90e530..472b3f9a37 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -234,7 +234,6 @@ export default function CreateKeyPage() { teams={teams} keys={keys} setUserRole={setUserRole} - userEmail={userEmail} setUserEmail={setUserEmail} setTeams={setTeams} setKeys={setKeys} @@ -275,7 +274,6 @@ export default function CreateKeyPage() { teams={teams} keys={keys} setUserRole={setUserRole} - userEmail={userEmail} setUserEmail={setUserEmail} setTeams={setTeams} setKeys={setKeys} diff --git a/ui/litellm-dashboard/src/components/leftnav.tsx b/ui/litellm-dashboard/src/components/leftnav.tsx index e47691d3bb..d9326cb887 100644 --- a/ui/litellm-dashboard/src/components/leftnav.tsx +++ b/ui/litellm-dashboard/src/components/leftnav.tsx @@ -1,8 +1,4 @@ import { Layout, Menu } from "antd"; -import Link from "next/link"; -import { List } from "postcss/lib/list"; -import { Text, Button } from "@tremor/react"; -import { useState } from "react"; import { KeyOutlined, PlayCircleOutlined, @@ -16,29 +12,17 @@ import { AppstoreOutlined, DatabaseOutlined, FileTextOutlined, - LineOutlined, LineChartOutlined, SafetyOutlined, ExperimentOutlined, - ThunderboltOutlined, - LockOutlined, ToolOutlined, TagsOutlined, BgColorsOutlined, - MenuFoldOutlined, - MenuUnfoldOutlined, } from "@ant-design/icons"; -import { - old_admin_roles, - v2_admin_role_names, - all_admin_roles, - rolesAllowedToSeeUsage, - rolesWithWriteAccess, - internalUserRoles, - isAdminRole, -} from "../utils/roles"; +import { all_admin_roles, rolesWithWriteAccess, internalUserRoles, isAdminRole } from "../utils/roles"; import UsageIndicator from "./usage_indicator"; import { ConfigProvider } from "antd"; +import { useRouter } from "next/navigation"; const { Sider } = Layout; // Define the props type @@ -61,6 +45,7 @@ interface MenuItem { } const Sidebar: React.FC = ({ accessToken, setPage, userRole, defaultSelectedKey, collapsed = false }) => { + const router = useRouter(); // Note: If a menu item does not have a role, it is visible to all roles. const menuItems: MenuItem[] = [ { @@ -252,6 +237,19 @@ const Sidebar: React.FC = ({ accessToken, setPage, userRole, defau return true; }); + const navigateToPage = (page: string) => { + if (page === "api-keys") { + // Go to clean route and DO NOT call setPage to avoid any parent sync that re-adds ?page=api-keys + router.replace("/virtual-keys"); + return; + } + const newSearchParams = new URLSearchParams(window.location.search); + newSearchParams.set("page", page); + // Use absolute root to replace everything after the domain + router.replace(`/?${newSearchParams.toString()}`); + setPage(page); + }; + return ( = ({ accessToken, setPage, userRole, defau key: child.key, icon: child.icon, label: child.label, - onClick: () => { - const newSearchParams = new URLSearchParams(window.location.search); - newSearchParams.set("page", child.page); - window.history.pushState(null, "", `?${newSearchParams.toString()}`); - setPage(child.page); - }, + onClick: () => navigateToPage(child.page), })), - onClick: !item.children - ? () => { - const newSearchParams = new URLSearchParams(window.location.search); - newSearchParams.set("page", item.page); - window.history.pushState(null, "", `?${newSearchParams.toString()}`); - setPage(item.page); - } - : undefined, + onClick: !item.children ? () => navigateToPage(item.page) : undefined, }))} /> diff --git a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx index c725466b98..20c1f5b3a3 100644 --- a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx +++ b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx @@ -131,6 +131,14 @@ export const fetchUserModels = async ( } }; + +/** + * ───────────────────────────────────────────────────────────────────────── + * @deprecated + * This component is being DEPRECATED in favor of src/app/(console)/virtual-keys/components/CreateKey.tsx + * Please contribute to the new refactor. + * ───────────────────────────────────────────────────────────────────────── + */ const CreateKey: React.FC = ({ userID, team, diff --git a/ui/litellm-dashboard/src/components/templates/view_key_table.tsx b/ui/litellm-dashboard/src/components/templates/view_key_table.tsx index bad8bdb983..f3ba12d56d 100644 --- a/ui/litellm-dashboard/src/components/templates/view_key_table.tsx +++ b/ui/litellm-dashboard/src/components/templates/view_key_table.tsx @@ -135,6 +135,13 @@ interface CombinedLimits { [key: string]: CombinedLimit; // Index signature allowing string keys } +/** + * ───────────────────────────────────────────────────────────────────────── + * @deprecated + * This component is being DEPRECATED in favor of src/app/(console)/virtual-keys/components/VirtualKeysTable/ + * Please contribute to the new refactor. + * ───────────────────────────────────────────────────────────────────────── + */ const ViewKeyTable: React.FC = ({ userID, userRole, diff --git a/ui/litellm-dashboard/src/utils/roles.ts b/ui/litellm-dashboard/src/utils/roles.ts index aafeb010be..f542da105f 100644 --- a/ui/litellm-dashboard/src/utils/roles.ts +++ b/ui/litellm-dashboard/src/utils/roles.ts @@ -5,7 +5,7 @@ export const all_admin_roles = [...old_admin_roles, ...v2_admin_role_names]; export const internalUserRoles = ["Internal User", "Internal Viewer"]; export const rolesAllowedToSeeUsage = ["Admin", "Admin Viewer", "Internal User", "Internal Viewer"]; -export const rolesWithWriteAccess = ["Internal User", "Admin"]; +export const rolesWithWriteAccess = ["Internal User", "Admin", "proxy_admin"]; // Helper function to check if a role is in all_admin_roles export const isAdminRole = (role: string): boolean => { From 3f53d6b7ad32b7b55f9782f80e336bba55cd9a4c Mon Sep 17 00:00:00 2001 From: = Date: Mon, 6 Oct 2025 09:45:58 -0700 Subject: [PATCH 02/48] Moved KeyInfoView to refactored folder, added deprecation notice --- .../components/VirtualKeysTable/VirtualKeysTable.tsx | 2 +- .../src/components/templates/key_info_view.tsx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx index 5c32a736ae..cdbd7cee43 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx +++ b/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx @@ -15,10 +15,10 @@ import { KeyResponse, Team } from "@/components/key_team_helpers/key_list"; import { Organization, userListCall } from "@/components/networking"; import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; import FilterComponent, { FilterOption } from "@/components/molecules/filter"; -import KeyInfoView from "@/components/templates/key_info_view"; import { useFilterLogic } from "@/components/key_team_helpers/filter_logic"; import useTeams from "@/app/(console)/virtual-keys/hooks/useTeams"; import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import KeyInfoView from "@/app/(console)/virtual-keys/components/KeyInfoView"; interface AllKeysTableProps { keys: KeyResponse[]; diff --git a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx b/ui/litellm-dashboard/src/components/templates/key_info_view.tsx index a5ec177425..0080924fb6 100644 --- a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx +++ b/ui/litellm-dashboard/src/components/templates/key_info_view.tsx @@ -47,6 +47,13 @@ interface KeyInfoViewProps { backButtonText?: string; } +/** + * ───────────────────────────────────────────────────────────────────────── + * @deprecated + * This component is being DEPRECATED in favor of src/app/(console)/virtual-keys/components/KeyInfoView.tsx + * Please contribute to the new refactor. + * ───────────────────────────────────────────────────────────────────────── + */ export default function KeyInfoView({ keyId, onClose, From 53ee3e2634f956c059bbf3b5449a061a46ba6666 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 6 Oct 2025 10:28:48 -0700 Subject: [PATCH 03/48] refactoredUI feature flag --- .../components/{Sidebar.tsx => Sidebar2.tsx} | 4 +- .../src/app/(console)/layout.tsx | 4 +- ui/litellm-dashboard/src/app/page.tsx | 24 +++++++--- .../src/components/leftnav.tsx | 46 +++++++++++-------- .../src/components/navbar.tsx | 21 ++++++++- .../src/hooks/useFeatureFlags.ts | 9 ++++ 6 files changed, 78 insertions(+), 30 deletions(-) rename ui/litellm-dashboard/src/app/(console)/components/{Sidebar.tsx => Sidebar2.tsx} (98%) create mode 100644 ui/litellm-dashboard/src/hooks/useFeatureFlags.ts diff --git a/ui/litellm-dashboard/src/app/(console)/components/Sidebar.tsx b/ui/litellm-dashboard/src/app/(console)/components/Sidebar2.tsx similarity index 98% rename from ui/litellm-dashboard/src/app/(console)/components/Sidebar.tsx rename to ui/litellm-dashboard/src/app/(console)/components/Sidebar2.tsx index ad60ba626a..b2477243a0 100644 --- a/ui/litellm-dashboard/src/app/(console)/components/Sidebar.tsx +++ b/ui/litellm-dashboard/src/app/(console)/components/Sidebar2.tsx @@ -44,7 +44,7 @@ interface MenuItem { icon?: React.ReactNode; } -const Sidebar: React.FC = ({ accessToken, userRole, defaultSelectedKey, collapsed = false }) => { +const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelectedKey, collapsed = false }) => { const menuItems: MenuItem[] = [ { key: "1", page: "api-keys", label: "Virtual Keys", icon: }, { @@ -288,4 +288,4 @@ const Sidebar: React.FC = ({ accessToken, userRole, defaultSelecte ); }; -export default Sidebar; +export default Sidebar2; diff --git a/ui/litellm-dashboard/src/app/(console)/layout.tsx b/ui/litellm-dashboard/src/app/(console)/layout.tsx index cbfb5bdcb5..6ad84208f5 100644 --- a/ui/litellm-dashboard/src/app/(console)/layout.tsx +++ b/ui/litellm-dashboard/src/app/(console)/layout.tsx @@ -3,7 +3,7 @@ import React from "react"; import Navbar from "@/components/navbar"; import { ThemeProvider } from "@/contexts/ThemeContext"; -import Sidebar from "@/app/(console)/components/Sidebar"; +import Sidebar2 from "@/app/(console)/components/Sidebar2"; import useAuthorized from "@/app/(console)/hooks/useAuthorized"; export default function Layout({ children }: { children: React.ReactNode }) { @@ -31,7 +31,7 @@ export default function Layout({ children }: { children: React.ReactNode }) { />
- row.startsWith(name + "=")); @@ -116,6 +118,8 @@ export default function CreateKeyPage() { const [authLoading, setAuthLoading] = useState(true); const [userID, setUserID] = useState(null); + const { refactoredUIFlag, setRefactoredUIFlag } = useFeatureFlags(); + const invitation_id = searchParams.get("invitation_id"); // Get page from URL, default to 'api-keys' if not present @@ -254,16 +258,22 @@ export default function CreateKeyPage() { isPublicPage={false} sidebarCollapsed={sidebarCollapsed} onToggleSidebar={toggleSidebar} + refactoredUIFlag={refactoredUIFlag} + setRefactoredUIFlag={setRefactoredUIFlag} />
- + {refactoredUIFlag ? ( + + ) : ( + + )}
{page == "api-keys" ? ( diff --git a/ui/litellm-dashboard/src/components/leftnav.tsx b/ui/litellm-dashboard/src/components/leftnav.tsx index d9326cb887..34916cddb9 100644 --- a/ui/litellm-dashboard/src/components/leftnav.tsx +++ b/ui/litellm-dashboard/src/components/leftnav.tsx @@ -12,17 +12,29 @@ import { AppstoreOutlined, DatabaseOutlined, FileTextOutlined, + LineOutlined, LineChartOutlined, SafetyOutlined, ExperimentOutlined, + ThunderboltOutlined, + LockOutlined, ToolOutlined, TagsOutlined, BgColorsOutlined, + MenuFoldOutlined, + MenuUnfoldOutlined, } from "@ant-design/icons"; -import { all_admin_roles, rolesWithWriteAccess, internalUserRoles, isAdminRole } from "../utils/roles"; +import { + old_admin_roles, + v2_admin_role_names, + all_admin_roles, + rolesAllowedToSeeUsage, + rolesWithWriteAccess, + internalUserRoles, + isAdminRole, +} from "../utils/roles"; import UsageIndicator from "./usage_indicator"; import { ConfigProvider } from "antd"; -import { useRouter } from "next/navigation"; const { Sider } = Layout; // Define the props type @@ -45,7 +57,6 @@ interface MenuItem { } const Sidebar: React.FC = ({ accessToken, setPage, userRole, defaultSelectedKey, collapsed = false }) => { - const router = useRouter(); // Note: If a menu item does not have a role, it is visible to all roles. const menuItems: MenuItem[] = [ { @@ -237,19 +248,6 @@ const Sidebar: React.FC = ({ accessToken, setPage, userRole, defau return true; }); - const navigateToPage = (page: string) => { - if (page === "api-keys") { - // Go to clean route and DO NOT call setPage to avoid any parent sync that re-adds ?page=api-keys - router.replace("/virtual-keys"); - return; - } - const newSearchParams = new URLSearchParams(window.location.search); - newSearchParams.set("page", page); - // Use absolute root to replace everything after the domain - router.replace(`/?${newSearchParams.toString()}`); - setPage(page); - }; - return ( = ({ accessToken, setPage, userRole, defau key: child.key, icon: child.icon, label: child.label, - onClick: () => navigateToPage(child.page), + onClick: () => { + const newSearchParams = new URLSearchParams(window.location.search); + newSearchParams.set("page", child.page); + window.history.pushState(null, "", `?${newSearchParams.toString()}`); + setPage(child.page); + }, })), - onClick: !item.children ? () => navigateToPage(item.page) : undefined, + onClick: !item.children + ? () => { + const newSearchParams = new URLSearchParams(window.location.search); + newSearchParams.set("page", item.page); + window.history.pushState(null, "", `?${newSearchParams.toString()}`); + setPage(item.page); + } + : undefined, }))} /> diff --git a/ui/litellm-dashboard/src/components/navbar.tsx b/ui/litellm-dashboard/src/components/navbar.tsx index 0764288057..e4a9c21c44 100644 --- a/ui/litellm-dashboard/src/components/navbar.tsx +++ b/ui/litellm-dashboard/src/components/navbar.tsx @@ -1,7 +1,7 @@ import Link from "next/link"; import React, { useState, useEffect } from "react"; import type { MenuProps } from "antd"; -import { Dropdown, Tooltip } from "antd"; +import { Dropdown, Tooltip, Switch } from "antd"; import { getProxyBaseUrl, Organization } from "@/components/networking"; import { defaultOrg } from "@/components/common_components/default_org"; import { @@ -19,6 +19,7 @@ import { clearTokenCookies } from "@/utils/cookieUtils"; import { fetchProxySettings } from "@/utils/proxyUtils"; import { useTheme } from "@/contexts/ThemeContext"; import { clearMCPAuthTokens } from "./mcp_tools/mcp_auth_storage"; +import useFeatureFlags from "@/hooks/useFeatureFlags"; interface NavbarProps { userID: string | null; @@ -31,6 +32,8 @@ interface NavbarProps { isPublicPage: boolean; sidebarCollapsed?: boolean; onToggleSidebar?: () => void; + refactoredUIFlag: boolean; + setRefactoredUIFlag: React.Dispatch>; } const Navbar: React.FC = ({ @@ -44,6 +47,8 @@ const Navbar: React.FC = ({ isPublicPage = false, sidebarCollapsed = false, onToggleSidebar, + refactoredUIFlag, + setRefactoredUIFlag, }) => { const baseUrl = getProxyBaseUrl(); const [logoutUrl, setLogoutUrl] = useState(""); @@ -79,6 +84,8 @@ const Navbar: React.FC = ({ const userItems: MenuProps["items"] = [ { key: "user-info", + // Prevent dropdown from closing when interacting with the toggle + onClick: (info) => info.domEvent?.stopPropagation(), label: (
@@ -115,6 +122,18 @@ const Navbar: React.FC = ({ {userEmail || "Unknown"}
+ + {/* NEW: Feature flag label + toggle below the email field */} +
+ Refactored UI + setRefactoredUIFlag(checked)} + aria-label="Toggle refactored UI feature flag" + /> +
), diff --git a/ui/litellm-dashboard/src/hooks/useFeatureFlags.ts b/ui/litellm-dashboard/src/hooks/useFeatureFlags.ts new file mode 100644 index 0000000000..b82f89e874 --- /dev/null +++ b/ui/litellm-dashboard/src/hooks/useFeatureFlags.ts @@ -0,0 +1,9 @@ +import { useState } from "react"; + +const useFeatureFlags = () => { + const [refactoredUIFlag, setRefactoredUIFlag] = useState(false); + + return { refactoredUIFlag, setRefactoredUIFlag }; +}; + +export default useFeatureFlags; From 715c4999a290a528a54ac3ccf6b01d08ae6811e9 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 12:57:16 -0700 Subject: [PATCH 04/48] global feature flag state for app --- .../(console)/components/SidebarProvider.tsx | 34 +++++++++++++++++++ .../src/app/(console)/layout.tsx | 1 + ui/litellm-dashboard/src/app/layout.tsx | 5 ++- ui/litellm-dashboard/src/app/page.tsx | 21 +++--------- .../src/components/navbar.tsx | 7 ++-- .../src/hooks/useFeatureFlags.ts | 9 ----- .../src/hooks/useFeatureFlags.tsx | 26 ++++++++++++++ 7 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 ui/litellm-dashboard/src/app/(console)/components/SidebarProvider.tsx delete mode 100644 ui/litellm-dashboard/src/hooks/useFeatureFlags.ts create mode 100644 ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx diff --git a/ui/litellm-dashboard/src/app/(console)/components/SidebarProvider.tsx b/ui/litellm-dashboard/src/app/(console)/components/SidebarProvider.tsx new file mode 100644 index 0000000000..a5e150da86 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(console)/components/SidebarProvider.tsx @@ -0,0 +1,34 @@ +import Sidebar2 from "@/app/(console)/components/Sidebar2"; +import Sidebar from "@/components/leftnav"; +import React from "react"; +import useFeatureFlags from "@/hooks/useFeatureFlags"; +import useAuthorized from "@/app/(console)/hooks/useAuthorized"; + +interface SidebarProviderProps { + defaultSelectedKey: string; + sidebarCollapsed: boolean; + setPage: (page: string) => void; +} + +const SidebarProvider = ({defaultSelectedKey, sidebarCollapsed, setPage}: SidebarProviderProps) => { + + const {accessToken, userRole} = useAuthorized(); + const { refactoredUIFlag, setRefactoredUIFlag } = useFeatureFlags(); + + return ( + refactoredUIFlag ? ( + + ) : ( + + ) + ); + +} + +export default SidebarProvider; \ No newline at end of file diff --git a/ui/litellm-dashboard/src/app/(console)/layout.tsx b/ui/litellm-dashboard/src/app/(console)/layout.tsx index 6ad84208f5..595eeedc59 100644 --- a/ui/litellm-dashboard/src/app/(console)/layout.tsx +++ b/ui/litellm-dashboard/src/app/(console)/layout.tsx @@ -5,6 +5,7 @@ import Navbar from "@/components/navbar"; import { ThemeProvider } from "@/contexts/ThemeContext"; import Sidebar2 from "@/app/(console)/components/Sidebar2"; import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import useFeatureFlags, { FeatureFlagsProvider } from "@/hooks/useFeatureFlags"; export default function Layout({ children }: { children: React.ReactNode }) { const { accessToken, userRole } = useAuthorized(); diff --git a/ui/litellm-dashboard/src/app/layout.tsx b/ui/litellm-dashboard/src/app/layout.tsx index 95c485fe2f..8a37d0fa1b 100644 --- a/ui/litellm-dashboard/src/app/layout.tsx +++ b/ui/litellm-dashboard/src/app/layout.tsx @@ -1,6 +1,7 @@ import type { Metadata } from "next"; import { Inter } from "next/font/google"; import "./globals.css"; +import { FeatureFlagsProvider } from "@/hooks/useFeatureFlags"; const inter = Inter({ subsets: ["latin"] }); @@ -17,7 +18,9 @@ export default function RootLayout({ }>) { return ( - {children} + + {children} + ); } diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index 2e49b422b4..eff997a3aa 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -39,8 +39,9 @@ import VectorStoreManagement from "@/components/vector_store_management"; import UIThemeSettings from "@/components/ui_theme_settings"; import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; import { cx } from "@/lib/cva.config"; -import useFeatureFlags from "@/hooks/useFeatureFlags"; +import useFeatureFlags, { FeatureFlagsProvider } from "@/hooks/useFeatureFlags"; import Sidebar2 from "@/app/(console)/components/Sidebar2"; +import SidebarProvider from "@/app/(console)/components/SidebarProvider"; function getCookie(name: string) { const cookieValue = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); @@ -118,8 +119,6 @@ export default function CreateKeyPage() { const [authLoading, setAuthLoading] = useState(true); const [userID, setUserID] = useState(null); - const { refactoredUIFlag, setRefactoredUIFlag } = useFeatureFlags(); - const invitation_id = searchParams.get("invitation_id"); // Get page from URL, default to 'api-keys' if not present @@ -234,6 +233,7 @@ export default function CreateKeyPage() {
- {refactoredUIFlag ? ( - - ) : ( - - )} +
{page == "api-keys" ? ( void; - refactoredUIFlag: boolean; - setRefactoredUIFlag: React.Dispatch>; } const Navbar: React.FC = ({ @@ -46,13 +44,12 @@ const Navbar: React.FC = ({ accessToken, isPublicPage = false, sidebarCollapsed = false, - onToggleSidebar, - refactoredUIFlag, - setRefactoredUIFlag, + onToggleSidebar }) => { const baseUrl = getProxyBaseUrl(); const [logoutUrl, setLogoutUrl] = useState(""); const { logoUrl } = useTheme(); + const { refactoredUIFlag, setRefactoredUIFlag } = useFeatureFlags(); // Simple logo URL: use custom logo if available, otherwise default const imageUrl = logoUrl || `${baseUrl}/get_image`; diff --git a/ui/litellm-dashboard/src/hooks/useFeatureFlags.ts b/ui/litellm-dashboard/src/hooks/useFeatureFlags.ts deleted file mode 100644 index b82f89e874..0000000000 --- a/ui/litellm-dashboard/src/hooks/useFeatureFlags.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { useState } from "react"; - -const useFeatureFlags = () => { - const [refactoredUIFlag, setRefactoredUIFlag] = useState(false); - - return { refactoredUIFlag, setRefactoredUIFlag }; -}; - -export default useFeatureFlags; diff --git a/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx b/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx new file mode 100644 index 0000000000..d50fdf46a6 --- /dev/null +++ b/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx @@ -0,0 +1,26 @@ +'use client'; +import React, {createContext, useContext, useState} from 'react'; + +type Flags = { + refactoredUIFlag: boolean; + setRefactoredUIFlag: (v: boolean) => void; +}; + +const FeatureFlagsCtx = createContext(null); + +export const FeatureFlagsProvider = ({ children }: { children: React.ReactNode }) => { + const [refactoredUIFlag, setRefactoredUIFlag] = useState(false); + return ( + + {children} + +); +} + +const useFeatureFlags = () => { + const ctx = useContext(FeatureFlagsCtx); + if (!ctx) throw new Error('useFeatureFlags must be used within FeatureFlagsProvider'); + return ctx; +} + +export default useFeatureFlags; From f4d9e4869ad7c29647aed699de6e77e51584b4e8 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 13:33:38 -0700 Subject: [PATCH 05/48] renamed (console), added use clients --- .../components/Sidebar2.tsx | 4 +++- .../components/SidebarProvider.tsx | 6 +++-- .../components/modals/CreateUserModal.tsx | 8 ++++--- .../hooks/useAuthorized.ts | 3 ++- .../app/{(console) => dashboard}/layout.tsx | 5 ++--- .../virtual-keys/components/CreateKey.tsx | 6 ++--- .../CreateKeyForm/KeyDetailsSection.tsx | 2 ++ .../CreateKeyForm/OptionalSettingsSection.tsx | 4 +++- .../CreateKeyForm/OwnershipSection.tsx | 4 +++- .../CreateKeyModal/CreateKeyModal.tsx | 22 ++++++++++--------- .../components/CreateKeyModal/hooks/index.ts | 0 .../hooks/useGuardrailsAndPrompts.ts | 4 ++-- .../hooks/useMcpAccessGroups.ts | 4 ++-- .../CreateKeyModal/hooks/useTeamModels.ts | 4 ++-- .../CreateKeyModal/hooks/useUserModels.ts | 4 ++-- .../CreateKeyModal/hooks/useUserSearch.ts | 4 ++-- .../components/CreateKeyModal/networking.ts | 2 +- .../components/CreateKeyModal/types.ts | 0 .../components/CreateKeyModal/utils.ts | 2 +- .../virtual-keys/components/KeyInfoView.tsx | 2 ++ .../virtual-keys/components/SaveKeyModal.tsx | 2 ++ .../VirtualKeysTable/VirtualKeysTable.tsx | 8 +++---- .../VirtualKeysTable/hooks/useFilterLogic.ts | 0 .../virtual-keys/hooks/useTeams.tsx | 4 ++-- .../virtual-keys/networking.ts | 0 .../virtual-keys/page.tsx | 9 +++----- ui/litellm-dashboard/src/app/page.tsx | 4 ++-- .../organisms/create_key_button.tsx | 2 +- .../components/templates/key_info_view.tsx | 2 +- .../components/templates/view_key_table.tsx | 2 +- 30 files changed, 69 insertions(+), 54 deletions(-) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/components/Sidebar2.tsx (99%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/components/SidebarProvider.tsx (86%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/components/modals/CreateUserModal.tsx (98%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/hooks/useAuthorized.ts (94%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/layout.tsx (86%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKey.tsx (94%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx (99%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx (99%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx (98%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx (91%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/hooks/index.ts (100%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts (83%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts (80%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts (89%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts (81%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts (89%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/networking.ts (95%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/types.ts (100%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/CreateKeyModal/utils.ts (98%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/KeyInfoView.tsx (99%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/SaveKeyModal.tsx (99%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx (99%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts (100%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/hooks/useTeams.tsx (79%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/networking.ts (100%) rename ui/litellm-dashboard/src/app/{(console) => dashboard}/virtual-keys/page.tsx (81%) diff --git a/ui/litellm-dashboard/src/app/(console)/components/Sidebar2.tsx b/ui/litellm-dashboard/src/app/dashboard/components/Sidebar2.tsx similarity index 99% rename from ui/litellm-dashboard/src/app/(console)/components/Sidebar2.tsx rename to ui/litellm-dashboard/src/app/dashboard/components/Sidebar2.tsx index b2477243a0..9de9f2f136 100644 --- a/ui/litellm-dashboard/src/app/(console)/components/Sidebar2.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/components/Sidebar2.tsx @@ -1,3 +1,5 @@ +"use client"; + import React from "react"; import Link from "next/link"; import { usePathname, useSearchParams } from "next/navigation"; @@ -216,7 +218,7 @@ const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelect }; const selectedMenuKey = - pathname === "/virtual-keys" + pathname === "/dashboard/virtual-keys" ? "1" : pageParam ? findMenuItemKey(pageParam) diff --git a/ui/litellm-dashboard/src/app/(console)/components/SidebarProvider.tsx b/ui/litellm-dashboard/src/app/dashboard/components/SidebarProvider.tsx similarity index 86% rename from ui/litellm-dashboard/src/app/(console)/components/SidebarProvider.tsx rename to ui/litellm-dashboard/src/app/dashboard/components/SidebarProvider.tsx index a5e150da86..8380493798 100644 --- a/ui/litellm-dashboard/src/app/(console)/components/SidebarProvider.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/components/SidebarProvider.tsx @@ -1,8 +1,10 @@ -import Sidebar2 from "@/app/(console)/components/Sidebar2"; +"use client"; + +import Sidebar2 from "@/app/dashboard/components/Sidebar2"; import Sidebar from "@/components/leftnav"; import React from "react"; import useFeatureFlags from "@/hooks/useFeatureFlags"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; interface SidebarProviderProps { defaultSelectedKey: string; diff --git a/ui/litellm-dashboard/src/app/(console)/components/modals/CreateUserModal.tsx b/ui/litellm-dashboard/src/app/dashboard/components/modals/CreateUserModal.tsx similarity index 98% rename from ui/litellm-dashboard/src/app/(console)/components/modals/CreateUserModal.tsx rename to ui/litellm-dashboard/src/app/dashboard/components/modals/CreateUserModal.tsx index 4caaceb662..8b16074b25 100644 --- a/ui/litellm-dashboard/src/app/(console)/components/modals/CreateUserModal.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/components/modals/CreateUserModal.tsx @@ -1,3 +1,5 @@ +"use client"; + // TODO: refactor import React, { useState, useEffect } from "react"; import { Button, Modal, Form, Input, message, Select, InputNumber, Select as Select2 } from "antd"; @@ -27,9 +29,9 @@ import { } from "@/components/networking"; import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; import BulkCreateUsersButton from "@/components/bulk_create_users_button"; -import { fetchTeams } from "@/app/(console)/virtual-keys/networking"; -import useTeams from "@/app/(console)/virtual-keys/hooks/useTeams"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import { fetchTeams } from "@/app/dashboard/virtual-keys/networking"; +import useTeams from "@/app/dashboard/virtual-keys/hooks/useTeams"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; // Helper function to generate UUID compatible across all environments const generateUUID = (): string => { diff --git a/ui/litellm-dashboard/src/app/(console)/hooks/useAuthorized.ts b/ui/litellm-dashboard/src/app/dashboard/hooks/useAuthorized.ts similarity index 94% rename from ui/litellm-dashboard/src/app/(console)/hooks/useAuthorized.ts rename to ui/litellm-dashboard/src/app/dashboard/hooks/useAuthorized.ts index 45f5ee92ea..9d436d0566 100644 --- a/ui/litellm-dashboard/src/app/(console)/hooks/useAuthorized.ts +++ b/ui/litellm-dashboard/src/app/dashboard/hooks/useAuthorized.ts @@ -1,4 +1,5 @@ -import { Router } from "next/router"; +"use client"; + import { getCookie } from "@/utils/cookieUtils"; import { useRouter } from "next/navigation"; import { jwtDecode } from "jwt-decode"; diff --git a/ui/litellm-dashboard/src/app/(console)/layout.tsx b/ui/litellm-dashboard/src/app/dashboard/layout.tsx similarity index 86% rename from ui/litellm-dashboard/src/app/(console)/layout.tsx rename to ui/litellm-dashboard/src/app/dashboard/layout.tsx index 595eeedc59..851ecec665 100644 --- a/ui/litellm-dashboard/src/app/(console)/layout.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/layout.tsx @@ -3,9 +3,8 @@ import React from "react"; import Navbar from "@/components/navbar"; import { ThemeProvider } from "@/contexts/ThemeContext"; -import Sidebar2 from "@/app/(console)/components/Sidebar2"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; -import useFeatureFlags, { FeatureFlagsProvider } from "@/hooks/useFeatureFlags"; +import Sidebar2 from "@/app/dashboard/components/Sidebar2"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; export default function Layout({ children }: { children: React.ReactNode }) { const { accessToken, userRole } = useAuthorized(); diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKey.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKey.tsx similarity index 94% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKey.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKey.tsx index c8e0b1d8ce..15dd713917 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKey.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKey.tsx @@ -6,9 +6,9 @@ import { Modal, Form } from "antd"; import { getPossibleUserRoles, Organization } from "@/components/networking"; import { rolesWithWriteAccess } from "@/utils/roles"; import { Team } from "@/components/key_team_helpers/key_list"; -import CreateKeyModal from "@/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyModal"; -import CreateUserModal from "@/app/(console)/components/modals/CreateUserModal"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import CreateKeyModal from "@/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyModal"; +import CreateUserModal from "@/app/dashboard/components/modals/CreateUserModal"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; interface CreateKeyProps { team: Team | null; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx similarity index 99% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx index 54e9aaefed..33a8ae06cf 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx @@ -1,3 +1,5 @@ +"use client"; + import { TextInput, Title } from "@tremor/react"; import { Form, FormInstance, Select, Tooltip } from "antd"; import { InfoCircleOutlined } from "@ant-design/icons"; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx similarity index 99% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx index c879cdf595..65ebd2d571 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx @@ -1,3 +1,5 @@ +"use client"; + import { Accordion, AccordionBody, AccordionHeader, Text, Title } from "@tremor/react"; import { Form, FormInstance, Input, Select, Tooltip } from "antd"; import { InfoCircleOutlined } from "@ant-design/icons"; @@ -15,7 +17,7 @@ import SchemaFormFields from "@/components/common_components/check_openapi_schem import { Team } from "@/components/key_team_helpers/key_list"; import React from "react"; import { DefaultOptionType } from "rc-select/lib/Select"; -import { ModelAliases } from "@/app/(console)/virtual-keys/components/CreateKeyModal/types"; +import { ModelAliases } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; export interface OptionalSettingsSectionProps { form: FormInstance; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx similarity index 98% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx index fdfb3893f6..00c2e9a1e2 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx @@ -1,10 +1,12 @@ +"use client"; + import { Button as Button2, Form, Radio, Select, Tooltip } from "antd"; import { Title } from "@tremor/react"; import { InfoCircleOutlined } from "@ant-design/icons"; import TeamDropdown from "@/components/common_components/team_dropdown"; import React from "react"; import { Team } from "@/components/key_team_helpers/key_list"; -import { UserOption } from "@/app/(console)/virtual-keys/components/CreateKeyModal/types"; +import { UserOption } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; interface OwnershipSectionProps { team: Team | null; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx similarity index 91% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx index 9f4d7528a8..2bee7f72b1 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx @@ -1,9 +1,11 @@ +"use client"; + import { Button as Button2, Form, FormInstance, Modal } from "antd"; import { Text } from "@tremor/react"; import { keyCreateCall, keyCreateServiceAccountCall } from "@/components/networking"; import React, { useEffect, useState } from "react"; import { Team } from "@/components/key_team_helpers/key_list"; -import SaveKeyModal from "@/app/(console)/virtual-keys/components/SaveKeyModal"; +import SaveKeyModal from "@/app/dashboard/virtual-keys/components/SaveKeyModal"; import NotificationsManager from "@/components/molecules/notifications_manager"; import { useGuardrailsAndPrompts, @@ -11,15 +13,15 @@ import { useTeamModels, useUserModels, useUserSearch, -} from "@/app/(console)/virtual-keys/components/CreateKeyModal/hooks"; -import OwnershipSection from "@/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection"; -import KeyDetailsSection from "@/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection"; -import OptionalSettingsSection from "@/app/(console)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection"; -import { ModelAliases } from "@/app/(console)/virtual-keys/components/CreateKeyModal/types"; -import { getPredefinedTags, prepareFormValues } from "@/app/(console)/virtual-keys/components/CreateKeyModal/utils"; -import { fetchTeams } from "@/app/(console)/virtual-keys/networking"; -import useTeams from "@/app/(console)/virtual-keys/hooks/useTeams"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +} from "@/app/dashboard/virtual-keys/components/CreateKeyModal/hooks"; +import OwnershipSection from "@/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection"; +import KeyDetailsSection from "@/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection"; +import OptionalSettingsSection from "@/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection"; +import { ModelAliases } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; +import { getPredefinedTags, prepareFormValues } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/utils"; +import { fetchTeams } from "@/app/dashboard/virtual-keys/networking"; +import useTeams from "@/app/dashboard/virtual-keys/hooks/useTeams"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; export interface CreateKeyModalProps { isModalVisible: boolean; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/index.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/index.ts similarity index 100% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/index.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/index.ts diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts similarity index 83% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts index d092219f70..2445240e1e 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { fetchGuardrails, fetchPrompts } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import { fetchGuardrails, fetchPrompts } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; export const useGuardrailsAndPrompts = () => { const [guardrails, setGuardrails] = useState([]); diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts similarity index 80% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts index 8313f6e8d6..5007040000 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { getMCPAccessGroups } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import { getMCPAccessGroups } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; export const useMcpAccessGroups = () => { const [mcpAccessGroups, setMcpAccessGroups] = useState([]); diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts similarity index 89% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts index c28ef0ecdb..979337f5aa 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState } from "react"; import type { Team } from "@/components/key_team_helpers/key_list"; -import { fetchTeamModels } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import { fetchTeamModels } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; export const useTeamModels = (selectedTeam: Team | null) => { const { userId: userID, userRole, accessToken } = useAuthorized(); diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts similarity index 81% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts index ddba6879cc..badcaf93d9 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { getUserModelNames } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import { getUserModelNames } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; export const useUserModels = () => { const { userId: userID, userRole, accessToken } = useAuthorized(); diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts similarity index 89% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts index 782beccf48..a3840bdc62 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState } from "react"; import { debounce } from "lodash"; -import { searchUserOptionsByEmail } from "@/app/(console)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import { searchUserOptionsByEmail } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; type User = { user_id: string; user_email: string; role?: string }; export interface UserOption { diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/networking.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/networking.ts similarity index 95% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/networking.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/networking.ts index 6cb4e2f7f0..2277800dad 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/networking.ts +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/networking.ts @@ -6,7 +6,7 @@ import { User, userFilterUICall, } from "@/components/networking"; -import { ModelAvailableResponse, UserOption } from "@/app/(console)/virtual-keys/components/CreateKeyModal/types"; +import { ModelAvailableResponse, UserOption } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; export const fetchGuardrails = async (accessToken: string) => { try { diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/types.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/types.ts similarity index 100% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/types.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/types.ts diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/utils.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/utils.ts similarity index 98% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/utils.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/utils.ts index 066770cf46..73cd433e78 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/CreateKeyModal/utils.ts +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/utils.ts @@ -1,5 +1,5 @@ import { mapDisplayToInternalNames } from "@/components/callback_info_helpers"; -import { ModelAliases } from "@/app/(console)/virtual-keys/components/CreateKeyModal/types"; +import { ModelAliases } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; export const getPredefinedTags = (data: any[] | null) => { let allTags = []; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/KeyInfoView.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/KeyInfoView.tsx similarity index 99% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/KeyInfoView.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/KeyInfoView.tsx index 1c7185f1dc..9f9a47fbe1 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/KeyInfoView.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/KeyInfoView.tsx @@ -1,3 +1,5 @@ +"use client"; + import React, { useEffect, useState } from "react"; import { Card, diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/SaveKeyModal.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/SaveKeyModal.tsx similarity index 99% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/SaveKeyModal.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/SaveKeyModal.tsx index bd0d425c46..fed678aadc 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/SaveKeyModal.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/SaveKeyModal.tsx @@ -1,3 +1,5 @@ +"use client"; + import { Button, Col, Grid, Text, Title } from "@tremor/react"; import { CopyToClipboard } from "react-copy-to-clipboard"; import { Modal } from "antd"; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx similarity index 99% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx index cdbd7cee43..b7727a299b 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx @@ -1,5 +1,5 @@ -// TODO: refactor "use client"; +// TODO: refactor import React, { useEffect, useState } from "react"; import { ColumnDef } from "@tanstack/react-table"; @@ -16,9 +16,9 @@ import { Organization, userListCall } from "@/components/networking"; import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; import FilterComponent, { FilterOption } from "@/components/molecules/filter"; import { useFilterLogic } from "@/components/key_team_helpers/filter_logic"; -import useTeams from "@/app/(console)/virtual-keys/hooks/useTeams"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; -import KeyInfoView from "@/app/(console)/virtual-keys/components/KeyInfoView"; +import useTeams from "@/app/dashboard/virtual-keys/hooks/useTeams"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import KeyInfoView from "@/app/dashboard/virtual-keys/components/KeyInfoView"; interface AllKeysTableProps { keys: KeyResponse[]; diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts similarity index 100% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/hooks/useTeams.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/hooks/useTeams.tsx similarity index 79% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/hooks/useTeams.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/hooks/useTeams.tsx index d1208737ec..92e5896e76 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/hooks/useTeams.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/hooks/useTeams.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; -import { fetchTeams } from "@/app/(console)/virtual-keys/networking"; +import { fetchTeams } from "@/app/dashboard/virtual-keys/networking"; import { Team } from "@/components/key_team_helpers/key_list"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; const useTeams = () => { const [teams, setTeams] = useState([]); diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/networking.ts b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/networking.ts similarity index 100% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/networking.ts rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/networking.ts diff --git a/ui/litellm-dashboard/src/app/(console)/virtual-keys/page.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/page.tsx similarity index 81% rename from ui/litellm-dashboard/src/app/(console)/virtual-keys/page.tsx rename to ui/litellm-dashboard/src/app/dashboard/virtual-keys/page.tsx index 9554905088..7dfc959867 100644 --- a/ui/litellm-dashboard/src/app/(console)/virtual-keys/page.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/page.tsx @@ -1,15 +1,12 @@ "use client"; -import VirtualKeysTable from "@/app/(console)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable"; -import { getCookie } from "@/utils/cookieUtils"; -import { jwtDecode } from "jwt-decode"; +import VirtualKeysTable from "@/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable"; import { useState } from "react"; import useKeyList from "@/components/key_team_helpers/key_list"; -import { useRouter } from "next/navigation"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { Col, Grid } from "@tremor/react"; -import CreateKey from "@/app/(console)/virtual-keys/components/CreateKey"; -import useAuthorized from "@/app/(console)/hooks/useAuthorized" +import CreateKey from "@/app/dashboard/virtual-keys/components/CreateKey"; +import useAuthorized from "@/app/dashboard/hooks/useAuthorized" const VirtualKeysPage = () => { const {accessToken, userRole} = useAuthorized(); diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index eff997a3aa..3815df002b 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -40,8 +40,8 @@ import UIThemeSettings from "@/components/ui_theme_settings"; import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; import { cx } from "@/lib/cva.config"; import useFeatureFlags, { FeatureFlagsProvider } from "@/hooks/useFeatureFlags"; -import Sidebar2 from "@/app/(console)/components/Sidebar2"; -import SidebarProvider from "@/app/(console)/components/SidebarProvider"; +import Sidebar2 from "@/app/dashboard/components/Sidebar2"; +import SidebarProvider from "@/app/dashboard/components/SidebarProvider"; function getCookie(name: string) { const cookieValue = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); diff --git a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx index 20c1f5b3a3..d4035e83f0 100644 --- a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx +++ b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx @@ -135,7 +135,7 @@ export const fetchUserModels = async ( /** * ───────────────────────────────────────────────────────────────────────── * @deprecated - * This component is being DEPRECATED in favor of src/app/(console)/virtual-keys/components/CreateKey.tsx + * This component is being DEPRECATED in favor of src/app/dashboard/virtual-keys/components/CreateKey.tsx * Please contribute to the new refactor. * ───────────────────────────────────────────────────────────────────────── */ diff --git a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx b/ui/litellm-dashboard/src/components/templates/key_info_view.tsx index 0080924fb6..ba04e2644a 100644 --- a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx +++ b/ui/litellm-dashboard/src/components/templates/key_info_view.tsx @@ -50,7 +50,7 @@ interface KeyInfoViewProps { /** * ───────────────────────────────────────────────────────────────────────── * @deprecated - * This component is being DEPRECATED in favor of src/app/(console)/virtual-keys/components/KeyInfoView.tsx + * This component is being DEPRECATED in favor of src/app/dashboard/virtual-keys/components/KeyInfoView.tsx * Please contribute to the new refactor. * ───────────────────────────────────────────────────────────────────────── */ diff --git a/ui/litellm-dashboard/src/components/templates/view_key_table.tsx b/ui/litellm-dashboard/src/components/templates/view_key_table.tsx index f3ba12d56d..3fad7c0a35 100644 --- a/ui/litellm-dashboard/src/components/templates/view_key_table.tsx +++ b/ui/litellm-dashboard/src/components/templates/view_key_table.tsx @@ -138,7 +138,7 @@ interface CombinedLimits { /** * ───────────────────────────────────────────────────────────────────────── * @deprecated - * This component is being DEPRECATED in favor of src/app/(console)/virtual-keys/components/VirtualKeysTable/ + * This component is being DEPRECATED in favor of src/app/dashboard/virtual-keys/components/VirtualKeysTable/ * Please contribute to the new refactor. * ───────────────────────────────────────────────────────────────────────── */ From cee408c0c06403b68837cd8cfc34d36c6a3ebc69 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 14:03:53 -0700 Subject: [PATCH 06/48] diagnosing next build issue --- .../src/app/dashboard/hooks/useAuthorized.ts | 39 +++++++++++++------ ui/litellm-dashboard/src/app/layout.tsx | 9 +++-- ui/litellm-dashboard/src/utils/cookieUtils.ts | 1 + 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/ui/litellm-dashboard/src/app/dashboard/hooks/useAuthorized.ts b/ui/litellm-dashboard/src/app/dashboard/hooks/useAuthorized.ts index 9d436d0566..74c0476f19 100644 --- a/ui/litellm-dashboard/src/app/dashboard/hooks/useAuthorized.ts +++ b/ui/litellm-dashboard/src/app/dashboard/hooks/useAuthorized.ts @@ -1,24 +1,41 @@ "use client"; -import { getCookie } from "@/utils/cookieUtils"; +import { useEffect, useMemo } from "react"; +import { getCookie, clearTokenCookies } from "@/utils/cookieUtils"; import { useRouter } from "next/navigation"; import { jwtDecode } from "jwt-decode"; const useAuthorized = () => { - const token = getCookie("token"); const router = useRouter(); - if (!token) { - router.replace("/sso/key/generate"); - } + const token = typeof document !== "undefined" ? getCookie("token") : null; - const decoded = jwtDecode(token as string) as { [key: string]: any }; - const accessToken = decoded.key; - const userId = decoded.user_id; - const userRole = decoded.user_role; - const premiumUser = decoded.premium_user; + // Redirect after mount if missing/invalid token + useEffect(() => { + if (!token) { + router.replace("/sso/key/generate"); + } + }, [token, router]); - return { accessToken, userId, userRole, premiumUser }; + // Decode safely + const decoded = useMemo(() => { + if (!token) return null; + try { + return jwtDecode(token) as Record; + } catch { + // Bad token in cookie — clear and bounce + clearTokenCookies(); + router.replace("/sso/key/generate"); + return null; + } + }, [token, router]); + + return { + accessToken: decoded?.key ?? null, + userId: decoded?.user_id ?? null, + userRole: decoded?.user_role ?? null, + premiumUser: decoded?.premium_user ?? null, + }; }; export default useAuthorized; diff --git a/ui/litellm-dashboard/src/app/layout.tsx b/ui/litellm-dashboard/src/app/layout.tsx index 8a37d0fa1b..9b6c027a56 100644 --- a/ui/litellm-dashboard/src/app/layout.tsx +++ b/ui/litellm-dashboard/src/app/layout.tsx @@ -18,9 +18,12 @@ export default function RootLayout({ }>) { return ( - - {children} - + + + + {children} + + ); } diff --git a/ui/litellm-dashboard/src/utils/cookieUtils.ts b/ui/litellm-dashboard/src/utils/cookieUtils.ts index 2cc9ef61eb..e477a9f77e 100644 --- a/ui/litellm-dashboard/src/utils/cookieUtils.ts +++ b/ui/litellm-dashboard/src/utils/cookieUtils.ts @@ -37,6 +37,7 @@ export function clearTokenCookies() { * @returns The cookie value or null if not found */ export function getCookie(name: string) { + if (typeof document === "undefined") return null; const cookieValue = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); return cookieValue ? cookieValue.split("=")[1] : null; } From 00f61b214c04c5c78380f74898cdd50cbf2ccdd4 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 14:17:02 -0700 Subject: [PATCH 07/48] more window guards --- .../VirtualKeysTable/VirtualKeysTable.tsx | 23 ++++++++++--------- ui/litellm-dashboard/src/utils/cookieUtils.ts | 4 ++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx index b7727a299b..cbf10f9771 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx +++ b/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx @@ -105,18 +105,19 @@ const VirtualKeysTable = ({ // Add a useEffect to call refresh when a key is created useEffect(() => { - if (refresh) { - const handleStorageChange = () => { - refresh(); - }; - - // Listen for storage events that might indicate a key was created - window.addEventListener("storage", handleStorageChange); - - return () => { - window.removeEventListener("storage", handleStorageChange); - }; + if (!refresh || typeof window === "undefined") { + return; } + const handleStorageChange = () => { + refresh(); + }; + + // Listen for storage events that might indicate a key was created + window.addEventListener("storage", handleStorageChange); + + return () => { + window.removeEventListener("storage", handleStorageChange); + }; }, [refresh]); const columns: ColumnDef[] = [ diff --git a/ui/litellm-dashboard/src/utils/cookieUtils.ts b/ui/litellm-dashboard/src/utils/cookieUtils.ts index e477a9f77e..23682fd6e8 100644 --- a/ui/litellm-dashboard/src/utils/cookieUtils.ts +++ b/ui/litellm-dashboard/src/utils/cookieUtils.ts @@ -6,6 +6,10 @@ * Clears the token cookie from both root and /ui paths */ export function clearTokenCookies() { + if (typeof window === "undefined" || typeof document === "undefined") { + return; + } + // Get the current domain const domain = window.location.hostname; From b1f3553ae4b7b0140540eb910c540d6e77f1a863 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 14:28:12 -0700 Subject: [PATCH 08/48] Update networking.tsx --- .../src/components/networking.tsx | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index 5f27c277d4..2ce673ee54 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -34,18 +34,34 @@ if (isLocal != true) { console.log = function () {}; } +const getWindowLocation = () => { + if (typeof window === "undefined") { + return null; + } + return window.location; +}; + const updateProxyBaseUrl = (serverRootPath: string, receivedProxyBaseUrl: string | null = null) => { /** * Special function for updating the proxy base url. Should only be called by getUiConfig. */ - const defaultProxyBaseUrl = isLocal ? "http://localhost:4000" : window.location.origin; - let initialProxyBaseUrl = receivedProxyBaseUrl || defaultProxyBaseUrl; + const browserLocation = getWindowLocation(); + const resolvedDefaultProxyBaseUrl = isLocal ? "http://localhost:4000" : browserLocation?.origin ?? null; + let initialProxyBaseUrl = receivedProxyBaseUrl || resolvedDefaultProxyBaseUrl; console.log("proxyBaseUrl:", proxyBaseUrl); console.log("serverRootPath:", serverRootPath); + + if (!initialProxyBaseUrl) { + proxyBaseUrl = proxyBaseUrl ?? null; + console.log("Updated proxyBaseUrl:", proxyBaseUrl); + return; + } + if (serverRootPath.length > 0 && !initialProxyBaseUrl.endsWith(serverRootPath) && serverRootPath != "/") { initialProxyBaseUrl += serverRootPath; - proxyBaseUrl = initialProxyBaseUrl; } + + proxyBaseUrl = initialProxyBaseUrl; console.log("Updated proxyBaseUrl:", proxyBaseUrl); }; @@ -54,7 +70,11 @@ const updateServerRootPath = (receivedServerRootPath: string) => { }; export const getProxyBaseUrl = (): string => { - return proxyBaseUrl ? proxyBaseUrl : window.location.origin; + if (proxyBaseUrl) { + return proxyBaseUrl; + } + const browserLocation = getWindowLocation(); + return browserLocation?.origin ?? ""; }; const HTTP_REQUEST = { @@ -159,7 +179,10 @@ const handleError = async (errorData: string) => { NotificationsManager.info("UI Session Expired. Logging out."); lastErrorTime = currentTime; clearTokenCookies(); - window.location.href = window.location.pathname; + const browserLocation = getWindowLocation(); + if (browserLocation) { + window.location.href = browserLocation.pathname; + } } lastErrorTime = currentTime; } else { From 6529ed4d620210efccc51912e413cb1ac4333041 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 19:21:34 -0700 Subject: [PATCH 09/48] hidden dashboard routing, dev and build env files --- ui/litellm-dashboard/.env.development | 2 + ui/litellm-dashboard/.env.production | 2 + .../components/Sidebar2.tsx | 33 ++++++-- .../components/SidebarProvider.tsx | 32 +++++++ .../components/modals/CreateUserModal.tsx | 6 +- .../hooks/useAuthorized.ts | 0 .../app/{dashboard => (dashboard)}/layout.tsx | 4 +- .../virtual-keys/components/CreateKey.tsx | 6 +- .../CreateKeyForm/KeyDetailsSection.tsx | 0 .../CreateKeyForm/OptionalSettingsSection.tsx | 2 +- .../CreateKeyForm/OwnershipSection.tsx | 2 +- .../CreateKeyModal/CreateKeyModal.tsx | 20 ++--- .../components/CreateKeyModal/hooks/index.ts | 0 .../hooks/useGuardrailsAndPrompts.ts | 4 +- .../hooks/useMcpAccessGroups.ts | 4 +- .../CreateKeyModal/hooks/useTeamModels.ts | 4 +- .../CreateKeyModal/hooks/useUserModels.ts | 4 +- .../CreateKeyModal/hooks/useUserSearch.ts | 4 +- .../components/CreateKeyModal/networking.ts | 2 +- .../components/CreateKeyModal/types.ts | 0 .../components/CreateKeyModal/utils.ts | 2 +- .../virtual-keys/components/KeyInfoView.tsx | 0 .../virtual-keys/components/SaveKeyModal.tsx | 0 .../VirtualKeysTable/VirtualKeysTable.tsx | 6 +- .../VirtualKeysTable/hooks/useFilterLogic.ts | 0 .../virtual-keys/hooks/useTeams.tsx | 4 +- .../virtual-keys/networking.ts | 0 .../virtual-keys/page.tsx | 8 +- .../dashboard/components/SidebarProvider.tsx | 36 -------- ui/litellm-dashboard/src/app/page.tsx | 8 +- .../src/components/leftnav.tsx | 37 +++++---- .../organisms/create_key_button.tsx | 3 +- .../components/templates/key_info_view.tsx | 2 +- .../components/templates/view_key_table.tsx | 2 +- .../src/hooks/useFeatureFlags.tsx | 83 ++++++++++++++++--- 35 files changed, 208 insertions(+), 114 deletions(-) create mode 100644 ui/litellm-dashboard/.env.development create mode 100644 ui/litellm-dashboard/.env.production rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/components/Sidebar2.tsx (87%) create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/components/modals/CreateUserModal.tsx (98%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/hooks/useAuthorized.ts (100%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/layout.tsx (91%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKey.tsx (92%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx (100%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx (99%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx (97%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx (89%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/hooks/index.ts (100%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts (76%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts (73%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts (85%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts (75%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts (84%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/networking.ts (95%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/types.ts (100%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/CreateKeyModal/utils.ts (98%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/KeyInfoView.tsx (100%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/SaveKeyModal.tsx (100%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx (99%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts (100%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/hooks/useTeams.tsx (77%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/networking.ts (100%) rename ui/litellm-dashboard/src/app/{dashboard => (dashboard)}/virtual-keys/page.tsx (81%) delete mode 100644 ui/litellm-dashboard/src/app/dashboard/components/SidebarProvider.tsx diff --git a/ui/litellm-dashboard/.env.development b/ui/litellm-dashboard/.env.development new file mode 100644 index 0000000000..b408125408 --- /dev/null +++ b/ui/litellm-dashboard/.env.development @@ -0,0 +1,2 @@ +NODE_ENV=development +NEXT_PUBLIC_BASE_URL="" \ No newline at end of file diff --git a/ui/litellm-dashboard/.env.production b/ui/litellm-dashboard/.env.production new file mode 100644 index 0000000000..1df897e7d2 --- /dev/null +++ b/ui/litellm-dashboard/.env.production @@ -0,0 +1,2 @@ +NODE_ENV=production +NEXT_PUBLIC_BASE_URL="ui/" \ No newline at end of file diff --git a/ui/litellm-dashboard/src/app/dashboard/components/Sidebar2.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx similarity index 87% rename from ui/litellm-dashboard/src/app/dashboard/components/Sidebar2.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx index 9de9f2f136..209cf2e67f 100644 --- a/ui/litellm-dashboard/src/app/dashboard/components/Sidebar2.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx @@ -46,6 +46,21 @@ interface MenuItem { icon?: React.ReactNode; } +/** ---------- Base URL helpers ---------- */ +/** Normalizes NEXT_PUBLIC_BASE_URL into either "" or "/something" (no trailing slash). */ +const getBasePath = () => { + const raw = process.env.NEXT_PUBLIC_BASE_URL ?? ""; + const trimmed = raw.replace(/^\/+|\/+$/g, ""); // strip leading/trailing slashes + return trimmed ? `/${trimmed}` : ""; +}; + +/** Joins base path with a relative path like "virtual-keys" or "/virtual-keys" -> "/base/virtual-keys" */ +const withBase = (relativePath: string) => { + const base = getBasePath(); // "" or "/ui" (no trailing slash) + const rel = relativePath.replace(/^\/+/, ""); // drop any leading slash + return `${base}/${rel}`.replace(/\/{2,}/g, "/"); // collapse accidental doubles +}; + const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelectedKey, collapsed = false }) => { const menuItems: MenuItem[] = [ { key: "1", page: "api-keys", label: "Virtual Keys", icon: }, @@ -217,8 +232,11 @@ const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelect return "1"; }; + // Match Virtual Keys path with base prefix (e.g., "/virtual-keys" or "/ui/virtual-keys") + const virtualKeysPath = withBase("virtual-keys"); + const selectedMenuKey = - pathname === "/dashboard/virtual-keys" + pathname === virtualKeysPath ? "1" : pageParam ? findMenuItemKey(pageParam) @@ -226,16 +244,19 @@ const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelect ? findMenuItemKey(defaultSelectedKey) : "1"; - // Root-only routing helper: always replace everything after the domain - const rootWithPage = (p: string) => ({ pathname: "/", query: { page: p } }); + // Root-only routing helper: always replace everything after the domain, honoring base path + const rootWithPage = (p: string) => ({ + pathname: getBasePath() || "/", + query: { page: p }, + }); // Convert to AntD Menu items: - // - "Virtual Keys" still routes to /virtual-keys - // - All other items (and children) route to "/?page=" + // - "Virtual Keys" routes to "//virtual-keys" + // - All other items (and children) route to "//?page=" const antdItems = filteredMenuItems.map((item) => { const isVirtualKeys = item.key === "1"; const label = isVirtualKeys ? ( - Virtual Keys + Virtual Keys ) : ( {item.label} ); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx new file mode 100644 index 0000000000..822a30e640 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx @@ -0,0 +1,32 @@ +"use client"; + +import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; +import Sidebar from "@/components/leftnav"; +import React from "react"; +import useFeatureFlags from "@/hooks/useFeatureFlags"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +interface SidebarProviderProps { + defaultSelectedKey: string; + sidebarCollapsed: boolean; + setPage: (page: string) => void; +} + +const SidebarProvider = ({ defaultSelectedKey, sidebarCollapsed, setPage }: SidebarProviderProps) => { + const { accessToken, userRole } = useAuthorized(); + const { refactoredUIFlag, setRefactoredUIFlag } = useFeatureFlags(); + + return refactoredUIFlag ? ( + + ) : ( + + ); +}; + +export default SidebarProvider; diff --git a/ui/litellm-dashboard/src/app/dashboard/components/modals/CreateUserModal.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx similarity index 98% rename from ui/litellm-dashboard/src/app/dashboard/components/modals/CreateUserModal.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx index 8b16074b25..fce7f69192 100644 --- a/ui/litellm-dashboard/src/app/dashboard/components/modals/CreateUserModal.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx @@ -29,9 +29,9 @@ import { } from "@/components/networking"; import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; import BulkCreateUsersButton from "@/components/bulk_create_users_button"; -import { fetchTeams } from "@/app/dashboard/virtual-keys/networking"; -import useTeams from "@/app/dashboard/virtual-keys/hooks/useTeams"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import { fetchTeams } from "@/app/(dashboard)/virtual-keys/networking"; +import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; // Helper function to generate UUID compatible across all environments const generateUUID = (): string => { diff --git a/ui/litellm-dashboard/src/app/dashboard/hooks/useAuthorized.ts b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts similarity index 100% rename from ui/litellm-dashboard/src/app/dashboard/hooks/useAuthorized.ts rename to ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts diff --git a/ui/litellm-dashboard/src/app/dashboard/layout.tsx b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx similarity index 91% rename from ui/litellm-dashboard/src/app/dashboard/layout.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/layout.tsx index 851ecec665..ad8a82703f 100644 --- a/ui/litellm-dashboard/src/app/dashboard/layout.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx @@ -3,8 +3,8 @@ import React from "react"; import Navbar from "@/components/navbar"; import { ThemeProvider } from "@/contexts/ThemeContext"; -import Sidebar2 from "@/app/dashboard/components/Sidebar2"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; export default function Layout({ children }: { children: React.ReactNode }) { const { accessToken, userRole } = useAuthorized(); diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKey.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKey.tsx similarity index 92% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKey.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKey.tsx index 15dd713917..82be28e495 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKey.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKey.tsx @@ -6,9 +6,9 @@ import { Modal, Form } from "antd"; import { getPossibleUserRoles, Organization } from "@/components/networking"; import { rolesWithWriteAccess } from "@/utils/roles"; import { Team } from "@/components/key_team_helpers/key_list"; -import CreateKeyModal from "@/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyModal"; -import CreateUserModal from "@/app/dashboard/components/modals/CreateUserModal"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import CreateKeyModal from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyModal"; +import CreateUserModal from "@/app/(dashboard)/components/modals/CreateUserModal"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; interface CreateKeyProps { team: Team | null; diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx similarity index 100% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx similarity index 99% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx index 65ebd2d571..b88f891944 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx @@ -17,7 +17,7 @@ import SchemaFormFields from "@/components/common_components/check_openapi_schem import { Team } from "@/components/key_team_helpers/key_list"; import React from "react"; import { DefaultOptionType } from "rc-select/lib/Select"; -import { ModelAliases } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; +import { ModelAliases } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/types"; export interface OptionalSettingsSectionProps { form: FormInstance; diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx similarity index 97% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx index 00c2e9a1e2..f08b4ea367 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx @@ -6,7 +6,7 @@ import { InfoCircleOutlined } from "@ant-design/icons"; import TeamDropdown from "@/components/common_components/team_dropdown"; import React from "react"; import { Team } from "@/components/key_team_helpers/key_list"; -import { UserOption } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; +import { UserOption } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/types"; interface OwnershipSectionProps { team: Team | null; diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx similarity index 89% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx index 2bee7f72b1..cbe3db4e8f 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx @@ -5,7 +5,7 @@ import { Text } from "@tremor/react"; import { keyCreateCall, keyCreateServiceAccountCall } from "@/components/networking"; import React, { useEffect, useState } from "react"; import { Team } from "@/components/key_team_helpers/key_list"; -import SaveKeyModal from "@/app/dashboard/virtual-keys/components/SaveKeyModal"; +import SaveKeyModal from "@/app/(dashboard)/virtual-keys/components/SaveKeyModal"; import NotificationsManager from "@/components/molecules/notifications_manager"; import { useGuardrailsAndPrompts, @@ -13,15 +13,15 @@ import { useTeamModels, useUserModels, useUserSearch, -} from "@/app/dashboard/virtual-keys/components/CreateKeyModal/hooks"; -import OwnershipSection from "@/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection"; -import KeyDetailsSection from "@/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection"; -import OptionalSettingsSection from "@/app/dashboard/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection"; -import { ModelAliases } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; -import { getPredefinedTags, prepareFormValues } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/utils"; -import { fetchTeams } from "@/app/dashboard/virtual-keys/networking"; -import useTeams from "@/app/dashboard/virtual-keys/hooks/useTeams"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +} from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks"; +import OwnershipSection from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection"; +import KeyDetailsSection from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection"; +import OptionalSettingsSection from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection"; +import { ModelAliases } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/types"; +import { getPredefinedTags, prepareFormValues } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/utils"; +import { fetchTeams } from "@/app/(dashboard)/virtual-keys/networking"; +import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; export interface CreateKeyModalProps { isModalVisible: boolean; diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/index.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/index.ts similarity index 100% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/index.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/index.ts diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts similarity index 76% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts index 2445240e1e..f4718e8ba0 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { fetchGuardrails, fetchPrompts } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import { fetchGuardrails, fetchPrompts } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; export const useGuardrailsAndPrompts = () => { const [guardrails, setGuardrails] = useState([]); diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts similarity index 73% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts index 5007040000..998b392f77 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { getMCPAccessGroups } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import { getMCPAccessGroups } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; export const useMcpAccessGroups = () => { const [mcpAccessGroups, setMcpAccessGroups] = useState([]); diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts similarity index 85% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts index 979337f5aa..dd99de0615 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState } from "react"; import type { Team } from "@/components/key_team_helpers/key_list"; -import { fetchTeamModels } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import { fetchTeamModels } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; export const useTeamModels = (selectedTeam: Team | null) => { const { userId: userID, userRole, accessToken } = useAuthorized(); diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts similarity index 75% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts index badcaf93d9..66b5520f06 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { getUserModelNames } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import { getUserModelNames } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; export const useUserModels = () => { const { userId: userID, userRole, accessToken } = useAuthorized(); diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts similarity index 84% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts index a3840bdc62..d266a51667 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState } from "react"; import { debounce } from "lodash"; -import { searchUserOptionsByEmail } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import { searchUserOptionsByEmail } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; type User = { user_id: string; user_email: string; role?: string }; export interface UserOption { diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/networking.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking.ts similarity index 95% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/networking.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking.ts index 2277800dad..377f6d3113 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/networking.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking.ts @@ -6,7 +6,7 @@ import { User, userFilterUICall, } from "@/components/networking"; -import { ModelAvailableResponse, UserOption } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; +import { ModelAvailableResponse, UserOption } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/types"; export const fetchGuardrails = async (accessToken: string) => { try { diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/types.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/types.ts similarity index 100% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/types.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/types.ts diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/utils.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/utils.ts similarity index 98% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/utils.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/utils.ts index 73cd433e78..1fb40b8789 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/CreateKeyModal/utils.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/utils.ts @@ -1,5 +1,5 @@ import { mapDisplayToInternalNames } from "@/components/callback_info_helpers"; -import { ModelAliases } from "@/app/dashboard/virtual-keys/components/CreateKeyModal/types"; +import { ModelAliases } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/types"; export const getPredefinedTags = (data: any[] | null) => { let allTags = []; diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/KeyInfoView.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/KeyInfoView.tsx similarity index 100% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/KeyInfoView.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/KeyInfoView.tsx diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/SaveKeyModal.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/SaveKeyModal.tsx similarity index 100% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/SaveKeyModal.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/SaveKeyModal.tsx diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx similarity index 99% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx index cbf10f9771..015d8c43f9 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx @@ -16,9 +16,9 @@ import { Organization, userListCall } from "@/components/networking"; import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; import FilterComponent, { FilterOption } from "@/components/molecules/filter"; import { useFilterLogic } from "@/components/key_team_helpers/filter_logic"; -import useTeams from "@/app/dashboard/virtual-keys/hooks/useTeams"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; -import KeyInfoView from "@/app/dashboard/virtual-keys/components/KeyInfoView"; +import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import KeyInfoView from "@/app/(dashboard)/virtual-keys/components/KeyInfoView"; interface AllKeysTableProps { keys: KeyResponse[]; diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts similarity index 100% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/hooks/useTeams.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx similarity index 77% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/hooks/useTeams.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx index 92e5896e76..5f04f8a28a 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/hooks/useTeams.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; -import { fetchTeams } from "@/app/dashboard/virtual-keys/networking"; +import { fetchTeams } from "@/app/(dashboard)/virtual-keys/networking"; import { Team } from "@/components/key_team_helpers/key_list"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; const useTeams = () => { const [teams, setTeams] = useState([]); diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/networking.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/networking.ts similarity index 100% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/networking.ts rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/networking.ts diff --git a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/page.tsx similarity index 81% rename from ui/litellm-dashboard/src/app/dashboard/virtual-keys/page.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/page.tsx index 7dfc959867..611d92f1a3 100644 --- a/ui/litellm-dashboard/src/app/dashboard/virtual-keys/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/page.tsx @@ -1,15 +1,15 @@ "use client"; -import VirtualKeysTable from "@/app/dashboard/virtual-keys/components/VirtualKeysTable/VirtualKeysTable"; +import VirtualKeysTable from "@/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable"; import { useState } from "react"; import useKeyList from "@/components/key_team_helpers/key_list"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { Col, Grid } from "@tremor/react"; -import CreateKey from "@/app/dashboard/virtual-keys/components/CreateKey"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized" +import CreateKey from "@/app/(dashboard)/virtual-keys/components/CreateKey"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; const VirtualKeysPage = () => { - const {accessToken, userRole} = useAuthorized(); + const { accessToken, userRole } = useAuthorized(); const [createClicked, setCreateClicked] = useState(false); const queryClient = new QueryClient(); diff --git a/ui/litellm-dashboard/src/app/dashboard/components/SidebarProvider.tsx b/ui/litellm-dashboard/src/app/dashboard/components/SidebarProvider.tsx deleted file mode 100644 index 8380493798..0000000000 --- a/ui/litellm-dashboard/src/app/dashboard/components/SidebarProvider.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; - -import Sidebar2 from "@/app/dashboard/components/Sidebar2"; -import Sidebar from "@/components/leftnav"; -import React from "react"; -import useFeatureFlags from "@/hooks/useFeatureFlags"; -import useAuthorized from "@/app/dashboard/hooks/useAuthorized"; - -interface SidebarProviderProps { - defaultSelectedKey: string; - sidebarCollapsed: boolean; - setPage: (page: string) => void; -} - -const SidebarProvider = ({defaultSelectedKey, sidebarCollapsed, setPage}: SidebarProviderProps) => { - - const {accessToken, userRole} = useAuthorized(); - const { refactoredUIFlag, setRefactoredUIFlag } = useFeatureFlags(); - - return ( - refactoredUIFlag ? ( - - ) : ( - - ) - ); - -} - -export default SidebarProvider; \ No newline at end of file diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index 3815df002b..8e25dc192c 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -40,8 +40,8 @@ import UIThemeSettings from "@/components/ui_theme_settings"; import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; import { cx } from "@/lib/cva.config"; import useFeatureFlags, { FeatureFlagsProvider } from "@/hooks/useFeatureFlags"; -import Sidebar2 from "@/app/dashboard/components/Sidebar2"; -import SidebarProvider from "@/app/dashboard/components/SidebarProvider"; +import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; +import SidebarProvider from "@/app/(dashboard)/components/SidebarProvider"; function getCookie(name: string) { const cookieValue = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); @@ -126,6 +126,10 @@ export default function CreateKeyPage() { return searchParams.get("page") || "api-keys"; }); + useEffect(() => { + setPage(searchParams.get("page") || "api-keys"); + }, [searchParams]); + // Custom setPage function that updates URL const updatePage = (newPage: string) => { // Update URL without full page reload diff --git a/ui/litellm-dashboard/src/components/leftnav.tsx b/ui/litellm-dashboard/src/components/leftnav.tsx index 34916cddb9..a0d8d162c6 100644 --- a/ui/litellm-dashboard/src/components/leftnav.tsx +++ b/ui/litellm-dashboard/src/components/leftnav.tsx @@ -56,6 +56,17 @@ interface MenuItem { icon?: React.ReactNode; } +/** ---------- Base URL helpers ---------- */ +/** + * Normalizes NEXT_PUBLIC_BASE_URL to either "/" or "/ui/" (always with a trailing slash). + * Supported env values: "" or "ui/". + */ +const getBasePath = () => { + const raw = process.env.NEXT_PUBLIC_BASE_URL ?? ""; + const trimmed = raw.replace(/^\/+|\/+$/g, ""); // strip leading/trailing slashes + return trimmed ? `/${trimmed}/` : "/"; // ensure trailing slash +}; + const Sidebar: React.FC = ({ accessToken, setPage, userRole, defaultSelectedKey, collapsed = false }) => { // Note: If a menu item does not have a role, it is visible to all roles. const menuItems: MenuItem[] = [ @@ -214,6 +225,7 @@ const Sidebar: React.FC = ({ accessToken, setPage, userRole, defau ], }, ]; + // Find the menu item that matches the default page, including in submenus const findMenuItemKey = (page: string): string => { // Check top-level items @@ -248,6 +260,15 @@ const Sidebar: React.FC = ({ accessToken, setPage, userRole, defau return true; }); + // Centralized navigation that prefixes the base path ("/" or "/ui/") + const goTo = (page: string) => { + const base = getBasePath(); // "/" or "/ui/" + const newSearchParams = new URLSearchParams(window.location.search); + newSearchParams.set("page", page); + window.history.pushState(null, "", `${base}?${newSearchParams.toString()}`); // e.g. "/ui/?page=..." + setPage(page); + }; + return ( = ({ accessToken, setPage, userRole, defau key: child.key, icon: child.icon, label: child.label, - onClick: () => { - const newSearchParams = new URLSearchParams(window.location.search); - newSearchParams.set("page", child.page); - window.history.pushState(null, "", `?${newSearchParams.toString()}`); - setPage(child.page); - }, + onClick: () => goTo(child.page), })), - onClick: !item.children - ? () => { - const newSearchParams = new URLSearchParams(window.location.search); - newSearchParams.set("page", item.page); - window.history.pushState(null, "", `?${newSearchParams.toString()}`); - setPage(item.page); - } - : undefined, + onClick: !item.children ? () => goTo(item.page) : undefined, }))} /> diff --git a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx index d4035e83f0..c37d94abb1 100644 --- a/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx +++ b/ui/litellm-dashboard/src/components/organisms/create_key_button.tsx @@ -131,11 +131,10 @@ export const fetchUserModels = async ( } }; - /** * ───────────────────────────────────────────────────────────────────────── * @deprecated - * This component is being DEPRECATED in favor of src/app/dashboard/virtual-keys/components/CreateKey.tsx + * This component is being DEPRECATED in favor of src/app/(dashboard)/virtual-keys/components/CreateKey.tsx * Please contribute to the new refactor. * ───────────────────────────────────────────────────────────────────────── */ diff --git a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx b/ui/litellm-dashboard/src/components/templates/key_info_view.tsx index ba04e2644a..26adaa11db 100644 --- a/ui/litellm-dashboard/src/components/templates/key_info_view.tsx +++ b/ui/litellm-dashboard/src/components/templates/key_info_view.tsx @@ -50,7 +50,7 @@ interface KeyInfoViewProps { /** * ───────────────────────────────────────────────────────────────────────── * @deprecated - * This component is being DEPRECATED in favor of src/app/dashboard/virtual-keys/components/KeyInfoView.tsx + * This component is being DEPRECATED in favor of src/app/(dashboard)/virtual-keys/components/KeyInfoView.tsx * Please contribute to the new refactor. * ───────────────────────────────────────────────────────────────────────── */ diff --git a/ui/litellm-dashboard/src/components/templates/view_key_table.tsx b/ui/litellm-dashboard/src/components/templates/view_key_table.tsx index 3fad7c0a35..d146d5ba79 100644 --- a/ui/litellm-dashboard/src/components/templates/view_key_table.tsx +++ b/ui/litellm-dashboard/src/components/templates/view_key_table.tsx @@ -138,7 +138,7 @@ interface CombinedLimits { /** * ───────────────────────────────────────────────────────────────────────── * @deprecated - * This component is being DEPRECATED in favor of src/app/dashboard/virtual-keys/components/VirtualKeysTable/ + * This component is being DEPRECATED in favor of src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/ * Please contribute to the new refactor. * ───────────────────────────────────────────────────────────────────────── */ diff --git a/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx b/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx index d50fdf46a6..f1914f463a 100644 --- a/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx +++ b/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx @@ -1,26 +1,87 @@ -'use client'; -import React, {createContext, useContext, useState} from 'react'; +"use client"; +import React, { createContext, useContext, useEffect, useState } from "react"; type Flags = { refactoredUIFlag: boolean; setRefactoredUIFlag: (v: boolean) => void; }; +const STORAGE_KEY = "feature.refactoredUIFlag"; + const FeatureFlagsCtx = createContext(null); -export const FeatureFlagsProvider = ({ children }: { children: React.ReactNode }) => { - const [refactoredUIFlag, setRefactoredUIFlag] = useState(false); - return ( - - {children} - -); +/** Safely read the flag from localStorage. If anything goes wrong, reset to false. */ +function readFlagSafely(): boolean { + try { + const raw = localStorage.getItem(STORAGE_KEY); + if (raw === null) { + localStorage.setItem(STORAGE_KEY, "false"); + return false; + } + + const v = raw.trim().toLowerCase(); + if (v === "true" || v === "1") return true; + if (v === "false" || v === "0") return false; + + // Last chance: try JSON.parse in case something odd was stored. + const parsed = JSON.parse(raw); + if (typeof parsed === "boolean") return parsed; + + // Malformed → reset to false + localStorage.setItem(STORAGE_KEY, "false"); + return false; + } catch { + // If even accessing localStorage throws, best effort reset then default to false + try { + localStorage.setItem(STORAGE_KEY, "false"); + } catch {} + return false; + } } +function writeFlagSafely(v: boolean) { + try { + localStorage.setItem(STORAGE_KEY, String(v)); + } catch { + // Ignore write errors; state will still reflect the intended value. + } +} + +export const FeatureFlagsProvider = ({ children }: { children: React.ReactNode }) => { + // Lazy init reads from localStorage only on the client + const [refactoredUIFlag, setRefactoredUIFlagState] = useState(() => readFlagSafely()); + + const setRefactoredUIFlag = (v: boolean) => { + setRefactoredUIFlagState(v); + writeFlagSafely(v); + }; + + // Keep this flag in sync across tabs/windows. + useEffect(() => { + const onStorage = (e: StorageEvent) => { + if (e.key === STORAGE_KEY && e.newValue != null) { + const next = e.newValue.trim().toLowerCase(); + setRefactoredUIFlagState(next === "true" || next === "1"); + } + // If the key was cleared elsewhere, self-heal to false. + if (e.key === STORAGE_KEY && e.newValue === null) { + writeFlagSafely(false); + setRefactoredUIFlagState(false); + } + }; + window.addEventListener("storage", onStorage); + return () => window.removeEventListener("storage", onStorage); + }, []); + + return ( + {children} + ); +}; + const useFeatureFlags = () => { const ctx = useContext(FeatureFlagsCtx); - if (!ctx) throw new Error('useFeatureFlags must be used within FeatureFlagsProvider'); + if (!ctx) throw new Error("useFeatureFlags must be used within FeatureFlagsProvider"); return ctx; -} +}; export default useFeatureFlags; From eed19fb4abc6f1c68fa4680acf9436f8fab06869 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 19:36:40 -0700 Subject: [PATCH 10/48] slight improvement for Sidebar2 --- .../app/(dashboard)/components/Sidebar2.tsx | 60 ++++++++++++------- ui/litellm-dashboard/src/app/page.tsx | 1 - 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx index 209cf2e67f..37901b5e63 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx @@ -1,8 +1,7 @@ "use client"; import React from "react"; -import Link from "next/link"; -import { usePathname, useSearchParams } from "next/navigation"; +import { usePathname, useSearchParams, useRouter } from "next/navigation"; import { Layout, Menu, ConfigProvider } from "antd"; import { KeyOutlined, @@ -62,6 +61,11 @@ const withBase = (relativePath: string) => { }; const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelectedKey, collapsed = false }) => { + const router = useRouter(); + const pathname = usePathname(); + const searchParams = useSearchParams(); + + /** ---------- Menu model ---------- */ const menuItems: MenuItem[] = [ { key: "1", page: "api-keys", label: "Virtual Keys", icon: }, { @@ -217,9 +221,7 @@ const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelect children: item.children?.filter((child) => !child.roles || child.roles.includes(userRole)), })); - // Highlight selection based on pathname or ?page= - const pathname = usePathname(); - const searchParams = useSearchParams(); + /** ---------- Selection state ---------- */ const pageParam = searchParams.get("page") || undefined; const findMenuItemKey = (page: string): string => { @@ -244,31 +246,47 @@ const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelect ? findMenuItemKey(defaultSelectedKey) : "1"; - // Root-only routing helper: always replace everything after the domain, honoring base path - const rootWithPage = (p: string) => ({ - pathname: getBasePath() || "/", - query: { page: p }, - }); + /** ---------- Navigation helpers (SPA only) ---------- */ + // Build a root URL ("/" or "/base/") with an updated ?page=... + const goTo = (p: string) => { + const base = getBasePath() || "/"; + const root = base.endsWith("/") ? base : `${base}/`; + const sp = new URLSearchParams(typeof window !== "undefined" ? window.location.search : ""); + sp.set("page", p); + // Use Next router for client navigation on the SAME route (no hard fetch) + router.replace(`${root}?${sp.toString()}`, { scroll: false }); + }; - // Convert to AntD Menu items: - // - "Virtual Keys" routes to "//virtual-keys" - // - All other items (and children) route to "//?page=" + // Keep the /virtual-keys path the same, but avoid route fetches/hard reloads. + const goToVirtualKeys = () => { + const base = getBasePath() || "/"; + const root = base.endsWith("/") ? base : `${base}/`; + const sp = new URLSearchParams(typeof window !== "undefined" ? window.location.search : ""); + sp.set("page", "api-keys"); + + // 1) Client transition to the root with ?page=api-keys so the view updates. + router.replace(`${root}?${sp.toString()}`, { scroll: false }); + + // 2) Cosmetic URL swap to ".../virtual-keys" without navigation (keeps path the same). + const vk = withBase("virtual-keys"); + if (typeof window !== "undefined") { + window.history.replaceState(null, "", vk); + } + }; + + /** ---------- AntD items with onClick handlers ---------- */ const antdItems = filteredMenuItems.map((item) => { const isVirtualKeys = item.key === "1"; - const label = isVirtualKeys ? ( - Virtual Keys - ) : ( - {item.label} - ); - return { key: item.key, icon: item.icon, - label, + label: item.label, // plain text; click handled via onClick + onClick: !item.children ? (isVirtualKeys ? goToVirtualKeys : () => goTo(item.page)) : undefined, children: item.children?.map((child) => ({ key: child.key, icon: child.icon, - label: {child.label}, + label: child.label, + onClick: () => goTo(child.page), })), }; }); diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index 8e25dc192c..104ef41810 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -39,7 +39,6 @@ import VectorStoreManagement from "@/components/vector_store_management"; import UIThemeSettings from "@/components/ui_theme_settings"; import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; import { cx } from "@/lib/cva.config"; -import useFeatureFlags, { FeatureFlagsProvider } from "@/hooks/useFeatureFlags"; import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; import SidebarProvider from "@/app/(dashboard)/components/SidebarProvider"; From 051c9a7c6192f5179e867ace63358f1bb67816a6 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 20:17:19 -0700 Subject: [PATCH 11/48] Sidebar2 uses FF now --- .../app/(dashboard)/components/Sidebar2.tsx | 247 ++++++++---------- .../components/SidebarProvider.tsx | 32 --- .../src/app/(dashboard)/layout.tsx | 26 +- ui/litellm-dashboard/src/app/page.tsx | 18 +- 4 files changed, 141 insertions(+), 182 deletions(-) delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx index 37901b5e63..843a176f6e 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx @@ -1,8 +1,5 @@ -"use client"; - -import React from "react"; -import { usePathname, useSearchParams, useRouter } from "next/navigation"; -import { Layout, Menu, ConfigProvider } from "antd"; +import { Layout, Menu } from "antd"; +import { useRouter, usePathname } from "next/navigation"; // UPDATED: also usePathname to detect current route import { KeyOutlined, PlayCircleOutlined, @@ -23,16 +20,18 @@ import { TagsOutlined, BgColorsOutlined, } from "@ant-design/icons"; +import { ConfigProvider } from "antd"; +import useFeatureFlags from "@/hooks/useFeatureFlags"; import { all_admin_roles, internalUserRoles, isAdminRole, rolesWithWriteAccess } from "@/utils/roles"; import UsageIndicator from "@/components/usage_indicator"; - +import React from "react"; const { Sider } = Layout; interface SidebarProps { accessToken: string | null; + setPage: (page: string) => void; userRole: string; - /** Used to highlight a menu item when pathname doesn't match (e.g., on non-routed pages) */ - defaultSelectedKey?: string; + defaultSelectedKey: string; collapsed?: boolean; } @@ -45,87 +44,77 @@ interface MenuItem { icon?: React.ReactNode; } -/** ---------- Base URL helpers ---------- */ -/** Normalizes NEXT_PUBLIC_BASE_URL into either "" or "/something" (no trailing slash). */ -const getBasePath = () => { - const raw = process.env.NEXT_PUBLIC_BASE_URL ?? ""; - const trimmed = raw.replace(/^\/+|\/+$/g, ""); // strip leading/trailing slashes - return trimmed ? `/${trimmed}` : ""; -}; - -/** Joins base path with a relative path like "virtual-keys" or "/virtual-keys" -> "/base/virtual-keys" */ -const withBase = (relativePath: string) => { - const base = getBasePath(); // "" or "/ui" (no trailing slash) - const rel = relativePath.replace(/^\/+/, ""); // drop any leading slash - return `${base}/${rel}`.replace(/\/{2,}/g, "/"); // collapse accidental doubles -}; - -const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelectedKey, collapsed = false }) => { +const Sidebar2: React.FC = ({ + accessToken, + setPage, + userRole, + defaultSelectedKey, + collapsed = false, +}) => { const router = useRouter(); const pathname = usePathname(); - const searchParams = useSearchParams(); + const { refactoredUIFlag } = useFeatureFlags(); - /** ---------- Menu model ---------- */ const menuItems: MenuItem[] = [ - { key: "1", page: "api-keys", label: "Virtual Keys", icon: }, + { key: "1", page: "api-keys", label: "Virtual Keys", icon: }, { key: "3", page: "llm-playground", label: "Test Key", - icon: , + icon: , roles: rolesWithWriteAccess, }, { key: "2", page: "models", label: "Models + Endpoints", - icon: , + icon: , roles: rolesWithWriteAccess, }, { key: "12", page: "new_usage", label: "Usage", - icon: , + icon: , roles: [...all_admin_roles, ...internalUserRoles], }, - { key: "6", page: "teams", label: "Teams", icon: }, + { key: "6", page: "teams", label: "Teams", icon: }, { key: "17", page: "organizations", label: "Organizations", - icon: , + icon: , roles: all_admin_roles, }, { key: "5", page: "users", label: "Internal Users", - icon: , + icon: , roles: all_admin_roles, }, - { key: "14", page: "api_ref", label: "API Reference", icon: }, - { key: "16", page: "model-hub-table", label: "Model Hub", icon: }, - { key: "15", page: "logs", label: "Logs", icon: }, + { key: "14", page: "api_ref", label: "API Reference", icon: }, + { key: "16", page: "model-hub-table", label: "Model Hub", icon: }, + { key: "15", page: "logs", label: "Logs", icon: }, { key: "11", page: "guardrails", label: "Guardrails", - icon: , + icon: , roles: all_admin_roles, }, { key: "26", page: "tools", label: "Tools", - icon: , + icon: , children: [ - { key: "18", page: "mcp-servers", label: "MCP Servers", icon: }, + { key: "18", page: "mcp-servers", label: "MCP Servers", icon: }, { key: "21", page: "vector-stores", label: "Vector Stores", - icon: , + icon: , roles: all_admin_roles, }, ], @@ -134,162 +123,145 @@ const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelect key: "experimental", page: "experimental", label: "Experimental", - icon: , + icon: , children: [ { key: "9", page: "caching", label: "Caching", - icon: , + icon: , roles: all_admin_roles, }, { key: "25", page: "prompts", label: "Prompts", - icon: , + icon: , roles: all_admin_roles, }, { key: "10", page: "budgets", label: "Budgets", - icon: , + icon: , roles: all_admin_roles, }, { key: "20", page: "transform-request", label: "API Playground", - icon: , + icon: , roles: [...all_admin_roles, ...internalUserRoles], }, { key: "19", page: "tag-management", label: "Tag Management", - icon: , + icon: , roles: all_admin_roles, }, - { key: "4", page: "usage", label: "Old Usage", icon: }, + { key: "4", page: "usage", label: "Old Usage", icon: }, ], }, { key: "settings", page: "settings", label: "Settings", - icon: , + icon: , roles: all_admin_roles, children: [ { key: "11", page: "general-settings", label: "Router Settings", - icon: , + icon: , roles: all_admin_roles, }, { key: "8", page: "settings", label: "Logging & Alerts", - icon: , + icon: , roles: all_admin_roles, }, { key: "13", page: "admin-panel", label: "Admin Settings", - icon: , + icon: , roles: all_admin_roles, }, { key: "14", page: "ui-theme", label: "UI Theme", - icon: , + icon: , roles: all_admin_roles, }, ], }, ]; - // Role filtering (preserves original visibility behavior) - const filteredMenuItems: MenuItem[] = menuItems - .filter((item) => !item.roles || item.roles.includes(userRole)) - .map((item) => ({ - ...item, - children: item.children?.filter((child) => !child.roles || child.roles.includes(userRole)), - })); - - /** ---------- Selection state ---------- */ - const pageParam = searchParams.get("page") || undefined; - const findMenuItemKey = (page: string): string => { - const top = filteredMenuItems.find((i) => i.page === page); - if (top) return top.key; - for (const i of filteredMenuItems) { - const child = i.children?.find((c) => c.page === page); - if (child) return child.key; + const topLevelItem = menuItems.find((item) => item.page === page); + if (topLevelItem) return topLevelItem.key; + for (const item of menuItems) { + if (item.children) { + const childItem = item.children.find((child) => child.page === page); + if (childItem) return childItem.key; + } } return "1"; }; - // Match Virtual Keys path with base prefix (e.g., "/virtual-keys" or "/ui/virtual-keys") - const virtualKeysPath = withBase("virtual-keys"); + const selectedMenuKey = findMenuItemKey(defaultSelectedKey); - const selectedMenuKey = - pathname === virtualKeysPath - ? "1" - : pageParam - ? findMenuItemKey(pageParam) - : defaultSelectedKey - ? findMenuItemKey(defaultSelectedKey) - : "1"; + const filteredMenuItems = menuItems.filter((item) => { + const hasParentAccess = !item.roles || item.roles.includes(userRole); + if (!hasParentAccess) return false; + if (item.children) { + item.children = item.children.filter((child) => !child.roles || child.roles.includes(userRole)); + } + return true; + }); - /** ---------- Navigation helpers (SPA only) ---------- */ - // Build a root URL ("/" or "/base/") with an updated ?page=... - const goTo = (p: string) => { - const base = getBasePath() || "/"; - const root = base.endsWith("/") ? base : `${base}/`; - const sp = new URLSearchParams(typeof window !== "undefined" ? window.location.search : ""); - sp.set("page", p); - // Use Next router for client navigation on the SAME route (no hard fetch) - router.replace(`${root}?${sp.toString()}`, { scroll: false }); - }; - - // Keep the /virtual-keys path the same, but avoid route fetches/hard reloads. - const goToVirtualKeys = () => { - const base = getBasePath() || "/"; - const root = base.endsWith("/") ? base : `${base}/`; - const sp = new URLSearchParams(typeof window !== "undefined" ? window.location.search : ""); - sp.set("page", "api-keys"); - - // 1) Client transition to the root with ?page=api-keys so the view updates. - router.replace(`${root}?${sp.toString()}`, { scroll: false }); - - // 2) Cosmetic URL swap to ".../virtual-keys" without navigation (keeps path the same). - const vk = withBase("virtual-keys"); - if (typeof window !== "undefined") { - window.history.replaceState(null, "", vk); + // Helper: go to /?page=...; when on /virtual-keys with refactored UI, replace instead of appending + const pushToRootWithPage = (page: string, useReplace = false) => { + const params = new URLSearchParams(); + params.set("page", page); + const url = `/?${params.toString()}`; + if (useReplace) { + router.replace(url); + } else { + router.push(url); } }; - /** ---------- AntD items with onClick handlers ---------- */ - const antdItems = filteredMenuItems.map((item) => { - const isVirtualKeys = item.key === "1"; - return { - key: item.key, - icon: item.icon, - label: item.label, // plain text; click handled via onClick - onClick: !item.children ? (isVirtualKeys ? goToVirtualKeys : () => goTo(item.page)) : undefined, - children: item.children?.map((child) => ({ - key: child.key, - icon: child.icon, - label: child.label, - onClick: () => goTo(child.page), - })), - }; - }); + // Centralized navigation that satisfies the requirement + const navigateToPage = (page: string) => { + // Special-case: Virtual Keys target + if (page === "api-keys") { + if (refactoredUIFlag) { + // Go to the dedicated /virtual-keys page + router.push("/virtual-keys"); + return; // do not call setPage here (parity with previous behavior) + } + // Legacy behavior + pushToRootWithPage(page); + setPage(page); + return; + } + + // All other pages + if (refactoredUIFlag) { + // If currently on /virtual-keys, REPLACE it with /?page=... + const onVirtualKeys = pathname?.startsWith("/virtual-keys"); + pushToRootWithPage(page, onVirtualKeys); + } else { + pushToRootWithPage(page); + } + setPage(page); + }; return ( @@ -300,29 +272,36 @@ const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelect collapsedWidth={80} collapsible trigger={null} - style={{ - transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)", - position: "relative", - }} + style={{ transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)", position: "relative" }} > - + ({ + key: item.key, + icon: item.icon, + label: item.label, + children: item.children?.map((child) => ({ + key: child.key, + icon: child.icon, + label: child.label, + onClick: () => { + navigateToPage(child.page); + }, + })), + onClick: !item.children + ? () => { + navigateToPage(item.page); + } + : undefined, + }))} /> - {isAdminRole(userRole) && !collapsed && } diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx deleted file mode 100644 index 822a30e640..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx +++ /dev/null @@ -1,32 +0,0 @@ -"use client"; - -import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; -import Sidebar from "@/components/leftnav"; -import React from "react"; -import useFeatureFlags from "@/hooks/useFeatureFlags"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; - -interface SidebarProviderProps { - defaultSelectedKey: string; - sidebarCollapsed: boolean; - setPage: (page: string) => void; -} - -const SidebarProvider = ({ defaultSelectedKey, sidebarCollapsed, setPage }: SidebarProviderProps) => { - const { accessToken, userRole } = useAuthorized(); - const { refactoredUIFlag, setRefactoredUIFlag } = useFeatureFlags(); - - return refactoredUIFlag ? ( - - ) : ( - - ); -}; - -export default SidebarProvider; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx index ad8a82703f..7e60443d24 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx @@ -1,14 +1,31 @@ "use client"; -import React from "react"; +import React, { useEffect, useState } from "react"; import Navbar from "@/components/navbar"; import { ThemeProvider } from "@/contexts/ThemeContext"; import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import { useRouter, useSearchParams } from "next/navigation"; export default function Layout({ children }: { children: React.ReactNode }) { + const router = useRouter(); + const searchParams = useSearchParams(); const { accessToken, userRole } = useAuthorized(); const [sidebarCollapsed, setSidebarCollapsed] = React.useState(false); + const [page, setPage] = useState(() => { + return searchParams.get("page") || "api-keys"; + }); + + const updatePage = (newPage: string) => { + const newSearchParams = new URLSearchParams(searchParams); + newSearchParams.set("page", newPage); + router.push(`/?${newSearchParams.toString()}`); // absolute, not relative + setPage(newPage); + }; + + useEffect(() => { + setPage(searchParams.get("page") || "api-keys"); + }, [searchParams]); const toggleSidebar = () => setSidebarCollapsed((v) => !v); @@ -31,12 +48,7 @@ export default function Layout({ children }: { children: React.ReactNode }) { />
- +
{children}
diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index 104ef41810..d386df4b77 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -1,7 +1,7 @@ "use client"; import React, { Suspense, useEffect, useState } from "react"; -import { useSearchParams } from "next/navigation"; +import { useRouter, useSearchParams } from "next/navigation"; import { jwtDecode } from "jwt-decode"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { Team } from "@/components/key_team_helpers/key_list"; @@ -23,7 +23,6 @@ import ModelHubTable from "@/components/model_hub_table"; import NewUsagePage from "@/components/new_usage"; import APIRef from "@/components/api_ref"; import ChatUI from "@/components/chat_ui/ChatUI"; -import Sidebar from "@/components/leftnav"; import Usage from "@/components/usage"; import CacheDashboard from "@/components/cache_dashboard"; import { getUiConfig, proxyBaseUrl, setGlobalLitellmHeaderName } from "@/components/networking"; @@ -40,7 +39,6 @@ import UIThemeSettings from "@/components/ui_theme_settings"; import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; import { cx } from "@/lib/cva.config"; import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; -import SidebarProvider from "@/app/(dashboard)/components/SidebarProvider"; function getCookie(name: string) { const cookieValue = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); @@ -97,6 +95,7 @@ function LoadingScreen() { } export default function CreateKeyPage() { + const router = useRouter(); const [userRole, setUserRole] = useState(""); const [premiumUser, setPremiumUser] = useState(false); const [disabledPersonalKeyCreation, setDisabledPersonalKeyCreation] = useState(false); @@ -131,13 +130,9 @@ export default function CreateKeyPage() { // Custom setPage function that updates URL const updatePage = (newPage: string) => { - // Update URL without full page reload const newSearchParams = new URLSearchParams(searchParams); newSearchParams.set("page", newPage); - - // Use Next.js router to update URL - window.history.pushState(null, "", `?${newSearchParams.toString()}`); - + router.push(`/?${newSearchParams.toString()}`); // absolute, not relative setPage(newPage); }; @@ -264,7 +259,12 @@ export default function CreateKeyPage() { />
- +
{page == "api-keys" ? ( From cc94fb87b5179936bf02cede86617eb043fbc2b4 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 20:32:47 -0700 Subject: [PATCH 12/48] added base URL helpers --- .../app/(dashboard)/components/Sidebar2.tsx | 28 +++++++++++++++---- .../src/app/(dashboard)/layout.tsx | 17 ++++++++++- ui/litellm-dashboard/src/app/page.tsx | 20 +++++++++++-- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx index 843a176f6e..95907f3def 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx @@ -44,6 +44,24 @@ interface MenuItem { icon?: React.ReactNode; } +/** ---- BASE URL HELPERS (shared pattern across files) ---- */ +function normalizeBasePrefix(raw: string | undefined | null): string { + const trimmed = (raw ?? "").trim(); + if (!trimmed) return ""; // no base + // strip leading/trailing slashes then rebuild as "/segment/" + const core = trimmed.replace(/^\/+/, "").replace(/\/+$/, ""); + return core ? `/${core}/` : "/"; +} +const BASE_PREFIX = normalizeBasePrefix(process.env.NEXT_PUBLIC_BASE_URL); +/** Builds an app-relative path under the configured base prefix. */ +function withBase(path: string): string { + // Accepts paths like "/virtual-keys" or "/?page=..." and prefixes with BASE_PREFIX when present. + const body = path.startsWith("/") ? path.slice(1) : path; + const combined = `${BASE_PREFIX}${body}`; + return combined.startsWith("/") ? combined : `/${combined}`; +} +/** -------------------------------------------------------- */ + const Sidebar2: React.FC = ({ accessToken, setPage, @@ -229,7 +247,7 @@ const Sidebar2: React.FC = ({ const pushToRootWithPage = (page: string, useReplace = false) => { const params = new URLSearchParams(); params.set("page", page); - const url = `/?${params.toString()}`; + const url = withBase(`/?${params.toString()}`); if (useReplace) { router.replace(url); } else { @@ -242,8 +260,8 @@ const Sidebar2: React.FC = ({ // Special-case: Virtual Keys target if (page === "api-keys") { if (refactoredUIFlag) { - // Go to the dedicated /virtual-keys page - router.push("/virtual-keys"); + // Go to the dedicated /virtual-keys page (always under base) + router.push(withBase("/virtual-keys")); return; // do not call setPage here (parity with previous behavior) } // Legacy behavior @@ -255,8 +273,8 @@ const Sidebar2: React.FC = ({ // All other pages if (refactoredUIFlag) { // If currently on /virtual-keys, REPLACE it with /?page=... - const onVirtualKeys = pathname?.startsWith("/virtual-keys"); - pushToRootWithPage(page, onVirtualKeys); + const onVirtualKeys = pathname?.startsWith(withBase("/virtual-keys")); + pushToRootWithPage(page, !!onVirtualKeys); } else { pushToRootWithPage(page); } diff --git a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx index 7e60443d24..3d38a7362b 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx @@ -7,6 +7,21 @@ import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; import { useRouter, useSearchParams } from "next/navigation"; +/** ---- BASE URL HELPERS ---- */ +function normalizeBasePrefix(raw: string | undefined | null): string { + const trimmed = (raw ?? "").trim(); + if (!trimmed) return ""; + const core = trimmed.replace(/^\/+/, "").replace(/\/+$/, ""); + return core ? `/${core}/` : "/"; +} +const BASE_PREFIX = normalizeBasePrefix(process.env.NEXT_PUBLIC_BASE_URL); +function withBase(path: string): string { + const body = path.startsWith("/") ? path.slice(1) : path; + const combined = `${BASE_PREFIX}${body}`; + return combined.startsWith("/") ? combined : `/${combined}`; +} +/** -------------------------------- */ + export default function Layout({ children }: { children: React.ReactNode }) { const router = useRouter(); const searchParams = useSearchParams(); @@ -19,7 +34,7 @@ export default function Layout({ children }: { children: React.ReactNode }) { const updatePage = (newPage: string) => { const newSearchParams = new URLSearchParams(searchParams); newSearchParams.set("page", newPage); - router.push(`/?${newSearchParams.toString()}`); // absolute, not relative + router.push(withBase(`/?${newSearchParams.toString()}`)); // always under BASE setPage(newPage); }; diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index d386df4b77..b110858349 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -40,6 +40,21 @@ import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; import { cx } from "@/lib/cva.config"; import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; +/** ---- BASE URL HELPERS ---- */ +function normalizeBasePrefix(raw: string | undefined | null): string { + const trimmed = (raw ?? "").trim(); + if (!trimmed) return ""; + const core = trimmed.replace(/^\/+/, "").replace(/\/+$/, ""); + return core ? `/${core}/` : "/"; +} +const BASE_PREFIX = normalizeBasePrefix(process.env.NEXT_PUBLIC_BASE_URL); +function withBase(path: string): string { + const body = path.startsWith("/") ? path.slice(1) : path; + const combined = `${BASE_PREFIX}${body}`; + return combined.startsWith("/") ? combined : `/${combined}`; +} +/** -------------------------------- */ + function getCookie(name: string) { const cookieValue = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); return cookieValue ? cookieValue.split("=")[1] : null; @@ -128,11 +143,11 @@ export default function CreateKeyPage() { setPage(searchParams.get("page") || "api-keys"); }, [searchParams]); - // Custom setPage function that updates URL + // Custom setPage function that updates URL (always under BASE) const updatePage = (newPage: string) => { const newSearchParams = new URLSearchParams(searchParams); newSearchParams.set("page", newPage); - router.push(`/?${newSearchParams.toString()}`); // absolute, not relative + router.push(withBase(`/?${newSearchParams.toString()}`)); setPage(newPage); }; @@ -160,6 +175,7 @@ export default function CreateKeyPage() { useEffect(() => { if (redirectToLogin) { + // This is an external auth route (kept as-is, not app navigation). window.location.href = (proxyBaseUrl || "") + "/sso/key/generate"; } }, [redirectToLogin]); From 7ed4715a9b763faf15520989637f99f62828989c Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Mon, 6 Oct 2025 20:42:59 -0700 Subject: [PATCH 13/48] eliminates loading screen flash --- .../app/(dashboard)/components/Sidebar2.tsx | 61 +- ui/litellm-dashboard/src/app/page.tsx | 534 +++++++++--------- 2 files changed, 280 insertions(+), 315 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx index 95907f3def..2ebfbc5d4f 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx @@ -1,5 +1,5 @@ import { Layout, Menu } from "antd"; -import { useRouter, usePathname } from "next/navigation"; // UPDATED: also usePathname to detect current route +import { usePathname } from "next/navigation"; import { KeyOutlined, PlayCircleOutlined, @@ -44,23 +44,29 @@ interface MenuItem { icon?: React.ReactNode; } -/** ---- BASE URL HELPERS (shared pattern across files) ---- */ +/** ---- BASE URL HELPERS ---- */ function normalizeBasePrefix(raw: string | undefined | null): string { const trimmed = (raw ?? "").trim(); if (!trimmed) return ""; // no base - // strip leading/trailing slashes then rebuild as "/segment/" const core = trimmed.replace(/^\/+/, "").replace(/\/+$/, ""); - return core ? `/${core}/` : "/"; + return core ? `/${core}` : ""; } const BASE_PREFIX = normalizeBasePrefix(process.env.NEXT_PUBLIC_BASE_URL); -/** Builds an app-relative path under the configured base prefix. */ + +/** Build an absolute path under the configured base. */ function withBase(path: string): string { - // Accepts paths like "/virtual-keys" or "/?page=..." and prefixes with BASE_PREFIX when present. - const body = path.startsWith("/") ? path.slice(1) : path; - const combined = `${BASE_PREFIX}${body}`; - return combined.startsWith("/") ? combined : `/${combined}`; + // path can be "/virtual-keys" or "/?page=..." + const p = path.startsWith("/") ? path : `/${path}`; + return `${BASE_PREFIX}${p}` || p; } -/** -------------------------------------------------------- */ + +/** History-based navigation to prevent hard reloads / suspense flashes */ +function softNavigate(url: string, replace = false) { + if (typeof window === "undefined") return; + if (replace) window.history.replaceState(null, "", url); + else window.history.pushState(null, "", url); +} +/** -------------------------------- */ const Sidebar2: React.FC = ({ accessToken, @@ -69,7 +75,6 @@ const Sidebar2: React.FC = ({ defaultSelectedKey, collapsed = false, }) => { - const router = useRouter(); const pathname = usePathname(); const { refactoredUIFlag } = useFeatureFlags(); @@ -243,38 +248,30 @@ const Sidebar2: React.FC = ({ return true; }); - // Helper: go to /?page=...; when on /virtual-keys with refactored UI, replace instead of appending + // Helper: update /?page=... under the configured base, WITHOUT triggering App Router nav const pushToRootWithPage = (page: string, useReplace = false) => { const params = new URLSearchParams(); params.set("page", page); const url = withBase(`/?${params.toString()}`); - if (useReplace) { - router.replace(url); - } else { - router.push(url); - } + softNavigate(url, useReplace); }; - // Centralized navigation that satisfies the requirement const navigateToPage = (page: string) => { - // Special-case: Virtual Keys target if (page === "api-keys") { if (refactoredUIFlag) { - // Go to the dedicated /virtual-keys page (always under base) - router.push(withBase("/virtual-keys")); - return; // do not call setPage here (parity with previous behavior) + // vanity URL, keep SPA alive + softNavigate(withBase("/virtual-keys")); + return; // don't call setPage to keep parity, UI already shows api-keys by default } - // Legacy behavior pushToRootWithPage(page); setPage(page); return; } - // All other pages if (refactoredUIFlag) { - // If currently on /virtual-keys, REPLACE it with /?page=... - const onVirtualKeys = pathname?.startsWith(withBase("/virtual-keys")); - pushToRootWithPage(page, !!onVirtualKeys); + const onVirtualKeys = + typeof window !== "undefined" && window.location.pathname.startsWith(withBase("/virtual-keys")); + pushToRootWithPage(page, onVirtualKeys); } else { pushToRootWithPage(page); } @@ -308,15 +305,9 @@ const Sidebar2: React.FC = ({ key: child.key, icon: child.icon, label: child.label, - onClick: () => { - navigateToPage(child.page); - }, + onClick: () => navigateToPage(child.page), })), - onClick: !item.children - ? () => { - navigateToPage(item.page); - } - : undefined, + onClick: !item.children ? () => navigateToPage(item.page) : undefined, }))} /> diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index b110858349..f83972e0c1 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -1,7 +1,6 @@ "use client"; -import React, { Suspense, useEffect, useState } from "react"; -import { useRouter, useSearchParams } from "next/navigation"; +import React, { useEffect, useMemo, useState } from "react"; import { jwtDecode } from "jwt-decode"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { Team } from "@/components/key_team_helpers/key_list"; @@ -45,32 +44,28 @@ function normalizeBasePrefix(raw: string | undefined | null): string { const trimmed = (raw ?? "").trim(); if (!trimmed) return ""; const core = trimmed.replace(/^\/+/, "").replace(/\/+$/, ""); - return core ? `/${core}/` : "/"; + return core ? `/${core}` : ""; } const BASE_PREFIX = normalizeBasePrefix(process.env.NEXT_PUBLIC_BASE_URL); function withBase(path: string): string { - const body = path.startsWith("/") ? path.slice(1) : path; - const combined = `${BASE_PREFIX}${body}`; - return combined.startsWith("/") ? combined : `/${combined}`; + const p = path.startsWith("/") ? path : `/${path}`; + return `${BASE_PREFIX}${p}` || p; } /** -------------------------------- */ function getCookie(name: string) { + if (typeof document === "undefined") return null; const cookieValue = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); return cookieValue ? cookieValue.split("=")[1] : null; } function formatUserRole(userRole: string) { - if (!userRole) { - return "Undefined Role"; - } + if (!userRole) return "Undefined Role"; switch (userRole.toLowerCase()) { case "app_owner": - return "App Owner"; case "demo_app_owner": return "App Owner"; case "app_admin": - return "Admin"; case "proxy_admin": return "Admin"; case "proxy_admin_viewer": @@ -80,7 +75,7 @@ function formatUserRole(userRole: string) { case "internal_user": return "Internal User"; case "internal_user_viewer": - case "internal_viewer": // TODO:remove if deprecated + case "internal_viewer": return "Internal Viewer"; case "app_user": return "App User"; @@ -100,7 +95,6 @@ function LoadingScreen() { return (
🚅 LiteLLM
-
Loading... @@ -109,8 +103,17 @@ function LoadingScreen() { ); } +/** Derive the app "page" from the URL without triggering App Router navigations */ +function getPageFromLocation(loc: Location): string { + const sp = new URLSearchParams(loc.search); + const p = sp.get("page"); + if (p) return p; + // vanity route for refactored UI + if (loc.pathname.endsWith("/virtual-keys")) return "api-keys"; + return "api-keys"; +} + export default function CreateKeyPage() { - const router = useRouter(); const [userRole, setUserRole] = useState(""); const [premiumUser, setPremiumUser] = useState(false); const [disabledPersonalKeyCreation, setDisabledPersonalKeyCreation] = useState(false); @@ -119,55 +122,64 @@ export default function CreateKeyPage() { const [keys, setKeys] = useState([]); const [organizations, setOrganizations] = useState([]); const [userModels, setUserModels] = useState([]); - const [proxySettings, setProxySettings] = useState({ - PROXY_BASE_URL: "", - PROXY_LOGOUT_URL: "", - }); - + const [proxySettings, setProxySettings] = useState({ PROXY_BASE_URL: "", PROXY_LOGOUT_URL: "" }); const [showSSOBanner, setShowSSOBanner] = useState(true); - const searchParams = useSearchParams()!; - const [modelData, setModelData] = useState({ data: [] }); + + // Stable local mirror of URLSearchParams (no suspense, no flashes) + const [searchParams, setSearchParams] = useState(() => + typeof window === "undefined" ? new URLSearchParams() : new URLSearchParams(window.location.search), + ); + const invitation_id = useMemo(() => searchParams.get("invitation_id"), [searchParams]); + + // Local page state (drives UI) + const [page, setPage] = useState(() => + typeof window === "undefined" ? "api-keys" : getPageFromLocation(window.location), + ); + + // Keep history/back/forward in sync with UI + useEffect(() => { + const onPop = () => { + if (typeof window === "undefined") return; + setSearchParams(new URLSearchParams(window.location.search)); + setPage(getPageFromLocation(window.location)); + }; + window.addEventListener("popstate", onPop); + return () => window.removeEventListener("popstate", onPop); + }, []); + + // Update URL without triggering App Router reload/suspense + const updatePage = (newPage: string) => { + if (typeof window === "undefined") return; + // 1) instant UI update + setPage(newPage); + // 2) URL update under base prefix + const sp = new URLSearchParams(window.location.search); + sp.set("page", newPage); + const url = withBase(`/?${sp.toString()}`); + window.history.pushState(null, "", url); + // 3) keep our local mirror in sync + setSearchParams(new URLSearchParams(sp)); + }; + const [token, setToken] = useState(null); const [createClicked, setCreateClicked] = useState(false); const [authLoading, setAuthLoading] = useState(true); const [userID, setUserID] = useState(null); - const invitation_id = searchParams.get("invitation_id"); - - // Get page from URL, default to 'api-keys' if not present - const [page, setPage] = useState(() => { - return searchParams.get("page") || "api-keys"; - }); - - useEffect(() => { - setPage(searchParams.get("page") || "api-keys"); - }, [searchParams]); - - // Custom setPage function that updates URL (always under BASE) - const updatePage = (newPage: string) => { - const newSearchParams = new URLSearchParams(searchParams); - newSearchParams.set("page", newPage); - router.push(withBase(`/?${newSearchParams.toString()}`)); - setPage(newPage); - }; - const [accessToken, setAccessToken] = useState(null); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); - const toggleSidebar = () => { - setSidebarCollapsed(!sidebarCollapsed); - }; + const toggleSidebar = () => setSidebarCollapsed((v) => !v); const addKey = (data: any) => { setKeys((prevData) => (prevData ? [...prevData, data] : [data])); - setCreateClicked(() => !createClicked); + setCreateClicked((v) => !v); }; const redirectToLogin = authLoading === false && token === null && invitation_id === null; useEffect(() => { const token = getCookie("token"); - getUiConfig().then((data) => { - // get the information for constructing the proxy base url, and then set the token and auth loading + getUiConfig().then(() => { setToken(token); setAuthLoading(false); }); @@ -175,59 +187,33 @@ export default function CreateKeyPage() { useEffect(() => { if (redirectToLogin) { - // This is an external auth route (kept as-is, not app navigation). window.location.href = (proxyBaseUrl || "") + "/sso/key/generate"; } }, [redirectToLogin]); useEffect(() => { - if (!token) { - return; - } - + if (!token) return; const decoded = jwtDecode(token) as { [key: string]: any }; - if (decoded) { - // set accessToken - setAccessToken(decoded.key); + if (!decoded) return; - setDisabledPersonalKeyCreation(decoded.disabled_non_admin_personal_key_creation); + setAccessToken(decoded.key); + setDisabledPersonalKeyCreation(decoded.disabled_non_admin_personal_key_creation); - // check if userRole is defined - if (decoded.user_role) { - const formattedUserRole = formatUserRole(decoded.user_role); - setUserRole(formattedUserRole); - if (formattedUserRole == "Admin Viewer") { - setPage("usage"); - } - } - - if (decoded.user_email) { - setUserEmail(decoded.user_email); - } - - if (decoded.login_method) { - setShowSSOBanner(decoded.login_method == "username_password" ? true : false); - } - - if (decoded.premium_user) { - setPremiumUser(decoded.premium_user); - } - - if (decoded.auth_header_name) { - setGlobalLitellmHeaderName(decoded.auth_header_name); - } - - if (decoded.user_id) { - setUserID(decoded.user_id); - } + if (decoded.user_role) { + const formattedUserRole = formatUserRole(decoded.user_role); + setUserRole(formattedUserRole); + if (formattedUserRole === "Admin Viewer") setPage("usage"); } + if (decoded.user_email) setUserEmail(decoded.user_email); + if (decoded.login_method) setShowSSOBanner(decoded.login_method === "username_password"); + if (decoded.premium_user) setPremiumUser(decoded.premium_user); + if (decoded.auth_header_name) setGlobalLitellmHeaderName(decoded.auth_header_name); + if (decoded.user_id) setUserID(decoded.user_id); }, [token]); useEffect(() => { if (accessToken && userID && userRole) { fetchUserModels(userID, userRole, accessToken, setUserModels); - } - if (accessToken && userID && userRole) { fetchTeams(accessToken, userID, userRole, null, setTeams); } if (accessToken) { @@ -240,206 +226,194 @@ export default function CreateKeyPage() { } return ( - }> - - - {invitation_id ? ( - + + {invitation_id ? ( + + ) : ( +
+ - ) : ( -
- -
-
- -
- - {page == "api-keys" ? ( - - ) : page == "models" ? ( - - ) : page == "llm-playground" ? ( - - ) : page == "users" ? ( - - ) : page == "teams" ? ( - - ) : page == "organizations" ? ( - - ) : page == "admin-panel" ? ( - - ) : page == "api_ref" ? ( - - ) : page == "settings" ? ( - - ) : page == "budgets" ? ( - - ) : page == "guardrails" ? ( - - ) : page == "prompts" ? ( - - ) : page == "transform-request" ? ( - - ) : page == "general-settings" ? ( - - ) : page == "ui-theme" ? ( - - ) : page == "model-hub-table" ? ( - - ) : page == "caching" ? ( - - ) : page == "pass-through-settings" ? ( - - ) : page == "logs" ? ( - - ) : page == "mcp-servers" ? ( - - ) : page == "tag-management" ? ( - - ) : page == "vector-stores" ? ( - - ) : page == "new_usage" ? ( - - ) : ( - - )} +
+
+
+ + {page === "api-keys" ? ( + + ) : page === "models" ? ( + {}} + premiumUser={premiumUser} + teams={teams} + /> + ) : page === "llm-playground" ? ( + + ) : page === "users" ? ( + + ) : page === "teams" ? ( + + ) : page === "organizations" ? ( + + ) : page === "admin-panel" ? ( + + ) : page === "api_ref" ? ( + + ) : page === "settings" ? ( + + ) : page === "budgets" ? ( + + ) : page === "guardrails" ? ( + + ) : page === "prompts" ? ( + + ) : page === "transform-request" ? ( + + ) : page === "general-settings" ? ( + + ) : page === "ui-theme" ? ( + + ) : page === "model-hub-table" ? ( + + ) : page === "caching" ? ( + + ) : page === "pass-through-settings" ? ( + + ) : page === "logs" ? ( + + ) : page === "mcp-servers" ? ( + + ) : page === "tag-management" ? ( + + ) : page === "vector-stores" ? ( + + ) : page === "new_usage" ? ( + + ) : ( + + )}
- )} - - - +
+ )} + + ); } From 1579752e06c13ba37f43a2c01679149bca31bb4e Mon Sep 17 00:00:00 2001 From: Leslie Cheng Date: Tue, 7 Oct 2025 20:53:38 -0700 Subject: [PATCH 14/48] Implement fix --- .../adapters/streaming_iterator.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py b/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py index 306bcd9bb2..bcfbee9fc3 100644 --- a/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py +++ b/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py @@ -7,7 +7,7 @@ from collections import deque from typing import TYPE_CHECKING, Any, AsyncIterator, Iterator, Literal, Optional from litellm import verbose_logger -from litellm.types.llms.anthropic import UsageDelta +from litellm.types.llms.anthropic import UsageDelta, ToolUseBlock from litellm.types.utils import AdapterCompletionStreamWrapper if TYPE_CHECKING: @@ -270,7 +270,6 @@ class AnthropicStreamWrapper(AdapterCompletionStreamWrapper): processed_chunk.get("delta", {}).get("stop_reason") is not None ): - self.holding_stop_reason_chunk = processed_chunk else: self.chunk_queue.append(processed_chunk) @@ -380,4 +379,11 @@ class AnthropicStreamWrapper(AdapterCompletionStreamWrapper): self.current_content_block_start = content_block_start return True + # For parallel tool calls, we'll necessarily have a new content block + # if we get a function name since it signals a new tool call + if block_type == "tool_use" and content_block_start.get("name"): + self.current_content_block_type = block_type + self.current_content_block_start = content_block_start + return True + return False From f0c9dfbaf8423b7814ed052f4d04ec99b6e6f1a4 Mon Sep 17 00:00:00 2001 From: Leslie Cheng Date: Tue, 7 Oct 2025 20:57:08 -0700 Subject: [PATCH 15/48] Add some tests --- .../messages/test_parallel_tool_calls.py | 315 ++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100644 tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_parallel_tool_calls.py diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_parallel_tool_calls.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_parallel_tool_calls.py new file mode 100644 index 0000000000..9d4e58f3c8 --- /dev/null +++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_parallel_tool_calls.py @@ -0,0 +1,315 @@ +import os +import sys +from typing import List + + +sys.path.insert(0, os.path.abspath("../../../../..")) + +from litellm.llms.anthropic.experimental_pass_through.adapters.streaming_iterator import ( + AnthropicStreamWrapper, +) +from litellm.types.utils import ( + Delta, + ModelResponse, + StreamingChoices, + Usage, + ChatCompletionDeltaToolCall, + Function, +) + + +class MockCompletionStream: + def __init__(self, responses: List[ModelResponse]): + self.responses = responses + self.index = 0 + + def __iter__(self): + return self + + def __next__(self): + if self.index >= len(self.responses): + raise StopIteration + response = self.responses[self.index] + self.index += 1 + return response + + def __aiter__(self): + return self + + async def __anext__(self): + if self.index >= len(self.responses): + raise StopAsyncIteration + response = self.responses[self.index] + self.index += 1 + return response + + +def construct_text_chunk(text: str) -> ModelResponse: + return ModelResponse( + stream=True, + choices=[ + StreamingChoices( + delta=Delta(content=text), + index=0, + finish_reason=None, + ) + ], + ) + + +def construct_split_tool_call( + id: str, function_name: str, function_arg_parts: List[str] +) -> List[ModelResponse]: + return [ + # https://platform.openai.com/docs/guides/function-calling#streaming + ModelResponse( + stream=True, + choices=[ + StreamingChoices( + delta=Delta( + tool_calls=[ + ChatCompletionDeltaToolCall( + id=id, + function=Function(arguments="", name=function_name), + index=0, + type="function", + ) + ] + ), + index=0, + finish_reason=None, + ) + ], + ), + *[ + ModelResponse( + stream=True, + choices=[ + StreamingChoices( + delta=Delta( + tool_calls=[ + ChatCompletionDeltaToolCall( + id=None, + function=Function(arguments=part, name=None), + index=0, + type=None, + ) + ] + ), + index=0, + finish_reason=None, + ) + ], + ) + for part in function_arg_parts + ], + ] + + +def test_anthropic_stream_wrapper_single_tool_call(): + responses = [ + *construct_split_tool_call("tooluse_foo", "get_weather", ['{"city":', '"NY"}']), + ModelResponse( + stream=True, + choices=[ + StreamingChoices( + delta=Delta(content="", stop_reason="tool_calls"), + index=0, + finish_reason="stop", + ) + ], + usage=Usage(prompt_tokens=230, completion_tokens=65, total_tokens=295), + ), + ] + + wrapper = AnthropicStreamWrapper( + completion_stream=MockCompletionStream(responses), + model="sonnet-4-5", + ) + + chunks = [] + chunk_types = [] + + # Collect all chunks + for chunk in wrapper: + chunks.append(chunk) + chunk_types.append(chunk.get("type")) + + # Verify the expected sequence of chunk types + expected_types = [ + "message_start", # Initial message start + # TODO: for future contributors: if the initial content_block_start + # respects the upstream's starting chunk, the initial empty text block + # should be removed (and this test should be updated accordingly) + # --------------------------------------------------------------------- + "content_block_start", # Initial empty text block start + "content_block_stop", # End of empty text block + # --------------------------------------------------------------------- + "content_block_start", # Start of first tool_use content block + "content_block_delta", # {"city": + "content_block_delta", # "NY"} + "content_block_stop", # End of first tool_use content block + "message_delta", # Stop reason with merged usage + "message_stop", # Final message stop + ] + + assert expected_types == chunk_types + + get_weather_calls = 0 + + for chunk in chunks: + if ( + chunk.get("type") == "content_block_start" + and chunk["content_block"]["type"] == "tool_use" + ): + if chunk["content_block"]["name"] == "get_weather": + get_weather_calls += 1 + + assert get_weather_calls == 1 + + +def test_anthropic_stream_wrapper_back_to_back_tool_calls(): + responses = [ + *construct_split_tool_call("tooluse_foo", "get_weather", ['{"city":', '"NY"}']), + *construct_split_tool_call("tooluse_bar", "get_weather", ['{"city":', '"SF"}']), + ModelResponse( + stream=True, + choices=[ + StreamingChoices( + delta=Delta(content="", stop_reason="tool_calls"), + index=0, + finish_reason="stop", + ) + ], + usage=Usage(prompt_tokens=230, completion_tokens=65, total_tokens=295), + ), + ] + + wrapper = AnthropicStreamWrapper( + completion_stream=MockCompletionStream(responses), + model="sonnet-4-5", + ) + + chunks = [] + chunk_types = [] + + # Collect all chunks + for chunk in wrapper: + chunks.append(chunk) + chunk_types.append(chunk.get("type")) + + # Verify the expected sequence of chunk types + expected_types = [ + "message_start", # Initial message start + # TODO: for future contributors: if the initial content_block_start + # respects the upstream's starting chunk, the initial empty text block + # should be removed (and this test should be updated accordingly) + # --------------------------------------------------------------------- + "content_block_start", # Initial empty text block start + "content_block_stop", # End of empty text block + # --------------------------------------------------------------------- + "content_block_start", # Start of first tool_use content block + "content_block_delta", # {"city": + "content_block_delta", # "NY"} + "content_block_stop", # End of first tool_use content block + "content_block_start", # Start of second tool_use content block + "content_block_delta", # {"city": + "content_block_delta", # " SF"} + "content_block_stop", # End of second tool_use content block + "message_delta", # Stop reason with merged usage + "message_stop", # Final message stop + ] + + assert expected_types == chunk_types + + get_weather_calls = 0 + + for chunk in chunks: + if ( + chunk.get("type") == "content_block_start" + and chunk["content_block"]["type"] == "tool_use" + ): + if chunk["content_block"]["name"] == "get_weather": + get_weather_calls += 1 + + assert get_weather_calls == 2 + + +def test_anthropic_stream_wrapper_interleaved_tool_calls_and_text(): + responses = [ + *construct_split_tool_call("tooluse_foo", "get_weather", ['{"city":', '"NY"}']), + construct_text_chunk("The weather is nice today."), + *construct_split_tool_call("tooluse_bar", "get_weather", ['{"city":', '"SF"}']), + *construct_split_tool_call( + "tooluse_bar", "get_weather", ['{"city":', '"CHI"}'] + ), + construct_text_chunk("The weather is not so nice today."), + ModelResponse( + stream=True, + choices=[ + StreamingChoices( + delta=Delta(content="", stop_reason="tool_calls"), + index=0, + finish_reason="stop", + ) + ], + usage=Usage(prompt_tokens=230, completion_tokens=65, total_tokens=295), + ), + ] + + wrapper = AnthropicStreamWrapper( + completion_stream=MockCompletionStream(responses), + model="sonnet-4-5", + ) + + chunks = [] + chunk_types = [] + + # Collect all chunks + for chunk in wrapper: + chunks.append(chunk) + chunk_types.append(chunk.get("type")) + + # Verify the expected sequence of chunk types + expected_types = [ + "message_start", # Initial message start + # TODO: for future contributors: if the initial content_block_start + # respects the upstream's starting chunk, the initial empty text block + # should be removed (and this test should be updated accordingly) + # --------------------------------------------------------------------- + "content_block_start", # Initial empty text block start + "content_block_stop", # End of empty text block + # --------------------------------------------------------------------- + "content_block_start", # Start of first tool_use content block + "content_block_delta", # {"city": + "content_block_delta", # "NY"} + "content_block_stop", # End of first tool_use content block + "content_block_start", # "The weather is nice today" + "content_block_stop", + "content_block_start", # Start of second tool_use content block + "content_block_delta", # {"city": + "content_block_delta", # " SF"} + "content_block_stop", # End of second tool_use content block + "content_block_start", # Start of third tool_use content block + "content_block_delta", # {"city": + "content_block_delta", # " CHI"} + "content_block_stop", # End of third tool_use content block + "content_block_start", # "The weather is not so nice today" + "content_block_stop", + "message_delta", # Stop reason with merged usage + "message_stop", # Final message stop + ] + + assert expected_types == chunk_types + + get_weather_calls = 0 + + for chunk in chunks: + if ( + chunk.get("type") == "content_block_start" + and chunk["content_block"]["type"] == "tool_use" + ): + if chunk["content_block"]["name"] == "get_weather": + get_weather_calls += 1 + + assert get_weather_calls == 3 From 86affa405cc764a38ed230944903f73ced078bd9 Mon Sep 17 00:00:00 2001 From: Leslie Cheng Date: Tue, 7 Oct 2025 21:11:56 -0700 Subject: [PATCH 16/48] Unused type --- .../experimental_pass_through/adapters/streaming_iterator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py b/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py index bcfbee9fc3..47263dc174 100644 --- a/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py +++ b/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py @@ -7,7 +7,7 @@ from collections import deque from typing import TYPE_CHECKING, Any, AsyncIterator, Iterator, Literal, Optional from litellm import verbose_logger -from litellm.types.llms.anthropic import UsageDelta, ToolUseBlock +from litellm.types.llms.anthropic import UsageDelta from litellm.types.utils import AdapterCompletionStreamWrapper if TYPE_CHECKING: From f8af72bbf14000f43d95a512750fe125aae4ba96 Mon Sep 17 00:00:00 2001 From: Tim Elfrink Date: Wed, 8 Oct 2025 10:31:35 +0200 Subject: [PATCH 17/48] fix: redact AWS credentials when redact_user_api_key_info enabled Use SensitiveDataMasker in print_deployment() to mask all sensitive credentials including AWS keys when redact_user_api_key_info is True. Fixes #14839 --- ...odel_prices_and_context_window_backup.json | 3 +-- litellm/router.py | 19 ++++++++++--- .../test_router_helper_utils.py | 27 +++++++++++++++++++ 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index bdfc4fd020..29a6588774 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -13303,8 +13303,7 @@ "supported_endpoints": [ "/v1/images/generations", "/v1/images/edits" - ], - "supports_vision": true + ] }, "gpt-realtime": { "cache_creation_input_audio_token_cost": 4e-07, diff --git a/litellm/router.py b/litellm/router.py index ef7bcba635..5349a212d6 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -59,6 +59,7 @@ from litellm.litellm_core_utils.coroutine_checker import coroutine_checker from litellm.litellm_core_utils.credential_accessor import CredentialAccessor from litellm.litellm_core_utils.dd_tracing import tracer from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLogging +from litellm.litellm_core_utils.sensitive_data_masker import SensitiveDataMasker from litellm.router_strategy.budget_limiter import RouterBudgetLimiting from litellm.router_strategy.least_busy import LeastBusyLoggingHandler from litellm.router_strategy.lowest_cost import LowestCostLoggingHandler @@ -142,10 +143,17 @@ from litellm.types.router import ( RoutingStrategy, ) from litellm.types.services import ServiceTypes -from litellm.types.utils import GenericBudgetConfigType, LiteLLMBatch +from litellm.types.utils import ( + GenericBudgetConfigType, + LiteLLMBatch, +) from litellm.types.utils import ModelInfo from litellm.types.utils import ModelInfo as ModelMapInfo -from litellm.types.utils import ModelResponseStream, StandardLoggingPayload, Usage +from litellm.types.utils import ( + ModelResponseStream, + StandardLoggingPayload, + Usage, +) from litellm.utils import ( CustomStreamWrapper, EmbeddingResponse, @@ -909,8 +917,13 @@ class Router: try: _deployment_copy = copy.deepcopy(deployment) litellm_params: dict = _deployment_copy["litellm_params"] - if "api_key" in litellm_params: + + if litellm.redact_user_api_key_info: + masker = SensitiveDataMasker(visible_prefix=2, visible_suffix=0) + _deployment_copy["litellm_params"] = masker.mask_dict(litellm_params) + elif "api_key" in litellm_params: litellm_params["api_key"] = litellm_params["api_key"][:2] + "*" * 10 + return _deployment_copy except Exception as e: verbose_router_logger.debug( diff --git a/tests/router_unit_tests/test_router_helper_utils.py b/tests/router_unit_tests/test_router_helper_utils.py index 094df944bc..a31c4d8210 100644 --- a/tests/router_unit_tests/test_router_helper_utils.py +++ b/tests/router_unit_tests/test_router_helper_utils.py @@ -94,6 +94,33 @@ def test_print_deployment(model_list): assert 10 * "*" in printed_deployment["litellm_params"]["api_key"] +def test_print_deployment_with_redact_enabled(model_list): + """Test if sensitive credentials are masked when redact_user_api_key_info is enabled""" + import litellm + + router = Router(model_list=model_list) + deployment = { + "model_name": "bedrock-claude", + "litellm_params": { + "model": "bedrock/anthropic.claude-v2", + "aws_access_key_id": "AKIAIOSFODNN7EXAMPLE", + "aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + "aws_region_name": "us-west-2", + }, + } + + original_setting = litellm.redact_user_api_key_info + try: + litellm.redact_user_api_key_info = True + printed_deployment = router.print_deployment(deployment) + + assert "*" in printed_deployment["litellm_params"]["aws_access_key_id"] + assert "*" in printed_deployment["litellm_params"]["aws_secret_access_key"] + assert "us-west-2" == printed_deployment["litellm_params"]["aws_region_name"] + finally: + litellm.redact_user_api_key_info = original_setting + + def test_completion(model_list): """Test if the completion function is working correctly""" router = Router(model_list=model_list) From 85d4142845d0f5ff7602640a4e5063cacf2c69dd Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Wed, 8 Oct 2025 21:14:23 +0530 Subject: [PATCH 18/48] Fix litellm_param based costing --- litellm/litellm_core_utils/litellm_logging.py | 2 +- litellm/router.py | 3 +- litellm/types/router.py | 21 +- litellm/types/utils.py | 47 ++++- .../test_pass_through_unit_tests.py | 185 ++++++++++++++++++ 5 files changed, 238 insertions(+), 20 deletions(-) diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 696c67c44d..eafcab8855 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -81,12 +81,12 @@ from litellm.types.llms.openai import ( ) from litellm.types.mcp import MCPPostCallResponseObject from litellm.types.rerank import RerankResponse -from litellm.types.router import CustomPricingLiteLLMParams from litellm.types.utils import ( CachingDetails, CallTypes, CostBreakdown, CostResponseTypes, + CustomPricingLiteLLMParams, DynamicPromptManagementParamLiteral, EmbeddingResponse, GuardrailStatus, diff --git a/litellm/router.py b/litellm/router.py index ef7bcba635..50f6d7f1b6 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -125,7 +125,6 @@ from litellm.types.router import ( AllowedFailsPolicy, AssistantsTypedDict, CredentialLiteLLMParams, - CustomPricingLiteLLMParams, CustomRoutingStrategyBase, Deployment, DeploymentTypedDict, @@ -145,7 +144,7 @@ from litellm.types.services import ServiceTypes from litellm.types.utils import GenericBudgetConfigType, LiteLLMBatch from litellm.types.utils import ModelInfo from litellm.types.utils import ModelInfo as ModelMapInfo -from litellm.types.utils import ModelResponseStream, StandardLoggingPayload, Usage +from litellm.types.utils import ModelResponseStream, StandardLoggingPayload, Usage, CustomPricingLiteLLMParams from litellm.utils import ( CustomStreamWrapper, EmbeddingResponse, diff --git a/litellm/types/router.py b/litellm/types/router.py index 62f1c13eb4..3482df19c3 100644 --- a/litellm/types/router.py +++ b/litellm/types/router.py @@ -4,24 +4,20 @@ litellm.Router Types - includes RouterConfig, UpdateRouterConfig, ModelInfo etc import datetime import enum -from litellm._uuid import uuid from dataclasses import dataclass from typing import Any, Dict, List, Literal, Optional, Tuple, Union, get_type_hints import httpx -from httpx import AsyncClient, Client -from openai import AsyncAzureOpenAI, AsyncOpenAI, AzureOpenAI, OpenAI from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Required, TypedDict -from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler +from litellm._uuid import uuid -from ..exceptions import RateLimitError from .completion import CompletionRequest from .embedding import EmbeddingRequest from .llms.openai import OpenAIFileObject from .llms.vertex_ai import VERTEX_CREDENTIALS_TYPES -from .utils import ModelResponse, ProviderSpecificModelInfo +from .utils import CustomPricingLiteLLMParams, ModelResponse class ConfigurableClientsideParamsCustomAuth(TypedDict): @@ -166,14 +162,7 @@ class CredentialLiteLLMParams(BaseModel): watsonx_region_name: Optional[str] = None -class CustomPricingLiteLLMParams(BaseModel): - ## CUSTOM PRICING ## - input_cost_per_token: Optional[float] = None - output_cost_per_token: Optional[float] = None - input_cost_per_second: Optional[float] = None - output_cost_per_second: Optional[float] = None - input_cost_per_pixel: Optional[float] = None - output_cost_per_pixel: Optional[float] = None + class GenericLiteLLMParams(CredentialLiteLLMParams, CustomPricingLiteLLMParams): @@ -482,7 +471,7 @@ class Deployment(BaseModel): def to_json(self, **kwargs): try: return self.model_dump(**kwargs) # noqa - except Exception as e: + except Exception: # if using pydantic v1 return self.dict(**kwargs) @@ -602,7 +591,7 @@ class ModelGroupInfo(BaseModel): def __init__(self, **data): for field_name, field_type in get_type_hints(self.__class__).items(): - if field_type == bool and data.get(field_name) is None: + if field_type is bool and data.get(field_name) is None: data[field_name] = False super().__init__(**data) diff --git a/litellm/types/utils.py b/litellm/types/utils.py index cac3bdfb01..d481422430 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -2226,6 +2226,51 @@ class StandardCallbackDynamicParams(TypedDict, total=False): turn_off_message_logging: Optional[bool] # when true will not log messages litellm_disabled_callbacks: Optional[List[str]] +class CustomPricingLiteLLMParams(BaseModel): + ## CUSTOM PRICING ## + input_cost_per_token: Optional[float] = None + output_cost_per_token: Optional[float] = None + input_cost_per_second: Optional[float] = None + output_cost_per_second: Optional[float] = None + input_cost_per_pixel: Optional[float] = None + output_cost_per_pixel: Optional[float] = None + + # Include all ModelInfoBase fields as optional + # This allows any model_info parameter to be set in litellm_params + input_cost_per_token_flex: Optional[float] = None + input_cost_per_token_priority: Optional[float] = None + cache_creation_input_token_cost: Optional[float] = None + cache_creation_input_token_cost_above_1hr: Optional[float] = None + cache_read_input_token_cost: Optional[float] = None + cache_read_input_token_cost_flex: Optional[float] = None + cache_read_input_token_cost_priority: Optional[float] = None + input_cost_per_character: Optional[float] = None + input_cost_per_audio_token: Optional[float] = None + input_cost_per_token_above_128k_tokens: Optional[float] = None + input_cost_per_token_above_200k_tokens: Optional[float] = None + input_cost_per_character_above_128k_tokens: Optional[float] = None + input_cost_per_query: Optional[float] = None + input_cost_per_image: Optional[float] = None + input_cost_per_audio_per_second: Optional[float] = None + input_cost_per_video_per_second: Optional[float] = None + input_cost_per_second: Optional[float] = None + input_cost_per_token_batches: Optional[float] = None + output_cost_per_token_batches: Optional[float] = None + output_cost_per_token_flex: Optional[float] = None + output_cost_per_token_priority: Optional[float] = None + output_cost_per_character: Optional[float] = None + output_cost_per_audio_token: Optional[float] = None + output_cost_per_token_above_128k_tokens: Optional[float] = None + output_cost_per_token_above_200k_tokens: Optional[float] = None + output_cost_per_character_above_128k_tokens: Optional[float] = None + output_cost_per_image: Optional[float] = None + output_cost_per_reasoning_token: Optional[float] = None + output_cost_per_video_per_second: Optional[float] = None + output_cost_per_audio_per_second: Optional[float] = None + output_cost_per_second: Optional[float] = None + search_context_cost_per_query: Optional[Dict[str, Any]] = None + citation_cost_per_token: Optional[float] = None + tiered_pricing: Optional[List[Dict[str, Any]]] = None all_litellm_params = [ "metadata", @@ -2325,7 +2370,7 @@ all_litellm_params = [ "litellm_session_id", "use_litellm_proxy", "prompt_label", -] + list(StandardCallbackDynamicParams.__annotations__.keys()) +] + list(StandardCallbackDynamicParams.__annotations__.keys()) + list(CustomPricingLiteLLMParams.model_fields.keys()) class KeyGenerationConfig(TypedDict, total=False): diff --git a/tests/pass_through_unit_tests/test_pass_through_unit_tests.py b/tests/pass_through_unit_tests/test_pass_through_unit_tests.py index 501fe24e65..445d0ca55e 100644 --- a/tests/pass_through_unit_tests/test_pass_through_unit_tests.py +++ b/tests/pass_through_unit_tests/test_pass_through_unit_tests.py @@ -418,3 +418,188 @@ def test_is_bedrock_agent_runtime_route(): is False ) assert _is_bedrock_agent_runtime_route("/some/random/endpoint") is False + + +def test_init_kwargs_filters_pricing_params(mock_request, mock_user_api_key_dict): + """ + Test that pricing parameters are properly filtered out from the request body + and don't get sent to the provider API. + + This ensures that custom pricing parameters like: + - cache_read_input_token_cost + - input_cost_per_token_batches + - output_cost_per_token_batches + - cache_creation_input_token_cost + etc. are removed from the request body before sending to provider. + + Regression test for: LIT-1221 + """ + request = mock_request() + + # Create a parsed body with pricing parameters that should be filtered out + parsed_body = { + "model": "gpt-4", + "messages": [{"role": "user", "content": "test"}], + # Standard pricing params (should be filtered) + "input_cost_per_token": 0.00002, + "output_cost_per_token": 0.00002, + "input_cost_per_second": 0.00001, + "output_cost_per_second": 0.00001, + # Cache-related pricing params (should be filtered) + "cache_read_input_token_cost": 0.00005, + "cache_creation_input_token_cost": 0.00003, + "cache_creation_input_token_cost_above_1hr": 0.00004, + # Batch pricing params (should be filtered) + "input_cost_per_token_batches": 0.00005, + "output_cost_per_token_batches": 0.00006, + # Other pricing params (should be filtered) + "input_cost_per_audio_token": 0.00001, + "output_cost_per_audio_token": 0.00001, + "input_cost_per_character": 0.000001, + "output_cost_per_character": 0.000001, + "input_cost_per_image": 0.001, + "output_cost_per_image": 0.001, + # Tiered pricing + "tiered_pricing": [{"input_cost_per_token": 0.00001}], + # This should NOT be filtered (it's a valid OpenAI parameter) + "temperature": 0.7, + "max_tokens": 100, + } + + passthrough_payload = PassthroughStandardLoggingPayload( + url="https://api.openai.com/v1/chat/completions", + request_body=parsed_body.copy(), + ) + + result = HttpPassThroughEndpointHelpers._init_kwargs_for_pass_through_endpoint( + request=request, + user_api_key_dict=mock_user_api_key_dict, + passthrough_logging_payload=passthrough_payload, + _parsed_body=parsed_body, + litellm_call_id="test-call-id", + logging_obj=LiteLLMLoggingObj( + model="gpt-4", + messages=[{"role": "user", "content": "test"}], + stream=False, + call_type="completion", + start_time=datetime.now(), + litellm_call_id="test-call-id", + function_id="test-function-id", + ), + ) + + # Verify pricing parameters were filtered out from parsed_body + assert "input_cost_per_token" not in parsed_body + assert "output_cost_per_token" not in parsed_body + assert "input_cost_per_second" not in parsed_body + assert "output_cost_per_second" not in parsed_body + assert "cache_read_input_token_cost" not in parsed_body + assert "cache_creation_input_token_cost" not in parsed_body + assert "cache_creation_input_token_cost_above_1hr" not in parsed_body + assert "input_cost_per_token_batches" not in parsed_body + assert "output_cost_per_token_batches" not in parsed_body + assert "input_cost_per_audio_token" not in parsed_body + assert "output_cost_per_audio_token" not in parsed_body + assert "input_cost_per_character" not in parsed_body + assert "output_cost_per_character" not in parsed_body + assert "input_cost_per_image" not in parsed_body + assert "output_cost_per_image" not in parsed_body + assert "tiered_pricing" not in parsed_body + + # Verify valid OpenAI parameters remain in parsed_body + assert parsed_body["model"] == "gpt-4" + assert parsed_body["messages"] == [{"role": "user", "content": "test"}] + assert parsed_body["temperature"] == 0.7 + assert parsed_body["max_tokens"] == 100 + + # Verify pricing parameters are stored in litellm_params for internal use + litellm_params = result["litellm_params"] + assert litellm_params["input_cost_per_token"] == 0.00002 + assert litellm_params["output_cost_per_token"] == 0.00002 + # Note: Other pricing params are also stored but we test the key ones that caused the regression + + +def test_custom_pricing_used_in_cost_calculation(): + """ + Test that when custom pricing parameters are provided in litellm_params, + they are actually used for cost calculation. + + This ensures that the custom pricing functionality works end-to-end: + 1. Pricing params are stored in litellm_params + 2. These params are used by completion_cost() to calculate costs + + Regression test for: LIT-1221 + """ + from litellm import completion_cost, Choices, Message, ModelResponse + from litellm.utils import Usage + + # Create a mock response with usage + resp = ModelResponse( + id="chatcmpl-test-123", + choices=[ + Choices( + finish_reason="stop", + index=0, + message=Message( + content="This is a test response", + role="assistant", + ), + ) + ], + created=1234567890, + model="gpt-4", + object="chat.completion", + usage=Usage(prompt_tokens=100, completion_tokens=50, total_tokens=150), + ) + + # Test 1: Standard pricing (should use default model pricing) + standard_cost = completion_cost( + completion_response=resp, + model="gpt-4", + ) + print(f"Standard cost: {standard_cost}") + + # Test 2: Custom pricing via custom_cost_per_token parameter + custom_input_price = 0.00010 # $0.0001 per token + custom_output_price = 0.00020 # $0.0002 per token + + custom_cost = completion_cost( + completion_response=resp, + custom_cost_per_token={ + "input_cost_per_token": custom_input_price, + "output_cost_per_token": custom_output_price, + }, + ) + + # Calculate expected cost + expected_custom_cost = (100 * custom_input_price) + (50 * custom_output_price) + + print(f"Custom cost: {custom_cost}") + print(f"Expected custom cost: {expected_custom_cost}") + + # Verify custom pricing is used (should match our calculation) + assert round(custom_cost, 10) == round(expected_custom_cost, 10) + + # Verify custom cost is different from standard cost (unless prices happen to match) + # This confirms custom pricing is actually being applied + assert custom_cost != standard_cost, "Custom pricing should produce different cost than standard pricing" + + # Test 3: Custom pricing with cache_read_input_token_cost and input_cost_per_token_batches + # This specifically tests the parameters that were causing the original issue + cache_cost = completion_cost( + completion_response=resp, + custom_cost_per_token={ + "input_cost_per_token": 0.00001, + "output_cost_per_token": 0.00002, + "cache_read_input_token_cost": 0.000005, # Should be accepted + "input_cost_per_token_batches": 0.000003, # Should be accepted + "output_cost_per_token_batches": 0.000004, # Should be accepted + }, + ) + + # Basic validation that it doesn't throw an error and returns a number + assert isinstance(cache_cost, (int, float)) + assert cache_cost >= 0 + + print(f"Cache-aware cost: {cache_cost}") + print("✅ Custom pricing parameters are correctly used in cost calculation") From ce8a520a86b0baf83bb779094ebccbc229363041 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Wed, 8 Oct 2025 14:40:01 -0700 Subject: [PATCH 19/48] new deep merge behavior when processing config --- litellm/proxy/proxy_server.py | 23 ++++++-- tests/proxy_unit_tests/test_proxy_utils.py | 68 ++++++++++++++++++++++ 2 files changed, 85 insertions(+), 6 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 7a1e8f1e73..7feb4b825b 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -2885,6 +2885,20 @@ class ProxyConfig: dict: Updated configuration dictionary """ + def _deep_merge_dicts(dst: dict, src: dict) -> None: + """ + Deep-merge src into dst, skipping None values from src. + On conflicts, src (DB) wins. + """ + for k, v in src.items(): + if v is None: + # Preserve existing config when DB value is None (matches prior behavior) + continue + if isinstance(v, dict) and isinstance(dst.get(k), dict): + _deep_merge_dicts(dst[k], v) + else: + dst[k] = v + if param_name == "environment_variables": decrypted_env_vars = self._decrypt_and_set_db_env_variables(db_param_value) current_config.setdefault("environment_variables", {}).update( @@ -2905,13 +2919,10 @@ class ProxyConfig: return current_config # For dictionary values, update only non-none values - if isinstance(current_config[param_name], dict): - # Only keep non None values from db_param_value - non_none_values = {k: v for k, v in db_param_value.items() if v is not None} - - # Update the config with non-none values - current_config[param_name].update(non_none_values) + if isinstance(current_config[param_name], dict) and isinstance(db_param_value, dict): + _deep_merge_dicts(current_config[param_name], db_param_value) else: + # Non-dict or mismatched types: DB value replaces config (unchanged behavior) current_config[param_name] = db_param_value return current_config diff --git a/tests/proxy_unit_tests/test_proxy_utils.py b/tests/proxy_unit_tests/test_proxy_utils.py index 34a8a9daf8..9b01f21c58 100644 --- a/tests/proxy_unit_tests/test_proxy_utils.py +++ b/tests/proxy_unit_tests/test_proxy_utils.py @@ -1029,6 +1029,74 @@ def test_update_config_fields(): assert team_config["langfuse_secret"] == "my-fake-secret" +def test_update_config_fields_deep_merge_db_wins(): + from litellm.proxy.proxy_server import ProxyConfig + + proxy_config = ProxyConfig() + + current_config = { + "router_settings": { + "routing_mode": "cost_optimized", + "model_group_alias": { + # Existing alias with older model + different hidden flag + "claude-sonnet-4": { + "model": "claude-sonnet-4-20240219", + "hidden": True, + }, + # An extra alias that should remain untouched unless DB overrides it + "legacy-sonnet": { + "model": "claude-2.1", + "hidden": True, + }, + }, + } + } + + db_param_value = { + "model_group_alias": { + # Conflict: DB should win (both 'model' and 'hidden') + "claude-sonnet-4": { + "model": "claude-sonnet-4-20250514", + "hidden": False, + }, + # New alias to be added by the merge + "claude-sonnet-latest": { + "model": "claude-sonnet-4-20250514", + "hidden": True, + }, + # Demonstrate that None values from DB are skipped (preserve existing) + "legacy-sonnet": { + "hidden": None # should not clobber current True + }, + } + } + + updated = proxy_config._update_config_fields( + current_config=current_config, + param_name="router_settings", + db_param_value=db_param_value, + ) + + rs = updated["router_settings"] + aliases = rs["model_group_alias"] + + # DB wins on conflicts (deep) for existing alias + assert aliases["claude-sonnet-4"]["model"] == "claude-sonnet-4-20250514" + assert aliases["claude-sonnet-4"]["hidden"] is False + + # New alias introduced by DB is present with its values + assert "claude-sonnet-latest" in aliases + assert aliases["claude-sonnet-latest"]["model"] == "claude-sonnet-4-20250514" + assert aliases["claude-sonnet-latest"]["hidden"] is True + + # None in DB does not overwrite existing values + assert aliases["legacy-sonnet"]["model"] == "claude-2.1" + assert aliases["legacy-sonnet"]["hidden"] is True + + # Unrelated router_settings keys are preserved + assert rs["routing_mode"] == "cost_optimized" + + def test_update_config_fields_default_internal_user_params(monkeypatch): from litellm.proxy.proxy_server import ProxyConfig From dceaf2f0f1241f32b8ed8b967ad6bab1f968d56f Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Wed, 8 Oct 2025 15:00:52 -0700 Subject: [PATCH 20/48] eliminates recursion for an explicit stack --- litellm/proxy/proxy_server.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 7feb4b825b..57988f8d99 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -2890,14 +2890,17 @@ class ProxyConfig: Deep-merge src into dst, skipping None values from src. On conflicts, src (DB) wins. """ - for k, v in src.items(): - if v is None: - # Preserve existing config when DB value is None (matches prior behavior) - continue - if isinstance(v, dict) and isinstance(dst.get(k), dict): - _deep_merge_dicts(dst[k], v) - else: - dst[k] = v + stack = [(dst, src)] + while stack: + d, s = stack.pop() + for k, v in s.items(): + if v is None: + # Preserve existing config when DB value is None (matches prior behavior) + continue + if isinstance(v, dict) and isinstance(d.get(k), dict): + stack.append((d[k], v)) + else: + d[k] = v if param_name == "environment_variables": decrypted_env_vars = self._decrypt_and_set_db_env_variables(db_param_value) From dd4249db7815e3ad83a5a7d0e5d5ae609c41c98d Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 8 Oct 2025 16:27:01 -0700 Subject: [PATCH 21/48] feat(mcp_server_manager.py): initial commit adding allowed params support allow admin to specify which parameters to allow/disallow by MCP tool --- .../mcp_server/mcp_server_manager.py | 75 ++++++++++++++++++- litellm/proxy/_new_secret_config.yaml | 39 +++++++++- .../types/mcp_server/mcp_server_manager.py | 3 + 3 files changed, 110 insertions(+), 7 deletions(-) diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py index 10e40b76ef..129a756e4f 100644 --- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py +++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py @@ -215,6 +215,7 @@ class MCPServerManager: extra_headers=server_config.get("extra_headers", None), allowed_tools=server_config.get("allowed_tools", None), disallowed_tools=server_config.get("disallowed_tools", None), + allowed_params=server_config.get("allowed_params", None), access_groups=server_config.get("access_groups", None), ) self.config_mcp_servers[server_id] = new_server @@ -602,6 +603,60 @@ class MCPServerManager: return tool_name not in server.disallowed_tools return True + def filter_allowed_params( + self, tool_name: str, arguments: Dict[str, Any], server: MCPServer + ) -> Dict[str, Any]: + """ + Filter arguments to only include allowed parameters for the given tool. + + Args: + tool_name: Name of the tool (with or without prefix) + arguments: Dictionary of arguments to filter + server: MCPServer configuration + + Returns: + Filtered dictionary containing only allowed parameters + + Raises: + HTTPException: If allowed_params is configured for this tool but arguments contain disallowed params + """ + from litellm.proxy._experimental.mcp_server.utils import ( + get_server_name_prefix_tool_mcp, + ) + + # If no allowed_params configured, return all arguments + if not server.allowed_params: + return arguments + + # Get the unprefixed tool name to match against config + unprefixed_tool_name, _ = get_server_name_prefix_tool_mcp(tool_name) + + # Check both prefixed and unprefixed tool names + allowed_params_list = server.allowed_params.get( + tool_name + ) or server.allowed_params.get(unprefixed_tool_name) + + # If this tool doesn't have allowed_params specified, allow all params + if allowed_params_list is None: + return arguments + + # Filter arguments to only include allowed parameters + disallowed_params = [ + param for param in arguments.keys() if param not in allowed_params_list + ] + + if disallowed_params: + raise HTTPException( + status_code=403, + detail={ + "error": f"Parameters {disallowed_params} are not allowed for tool {tool_name}. " + f"Allowed parameters: {allowed_params_list}. " + f"Contact proxy admin to allow these parameters." + }, + ) + + return {k: v for k, v in arguments.items() if k in allowed_params_list} + async def check_tool_permission_for_key_team( self, tool_name: str, @@ -621,18 +676,20 @@ class MCPServerManager: Raises: HTTPException: If tool is not allowed for this key/team """ - from litellm.proxy._experimental.mcp_server.auth.user_api_key_auth_mcp import MCPRequestHandler - + from litellm.proxy._experimental.mcp_server.auth.user_api_key_auth_mcp import ( + MCPRequestHandler, + ) + if not user_api_key_auth: return - + # Check if tool is allowed is_allowed = await MCPRequestHandler.is_tool_allowed_for_server( tool_name=tool_name, server_id=server.server_id, user_api_key_auth=user_api_key_auth, ) - + if not is_allowed: raise HTTPException( status_code=403, @@ -667,6 +724,16 @@ class MCPServerManager: user_api_key_auth=user_api_key_auth, ) + ## filter parameters based on allowed_params configuration + filtered_arguments = self.filter_allowed_params( + tool_name=name, + arguments=arguments, + server=server, + ) + # Update arguments with filtered version + arguments.clear() + arguments.update(filtered_arguments) + pre_hook_kwargs = { "name": name, "arguments": arguments, diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yaml index 52a6fc16ff..b2f4635ac9 100644 --- a/litellm/proxy/_new_secret_config.yaml +++ b/litellm/proxy/_new_secret_config.yaml @@ -1,6 +1,39 @@ model_list: - model_name: gpt-5-mini litellm_params: - model: azure/gpt-5-mini-2 - api_key: os.environ/AZURE_API_KEY_ALT - api_base: os.environ/AZURE_API_BASE_ALT + model: openai/gpt-4o-mini + api_base: "https://webhook.site/2f385e05-00aa-402b-86d1-efc9261471a5" + api_key: dummy + - model_name: "byok-wildcard/*" + litellm_params: + model: openai/* + - model_name: xai-grok-3 + litellm_params: + model: xai/grok-3 + - model_name: hosted_vllm/whisper-v3 + litellm_params: + model: hosted_vllm/whisper-v3 + api_base: "https://webhook.site/2f385e05-00aa-402b-86d1-efc9261471a5" + api_key: dummy + +mcp_servers: + my_api_mcp: + url: "http://0.0.0.0:8090" + spec_path: "/Users/krrishdholakia/Documents/temp_py_folder/example_openapi.json" + auth_type: none + allowed_tools: ["getpetbyid", "my_api_mcp-findpetsbystatus"] + # Configure allowed parameters per tool + # Key: tool name (with or without prefix) + # Value: list of allowed parameter names + allowed_params: + # Using unprefixed tool name + "getpetbyid": ["petId"] + # Using prefixed tool name (both formats work) + "my_api_mcp-findpetsbystatus": ["status", "limit"] + # Example: allow only specific params for another tool + # "another_tool": ["param1", "param2"] + + +litellm_settings: + callbacks: ["prometheus"] + custom_prometheus_metadata_labels: ["metadata.initiative", "metadata.business-unit"] diff --git a/litellm/types/mcp_server/mcp_server_manager.py b/litellm/types/mcp_server/mcp_server_manager.py index 3e0c2b20e3..81c116bdab 100644 --- a/litellm/types/mcp_server/mcp_server_manager.py +++ b/litellm/types/mcp_server/mcp_server_manager.py @@ -25,6 +25,9 @@ class MCPServer(BaseModel): ) allowed_tools: Optional[List[str]] = None disallowed_tools: Optional[List[str]] = None + allowed_params: Optional[Dict[str, List[str]]] = ( + None # map of tool names to allowed parameter lists + ) # OAuth-specific fields client_id: Optional[str] = None client_secret: Optional[str] = None From ecb6c0e8147e856916eee89c6cea539574a105aa Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 8 Oct 2025 16:37:50 -0700 Subject: [PATCH 22/48] fix(mcp_server_manager.py): ensure only allowed params sent to MCP server --- .../mcp_server/mcp_server_manager.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py index 129a756e4f..8070bedbc7 100644 --- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py +++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py @@ -603,9 +603,9 @@ class MCPServerManager: return tool_name not in server.disallowed_tools return True - def filter_allowed_params( + def validate_allowed_params( self, tool_name: str, arguments: Dict[str, Any], server: MCPServer - ) -> Dict[str, Any]: + ) -> None: """ Filter arguments to only include allowed parameters for the given tool. @@ -626,7 +626,7 @@ class MCPServerManager: # If no allowed_params configured, return all arguments if not server.allowed_params: - return arguments + return # Get the unprefixed tool name to match against config unprefixed_tool_name, _ = get_server_name_prefix_tool_mcp(tool_name) @@ -638,7 +638,7 @@ class MCPServerManager: # If this tool doesn't have allowed_params specified, allow all params if allowed_params_list is None: - return arguments + return None # Filter arguments to only include allowed parameters disallowed_params = [ @@ -655,8 +655,6 @@ class MCPServerManager: }, ) - return {k: v for k, v in arguments.items() if k in allowed_params_list} - async def check_tool_permission_for_key_team( self, tool_name: str, @@ -725,14 +723,11 @@ class MCPServerManager: ) ## filter parameters based on allowed_params configuration - filtered_arguments = self.filter_allowed_params( + self.validate_allowed_params( tool_name=name, arguments=arguments, server=server, ) - # Update arguments with filtered version - arguments.clear() - arguments.update(filtered_arguments) pre_hook_kwargs = { "name": name, From 2b0df22dc549f8c394ea7864285569122e302b75 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Wed, 8 Oct 2025 17:07:46 -0700 Subject: [PATCH 23/48] next routing, feature flagged via sidebar --- .../app/(dashboard)/api-reference/page.tsx | 17 + .../app/(dashboard)/components/Sidebar2.tsx | 319 +++++---- .../components/SidebarProvider.tsx | 29 + .../components/modals/CreateUserModal.tsx | 2 +- .../experimental/api-playground/page.tsx | 12 + .../(dashboard)/experimental/budgets/page.tsx | 12 + .../(dashboard)/experimental/caching/page.tsx | 20 + .../experimental/old-usage/page.tsx | 23 + .../(dashboard)/experimental/prompts/page.tsx | 12 + .../experimental/tag-management/page.tsx | 12 + .../src/app/(dashboard)/guardrails/page.tsx | 12 + .../app/(dashboard)/hooks/useAuthorized.ts | 5 +- .../src/app/(dashboard)/logs/page.tsx | 28 + .../src/app/(dashboard)/model-hub/page.tsx | 12 + .../(dashboard)/models-and-endpoints/page.tsx | 29 + .../app/(dashboard)/organizations/page.tsx | 34 + .../settings/admin-settings/page.tsx | 29 + .../settings/logging-and-alerts/page.tsx | 12 + .../settings/router-settings/page.tsx | 12 + .../(dashboard)/settings/ui-theme/page.tsx | 12 + .../src/app/(dashboard)/teams/page.tsx | 35 + .../src/app/(dashboard)/test-key/page.tsx | 20 + .../(dashboard)/tools/mcp-servers/page.tsx | 19 + .../(dashboard)/tools/vector-stores/page.tsx | 12 + .../src/app/(dashboard)/usage/page.tsx | 22 + .../src/app/(dashboard)/users/page.tsx | 31 + .../VirtualKeysTable/VirtualKeysTable.tsx | 2 +- .../virtual-keys/hooks/useTeams.tsx | 4 +- ui/litellm-dashboard/src/app/page.tsx | 619 ++++++++++-------- 29 files changed, 1010 insertions(+), 397 deletions(-) create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/api-reference/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/experimental/api-playground/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/experimental/budgets/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/experimental/caching/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/experimental/old-usage/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/experimental/prompts/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/experimental/tag-management/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/guardrails/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/model-hub/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/organizations/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/settings/admin-settings/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/settings/logging-and-alerts/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/settings/router-settings/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/settings/ui-theme/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/teams/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/test-key/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/tools/mcp-servers/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/tools/vector-stores/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx create mode 100644 ui/litellm-dashboard/src/app/(dashboard)/users/page.tsx diff --git a/ui/litellm-dashboard/src/app/(dashboard)/api-reference/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/api-reference/page.tsx new file mode 100644 index 0000000000..265a6d8195 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/api-reference/page.tsx @@ -0,0 +1,17 @@ +"use client"; + +import APIRef from "@/components/api_ref"; +import { useState } from "react"; + +interface ProxySettings { + PROXY_BASE_URL: string; + PROXY_LOGOUT_URL: string; +} + +const APIReferencePage = () => { + const [proxySettings, setProxySettings] = useState({ PROXY_BASE_URL: "", PROXY_LOGOUT_URL: "" }); + + return ; +}; + +export default APIReferencePage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx index 2ebfbc5d4f..96bb9b5a4b 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx @@ -1,5 +1,6 @@ -import { Layout, Menu } from "antd"; -import { usePathname } from "next/navigation"; +"use client"; + +import { Layout, Menu, ConfigProvider } from "antd"; import { KeyOutlined, PlayCircleOutlined, @@ -18,126 +19,191 @@ import { ExperimentOutlined, ToolOutlined, TagsOutlined, - BgColorsOutlined, } from "@ant-design/icons"; -import { ConfigProvider } from "antd"; -import useFeatureFlags from "@/hooks/useFeatureFlags"; +// import { +// all_admin_roles, +// rolesWithWriteAccess, +// internalUserRoles, +// isAdminRole, +// } from "../utils/roles"; +// import UsageIndicator from "./usage_indicator"; +import * as React from "react"; +import { useRouter, usePathname } from "next/navigation"; import { all_admin_roles, internalUserRoles, isAdminRole, rolesWithWriteAccess } from "@/utils/roles"; import UsageIndicator from "@/components/usage_indicator"; -import React from "react"; + const { Sider } = Layout; +// -------- Types -------- interface SidebarProps { accessToken: string | null; - setPage: (page: string) => void; userRole: string; + /** Fallback selection id (legacy), used if path can't be matched */ defaultSelectedKey: string; collapsed?: boolean; } -interface MenuItem { +interface MenuItemCfg { key: string; - page: string; + page: string; // legacy id; we map this to a path below label: string; roles?: string[]; - children?: MenuItem[]; + children?: MenuItemCfg[]; icon?: React.ReactNode; } -/** ---- BASE URL HELPERS ---- */ -function normalizeBasePrefix(raw: string | undefined | null): string { - const trimmed = (raw ?? "").trim(); - if (!trimmed) return ""; // no base - const core = trimmed.replace(/^\/+/, "").replace(/\/+$/, ""); - return core ? `/${core}` : ""; -} -const BASE_PREFIX = normalizeBasePrefix(process.env.NEXT_PUBLIC_BASE_URL); +/** ---------- Base URL helpers ---------- */ +/** + * Normalizes NEXT_PUBLIC_BASE_URL to either "/" or "/ui/" (always with a trailing slash). + * Supported env values: "" or "ui/". + */ +const getBasePath = () => { + const raw = process.env.NEXT_PUBLIC_BASE_URL ?? ""; + const trimmed = raw.replace(/^\/+|\/+$/g, ""); // strip leading/trailing slashes + return trimmed ? `/${trimmed}/` : "/"; // ensure trailing slash +}; -/** Build an absolute path under the configured base. */ -function withBase(path: string): string { - // path can be "/virtual-keys" or "/?page=..." - const p = path.startsWith("/") ? path : `/${path}`; - return `${BASE_PREFIX}${p}` || p; -} +/** Map legacy `page` ids to real app routes (relative, no leading slash). */ +const routeFor = (slug: string): string => { + switch (slug) { + // top level + case "api-keys": + return "virtual-keys"; + case "llm-playground": + return "test-key"; + case "models": + return "models-and-endpoints"; + case "new_usage": + return "usage"; + case "teams": + return "teams"; + case "organizations": + return "organizations"; + case "users": + return "users"; + case "api_ref": + return "api-reference"; + case "model-hub-table": + // If you intend the newer in-dashboard page, use "model-hub". + return "model-hub"; + case "logs": + return "logs"; + case "guardrails": + return "guardrails"; -/** History-based navigation to prevent hard reloads / suspense flashes */ -function softNavigate(url: string, replace = false) { - if (typeof window === "undefined") return; - if (replace) window.history.replaceState(null, "", url); - else window.history.pushState(null, "", url); -} -/** -------------------------------- */ + // tools + case "mcp-servers": + return "tools/mcp-servers"; + case "vector-stores": + return "tools/vector-stores"; -const Sidebar2: React.FC = ({ - accessToken, - setPage, - userRole, - defaultSelectedKey, - collapsed = false, -}) => { - const pathname = usePathname(); - const { refactoredUIFlag } = useFeatureFlags(); + // experimental + case "caching": + return "experimental/caching"; + case "prompts": + return "experimental/prompts"; + case "budgets": + return "experimental/budgets"; + case "transform-request": + return "experimental/api-playground"; + case "tag-management": + return "experimental/tag-management"; + case "usage": // "Old Usage" + return "experimental/old-usage"; - const menuItems: MenuItem[] = [ - { key: "1", page: "api-keys", label: "Virtual Keys", icon: }, + // settings + case "general-settings": + return "settings/router-settings"; + case "settings": // "Logging & Alerts" + return "settings/logging-and-alerts"; + case "admin-panel": + return "settings/admin-settings"; + case "ui-theme": + return "settings/ui-theme"; + + default: + // treat as already a relative path + return slug.replace(/^\/+/, ""); + } +}; + +/** Prefix base path ("/" or "/ui/") */ +const toHref = (slugOrPath: string) => { + const base = getBasePath(); // "/" or "/ui/" + const rel = routeFor(slugOrPath).replace(/^\/+|\/+$/g, ""); + return `${base}${rel}`; +}; + +const Sidebar2: React.FC = ({ accessToken, userRole, defaultSelectedKey, collapsed = false }) => { + const router = useRouter(); + const pathname = usePathname() || "/"; + + // ----- Menu config (unchanged labels/icons; same appearance) ----- + const menuItems: MenuItemCfg[] = [ + { key: "1", page: "api-keys", label: "Virtual Keys", icon: }, { key: "3", page: "llm-playground", label: "Test Key", - icon: , + icon: , roles: rolesWithWriteAccess, }, { key: "2", page: "models", label: "Models + Endpoints", - icon: , + icon: , roles: rolesWithWriteAccess, }, { key: "12", page: "new_usage", label: "Usage", - icon: , + icon: , roles: [...all_admin_roles, ...internalUserRoles], }, - { key: "6", page: "teams", label: "Teams", icon: }, + { key: "6", page: "teams", label: "Teams", icon: }, { key: "17", page: "organizations", label: "Organizations", - icon: , + icon: , roles: all_admin_roles, }, { key: "5", page: "users", label: "Internal Users", - icon: , + icon: , roles: all_admin_roles, }, - { key: "14", page: "api_ref", label: "API Reference", icon: }, - { key: "16", page: "model-hub-table", label: "Model Hub", icon: }, - { key: "15", page: "logs", label: "Logs", icon: }, + { key: "14", page: "api_ref", label: "API Reference", icon: }, + { + key: "16", + page: "model-hub-table", + label: "Model Hub", + icon: , + }, + { key: "15", page: "logs", label: "Logs", icon: }, { key: "11", page: "guardrails", label: "Guardrails", - icon: , + icon: , roles: all_admin_roles, }, { key: "26", page: "tools", label: "Tools", - icon: , + icon: , children: [ - { key: "18", page: "mcp-servers", label: "MCP Servers", icon: }, + { key: "18", page: "mcp-servers", label: "MCP Servers", icon: }, { key: "21", page: "vector-stores", label: "Vector Stores", - icon: , + icon: , roles: all_admin_roles, }, ], @@ -146,136 +212,135 @@ const Sidebar2: React.FC = ({ key: "experimental", page: "experimental", label: "Experimental", - icon: , + icon: , children: [ { key: "9", page: "caching", label: "Caching", - icon: , + icon: , roles: all_admin_roles, }, { key: "25", page: "prompts", label: "Prompts", - icon: , + icon: , roles: all_admin_roles, }, { key: "10", page: "budgets", label: "Budgets", - icon: , + icon: , roles: all_admin_roles, }, { key: "20", page: "transform-request", label: "API Playground", - icon: , + icon: , roles: [...all_admin_roles, ...internalUserRoles], }, { key: "19", page: "tag-management", label: "Tag Management", - icon: , + icon: , roles: all_admin_roles, }, - { key: "4", page: "usage", label: "Old Usage", icon: }, + { key: "4", page: "usage", label: "Old Usage", icon: }, ], }, { key: "settings", page: "settings", label: "Settings", - icon: , + icon: , roles: all_admin_roles, children: [ { key: "11", page: "general-settings", label: "Router Settings", - icon: , + icon: , roles: all_admin_roles, }, { key: "8", page: "settings", label: "Logging & Alerts", - icon: , + icon: , roles: all_admin_roles, }, { key: "13", page: "admin-panel", label: "Admin Settings", - icon: , + icon: , roles: all_admin_roles, }, { key: "14", page: "ui-theme", label: "UI Theme", - icon: , + icon: , roles: all_admin_roles, }, ], }, ]; - const findMenuItemKey = (page: string): string => { - const topLevelItem = menuItems.find((item) => item.page === page); - if (topLevelItem) return topLevelItem.key; - for (const item of menuItems) { + // ----- Filter by role without mutating originals ----- + const filteredMenuItems = React.useMemo(() => { + return menuItems + .filter((item) => !item.roles || item.roles.includes(userRole)) + .map((item) => ({ + ...item, + children: item.children ? item.children.filter((c) => !c.roles || c.roles.includes(userRole)) : undefined, + })); + }, [userRole]); + + // ----- Compute selected key from current path ----- + const selectedMenuKey = React.useMemo(() => { + const base = getBasePath(); + // strip base prefix and leading slash -> "virtual-keys", "tools/mcp-servers", etc. + const rel = pathname.startsWith(base) ? pathname.slice(base.length) : pathname.replace(/^\/+/, ""); + const relLower = rel.toLowerCase(); + + const matchesPath = (slug: string) => { + const route = routeFor(slug).toLowerCase(); + return relLower === route || relLower.startsWith(`${route}/`); + }; + + // search top-level + for (const item of filteredMenuItems) { + if (!item.children && matchesPath(item.page)) return item.key; if (item.children) { - const childItem = item.children.find((child) => child.page === page); - if (childItem) return childItem.key; + for (const child of item.children) { + if (matchesPath(child.page)) return child.key; + } } } + + // fallback to legacy defaultSelectedKey mapping + const fallback = filteredMenuItems.find((i) => i.page === defaultSelectedKey)?.key; + if (fallback) return fallback; + + for (const item of filteredMenuItems) { + if (item.children?.some((c) => c.page === defaultSelectedKey)) { + const child = item.children.find((c) => c.page === defaultSelectedKey)!; + return child.key; + } + } + return "1"; - }; + }, [pathname, filteredMenuItems, defaultSelectedKey]); - const selectedMenuKey = findMenuItemKey(defaultSelectedKey); - - const filteredMenuItems = menuItems.filter((item) => { - const hasParentAccess = !item.roles || item.roles.includes(userRole); - if (!hasParentAccess) return false; - if (item.children) { - item.children = item.children.filter((child) => !child.roles || child.roles.includes(userRole)); - } - return true; - }); - - // Helper: update /?page=... under the configured base, WITHOUT triggering App Router nav - const pushToRootWithPage = (page: string, useReplace = false) => { - const params = new URLSearchParams(); - params.set("page", page); - const url = withBase(`/?${params.toString()}`); - softNavigate(url, useReplace); - }; - - const navigateToPage = (page: string) => { - if (page === "api-keys") { - if (refactoredUIFlag) { - // vanity URL, keep SPA alive - softNavigate(withBase("/virtual-keys")); - return; // don't call setPage to keep parity, UI already shows api-keys by default - } - pushToRootWithPage(page); - setPage(page); - return; - } - - if (refactoredUIFlag) { - const onVirtualKeys = - typeof window !== "undefined" && window.location.pathname.startsWith(withBase("/virtual-keys")); - pushToRootWithPage(page, onVirtualKeys); - } else { - pushToRootWithPage(page); - } - setPage(page); + // ----- Navigation ----- + const goTo = (slug: string) => { + const href = toHref(slug); + router.push(href); }; return ( @@ -287,16 +352,32 @@ const Sidebar2: React.FC = ({ collapsedWidth={80} collapsible trigger={null} - style={{ transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)", position: "relative" }} + style={{ + transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)", + position: "relative", + }} > - + ({ key: item.key, icon: item.icon, @@ -305,9 +386,9 @@ const Sidebar2: React.FC = ({ key: child.key, icon: child.icon, label: child.label, - onClick: () => navigateToPage(child.page), + onClick: () => goTo(child.page), })), - onClick: !item.children ? () => navigateToPage(item.page) : undefined, + onClick: !item.children ? () => goTo(item.page) : undefined, }))} /> diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx new file mode 100644 index 0000000000..cb7f0f1a32 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/SidebarProvider.tsx @@ -0,0 +1,29 @@ +import useFeatureFlags from "@/hooks/useFeatureFlags"; +import Sidebar from "@/components/leftnav"; +import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +interface SidebarProviderProps { + defaultSelectedKey: string; + setPage: (newPage: string) => void; + sidebarCollapsed: boolean; +} + +const SidebarProvider = ({ setPage, defaultSelectedKey, sidebarCollapsed }: SidebarProviderProps) => { + const { refactoredUIFlag } = useFeatureFlags(); + const { accessToken, userRole } = useAuthorized(); + + return refactoredUIFlag ? ( + + ) : ( + + ); +}; + +export default SidebarProvider; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx index fce7f69192..9eb4191be1 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx @@ -70,7 +70,7 @@ const CreateUserModal: React.FC = ({ possibleUIRoles, onUs const [isInvitationLinkModalVisible, setIsInvitationLinkModalVisible] = useState(false); const [invitationLinkData, setInvitationLinkData] = useState(null); const [baseUrl, setBaseUrl] = useState(null); - const teams = useTeams(); + const { teams } = useTeams(); // get all models useEffect(() => { diff --git a/ui/litellm-dashboard/src/app/(dashboard)/experimental/api-playground/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/experimental/api-playground/page.tsx new file mode 100644 index 0000000000..0948b7626d --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/experimental/api-playground/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import TransformRequestPanel from "@/components/transform_request"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const APIPlaygroundPage = () => { + const { accessToken } = useAuthorized(); + + return ; +}; + +export default APIPlaygroundPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/experimental/budgets/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/experimental/budgets/page.tsx new file mode 100644 index 0000000000..e49bd342c0 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/experimental/budgets/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import BudgetPanel from "@/components/budgets/budget_panel"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const BudgetsPage = () => { + const { accessToken } = useAuthorized(); + + return ; +}; + +export default BudgetsPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/experimental/caching/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/experimental/caching/page.tsx new file mode 100644 index 0000000000..6dcbcdc697 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/experimental/caching/page.tsx @@ -0,0 +1,20 @@ +"use client"; + +import CacheDashboard from "@/components/cache_dashboard"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const CachingPage = () => { + const { token, accessToken, userRole, userId, premiumUser } = useAuthorized(); + + return ( + + ); +}; + +export default CachingPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/experimental/old-usage/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/experimental/old-usage/page.tsx new file mode 100644 index 0000000000..9521f4f69f --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/experimental/old-usage/page.tsx @@ -0,0 +1,23 @@ +"use client"; + +import Usage from "@/components/usage"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import { useState } from "react"; + +const OldUsagePage = () => { + const { accessToken, token, userRole, userId, premiumUser } = useAuthorized(); + const [keys, setKeys] = useState([]); + + return ( + + ); +}; + +export default OldUsagePage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/experimental/prompts/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/experimental/prompts/page.tsx new file mode 100644 index 0000000000..0836a03b7e --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/experimental/prompts/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import PromptsPanel from "@/components/prompts"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const PromptsPage = () => { + const { accessToken } = useAuthorized(); + + return ; +}; + +export default PromptsPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/experimental/tag-management/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/experimental/tag-management/page.tsx new file mode 100644 index 0000000000..0e686387b3 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/experimental/tag-management/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import TagManagement from "@/components/tag_management"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const TagManagementPage = () => { + const { accessToken, userId, userRole } = useAuthorized(); + + return ; +}; + +export default TagManagementPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/page.tsx new file mode 100644 index 0000000000..50cee215eb --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import GuardrailsPanel from "@/components/guardrails"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const GuardrailsPage = () => { + const { accessToken } = useAuthorized(); + + return ; +}; + +export default GuardrailsPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts index 74c0476f19..ebb0c34592 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts @@ -1,9 +1,9 @@ "use client"; import { useEffect, useMemo } from "react"; -import { getCookie, clearTokenCookies } from "@/utils/cookieUtils"; import { useRouter } from "next/navigation"; import { jwtDecode } from "jwt-decode"; +import { clearTokenCookies, getCookie } from "@/utils/cookieUtils"; const useAuthorized = () => { const router = useRouter(); @@ -31,10 +31,13 @@ const useAuthorized = () => { }, [token, router]); return { + token: token, accessToken: decoded?.key ?? null, userId: decoded?.user_id ?? null, userRole: decoded?.user_role ?? null, premiumUser: decoded?.premium_user ?? null, + disabledPersonalKeyCreation: decoded?.disabled_non_admin_personal_key_creation ?? null, + showSSOBanner: decoded?.login_method === "username_password" ?? false, }; }; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx new file mode 100644 index 0000000000..4c6e7acc19 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx @@ -0,0 +1,28 @@ +"use client"; + +import SpendLogsTable from "@/components/view_logs"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; + +const LogsPage = () => { + const { accessToken, token, userRole, userId, premiumUser } = useAuthorized(); + const { teams } = useTeams(); + + const queryClient = new QueryClient(); + + return ( + + + + ); +}; + +export default LogsPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/model-hub/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/model-hub/page.tsx new file mode 100644 index 0000000000..86967b660f --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/model-hub/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import ModelHubTable from "@/components/model_hub_table"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const ModelHubPage = () => { + const { accessToken, premiumUser, userRole } = useAuthorized(); + + return ; +}; + +export default ModelHubPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx new file mode 100644 index 0000000000..2c523ea403 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx @@ -0,0 +1,29 @@ +"use client"; + +import ModelDashboard from "@/components/templates/model_dashboard"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import { useState } from "react"; + +const ModelsAndEndpointsPage = () => { + const { token, accessToken, userRole, userId, premiumUser } = useAuthorized(); + const [keys, setKeys] = useState([]); + + const { teams } = useTeams(); + + return ( + {}} + premiumUser={premiumUser} + teams={teams} + /> + ); +}; + +export default ModelsAndEndpointsPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/organizations/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/organizations/page.tsx new file mode 100644 index 0000000000..6112fac316 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/organizations/page.tsx @@ -0,0 +1,34 @@ +"use client"; + +import Organizations, { fetchOrganizations } from "@/components/organizations"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import { useEffect, useState } from "react"; +import { Organization } from "@/components/networking"; +import { fetchUserModels } from "@/components/organisms/create_key_button"; + +const OrganizationsPage = () => { + const { userId: userID, accessToken, userRole, premiumUser } = useAuthorized(); + const [organizations, setOrganizations] = useState([]); + const [userModels, setUserModels] = useState([]); + + useEffect(() => { + fetchOrganizations(accessToken, setOrganizations).then(() => {}); + }, [accessToken]); + + useEffect(() => { + fetchUserModels(userID, userRole, accessToken, setUserModels).then(() => {}); + }, [userID, userRole, accessToken]); + + return ( + + ); +}; + +export default OrganizationsPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/settings/admin-settings/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/settings/admin-settings/page.tsx new file mode 100644 index 0000000000..a851ce766a --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/settings/admin-settings/page.tsx @@ -0,0 +1,29 @@ +"use client"; + +import AdminPanel from "@/components/admins"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import { useState } from "react"; +import { Team } from "@/components/key_team_helpers/key_list"; +import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; + +const AdminSettings = () => { + const { teams, setTeams } = useTeams(); + + const [searchParams, setSearchParams] = useState(() => + typeof window === "undefined" ? new URLSearchParams() : new URLSearchParams(window.location.search), + ); + const { accessToken, userId, premiumUser, showSSOBanner } = useAuthorized(); + + return ( + + ); +}; + +export default AdminSettings; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/settings/logging-and-alerts/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/settings/logging-and-alerts/page.tsx new file mode 100644 index 0000000000..b13e3c42f9 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/settings/logging-and-alerts/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import Settings from "@/components/settings"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const LoggingAndAlertsPage = () => { + const { accessToken, userRole, userId, premiumUser } = useAuthorized(); + + return ; +}; + +export default LoggingAndAlertsPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/settings/router-settings/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/settings/router-settings/page.tsx new file mode 100644 index 0000000000..2b5463cd81 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/settings/router-settings/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import GeneralSettings from "@/components/general_settings"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const RouterSettingsPage = () => { + const { accessToken, userRole, userId } = useAuthorized(); + + return ; +}; + +export default RouterSettingsPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/settings/ui-theme/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/settings/ui-theme/page.tsx new file mode 100644 index 0000000000..c6826cf11d --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/settings/ui-theme/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import UIThemeSettings from "@/components/ui_theme_settings"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const UIThemePage = () => { + const { userId, userRole, accessToken } = useAuthorized(); + + return ; +}; + +export default UIThemePage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/teams/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/teams/page.tsx new file mode 100644 index 0000000000..f1f0460d53 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/teams/page.tsx @@ -0,0 +1,35 @@ +"use client"; + +import Teams from "@/components/teams"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import { useEffect, useState } from "react"; +import { Organization } from "@/components/networking"; +import { fetchOrganizations } from "@/components/organizations"; + +const TeamsPage = () => { + const { accessToken, userId, userRole } = useAuthorized(); + const { teams, setTeams } = useTeams(); + const [searchParams, setSearchParams] = useState(() => + typeof window === "undefined" ? new URLSearchParams() : new URLSearchParams(window.location.search), + ); + const [organizations, setOrganizations] = useState([]); + + useEffect(() => { + fetchOrganizations(accessToken, setOrganizations).then(() => {}); + }, [accessToken]); + + return ( + + ); +}; + +export default TeamsPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/test-key/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/test-key/page.tsx new file mode 100644 index 0000000000..6324f3c555 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/test-key/page.tsx @@ -0,0 +1,20 @@ +"use client"; + +import ChatUI from "@/components/chat_ui/ChatUI"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const TestKeyPage = () => { + const { token, accessToken, userRole, userId, disabledPersonalKeyCreation } = useAuthorized(); + + return ( + + ); +}; + +export default TestKeyPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/tools/mcp-servers/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/tools/mcp-servers/page.tsx new file mode 100644 index 0000000000..1bea7ac74a --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/tools/mcp-servers/page.tsx @@ -0,0 +1,19 @@ +"use client"; + +import { MCPServers } from "@/components/mcp_tools"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; + +const MCPServersPage = () => { + const { accessToken, userRole, userId } = useAuthorized(); + + const queryClient = new QueryClient(); + + return ( + + + + ); +}; + +export default MCPServersPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/tools/vector-stores/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/tools/vector-stores/page.tsx new file mode 100644 index 0000000000..8516a0faa1 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/tools/vector-stores/page.tsx @@ -0,0 +1,12 @@ +"use client"; + +import VectorStoreManagement from "@/components/vector_store_management"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; + +const VectorStoresPage = () => { + const { accessToken, userId, userRole } = useAuthorized(); + + return ; +}; + +export default VectorStoresPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx new file mode 100644 index 0000000000..c20b13c67d --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx @@ -0,0 +1,22 @@ +"use client"; + +import NewUsagePage from "@/components/new_usage"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; + +const UsagePage = () => { + const { accessToken, userRole, userId, premiumUser } = useAuthorized(); + const { teams } = useTeams(); + + return ( + + ); +}; + +export default UsagePage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/users/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/users/page.tsx new file mode 100644 index 0000000000..dd53166574 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/users/page.tsx @@ -0,0 +1,31 @@ +"use client"; + +import ViewUserDashboard from "@/components/view_users"; +import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import { useState } from "react"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; + +const UsersPage = () => { + const { accessToken, userRole, userId, token } = useAuthorized(); + const [keys, setKeys] = useState([]); + + const { teams } = useTeams(); + const queryClient = new QueryClient(); + + return ( + + + + ); +}; + +export default UsersPage; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx index 015d8c43f9..180d3336f1 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx @@ -61,7 +61,7 @@ const VirtualKeysTable = ({ setAccessToken, }: AllKeysTableProps) => { const { userId: userID, userRole, accessToken, premiumUser } = useAuthorized(); - const teams = useTeams(); + const { teams } = useTeams(); const [selectedKeyId, setSelectedKeyId] = useState(null); const [userList, setUserList] = useState([]); const [sorting, setSorting] = React.useState(() => { diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx index 5f04f8a28a..7ba7a2fea5 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx @@ -4,7 +4,7 @@ import { Team } from "@/components/key_team_helpers/key_list"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; const useTeams = () => { - const [teams, setTeams] = useState([]); + const [teams, setTeams] = useState([]); const { accessToken, userId: userID, userRole } = useAuthorized(); useEffect(() => { @@ -14,7 +14,7 @@ const useTeams = () => { })(); }, [accessToken, userID, userRole]); - return teams; + return { teams, setTeams }; }; export default useTeams; diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index f83972e0c1..ceee52399e 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -1,6 +1,7 @@ "use client"; -import React, { useEffect, useMemo, useState } from "react"; +import React, { Suspense, useEffect, useState } from "react"; +import { useSearchParams } from "next/navigation"; import { jwtDecode } from "jwt-decode"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { Team } from "@/components/key_team_helpers/key_list"; @@ -22,6 +23,7 @@ import ModelHubTable from "@/components/model_hub_table"; import NewUsagePage from "@/components/new_usage"; import APIRef from "@/components/api_ref"; import ChatUI from "@/components/chat_ui/ChatUI"; +import Sidebar from "@/components/leftnav"; import Usage from "@/components/usage"; import CacheDashboard from "@/components/cache_dashboard"; import { getUiConfig, proxyBaseUrl, setGlobalLitellmHeaderName } from "@/components/networking"; @@ -37,35 +39,50 @@ import VectorStoreManagement from "@/components/vector_store_management"; import UIThemeSettings from "@/components/ui_theme_settings"; import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; import { cx } from "@/lib/cva.config"; -import Sidebar2 from "@/app/(dashboard)/components/Sidebar2"; - -/** ---- BASE URL HELPERS ---- */ -function normalizeBasePrefix(raw: string | undefined | null): string { - const trimmed = (raw ?? "").trim(); - if (!trimmed) return ""; - const core = trimmed.replace(/^\/+/, "").replace(/\/+$/, ""); - return core ? `/${core}` : ""; -} -const BASE_PREFIX = normalizeBasePrefix(process.env.NEXT_PUBLIC_BASE_URL); -function withBase(path: string): string { - const p = path.startsWith("/") ? path : `/${path}`; - return `${BASE_PREFIX}${p}` || p; -} -/** -------------------------------- */ +import useFeatureFlags from "@/hooks/useFeatureFlags"; +import SidebarProvider from "@/app/(dashboard)/components/SidebarProvider"; function getCookie(name: string) { - if (typeof document === "undefined") return null; - const cookieValue = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); - return cookieValue ? cookieValue.split("=")[1] : null; + // Safer cookie read + decoding; handles '=' inside values + const match = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); + if (!match) return null; + const value = match.slice(name.length + 1); + try { + return decodeURIComponent(value); + } catch { + return value; + } +} + +function deleteCookie(name: string, path = "/") { + // Best-effort client-side clear (works for non-HttpOnly cookies without Domain) + document.cookie = `${name}=; Max-Age=0; Path=${path}`; +} + +function isJwtExpired(token: string): boolean { + try { + const decoded: any = jwtDecode(token); + if (decoded && typeof decoded.exp === "number") { + return decoded.exp * 1000 <= Date.now(); + } + return false; + } catch { + // If we can't decode, treat as invalid/expired + return true; + } } function formatUserRole(userRole: string) { - if (!userRole) return "Undefined Role"; + if (!userRole) { + return "Undefined Role"; + } switch (userRole.toLowerCase()) { case "app_owner": + return "App Owner"; case "demo_app_owner": return "App Owner"; case "app_admin": + return "Admin"; case "proxy_admin": return "Admin"; case "proxy_admin_viewer": @@ -75,7 +92,7 @@ function formatUserRole(userRole: string) { case "internal_user": return "Internal User"; case "internal_user_viewer": - case "internal_viewer": + case "internal_viewer": // TODO:remove if deprecated return "Internal Viewer"; case "app_user": return "App User"; @@ -95,6 +112,7 @@ function LoadingScreen() { return (
🚅 LiteLLM
+
Loading... @@ -103,16 +121,6 @@ function LoadingScreen() { ); } -/** Derive the app "page" from the URL without triggering App Router navigations */ -function getPageFromLocation(loc: Location): string { - const sp = new URLSearchParams(loc.search); - const p = sp.get("page"); - if (p) return p; - // vanity route for refactored UI - if (loc.pathname.endsWith("/virtual-keys")) return "api-keys"; - return "api-keys"; -} - export default function CreateKeyPage() { const [userRole, setUserRole] = useState(""); const [premiumUser, setPremiumUser] = useState(false); @@ -122,98 +130,156 @@ export default function CreateKeyPage() { const [keys, setKeys] = useState([]); const [organizations, setOrganizations] = useState([]); const [userModels, setUserModels] = useState([]); - const [proxySettings, setProxySettings] = useState({ PROXY_BASE_URL: "", PROXY_LOGOUT_URL: "" }); + const [proxySettings, setProxySettings] = useState({ + PROXY_BASE_URL: "", + PROXY_LOGOUT_URL: "", + }); + const [showSSOBanner, setShowSSOBanner] = useState(true); - - // Stable local mirror of URLSearchParams (no suspense, no flashes) - const [searchParams, setSearchParams] = useState(() => - typeof window === "undefined" ? new URLSearchParams() : new URLSearchParams(window.location.search), - ); - const invitation_id = useMemo(() => searchParams.get("invitation_id"), [searchParams]); - - // Local page state (drives UI) - const [page, setPage] = useState(() => - typeof window === "undefined" ? "api-keys" : getPageFromLocation(window.location), - ); - - // Keep history/back/forward in sync with UI - useEffect(() => { - const onPop = () => { - if (typeof window === "undefined") return; - setSearchParams(new URLSearchParams(window.location.search)); - setPage(getPageFromLocation(window.location)); - }; - window.addEventListener("popstate", onPop); - return () => window.removeEventListener("popstate", onPop); - }, []); - - // Update URL without triggering App Router reload/suspense - const updatePage = (newPage: string) => { - if (typeof window === "undefined") return; - // 1) instant UI update - setPage(newPage); - // 2) URL update under base prefix - const sp = new URLSearchParams(window.location.search); - sp.set("page", newPage); - const url = withBase(`/?${sp.toString()}`); - window.history.pushState(null, "", url); - // 3) keep our local mirror in sync - setSearchParams(new URLSearchParams(sp)); - }; - + const searchParams = useSearchParams()!; + const [modelData, setModelData] = useState({ data: [] }); const [token, setToken] = useState(null); const [createClicked, setCreateClicked] = useState(false); const [authLoading, setAuthLoading] = useState(true); const [userID, setUserID] = useState(null); + const { refactoredUIFlag } = useFeatureFlags(); + + const invitation_id = searchParams.get("invitation_id"); + + // Get page from URL, default to 'api-keys' if not present + const [page, setPage] = useState(() => { + return searchParams.get("page") || "api-keys"; + }); + + // Custom setPage function that updates URL + const updatePage = (newPage: string) => { + // Update URL without full page reload + const newSearchParams = new URLSearchParams(searchParams); + newSearchParams.set("page", newPage); + + // Use Next.js router to update URL + window.history.pushState(null, "", `?${newSearchParams.toString()}`); + + setPage(newPage); + }; const [accessToken, setAccessToken] = useState(null); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); - const toggleSidebar = () => setSidebarCollapsed((v) => !v); + const toggleSidebar = () => { + setSidebarCollapsed(!sidebarCollapsed); + }; const addKey = (data: any) => { setKeys((prevData) => (prevData ? [...prevData, data] : [data])); - setCreateClicked((v) => !v); + setCreateClicked(() => !createClicked); }; const redirectToLogin = authLoading === false && token === null && invitation_id === null; useEffect(() => { - const token = getCookie("token"); - getUiConfig().then(() => { - setToken(token); - setAuthLoading(false); - }); + let cancelled = false; + + (async () => { + try { + await getUiConfig(); // ensures proxyBaseUrl etc. are ready + } catch { + // proceed regardless; we still need to decide auth state + } + + if (cancelled) return; + + const raw = getCookie("token"); + const valid = raw && !isJwtExpired(raw) ? raw : null; + + // If token exists but is invalid/expired, clear it so downstream code + // doesn't keep trying to use it and cause redirect spasms. + if (raw && !valid) { + deleteCookie("token", "/"); + } + + if (!cancelled) { + setToken(valid); + setAuthLoading(false); + } + })(); + + return () => { + cancelled = true; + }; }, []); useEffect(() => { if (redirectToLogin) { - window.location.href = (proxyBaseUrl || "") + "/sso/key/generate"; + // Replace instead of assigning to avoid back-button loops + const dest = (proxyBaseUrl || "") + "/sso/key/generate"; + window.location.replace(dest); } }, [redirectToLogin]); useEffect(() => { - if (!token) return; - const decoded = jwtDecode(token) as { [key: string]: any }; - if (!decoded) return; + if (!token) { + return; + } - setAccessToken(decoded.key); - setDisabledPersonalKeyCreation(decoded.disabled_non_admin_personal_key_creation); + // Defensive: re-check expiry in case cookie changed after mount + if (isJwtExpired(token)) { + deleteCookie("token", "/"); + setToken(null); + return; + } - if (decoded.user_role) { - const formattedUserRole = formatUserRole(decoded.user_role); - setUserRole(formattedUserRole); - if (formattedUserRole === "Admin Viewer") setPage("usage"); + let decoded: any = null; + try { + decoded = jwtDecode(token); + } catch { + // Malformed token → treat as unauthenticated + deleteCookie("token", "/"); + setToken(null); + return; + } + + if (decoded) { + // set accessToken + setAccessToken(decoded.key); + + setDisabledPersonalKeyCreation(decoded.disabled_non_admin_personal_key_creation); + + // check if userRole is defined + if (decoded.user_role) { + const formattedUserRole = formatUserRole(decoded.user_role); + setUserRole(formattedUserRole); + if (formattedUserRole == "Admin Viewer") { + setPage("usage"); + } + } + + if (decoded.user_email) { + setUserEmail(decoded.user_email); + } + + if (decoded.login_method) { + setShowSSOBanner(decoded.login_method == "username_password" ? true : false); + } + + if (decoded.premium_user) { + setPremiumUser(decoded.premium_user); + } + + if (decoded.auth_header_name) { + setGlobalLitellmHeaderName(decoded.auth_header_name); + } + + if (decoded.user_id) { + setUserID(decoded.user_id); + } } - if (decoded.user_email) setUserEmail(decoded.user_email); - if (decoded.login_method) setShowSSOBanner(decoded.login_method === "username_password"); - if (decoded.premium_user) setPremiumUser(decoded.premium_user); - if (decoded.auth_header_name) setGlobalLitellmHeaderName(decoded.auth_header_name); - if (decoded.user_id) setUserID(decoded.user_id); }, [token]); useEffect(() => { if (accessToken && userID && userRole) { fetchUserModels(userID, userRole, accessToken, setUserModels); + } + if (accessToken && userID && userRole) { fetchTeams(accessToken, userID, userRole, null, setTeams); } if (accessToken) { @@ -226,194 +292,201 @@ export default function CreateKeyPage() { } return ( - - - {invitation_id ? ( - - ) : ( -
- }> + + + {invitation_id ? ( + -
-
- -
+ ) : ( +
+ +
+
+ +
- {page === "api-keys" ? ( - - ) : page === "models" ? ( - {}} - premiumUser={premiumUser} - teams={teams} - /> - ) : page === "llm-playground" ? ( - - ) : page === "users" ? ( - - ) : page === "teams" ? ( - - ) : page === "organizations" ? ( - - ) : page === "admin-panel" ? ( - - ) : page === "api_ref" ? ( - - ) : page === "settings" ? ( - - ) : page === "budgets" ? ( - - ) : page === "guardrails" ? ( - - ) : page === "prompts" ? ( - - ) : page === "transform-request" ? ( - - ) : page === "general-settings" ? ( - - ) : page === "ui-theme" ? ( - - ) : page === "model-hub-table" ? ( - - ) : page === "caching" ? ( - - ) : page === "pass-through-settings" ? ( - - ) : page === "logs" ? ( - - ) : page === "mcp-servers" ? ( - - ) : page === "tag-management" ? ( - - ) : page === "vector-stores" ? ( - - ) : page === "new_usage" ? ( - - ) : ( - - )} + {page == "api-keys" ? ( + + ) : page == "models" ? ( + + ) : page == "llm-playground" ? ( + + ) : page == "users" ? ( + + ) : page == "teams" ? ( + + ) : page == "organizations" ? ( + + ) : page == "admin-panel" ? ( + + ) : page == "api_ref" ? ( + + ) : page == "settings" ? ( + + ) : page == "budgets" ? ( + + ) : page == "guardrails" ? ( + + ) : page == "prompts" ? ( + + ) : page == "transform-request" ? ( + + ) : page == "general-settings" ? ( + + ) : page == "ui-theme" ? ( + + ) : page == "model-hub-table" ? ( + + ) : page == "caching" ? ( + + ) : page == "pass-through-settings" ? ( + + ) : page == "logs" ? ( + + ) : page == "mcp-servers" ? ( + + ) : page == "tag-management" ? ( + + ) : page == "vector-stores" ? ( + + ) : page == "new_usage" ? ( + + ) : ( + + )} +
-
- )} -
-
+ )} + + + ); } From 0b27c361fe2a9fdf55e12fc1093a79cdca2c3632 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 8 Oct 2025 17:33:11 -0700 Subject: [PATCH 24/48] feat(mcp/): initial commit raising correct oauth error --- .../mcp_server/auth/user_api_key_auth_mcp.py | 89 +++++++++++++------ .../proxy/_experimental/mcp_server/server.py | 41 +++++---- .../index.html} | 0 .../proxy/_experimental/out/onboarding.html | 1 - litellm/proxy/_new_secret_config.yaml | 26 ++---- litellm/proxy/proxy_server.py | 30 ++++--- 6 files changed, 108 insertions(+), 79 deletions(-) rename litellm/proxy/_experimental/out/{model_hub_table.html => model_hub_table/index.html} (100%) delete mode 100644 litellm/proxy/_experimental/out/onboarding.html diff --git a/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py b/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py index 0c15138b05..714f2c8746 100644 --- a/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py +++ b/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py @@ -5,7 +5,12 @@ from starlette.requests import Request from starlette.types import Scope from litellm._logging import verbose_logger -from litellm.proxy._types import LiteLLM_TeamTable, SpecialHeaders, UserAPIKeyAuth +from litellm.proxy._types import ( + LiteLLM_TeamTable, + LitellmUserRoles, + SpecialHeaders, + UserAPIKeyAuth, +) from litellm.proxy.auth.user_api_key_auth import user_api_key_auth @@ -109,10 +114,21 @@ class MCPRequestHandler: request.body = mock_body # type: ignore if ".well-known" in str(request.url): # public routes validated_user_api_key_auth = UserAPIKeyAuth() + elif litellm_api_key == "": + from fastapi import HTTPException + + raise HTTPException( + status_code=401, + detail="LiteLLM API key is missing. Please add it or use OAuth authentication.", + headers={ + "WWW-Authenticate": f'Bearer resource_metadata=f"{request.base_url}/.well-known/oauth-protected-resource"', + }, + ) else: validated_user_api_key_auth = await user_api_key_auth( api_key=litellm_api_key, request=request ) + return ( validated_user_api_key_auth, mcp_auth_header, @@ -344,14 +360,14 @@ class MCPRequestHandler: proxy_logging_obj, user_api_key_cache, ) - + if not user_api_key_auth: return None - + # Already loaded if user_api_key_auth.object_permission: return user_api_key_auth.object_permission - + # Need to fetch from DB if user_api_key_auth.object_permission_id and prisma_client: return await get_object_permission( @@ -361,7 +377,7 @@ class MCPRequestHandler: parent_otel_span=user_api_key_auth.parent_otel_span, proxy_logging_obj=proxy_logging_obj, ) - + return None @staticmethod @@ -369,16 +385,19 @@ class MCPRequestHandler: user_api_key_auth: Optional[UserAPIKeyAuth] = None, ): """Helper to get team object_permission from cache or DB.""" - from litellm.proxy.auth.auth_checks import get_object_permission, get_team_object + from litellm.proxy.auth.auth_checks import ( + get_object_permission, + get_team_object, + ) from litellm.proxy.proxy_server import ( prisma_client, proxy_logging_obj, user_api_key_cache, ) - + if not user_api_key_auth or not user_api_key_auth.team_id or not prisma_client: return None - + # First get the team object (which may have object_permission already loaded) team_obj: Optional[LiteLLM_TeamTable] = await get_team_object( team_id=user_api_key_auth.team_id, @@ -387,14 +406,14 @@ class MCPRequestHandler: parent_otel_span=user_api_key_auth.parent_otel_span, proxy_logging_obj=proxy_logging_obj, ) - + if not team_obj: return None - + # Already loaded if team_obj.object_permission: return team_obj.object_permission - + # Need to fetch from DB using object_permission_id if team_obj.object_permission_id: return await get_object_permission( @@ -404,7 +423,7 @@ class MCPRequestHandler: parent_otel_span=user_api_key_auth.parent_otel_span, proxy_logging_obj=proxy_logging_obj, ) - + return None @staticmethod @@ -415,26 +434,38 @@ class MCPRequestHandler: """ Get list of allowed tool names for a specific server based on key/team permissions. Follows same inheritance logic as get_allowed_mcp_servers. - + Args: server_id: Server ID to check permissions for user_api_key_auth: User auth - + Returns: List[str] if restrictions exist, None if no restrictions (allow all) """ if not user_api_key_auth: return None - + try: # Get key and team object permissions - key_obj_perm = await MCPRequestHandler._get_key_object_permission(user_api_key_auth) - team_obj_perm = await MCPRequestHandler._get_team_object_permission(user_api_key_auth) - + key_obj_perm = await MCPRequestHandler._get_key_object_permission( + user_api_key_auth + ) + team_obj_perm = await MCPRequestHandler._get_team_object_permission( + user_api_key_auth + ) + # Extract tool permissions for this server - key_tools = key_obj_perm.mcp_tool_permissions.get(server_id) if key_obj_perm and key_obj_perm.mcp_tool_permissions else None - team_tools = team_obj_perm.mcp_tool_permissions.get(server_id) if team_obj_perm and team_obj_perm.mcp_tool_permissions else None - + key_tools = ( + key_obj_perm.mcp_tool_permissions.get(server_id) + if key_obj_perm and key_obj_perm.mcp_tool_permissions + else None + ) + team_tools = ( + team_obj_perm.mcp_tool_permissions.get(server_id) + if team_obj_perm and team_obj_perm.mcp_tool_permissions + else None + ) + # Apply same inheritance logic as get_allowed_mcp_servers if team_tools: if key_tools: @@ -446,7 +477,7 @@ class MCPRequestHandler: else: # No team restrictions → use key restrictions return key_tools - + except Exception as e: verbose_logger.warning(f"Failed to get allowed tools for server: {str(e)}") return None @@ -459,12 +490,12 @@ class MCPRequestHandler: ) -> bool: """ Check if a specific tool is allowed for a server based on key/team permissions. - + Args: tool_name: Name of the tool to check server_id: Server ID user_api_key_auth: User auth - + Returns: True if allowed, False if blocked """ @@ -472,15 +503,15 @@ class MCPRequestHandler: server_id=server_id, user_api_key_auth=user_api_key_auth, ) - + # None means no restrictions (allow all) if allowed_tools is None: return True - + # Empty list means no tools allowed if not allowed_tools: return False - + # Check if tool is in allowed list return tool_name in allowed_tools @@ -555,7 +586,7 @@ class MCPRequestHandler: ) -> List[str]: """ Get allowed MCP servers for a team. - + Uses the helper _get_team_object_permission which: 1. First checks if object_permission is already loaded on the team 2. If not, fetches from DB using object_permission_id if it exists @@ -571,7 +602,7 @@ class MCPRequestHandler: object_permissions = await MCPRequestHandler._get_team_object_permission( user_api_key_auth ) - + if object_permissions is None: return [] diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.py index d7ebfb805f..db3958d156 100644 --- a/litellm/proxy/_experimental/mcp_server/server.py +++ b/litellm/proxy/_experimental/mcp_server/server.py @@ -364,25 +364,25 @@ if MCP_AVAILABLE: def _tool_name_matches(tool_name: str, filter_list: List[str]) -> bool: """ Check if a tool name matches any name in the filter list. - + Checks both the full tool name and unprefixed version (without server prefix). This allows users to configure simple tool names regardless of prefixing. - + Args: tool_name: The tool name to check (may be prefixed like "server-tool_name") filter_list: List of tool names to match against - + Returns: True if the tool name (prefixed or unprefixed) is in the filter list """ from litellm.proxy._experimental.mcp_server.utils import ( get_server_name_prefix_tool_mcp, ) - + # Check if the full name is in the list if tool_name in filter_list: return True - + # Check if the unprefixed name is in the list unprefixed_name, _ = get_server_name_prefix_tool_mcp(tool_name) return unprefixed_name in filter_list @@ -393,34 +393,36 @@ if MCP_AVAILABLE: ) -> List[MCPTool]: """ Filter tools by allowed/disallowed tools configuration. - + If allowed_tools is set, only tools in that list are returned. If disallowed_tools is set, tools in that list are excluded. Tool names are matched with and without server prefixes for flexibility. - + Args: tools: List of tools to filter mcp_server: Server configuration with allowed_tools/disallowed_tools - + Returns: Filtered list of tools """ tools_to_return = tools - + # Filter by allowed_tools (whitelist) if mcp_server.allowed_tools: tools_to_return = [ - tool for tool in tools + tool + for tool in tools if _tool_name_matches(tool.name, mcp_server.allowed_tools) ] - + # Filter by disallowed_tools (blacklist) if mcp_server.disallowed_tools: tools_to_return = [ - tool for tool in tools_to_return + tool + for tool in tools_to_return if not _tool_name_matches(tool.name, mcp_server.disallowed_tools) ] - + return tools_to_return async def _get_tools_from_mcp_servers( @@ -497,17 +499,17 @@ if MCP_AVAILABLE: extra_headers=extra_headers, add_prefix=add_prefix, ) - + filtered_tools = filter_tools_by_allowed_tools(tools, server) - + filtered_tools = await filter_tools_by_key_team_permissions( tools=filtered_tools, server_id=server_id, user_api_key_auth=user_api_key_auth, ) - + all_tools.extend(filtered_tools) - + verbose_logger.debug( f"Successfully fetched {len(tools)} tools from server {server.name}, {len(filtered_tools)} after filtering" ) @@ -529,7 +531,7 @@ if MCP_AVAILABLE: ) -> List[MCPTool]: """ Filter tools based on key/team mcp_tool_permissions. - + Note: Tool names in the DB are stored without server prefixes, but tool names from MCP servers are prefixed. We need to strip the prefix before comparing. @@ -551,7 +553,7 @@ if MCP_AVAILABLE: else: # No restrictions, return all tools filtered_tools = tools - + return filtered_tools async def _list_mcp_tools( @@ -906,6 +908,7 @@ if MCP_AVAILABLE: await session_manager.handle_request(scope, receive, send) except Exception as e: + raise e verbose_logger.exception(f"Error handling MCP request: {e}") # Instead of re-raising, try to send a graceful error response try: diff --git a/litellm/proxy/_experimental/out/model_hub_table.html b/litellm/proxy/_experimental/out/model_hub_table/index.html similarity index 100% rename from litellm/proxy/_experimental/out/model_hub_table.html rename to litellm/proxy/_experimental/out/model_hub_table/index.html diff --git a/litellm/proxy/_experimental/out/onboarding.html b/litellm/proxy/_experimental/out/onboarding.html deleted file mode 100644 index 04c6c88676..0000000000 --- a/litellm/proxy/_experimental/out/onboarding.html +++ /dev/null @@ -1 +0,0 @@ -LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yaml index b2f4635ac9..ff68684416 100644 --- a/litellm/proxy/_new_secret_config.yaml +++ b/litellm/proxy/_new_secret_config.yaml @@ -17,23 +17,15 @@ model_list: api_key: dummy mcp_servers: - my_api_mcp: - url: "http://0.0.0.0:8090" - spec_path: "/Users/krrishdholakia/Documents/temp_py_folder/example_openapi.json" - auth_type: none - allowed_tools: ["getpetbyid", "my_api_mcp-findpetsbystatus"] - # Configure allowed parameters per tool - # Key: tool name (with or without prefix) - # Value: list of allowed parameter names - allowed_params: - # Using unprefixed tool name - "getpetbyid": ["petId"] - # Using prefixed tool name (both formats work) - "my_api_mcp-findpetsbystatus": ["status", "limit"] - # Example: allow only specific params for another tool - # "another_tool": ["param1", "param2"] - - + github_mcp: + url: "https://api.githubcopilot.com/mcp" + auth_type: oauth2 + authorization_url: https://github.com/login/oauth/authorize + token_url: https://github.com/login/oauth/access_token + client_id: os.environ/GITHUB_OAUTH_CLIENT_ID + client_secret: os.environ/GITHUB_OAUTH_CLIENT_SECRET + scopes: ["public_repo", "user:email"] + litellm_settings: callbacks: ["prometheus"] custom_prometheus_metadata_labels: ["metadata.initiative", "metadata.business-unit"] diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 7a1e8f1e73..366d3f57dc 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -1883,7 +1883,9 @@ class ProxyConfig: elif key == "priority_reservation_settings": from litellm.types.utils import PriorityReservationSettings - litellm.priority_reservation_settings = PriorityReservationSettings(**value) + litellm.priority_reservation_settings = PriorityReservationSettings( + **value + ) elif key == "callbacks": initialize_callbacks_on_proxy( value=value, @@ -2966,32 +2968,32 @@ class ProxyConfig: ) -> bool: """ Check if an object type should be loaded from the database based on general_settings.supported_db_objects. - + Args: object_type: Type of object to check (e.g., SupportedDBObjectType.MODELS, "models", etc.) - + Returns: True if the object should be loaded, False otherwise """ global general_settings - + # Get the supported_db_objects configuration supported_db_objects = general_settings.get("supported_db_objects", None) - + # If supported_db_objects is not set, load all objects (default behavior) if supported_db_objects is None: return True - + # If supported_db_objects is set, only load specified objects if not isinstance(supported_db_objects, list): verbose_proxy_logger.warning( f"supported_db_objects is not a list, got {type(supported_db_objects)}. Loading all objects." ) return True - + # Convert object_type to string for comparison (handles both str and enum) object_type_str = str(object_type) - + # Check if the object type is in the list (supports both str and enum values) return any(str(obj) == object_type_str for obj in supported_db_objects) @@ -3063,19 +3065,19 @@ class ProxyConfig: """ if self._should_load_db_object(object_type="guardrails"): await self._init_guardrails_in_db(prisma_client=prisma_client) - + if self._should_load_db_object(object_type="vector_stores"): await self._init_vector_stores_in_db(prisma_client=prisma_client) - + if self._should_load_db_object(object_type="mcp"): await self._init_mcp_servers_in_db() - + if self._should_load_db_object(object_type="pass_through_endpoints"): await self._init_pass_through_endpoints_in_db() - + if self._should_load_db_object(object_type="prompts"): await self._init_prompts_in_db(prisma_client=prisma_client) - + if self._should_load_db_object(object_type="model_cost_map"): await self._check_and_reload_model_cost_map(prisma_client=prisma_client) @@ -9708,6 +9710,8 @@ async def dynamic_mcp_route(mcp_server_name: str, request: Request): media_type=headers_dict.get("content-type", "application/json"), ) + except HTTPException as e: + raise e except Exception as e: verbose_proxy_logger.error( f"Error handling dynamic MCP route for {mcp_server_name}: {str(e)}" From 825a040524dfca7b343b7427d30df5a7a0ff5f30 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Wed, 8 Oct 2025 17:38:42 -0700 Subject: [PATCH 25/48] moved virtual-key-refactor to its own branch --- .../components/modals/CreateUserModal.tsx | 3 +- .../app/(dashboard)/hooks/useAuthorized.ts | 1 + .../{virtual-keys => }/hooks/useTeams.tsx | 2 +- .../src/app/(dashboard)/logs/page.tsx | 2 +- .../(dashboard)/models-and-endpoints/page.tsx | 2 +- .../{virtual-keys => }/networking.ts | 0 .../settings/admin-settings/page.tsx | 2 +- .../src/app/(dashboard)/teams/page.tsx | 2 +- .../src/app/(dashboard)/usage/page.tsx | 2 +- .../src/app/(dashboard)/users/page.tsx | 2 +- .../virtual-keys/components/CreateKey.tsx | 108 --- .../CreateKeyForm/KeyDetailsSection.tsx | 150 ---- .../CreateKeyForm/OptionalSettingsSection.tsx | 460 ------------ .../CreateKeyForm/OwnershipSection.tsx | 132 ---- .../CreateKeyModal/CreateKeyModal.tsx | 235 ------ .../components/CreateKeyModal/hooks/index.ts | 5 - .../hooks/useGuardrailsAndPrompts.ts | 24 - .../hooks/useMcpAccessGroups.ts | 21 - .../CreateKeyModal/hooks/useTeamModels.ts | 26 - .../CreateKeyModal/hooks/useUserModels.ts | 21 - .../CreateKeyModal/hooks/useUserSearch.ts | 41 - .../components/CreateKeyModal/networking.ts | 84 --- .../components/CreateKeyModal/types.ts | 17 - .../components/CreateKeyModal/utils.ts | 187 ----- .../virtual-keys/components/KeyInfoView.tsx | 699 ------------------ .../virtual-keys/components/SaveKeyModal.tsx | 60 -- .../VirtualKeysTable/VirtualKeysTable.tsx | 667 ----------------- .../VirtualKeysTable/hooks/useFilterLogic.ts | 189 ----- .../src/app/(dashboard)/virtual-keys/page.tsx | 41 +- .../components/templates/view_key_table.tsx | 9 +- .../src/components/user_dashboard.tsx | 5 +- .../src/components/view_users.tsx | 2 + 32 files changed, 37 insertions(+), 3164 deletions(-) rename ui/litellm-dashboard/src/app/(dashboard)/{virtual-keys => }/hooks/useTeams.tsx (88%) rename ui/litellm-dashboard/src/app/(dashboard)/{virtual-keys => }/networking.ts (100%) delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKey.tsx delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection.tsx delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/index.ts delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking.ts delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/types.ts delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/utils.ts delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/KeyInfoView.tsx delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/SaveKeyModal.tsx delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx index 9eb4191be1..be3ea48bf2 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx @@ -29,8 +29,7 @@ import { } from "@/components/networking"; import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; import BulkCreateUsersButton from "@/components/bulk_create_users_button"; -import { fetchTeams } from "@/app/(dashboard)/virtual-keys/networking"; -import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useTeams from "@/app/(dashboard)/hooks/useTeams"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; // Helper function to generate UUID compatible across all environments diff --git a/ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts index ebb0c34592..435000f9c8 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useAuthorized.ts @@ -34,6 +34,7 @@ const useAuthorized = () => { token: token, accessToken: decoded?.key ?? null, userId: decoded?.user_id ?? null, + userEmail: decoded?.user_email ?? null, userRole: decoded?.user_role ?? null, premiumUser: decoded?.premium_user ?? null, disabledPersonalKeyCreation: decoded?.disabled_non_admin_personal_key_creation ?? null, diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useTeams.tsx similarity index 88% rename from ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/hooks/useTeams.tsx index 7ba7a2fea5..64cbf624f9 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/hooks/useTeams.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useTeams.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; -import { fetchTeams } from "@/app/(dashboard)/virtual-keys/networking"; import { Team } from "@/components/key_team_helpers/key_list"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import { fetchTeams } from "@/app/(dashboard)/networking"; const useTeams = () => { const [teams, setTeams] = useState([]); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx index 4c6e7acc19..b04a12e230 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/logs/page.tsx @@ -2,7 +2,7 @@ import SpendLogsTable from "@/components/view_logs"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; -import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useTeams from "@/app/(dashboard)/hooks/useTeams"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; const LogsPage = () => { diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx index 2c523ea403..b661e4de3e 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx @@ -2,7 +2,7 @@ import ModelDashboard from "@/components/templates/model_dashboard"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; -import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useTeams from "@/app/(dashboard)/hooks/useTeams"; import { useState } from "react"; const ModelsAndEndpointsPage = () => { diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/networking.ts b/ui/litellm-dashboard/src/app/(dashboard)/networking.ts similarity index 100% rename from ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/networking.ts rename to ui/litellm-dashboard/src/app/(dashboard)/networking.ts diff --git a/ui/litellm-dashboard/src/app/(dashboard)/settings/admin-settings/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/settings/admin-settings/page.tsx index a851ce766a..c99242f0c3 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/settings/admin-settings/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/settings/admin-settings/page.tsx @@ -4,7 +4,7 @@ import AdminPanel from "@/components/admins"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; import { useState } from "react"; import { Team } from "@/components/key_team_helpers/key_list"; -import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useTeams from "@/app/(dashboard)/hooks/useTeams"; const AdminSettings = () => { const { teams, setTeams } = useTeams(); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/teams/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/teams/page.tsx index f1f0460d53..42e6d250ee 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/teams/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/teams/page.tsx @@ -2,7 +2,7 @@ import Teams from "@/components/teams"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; -import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useTeams from "@/app/(dashboard)/hooks/useTeams"; import { useEffect, useState } from "react"; import { Organization } from "@/components/networking"; import { fetchOrganizations } from "@/components/organizations"; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx index c20b13c67d..e4b44e5a45 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx @@ -2,7 +2,7 @@ import NewUsagePage from "@/components/new_usage"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; -import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useTeams from "@/app/(dashboard)/hooks/useTeams"; const UsagePage = () => { const { accessToken, userRole, userId, premiumUser } = useAuthorized(); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/users/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/users/page.tsx index dd53166574..7cf401873d 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/users/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/users/page.tsx @@ -2,7 +2,7 @@ import ViewUserDashboard from "@/components/view_users"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; -import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; +import useTeams from "@/app/(dashboard)/hooks/useTeams"; import { useState } from "react"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKey.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKey.tsx deleted file mode 100644 index 82be28e495..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKey.tsx +++ /dev/null @@ -1,108 +0,0 @@ -"use client"; - -import React, { useState, useEffect } from "react"; -import { Button } from "@tremor/react"; -import { Modal, Form } from "antd"; -import { getPossibleUserRoles, Organization } from "@/components/networking"; -import { rolesWithWriteAccess } from "@/utils/roles"; -import { Team } from "@/components/key_team_helpers/key_list"; -import CreateKeyModal from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyModal"; -import CreateUserModal from "@/app/(dashboard)/components/modals/CreateUserModal"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; - -interface CreateKeyProps { - team: Team | null; - userRole: string | null; - data: any[] | null; - addKey: (data: any) => void; -} - -interface User { - user_id: string; - user_email: string; - role?: string; -} - -interface UserOption { - label: string; - value: string; - user: User; -} -const CreateKey: React.FC = ({ team, userRole, data, addKey }) => { - const { accessToken } = useAuthorized(); - const [form] = Form.useForm(); - const [isModalVisible, setIsModalVisible] = useState(false); - const [isCreateUserModalVisible, setIsCreateUserModalVisible] = useState(false); - const [newlyCreatedUserId, setNewlyCreatedUserId] = useState(null); - const [possibleUIRoles, setPossibleUIRoles] = useState>>({}); - - useEffect(() => { - const fetchPossibleRoles = async () => { - try { - if (accessToken) { - // Check if roles are cached in session storage - const cachedRoles = sessionStorage.getItem("possibleUserRoles"); - if (cachedRoles) { - setPossibleUIRoles(JSON.parse(cachedRoles)); - } else { - const availableUserRoles = await getPossibleUserRoles(accessToken); - sessionStorage.setItem("possibleUserRoles", JSON.stringify(availableUserRoles)); - setPossibleUIRoles(availableUserRoles); - } - } - } catch (error) { - console.error("Error fetching possible user roles:", error); - } - }; - - fetchPossibleRoles(); - }, [accessToken]); - - // Add a callback function to handle user creation - const handleUserCreated = (userId: string) => { - setNewlyCreatedUserId(userId); - form.setFieldsValue({ user_id: userId }); - setIsCreateUserModalVisible(false); - }; - - const handleUserSelect = (_value: string, option: UserOption): void => { - const selectedUser = option.user; - form.setFieldsValue({ - user_id: selectedUser.user_id, - }); - }; - - return ( -
- {userRole && rolesWithWriteAccess.includes(userRole) && ( - - )} - - - {isCreateUserModalVisible && ( - setIsCreateUserModalVisible(false)} - footer={null} - width={800} - > - - - )} -
- ); -}; - -export default CreateKey; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx deleted file mode 100644 index 33a8ae06cf..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection.tsx +++ /dev/null @@ -1,150 +0,0 @@ -"use client"; - -import { TextInput, Title } from "@tremor/react"; -import { Form, FormInstance, Select, Tooltip } from "antd"; -import { InfoCircleOutlined } from "@ant-design/icons"; -import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; -import React from "react"; - -export interface KeyDetailsSectionProps { - form: FormInstance; - keyOwner: string; - modelsToPick: string[]; - keyType: string; - setKeyType: (keyType: string) => void; -} - -const { Option } = Select; - -const KeyDetailsSection = ({ form, keyOwner, keyType, modelsToPick, setKeyType }: KeyDetailsSectionProps) => { - return ( -
- Key Details - - {keyOwner === "you" || keyOwner === "another_user" ? "Key Name" : "Service Account ID"}{" "} - - - - - } - name="key_alias" - rules={[ - { - required: true, - message: `Please input a ${keyOwner === "you" ? "key name" : "service account ID"}`, - }, - ]} - help="required" - > - - - - - Models{" "} - - - - - } - name="models" - rules={ - keyType === "management" || keyType === "read_only" - ? [] - : [{ required: true, message: "Please select a model" }] - } - help={ - keyType === "management" || keyType === "read_only" - ? "Models field is disabled for this key type" - : "required" - } - className="mt-4" - > - - - - - Key Type{" "} - - - - - } - name="key_type" - initialValue="default" - className="mt-4" - > - - -
- ); -}; - -export default KeyDetailsSection; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx deleted file mode 100644 index b88f891944..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection.tsx +++ /dev/null @@ -1,460 +0,0 @@ -"use client"; - -import { Accordion, AccordionBody, AccordionHeader, Text, Title } from "@tremor/react"; -import { Form, FormInstance, Input, Select, Tooltip } from "antd"; -import { InfoCircleOutlined } from "@ant-design/icons"; -import { formatNumberWithCommas } from "@/utils/dataUtils"; -import NumericalInput from "@/components/shared/numerical_input"; -import BudgetDurationDropdown from "@/components/common_components/budget_duration_dropdown"; -import RateLimitTypeFormItem from "@/components/common_components/RateLimitTypeFormItem"; -import VectorStoreSelector from "@/components/vector_store_management/VectorStoreSelector"; -import MCPServerSelector from "@/components/mcp_server_management/MCPServerSelector"; -import PremiumLoggingSettings from "@/components/common_components/PremiumLoggingSettings"; -import ModelAliasManager from "@/components/common_components/ModelAliasManager"; -import KeyLifecycleSettings from "@/components/common_components/KeyLifecycleSettings"; -import { proxyBaseUrl } from "@/components/networking"; -import SchemaFormFields from "@/components/common_components/check_openapi_schema"; -import { Team } from "@/components/key_team_helpers/key_list"; -import React from "react"; -import { DefaultOptionType } from "rc-select/lib/Select"; -import { ModelAliases } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/types"; - -export interface OptionalSettingsSectionProps { - form: FormInstance; - team: Team | null; - premiumUser: boolean; - guardrails: string[]; - prompts: string[]; - accessToken: string; - predefinedTags: DefaultOptionType[]; - loggingSettings: any; - setLoggingSettings: (settings: any) => void; - disabledCallbacks: string[]; - setDisabledCallbacks: (disabledCallbacks: string[]) => void; - modelAliases: ModelAliases; - setModelAliases: (aliases: ModelAliases) => void; - autoRotationEnabled: boolean; - setAutoRotationEnabled: (enabled: boolean) => void; - rotationInterval: string; - setRotationInterval: (interval: string) => void; -} - -// TODO: break apart this component into smaller sections -const OptionalSettingsSection = ({ - form, - team, - premiumUser, - guardrails, - prompts, - accessToken, - predefinedTags, - loggingSettings, - setLoggingSettings, - disabledCallbacks, - setDisabledCallbacks, - modelAliases, - setModelAliases, - autoRotationEnabled, - setAutoRotationEnabled, - rotationInterval, - setRotationInterval, -}: OptionalSettingsSectionProps) => { - return ( -
- - - Optional Settings - - - - Max Budget (USD){" "} - - - - - } - name="max_budget" - help={`Budget cannot exceed team max budget: $${team?.max_budget !== null && team?.max_budget !== undefined ? team?.max_budget : "unlimited"}`} - rules={[ - { - validator: async (_, value) => { - if (value && team && team.max_budget !== null && value > team.max_budget) { - throw new Error( - `Budget cannot exceed team max budget: $${formatNumberWithCommas(team.max_budget, 4)}`, - ); - } - }, - }, - ]} - > - - - - Reset Budget{" "} - - - - - } - name="budget_duration" - help={`Team Reset Budget: ${team?.budget_duration !== null && team?.budget_duration !== undefined ? team?.budget_duration : "None"}`} - > - form.setFieldValue("budget_duration", value)} /> - - - Tokens per minute Limit (TPM){" "} - - - - - } - name="tpm_limit" - help={`TPM cannot exceed team TPM limit: ${team?.tpm_limit !== null && team?.tpm_limit !== undefined ? team?.tpm_limit : "unlimited"}`} - rules={[ - { - validator: async (_, value) => { - if (value && team && team.tpm_limit !== null && value > team.tpm_limit) { - throw new Error(`TPM limit cannot exceed team TPM limit: ${team.tpm_limit}`); - } - }, - }, - ]} - > - - - - - Requests per minute Limit (RPM){" "} - - - - - } - name="rpm_limit" - help={`RPM cannot exceed team RPM limit: ${team?.rpm_limit !== null && team?.rpm_limit !== undefined ? team?.rpm_limit : "unlimited"}`} - rules={[ - { - validator: async (_, value) => { - if (value && team && team.rpm_limit !== null && value > team.rpm_limit) { - throw new Error(`RPM limit cannot exceed team RPM limit: ${team.rpm_limit}`); - } - }, - }, - ]} - > - - - - - Guardrails{" "} - - e.stopPropagation()} // Prevent accordion from collapsing when clicking link - > - - - - - } - name="guardrails" - className="mt-4" - help={ - premiumUser - ? "Select existing guardrails or enter new ones" - : "Premium feature - Upgrade to set guardrails by key" - } - > - ({ value: name, label: name }))} - /> - - - Allowed Vector Stores{" "} - - - - - } - name="allowed_vector_store_ids" - className="mt-4" - help="Select vector stores this key can access. Leave empty for access to all vector stores" - > - form.setFieldValue("allowed_vector_store_ids", values)} - value={form.getFieldValue("allowed_vector_store_ids")} - accessToken={accessToken} - placeholder="Select vector stores (optional)" - /> - - - - Allowed MCP Servers{" "} - - - - - } - name="allowed_mcp_servers_and_groups" - className="mt-4" - help="Select MCP servers or access groups this key can access. " - > - form.setFieldValue("allowed_mcp_servers_and_groups", val)} - value={form.getFieldValue("allowed_mcp_servers_and_groups")} - accessToken={accessToken} - placeholder="Select MCP servers or access groups (optional)" - /> - - - - Metadata{" "} - - - - - } - name="metadata" - className="mt-4" - > - - - - Tags{" "} - - - - - } - name="tags" - className="mt-4" - help={`Tags for tracking spend and/or doing tag-based routing.`} - > - handleUserSelect(value, option as UserOption)} - options={userOptions} - loading={userSearchLoading} - allowClear - style={{ width: "100%" }} - notFoundContent={userSearchLoading ? "Searching..." : "No users found"} - /> - setIsCreateUserModalVisible(true)} style={{ marginLeft: "8px" }}> - Create User - -
-
Search by email to find users
-
- - )} - - Team{" "} - - - - - } - name="team_id" - initialValue={team ? team.team_id : null} - className="mt-4" - rules={[ - { - required: keyOwner === "service_account", - message: "Please select a team for the service account", - }, - ]} - help={keyOwner === "service_account" ? "required" : ""} - > - { - const selectedTeam = teams?.find((t) => t.team_id === teamId) || null; - setSelectedCreateKeyTeam(selectedTeam); - }} - /> - -
- ); -}; - -export default OwnershipSection; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx deleted file mode 100644 index cbe3db4e8f..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyModal.tsx +++ /dev/null @@ -1,235 +0,0 @@ -"use client"; - -import { Button as Button2, Form, FormInstance, Modal } from "antd"; -import { Text } from "@tremor/react"; -import { keyCreateCall, keyCreateServiceAccountCall } from "@/components/networking"; -import React, { useEffect, useState } from "react"; -import { Team } from "@/components/key_team_helpers/key_list"; -import SaveKeyModal from "@/app/(dashboard)/virtual-keys/components/SaveKeyModal"; -import NotificationsManager from "@/components/molecules/notifications_manager"; -import { - useGuardrailsAndPrompts, - useMcpAccessGroups, - useTeamModels, - useUserModels, - useUserSearch, -} from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks"; -import OwnershipSection from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OwnershipSection"; -import KeyDetailsSection from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/KeyDetailsSection"; -import OptionalSettingsSection from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/CreateKeyForm/OptionalSettingsSection"; -import { ModelAliases } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/types"; -import { getPredefinedTags, prepareFormValues } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/utils"; -import { fetchTeams } from "@/app/(dashboard)/virtual-keys/networking"; -import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; - -export interface CreateKeyModalProps { - isModalVisible: boolean; - setIsModalVisible: (isModalVisible: boolean) => void; - form: FormInstance; - handleUserSelect: (_value: string, option: UserOption) => void; - setIsCreateUserModalVisible: (visible: boolean) => void; - team: Team | null; - data: any[] | null; - addKey: (data: any) => void; -} - -interface User { - user_id: string; - user_email: string; - role?: string; -} - -interface UserOption { - label: string; - value: string; - user: User; -} - -const CreateKeyModal = ({ - isModalVisible, - setIsModalVisible, - form, - handleUserSelect, - setIsCreateUserModalVisible, - team, - data, - addKey, -}: CreateKeyModalProps) => { - const { userId: userID, userRole, accessToken, premiumUser } = useAuthorized(); - const [apiKey, setApiKey] = useState(null); - const [keyOwner, setKeyOwner] = useState("you"); - const [keyType, setKeyType] = useState("default"); - - const [selectedCreateKeyTeam, setSelectedCreateKeyTeam] = useState(team); - - const [softBudget, setSoftBudget] = useState(null); - const [loggingSettings, setLoggingSettings] = useState([]); - const [disabledCallbacks, setDisabledCallbacks] = useState([]); - const [autoRotationEnabled, setAutoRotationEnabled] = useState(false); - const [rotationInterval, setRotationInterval] = useState("30d"); - const [modelAliases, setModelAliases] = useState({}); - const predefinedTags = getPredefinedTags(data); - - const { options: userOptions, loading: userSearchLoading, onSearch: handleUserSearch } = useUserSearch(); - const { guardrails, prompts } = useGuardrailsAndPrompts(); - const teams = useTeams(); - const mcpAccessGroups = useMcpAccessGroups(); - const userModels = useUserModels(); - const modelsToPick = useTeamModels(selectedCreateKeyTeam); - - const isTeamSelectionRequired = modelsToPick.includes("no-default-models"); - const isFormDisabled = isTeamSelectionRequired && !selectedCreateKeyTeam; - - const handleCancel = () => { - setIsModalVisible(false); - setApiKey(null); - setSelectedCreateKeyTeam(null); - form.resetFields(); - setLoggingSettings([]); - setDisabledCallbacks([]); - setKeyType("default"); - setModelAliases({}); - setAutoRotationEnabled(false); - setRotationInterval("30d"); - }; - - const handleOk = () => { - setIsModalVisible(false); - form.resetFields(); - setLoggingSettings([]); - setDisabledCallbacks([]); - setKeyType("default"); - setModelAliases({}); - setAutoRotationEnabled(false); - setRotationInterval("30d"); - }; - - const handleCreate = async (formValues: Record) => { - try { - const newKeyAlias = formValues?.key_alias ?? ""; - const newKeyTeamId = formValues?.team_id ?? null; - - const existingKeyAliases = data?.filter((k) => k.team_id === newKeyTeamId).map((k) => k.key_alias) ?? []; - - if (existingKeyAliases.includes(newKeyAlias)) { - throw new Error( - `Key alias ${newKeyAlias} already exists for team with ID ${newKeyTeamId}, please provide another key alias`, - ); - } - - NotificationsManager.info("Making API Call"); - setIsModalVisible(true); - - const prepared = prepareFormValues(formValues, { - keyOwner, - userID, - loggingSettings, - disabledCallbacks, - autoRotationEnabled, - rotationInterval, - modelAliases, - }); - - let response; - if (keyOwner === "service_account") { - response = await keyCreateServiceAccountCall(accessToken, prepared); - } else { - response = await keyCreateCall(accessToken, userID, prepared); - } - - // TODO: change logic to trigger API call in parent component - addKey(response); - - setApiKey(response["key"]); - setSoftBudget(response["soft_budget"]); - NotificationsManager.success("API Key Created"); - form.resetFields(); - localStorage.removeItem("userData" + userID); - } catch (error) { - console.log("error in create key:", error); - NotificationsManager.fromBackend(`Error creating the key: ${error}`); - } - }; - - useEffect(() => { - form.setFieldValue("models", []); - }, [selectedCreateKeyTeam, accessToken, userID, userRole, form]); - - return ( -
- -
- - - {/* Show message when team selection is required */} - {isFormDisabled && ( -
- - 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. - -
- )} - - {/* Section 2: Key Details */} - {!isFormDisabled && ( - - )} - - {/* Section 3: Optional Settings */} - {!isFormDisabled && ( - - )} - -
- - Create Key - -
- -
- {apiKey && ( - - )} -
- ); -}; - -export default CreateKeyModal; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/index.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/index.ts deleted file mode 100644 index ca3c4a663b..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./useGuardrailsAndPrompts"; -export * from "./useMcpAccessGroups"; -export * from "./useUserModels"; -export * from "./useTeamModels"; -export * from "./useUserSearch"; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts deleted file mode 100644 index f4718e8ba0..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useGuardrailsAndPrompts.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { useEffect, useState } from "react"; -import { fetchGuardrails, fetchPrompts } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; - -export const useGuardrailsAndPrompts = () => { - const [guardrails, setGuardrails] = useState([]); - const [prompts, setPrompts] = useState([]); - const { accessToken } = useAuthorized(); - - useEffect(() => { - if (!accessToken) { - setGuardrails([]); - setPrompts([]); - return; - } - (async () => { - const [g, p] = await Promise.all([fetchGuardrails(accessToken), fetchPrompts(accessToken)]); - setGuardrails(g || []); - setPrompts(p || []); - })(); - }, [accessToken]); - - return { guardrails, prompts }; -}; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts deleted file mode 100644 index 998b392f77..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useMcpAccessGroups.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { useEffect, useState } from "react"; -import { getMCPAccessGroups } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; - -export const useMcpAccessGroups = () => { - const [mcpAccessGroups, setMcpAccessGroups] = useState([]); - const { accessToken } = useAuthorized(); - - useEffect(() => { - if (!accessToken) { - setMcpAccessGroups([]); - return; - } - (async () => { - const groups = await getMCPAccessGroups(accessToken); - setMcpAccessGroups(groups || []); - })(); - }, [accessToken]); - - return mcpAccessGroups; -}; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts deleted file mode 100644 index dd99de0615..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useTeamModels.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { useEffect, useMemo, useState } from "react"; -import type { Team } from "@/components/key_team_helpers/key_list"; -import { fetchTeamModels } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; - -export const useTeamModels = (selectedTeam: Team | null) => { - const { userId: userID, userRole, accessToken } = useAuthorized(); - const [modelsToPick, setModelsToPick] = useState([]); - - // turn array into a stable dep so it only re-runs when contents change - const selectedTeamModelsKey = useMemo(() => (selectedTeam?.models ?? []).join("|"), [selectedTeam?.models]); - - useEffect(() => { - if (!userID || !userRole || !accessToken) { - setModelsToPick([]); - return; - } - (async () => { - const fetched = await fetchTeamModels(userID, userRole, accessToken, selectedTeam?.team_id ?? null); - const union = Array.from(new Set([...(selectedTeam?.models ?? []), ...(fetched || [])])); - setModelsToPick(union); - })(); - }, [userID, userRole, accessToken, selectedTeam?.team_id, selectedTeamModelsKey, selectedTeam?.models]); - - return modelsToPick; -}; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts deleted file mode 100644 index 66b5520f06..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserModels.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { useEffect, useState } from "react"; -import { getUserModelNames } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; - -export const useUserModels = () => { - const { userId: userID, userRole, accessToken } = useAuthorized(); - const [userModels, setUserModels] = useState([]); - - useEffect(() => { - if (!userID || !userRole || !accessToken) { - setUserModels([]); - return; - } - (async () => { - const modelNames = await getUserModelNames(userID, userRole, accessToken); - setUserModels(modelNames || []); - })(); - }, [userID, userRole, accessToken]); - - return userModels; -}; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts deleted file mode 100644 index d266a51667..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/hooks/useUserSearch.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { useEffect, useMemo, useState } from "react"; -import { debounce } from "lodash"; -import { searchUserOptionsByEmail } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; - -type User = { user_id: string; user_email: string; role?: string }; -export interface UserOption { - label: string; - value: string; - user: User; -} - -export const useUserSearch = (delay = 300) => { - const { accessToken } = useAuthorized(); - const [options, setOptions] = useState([]); - const [loading, setLoading] = useState(false); - - const doSearch = async (raw: string) => { - const q = raw?.trim(); - if (!q || !accessToken) { - setOptions([]); - setLoading(false); - return; - } - setLoading(true); - try { - const res = await searchUserOptionsByEmail(accessToken, q); - setOptions(res || []); - } finally { - setLoading(false); - } - }; - - const onSearch = useMemo(() => debounce(doSearch, delay), [accessToken, delay]); - - useEffect(() => { - return () => onSearch.cancel(); - }, [onSearch]); - - return { options, loading, onSearch }; -}; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking.ts deleted file mode 100644 index 377f6d3113..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/networking.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { - fetchMCPAccessGroups, - getGuardrailsList, - getPromptsList, - modelAvailableCall, - User, - userFilterUICall, -} from "@/components/networking"; -import { ModelAvailableResponse, UserOption } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/types"; - -export const fetchGuardrails = async (accessToken: string) => { - try { - const response = await getGuardrailsList(accessToken); - return response.guardrails.map((g: { guardrail_name: string }) => g.guardrail_name); - } catch (error) { - console.error("Failed to fetch guardrails:", error); - return []; - } -}; - -export const fetchPrompts = async (accessToken: string) => { - try { - const response = await getPromptsList(accessToken); - return response.prompts.map((prompt) => prompt.prompt_id); - } catch (error) { - console.error("Failed to fetch prompts:", error); - return []; - } -}; - -export const searchUserOptionsByEmail = async (accessToken: string, emailQuery: string): Promise => { - const params = new URLSearchParams(); - params.append("user_email", emailQuery); - - const response = await userFilterUICall(accessToken, params); - const users: User[] = response; - - return users.map((user) => ({ - label: `${user.user_email} (${user.user_id})`, - value: user.user_id, - user, - })); -}; - -export const getUserModelNames = async (userID: string, userRole: string, accessToken: string): Promise => { - const res: ModelAvailableResponse = await modelAvailableCall(accessToken, userID, userRole); - return (res?.data ?? []).map((m) => m.id); -}; - -export const fetchTeamModels = async ( - userID: string, - userRole: string, - accessToken: string, - teamID: string | null, -): Promise => { - try { - if (userID === null || userRole === null) { - return []; - } - - if (accessToken !== null) { - const model_available = await modelAvailableCall(accessToken, userID, userRole, true, teamID, true); - let available_model_names = model_available["data"].map((element: { id: string }) => element.id); - console.log("available_model_names:", available_model_names); - return available_model_names; - } - return []; - } catch (error) { - console.error("Error fetching user models:", error); - return []; - } -}; - -export const getMCPAccessGroups = async (accessToken: string): Promise => { - try { - if (accessToken == null) { - return []; - } - return await fetchMCPAccessGroups(accessToken); - } catch (error) { - console.error("Failed to fetch MCP access groups:", error); - return []; - } -}; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/types.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/types.ts deleted file mode 100644 index 4d48df82d4..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/types.ts +++ /dev/null @@ -1,17 +0,0 @@ -export interface User { - user_id: string; - user_email: string; - role?: string; -} - -export interface UserOption { - label: string; - value: string; - user: User; -} - -export type Model = { id: string }; - -export type ModelAvailableResponse = { data: Model[] }; - -export type ModelAliases = { [key: string]: string }; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/utils.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/utils.ts deleted file mode 100644 index 1fb40b8789..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/CreateKeyModal/utils.ts +++ /dev/null @@ -1,187 +0,0 @@ -import { mapDisplayToInternalNames } from "@/components/callback_info_helpers"; -import { ModelAliases } from "@/app/(dashboard)/virtual-keys/components/CreateKeyModal/types"; - -export const getPredefinedTags = (data: any[] | null) => { - let allTags = []; - - console.log("data:", JSON.stringify(data)); - - if (data) { - for (let key of data) { - if (key["metadata"] && key["metadata"]["tags"]) { - allTags.push(...key["metadata"]["tags"]); - } - } - } - - const uniqueTags = Array.from(new Set(allTags)).map((tag) => ({ - value: tag, - label: tag, - })); - - console.log("uniqueTags:", uniqueTags); - return uniqueTags; -}; - -type AnyObj = Record; - -type PrepareOptions = { - keyOwner: string; - userID: string; - loggingSettings: any[]; - disabledCallbacks: string[]; - autoRotationEnabled: boolean; - rotationInterval: string; - modelAliases: ModelAliases; -}; - -export function safeParseMetadata(metadataStr: string | undefined): AnyObj { - try { - return JSON.parse(metadataStr || "{}"); - } catch (error) { - console.error("Error parsing metadata:", error); - return {}; - } -} - -export function withOwnerAssignments( - values: AnyObj, - { keyOwner, userID }: Pick, -): AnyObj { - // If owned by "you", set user_id - const base = keyOwner === "you" ? { ...values, user_id: userID } : { ...values }; - return base; -} - -export function enrichMetadata( - metadata: AnyObj, - values: AnyObj, - { - keyOwner, - loggingSettings, - disabledCallbacks, - }: Pick, -): AnyObj { - let next = { ...metadata }; - - // If it's a service account, add the service_account_id to the metadata - if (keyOwner === "service_account") { - next = { ...next, service_account_id: values.key_alias }; - } - - // Add logging settings to the metadata - if (Array.isArray(loggingSettings) && loggingSettings.length > 0) { - next = { ...next, logging: loggingSettings.filter((config: any) => config?.callback_name) }; - } - - // Add disabled callbacks to the metadata - if (Array.isArray(disabledCallbacks) && disabledCallbacks.length > 0) { - const mappedDisabledCallbacks = mapDisplayToInternalNames(disabledCallbacks); - next = { ...next, litellm_disabled_callbacks: mappedDisabledCallbacks }; - } - - return next; -} - -export function withAutoRotation( - values: AnyObj, - { autoRotationEnabled, rotationInterval }: Pick, -): AnyObj { - if (!autoRotationEnabled) return { ...values }; - return { ...values, auto_rotate: true, rotation_interval: rotationInterval }; -} - -export function withDurationNoop(values: AnyObj): AnyObj { - // Preserve the original no-op logic: if duration exists, set it to itself - if (values.duration) { - return { ...values, duration: values.duration }; - } - return { ...values }; -} - -export function mergeObjectPermission(values: AnyObj, patch: AnyObj): AnyObj { - const object_permission = { ...(values.object_permission || {}), ...patch }; - return { ...values, object_permission }; -} - -export function withVectorStores(values: AnyObj): AnyObj { - const { allowed_vector_store_ids, ...rest } = values; - if (Array.isArray(allowed_vector_store_ids) && allowed_vector_store_ids.length > 0) { - const patched = mergeObjectPermission(rest, { vector_stores: allowed_vector_store_ids }); - return patched; // original field removed by destructuring - } - return { ...values }; -} - -export function withMcpServersAndGroups(values: AnyObj): AnyObj { - const { allowed_mcp_servers_and_groups, ...rest } = values; - const servers = allowed_mcp_servers_and_groups?.servers; - const accessGroups = allowed_mcp_servers_and_groups?.accessGroups; - - const hasServers = Array.isArray(servers) && servers.length > 0; - const hasAccessGroups = Array.isArray(accessGroups) && accessGroups.length > 0; - - if (!hasServers && !hasAccessGroups) return { ...values }; - - let patched = { ...rest }; - if (hasServers) patched = mergeObjectPermission(patched, { mcp_servers: servers }); - if (hasAccessGroups) patched = mergeObjectPermission(patched, { mcp_access_groups: accessGroups }); - - // original field removed by destructuring - return patched; -} - -export function withMcpAccessGroups(values: AnyObj): AnyObj { - const { allowed_mcp_access_groups, ...rest } = values; - if (Array.isArray(allowed_mcp_access_groups) && allowed_mcp_access_groups.length > 0) { - const patched = mergeObjectPermission(rest, { mcp_access_groups: allowed_mcp_access_groups }); - return patched; // original field removed by destructuring - } - return { ...values }; -} - -function withAliases(values: AnyObj, modelAliases: ModelAliases): AnyObj { - if (modelAliases && Object.keys(modelAliases).length > 0) { - return { ...values, aliases: JSON.stringify(modelAliases) }; - } - return { ...values }; -} - -function withMetadataString(values: AnyObj, metadata: AnyObj): AnyObj { - return { ...values, metadata: JSON.stringify(metadata) }; -} - -export function prepareFormValues(initialValues: AnyObj, opts: PrepareOptions): AnyObj { - // Step 1: assign user id if needed - let values = withOwnerAssignments(initialValues, { keyOwner: opts.keyOwner, userID: opts.userID }); - - // Step 2: metadata parse & enrichment - const parsedMetadata = safeParseMetadata(values.metadata); - const enrichedMetadata = enrichMetadata(parsedMetadata, values, { - keyOwner: opts.keyOwner, - loggingSettings: opts.loggingSettings, - disabledCallbacks: opts.disabledCallbacks, - }); - - // Step 3: auto-rotation - values = withAutoRotation(values, { - autoRotationEnabled: opts.autoRotationEnabled, - rotationInterval: opts.rotationInterval, - }); - - // Step 4: duration (no-op preservation) - values = withDurationNoop(values); - - // Step 5: commit metadata string - values = withMetadataString(values, enrichedMetadata); - - // Step 6: object_permission transformations - values = withVectorStores(values); - values = withMcpServersAndGroups(values); - values = withMcpAccessGroups(values); - - // Step 7: aliases - values = withAliases(values, opts.modelAliases); - - return values; -} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/KeyInfoView.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/KeyInfoView.tsx deleted file mode 100644 index 9f9a47fbe1..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/KeyInfoView.tsx +++ /dev/null @@ -1,699 +0,0 @@ -"use client"; - -import React, { useEffect, useState } from "react"; -import { - Card, - Text, - Button, - Grid, - Tab, - TabList, - TabGroup, - TabPanel, - TabPanels, - Title, - Badge, -} from "@tremor/react"; -import { ArrowLeftIcon, TrashIcon, RefreshIcon } from "@heroicons/react/outline"; -import { Form, Tooltip, Button as AntdButton } from "antd"; -import { copyToClipboard as utilCopyToClipboard, formatNumberWithCommas } from "@/utils/dataUtils"; -import { CopyIcon, CheckIcon } from "lucide-react"; -import { KeyResponse } from "@/components/key_team_helpers/key_list" -import { mapDisplayToInternalNames, mapInternalToDisplayNames } from "@/components/callback_info_helpers" -import NotificationManager from "@/components/molecules/notifications_manager" -import { keyDeleteCall, keyUpdateCall } from "@/components/networking" -import { parseErrorMessage } from "@/components/shared/errorUtils" -import { rolesWithWriteAccess } from "@/utils/roles" -import { RegenerateKeyModal } from "@/components/organisms/regenerate_key_modal" -import ObjectPermissionsView from "@/components/object_permissions_view" -import LoggingSettingsView from "@/components/logging_settings_view" -import { extractLoggingSettings, formatMetadataForDisplay } from "@/components/key_info_utils" -import AutoRotationView from "@/components/common_components/AutoRotationView" -import { KeyEditView } from "@/components/templates/key_edit_view" - - -interface KeyInfoViewProps { - keyId: string; - onClose: () => void; - keyData: KeyResponse | undefined; - onKeyDataUpdate?: (data: Partial) => void; - onDelete?: () => void; - accessToken: string | null; - userID: string | null; - userRole: string | null; - teams: any[] | null; - premiumUser: boolean; - setAccessToken?: (token: string) => void; - backButtonText?: string; -} - -const KeyInfoView = ({ - keyId, - onClose, - keyData, - accessToken, - userID, - userRole, - teams, - onKeyDataUpdate, - onDelete, - premiumUser, - setAccessToken, - backButtonText = "Back to Keys", - }: KeyInfoViewProps) => { - const [isEditing, setIsEditing] = useState(false); - const [form] = Form.useForm(); - const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); - const [deleteConfirmInput, setDeleteConfirmInput] = useState(""); - const [isRegenerateModalOpen, setIsRegenerateModalOpen] = useState(false); - const [copiedStates, setCopiedStates] = useState>({}); - - // Add local state to maintain key data and track regeneration - const [currentKeyData, setCurrentKeyData] = useState(keyData); - const [lastRegeneratedAt, setLastRegeneratedAt] = useState(null); - const [isRecentlyRegenerated, setIsRecentlyRegenerated] = useState(false); - - // Update local state when keyData prop changes (but don't reset to undefined) - useEffect(() => { - if (keyData) { - setCurrentKeyData(keyData); - } - }, [keyData]); - - // Reset recent regeneration indicator after 5 seconds - useEffect(() => { - if (isRecentlyRegenerated) { - const timer = setTimeout(() => { - setIsRecentlyRegenerated(false); - }, 5000); - return () => clearTimeout(timer); - } - }, [isRecentlyRegenerated]); - - // Use currentKeyData instead of keyData throughout the component - if (!currentKeyData) { - return ( -
- - Key not found -
- ); - } - - const handleKeyUpdate = async (formValues: Record) => { - try { - if (!accessToken) return; - - const currentKey = formValues.token; - formValues.key = currentKey; - - // Guard premium features - if (!premiumUser) { - delete formValues.guardrails; - delete formValues.prompts; - } - - // Handle object_permission updates - if (formValues.vector_stores !== undefined) { - formValues.object_permission = { - ...currentKeyData.object_permission, - vector_stores: formValues.vector_stores || [], - }; - // Remove vector_stores from the top level as it should be in object_permission - delete formValues.vector_stores; - } - - if (formValues.mcp_servers_and_groups !== undefined) { - const { servers, accessGroups } = formValues.mcp_servers_and_groups || { servers: [], accessGroups: [] }; - formValues.object_permission = { - ...currentKeyData.object_permission, - mcp_servers: servers || [], - mcp_access_groups: accessGroups || [], - }; - // Remove mcp_servers_and_groups from the top level as it should be in object_permission - delete formValues.mcp_servers_and_groups; - } - - // Convert metadata back to an object if it exists and is a string - if (formValues.metadata && typeof formValues.metadata === "string") { - try { - const parsedMetadata = JSON.parse(formValues.metadata); - formValues.metadata = { - ...parsedMetadata, - ...(formValues.guardrails?.length > 0 ? { guardrails: formValues.guardrails } : {}), - ...(formValues.logging_settings ? { logging: formValues.logging_settings } : {}), - ...(formValues.disabled_callbacks?.length > 0 - ? { - litellm_disabled_callbacks: mapDisplayToInternalNames(formValues.disabled_callbacks), - } - : {}), - }; - } catch (error) { - console.error("Error parsing metadata JSON:", error); - NotificationManager.error("Invalid metadata JSON"); - return; - } - } else { - formValues.metadata = { - ...(formValues.metadata || {}), - ...(formValues.guardrails?.length > 0 ? { guardrails: formValues.guardrails } : {}), - ...(formValues.logging_settings ? { logging: formValues.logging_settings } : {}), - ...(formValues.disabled_callbacks?.length > 0 - ? { - litellm_disabled_callbacks: mapDisplayToInternalNames(formValues.disabled_callbacks), - } - : {}), - }; - } - - delete formValues.logging_settings; - - // Convert budget_duration to API format - if (formValues.budget_duration) { - const durationMap: Record = { - daily: "24h", - weekly: "7d", - monthly: "30d", - }; - formValues.budget_duration = durationMap[formValues.budget_duration]; - } - - const newKeyValues = await keyUpdateCall(accessToken, formValues); - - // Update local state - setCurrentKeyData((prevData) => (prevData ? { ...prevData, ...newKeyValues } : undefined)); - - if (onKeyDataUpdate) { - onKeyDataUpdate(newKeyValues); - } - NotificationManager.success("Key updated successfully"); - setIsEditing(false); - // Refresh key data here if needed - } catch (error) { - NotificationManager.fromBackend(parseErrorMessage(error)); - console.error("Error updating key:", error); - } - }; - - const handleDelete = async () => { - try { - if (!accessToken) return; - await keyDeleteCall(accessToken as string, currentKeyData.token || currentKeyData.token_id); - NotificationManager.success("Key deleted successfully"); - if (onDelete) { - onDelete(); - } - onClose(); - } catch (error) { - console.error("Error deleting the key:", error); - NotificationManager.fromBackend(error); - } - // Reset the confirmation input - setDeleteConfirmInput(""); - }; - - const copyToClipboard = async (text: string, key: string) => { - const success = await utilCopyToClipboard(text); - if (success) { - setCopiedStates((prev) => ({ ...prev, [key]: true })); - setTimeout(() => { - setCopiedStates((prev) => ({ ...prev, [key]: false })); - }, 2000); - } - }; - - const handleRegenerateKeyUpdate = (updatedKeyData: Partial) => { - // Update local state immediately with ALL the new data - setCurrentKeyData((prevData) => { - if (!prevData) return undefined; - const newData = { - ...prevData, - ...updatedKeyData, // This should include the new token (key-id) - // Update the created_at to show when it was regenerated - created_at: new Date().toLocaleString(), - }; - return newData; - }); - - // Track regeneration timestamp - setLastRegeneratedAt(new Date()); - setIsRecentlyRegenerated(true); - - if (onKeyDataUpdate) { - onKeyDataUpdate({ - ...updatedKeyData, - created_at: new Date().toLocaleString(), - }); - } - }; - - // Update the formatTimestamp function to use the desired date format - const formatTimestamp = (timestamp: string | Date) => { - const date = new Date(timestamp); - const dateStr = date.toLocaleDateString("en-US", { - year: "numeric", - month: "short", - day: "numeric", - }); - const timeStr = date.toLocaleTimeString("en-US", { - hour: "numeric", - minute: "2-digit", - hour12: true, - }); - return `${dateStr} at ${timeStr}`; - }; - - return ( -
-
-
- - {currentKeyData.key_alias || "API Key"} - -
-
- Key ID - {currentKeyData.token_id || currentKeyData.token} -
- : } - onClick={() => copyToClipboard(currentKeyData.token_id || currentKeyData.token, "key-id")} - className={`ml-2 transition-all duration-200${ - copiedStates["key-id"] - ? "text-green-600 bg-green-50 border-green-200" - : "text-gray-500 hover:text-gray-700 hover:bg-gray-100" - }`} - /> -
- - {/* Add timestamp and regeneration indicator */} -
- - {currentKeyData.updated_at && currentKeyData.updated_at !== currentKeyData.created_at - ? `Updated: ${formatTimestamp(currentKeyData.updated_at)}` - : `Created: ${formatTimestamp(currentKeyData.created_at)}`} - - - {isRecentlyRegenerated && ( - - Recently Regenerated - - )} - - {lastRegeneratedAt && ( - - Regenerated - - )} -
-
- {userRole && rolesWithWriteAccess.includes(userRole) && ( -
- - - - - - -
- )} -
- - {/* Add RegenerateKeyModal */} - setIsRegenerateModalOpen(false)} - accessToken={accessToken} - premiumUser={premiumUser} - setAccessToken={setAccessToken} - onKeyUpdate={handleRegenerateKeyUpdate} - /> - - {/* Delete Confirmation Modal */} - {isDeleteModalOpen && - (() => { - const keyName = currentKeyData?.key_alias || currentKeyData?.token_id || "API Key"; - const isValid = deleteConfirmInput === keyName; - return ( -
-
-
-
-

Delete Key

- -
-
-
-
- - - -
-
-

- Warning: You are about to delete this API key. -

-

- This action is irreversible and will immediately revoke access for any applications using this - key. -

-
-
-

Are you sure you want to delete this API key?

-
- - setDeleteConfirmInput(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 - /> -
-
-
-
- - -
-
-
- ); - })()} - - - - Overview - Settings - - - - {/* Overview Panel */} - - - - Spend -
- ${formatNumberWithCommas(currentKeyData.spend, 4)} - - of{" "} - {currentKeyData.max_budget !== null - ? `$${formatNumberWithCommas(currentKeyData.max_budget)}` - : "Unlimited"} - -
-
- - - Rate Limits -
- TPM: {currentKeyData.tpm_limit !== null ? currentKeyData.tpm_limit : "Unlimited"} - RPM: {currentKeyData.rpm_limit !== null ? currentKeyData.rpm_limit : "Unlimited"} -
-
- - - Models -
- {currentKeyData.models && currentKeyData.models.length > 0 ? ( - currentKeyData.models.map((model, index) => ( - - {model} - - )) - ) : ( - No models specified - )} -
-
- - - - - - - - -
-
- - {/* Settings Panel */} - - -
- Key Settings - {!isEditing && userRole && rolesWithWriteAccess.includes(userRole) && ( - - )} -
- - {isEditing ? ( - setIsEditing(false)} - onSubmit={handleKeyUpdate} - teams={teams} - accessToken={accessToken} - userID={userID} - userRole={userRole} - premiumUser={premiumUser} - /> - ) : ( -
-
- Key ID - {currentKeyData.token_id || currentKeyData.token} -
- -
- Key Alias - {currentKeyData.key_alias || "Not Set"} -
- -
- Secret Key - {currentKeyData.key_name} -
- -
- Team ID - {currentKeyData.team_id || "Not Set"} -
- -
- Organization - {currentKeyData.organization_id || "Not Set"} -
- -
- Created - {formatTimestamp(currentKeyData.created_at)} -
- - {lastRegeneratedAt && ( -
- Last Regenerated -
- {formatTimestamp(lastRegeneratedAt)} - - Recent - -
-
- )} - -
- Expires - {currentKeyData.expires ? formatTimestamp(currentKeyData.expires) : "Never"} -
- - - -
- Spend - ${formatNumberWithCommas(currentKeyData.spend, 4)} USD -
- -
- Budget - - {currentKeyData.max_budget !== null - ? `$${formatNumberWithCommas(currentKeyData.max_budget, 2)}` - : "Unlimited"} - -
- -
- Prompts - - {Array.isArray(currentKeyData.metadata?.prompts) && currentKeyData.metadata.prompts.length > 0 - ? currentKeyData.metadata.prompts.map((prompt, index) => ( - - {prompt} - - )) - : "No prompts specified"} - -
- -
- Models -
- {currentKeyData.models && currentKeyData.models.length > 0 ? ( - currentKeyData.models.map((model, index) => ( - - {model} - - )) - ) : ( - No models specified - )} -
-
- -
- Rate Limits - TPM: {currentKeyData.tpm_limit !== null ? currentKeyData.tpm_limit : "Unlimited"} - RPM: {currentKeyData.rpm_limit !== null ? currentKeyData.rpm_limit : "Unlimited"} - - Max Parallel Requests:{" "} - {currentKeyData.max_parallel_requests !== null - ? currentKeyData.max_parallel_requests - : "Unlimited"} - - - Model TPM Limits:{" "} - {currentKeyData.metadata?.model_tpm_limit - ? JSON.stringify(currentKeyData.metadata.model_tpm_limit) - : "Unlimited"} - - - Model RPM Limits:{" "} - {currentKeyData.metadata?.model_rpm_limit - ? JSON.stringify(currentKeyData.metadata.model_rpm_limit) - : "Unlimited"} - -
- -
- Metadata -
-                      {formatMetadataForDisplay(currentKeyData.metadata)}
-                    
-
- - - - -
- )} -
-
-
-
-
- ); -} - -export default KeyInfoView; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/SaveKeyModal.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/SaveKeyModal.tsx deleted file mode 100644 index fed678aadc..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/SaveKeyModal.tsx +++ /dev/null @@ -1,60 +0,0 @@ -"use client"; - -import { Button, Col, Grid, Text, Title } from "@tremor/react"; -import { CopyToClipboard } from "react-copy-to-clipboard"; -import { Modal } from "antd"; -import React from "react"; -import NotificationsManager from "@/components/molecules/notifications_manager"; - -export interface SaveKeyModalProps { - apiKey: string; - isModalVisible: boolean; - handleOk: () => void; - handleCancel: () => void; -} - -const SaveKeyModal = ({ apiKey, isModalVisible, handleOk, handleCancel }: SaveKeyModalProps) => { - const handleCopy = () => { - NotificationsManager.success("API Key copied to clipboard"); - }; - - return ( - - - Save your Key - -

- Please save this secret key somewhere safe and accessible. For security reasons,{" "} - 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. -

- - - {apiKey != null ? ( -
- API Key: -
-
{apiKey}
-
- - - - -
- ) : ( - Key being created, this might take 30s - )} - -
-
- ); -}; - -export default SaveKeyModal; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx deleted file mode 100644 index 180d3336f1..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable.tsx +++ /dev/null @@ -1,667 +0,0 @@ -"use client"; -// TODO: refactor - -import React, { useEffect, useState } from "react"; -import { ColumnDef } from "@tanstack/react-table"; -import { Button } from "@tremor/react"; -import { Tooltip } from "antd"; -import { updateExistingKeys } from "@/utils/dataUtils"; -import { flexRender, getCoreRowModel, getSortedRowModel, SortingState, useReactTable } from "@tanstack/react-table"; -import { Table, TableHead, TableHeaderCell, TableBody, TableRow, TableCell, Icon } from "@tremor/react"; -import { SwitchVerticalIcon, ChevronUpIcon, ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/outline"; -import { Badge, Text } from "@tremor/react"; -import { formatNumberWithCommas } from "@/utils/dataUtils"; -import { KeyResponse, Team } from "@/components/key_team_helpers/key_list"; -import { Organization, userListCall } from "@/components/networking"; -import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; -import FilterComponent, { FilterOption } from "@/components/molecules/filter"; -import { useFilterLogic } from "@/components/key_team_helpers/filter_logic"; -import useTeams from "@/app/(dashboard)/virtual-keys/hooks/useTeams"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; -import KeyInfoView from "@/app/(dashboard)/virtual-keys/components/KeyInfoView"; - -interface AllKeysTableProps { - keys: KeyResponse[]; - setKeys: (keys: KeyResponse[] | ((prev: KeyResponse[]) => KeyResponse[])) => void; - isLoading?: boolean; - pagination: { - currentPage: number; - totalPages: number; - totalCount: number; - }; - onPageChange: (page: number) => void; - pageSize?: number; - organizations: Organization[] | null; - refresh?: () => void; - onSortChange?: (sortBy: string, sortOrder: "asc" | "desc") => void; - currentSort?: { - sortBy: string; - sortOrder: "asc" | "desc"; - }; - setAccessToken?: (token: string) => void; -} - -interface UserResponse { - user_id: string; - user_email: string; - user_role: string; -} - -const VirtualKeysTable = ({ - keys, - setKeys, - isLoading = false, - pagination, - onPageChange, - pageSize = 50, - organizations, - refresh, - onSortChange, - currentSort, - setAccessToken, -}: AllKeysTableProps) => { - const { userId: userID, userRole, accessToken, premiumUser } = useAuthorized(); - const { teams } = useTeams(); - const [selectedKeyId, setSelectedKeyId] = useState(null); - const [userList, setUserList] = useState([]); - const [sorting, setSorting] = React.useState(() => { - if (currentSort) { - return [ - { - id: currentSort.sortBy, - desc: currentSort.sortOrder === "desc", - }, - ]; - } - return [ - { - id: "created_at", - desc: true, - }, - ]; - }); - const [expandedAccordions, setExpandedAccordions] = useState>({}); - - // Use the filter logic hook - - const { filters, filteredKeys, allKeyAliases, allTeams, allOrganizations, handleFilterChange, handleFilterReset } = - useFilterLogic({ - keys, - teams, - organizations, - accessToken, - }); - - useEffect(() => { - if (accessToken) { - const user_IDs = keys.map((key) => key.user_id).filter((id) => id !== null); - const fetchUserList = async () => { - const userListData = await userListCall(accessToken, user_IDs, 1, 100); - setUserList(userListData.users); - }; - fetchUserList(); - } - }, [accessToken, keys]); - - // Add a useEffect to call refresh when a key is created - useEffect(() => { - if (!refresh || typeof window === "undefined") { - return; - } - const handleStorageChange = () => { - refresh(); - }; - - // Listen for storage events that might indicate a key was created - window.addEventListener("storage", handleStorageChange); - - return () => { - window.removeEventListener("storage", handleStorageChange); - }; - }, [refresh]); - - const columns: ColumnDef[] = [ - { - id: "expander", - header: () => null, - cell: ({ row }) => - row.getCanExpand() ? ( - - ) : null, - }, - { - id: "token", - accessorKey: "token", - header: "Key ID", - cell: (info) => ( -
- - - -
- ), - }, - { - id: "key_alias", - accessorKey: "key_alias", - header: "Key Alias", - cell: (info) => { - const value = info.getValue() as string; - return ( - {value ? (value.length > 20 ? `${value.slice(0, 20)}...` : value) : "-"} - ); - }, - }, - { - id: "key_name", - accessorKey: "key_name", - header: "Secret Key", - cell: (info) => {info.getValue() as string}, - }, - { - id: "team_alias", - accessorKey: "team_id", - header: "Team Alias", - cell: ({ row, getValue }) => { - const teamId = getValue() as string; - const team = teams?.find((t) => t.team_id === teamId); - return team?.team_alias || "Unknown"; - }, - }, - { - id: "team_id", - accessorKey: "team_id", - header: "Team ID", - cell: (info) => ( - - {info.getValue() ? `${(info.getValue() as string).slice(0, 7)}...` : "-"} - - ), - }, - { - id: "organization_id", - accessorKey: "organization_id", - header: "Organization ID", - cell: (info) => (info.getValue() ? info.renderValue() : "-"), - }, - { - id: "user_email", - accessorKey: "user_id", - header: "User Email", - cell: (info) => { - const userId = info.getValue() as string; - const user = userList.find((u) => u.user_id === userId); - return user?.user_email ? ( - - {user?.user_email.slice(0, 20)}... - - ) : ( - "-" - ); - }, - }, - { - id: "user_id", - accessorKey: "user_id", - header: "User ID", - cell: (info) => { - const userId = info.getValue() as string | null; - if (userId && userId.length > 15) { - return ( - - {userId.slice(0, 7)}... - - ); - } - return userId ? userId : "-"; - }, - }, - { - id: "created_at", - accessorKey: "created_at", - header: "Created At", - cell: (info) => { - const value = info.getValue(); - return value ? new Date(value as string).toLocaleDateString() : "-"; - }, - }, - { - id: "created_by", - accessorKey: "created_by", - header: "Created By", - cell: (info) => { - const value = info.getValue() as string | null; - if (value && value.length > 15) { - return ( - - {value.slice(0, 7)}... - - ); - } - return value; - }, - }, - { - id: "updated_at", - accessorKey: "updated_at", - header: "Updated At", - cell: (info) => { - const value = info.getValue(); - return value ? new Date(value as string).toLocaleDateString() : "Never"; - }, - }, - { - id: "expires", - accessorKey: "expires", - header: "Expires", - cell: (info) => { - const value = info.getValue(); - return value ? new Date(value as string).toLocaleDateString() : "Never"; - }, - }, - { - id: "spend", - accessorKey: "spend", - header: "Spend (USD)", - cell: (info) => formatNumberWithCommas(info.getValue() as number, 4), - }, - { - id: "max_budget", - accessorKey: "max_budget", - header: "Budget (USD)", - cell: (info) => { - const maxBudget = info.getValue() as number | null; - if (maxBudget === null) { - return "Unlimited"; - } - return `$${formatNumberWithCommas(maxBudget)}`; - }, - }, - { - id: "budget_reset_at", - accessorKey: "budget_reset_at", - header: "Budget Reset", - cell: (info) => { - const value = info.getValue(); - return value ? new Date(value as string).toLocaleString() : "Never"; - }, - }, - { - id: "models", - accessorKey: "models", - header: "Models", - cell: (info) => { - const models = info.getValue() as string[]; - return ( -
- {Array.isArray(models) ? ( -
- {models.length === 0 ? ( - - All Proxy Models - - ) : ( - <> -
- {models.length > 3 && ( -
- { - setExpandedAccordions((prev) => ({ - ...prev, - [info.row.id]: !prev[info.row.id], - })); - }} - /> -
- )} -
- {models.slice(0, 3).map((model, index) => - model === "all-proxy-models" ? ( - - All Proxy Models - - ) : ( - - - {model.length > 30 - ? `${getModelDisplayName(model).slice(0, 30)}...` - : getModelDisplayName(model)} - - - ), - )} - {models.length > 3 && !expandedAccordions[info.row.id] && ( - - - +{models.length - 3} {models.length - 3 === 1 ? "more model" : "more models"} - - - )} - {expandedAccordions[info.row.id] && ( -
- {models.slice(3).map((model, index) => - model === "all-proxy-models" ? ( - - All Proxy Models - - ) : ( - - - {model.length > 30 - ? `${getModelDisplayName(model).slice(0, 30)}...` - : getModelDisplayName(model)} - - - ), - )} -
- )} -
-
- - )} -
- ) : null} -
- ); - }, - }, - { - id: "rate_limits", - header: "Rate Limits", - cell: ({ row }) => { - const key = row.original; - return ( -
-
TPM: {key.tpm_limit !== null ? key.tpm_limit : "Unlimited"}
-
RPM: {key.rpm_limit !== null ? key.rpm_limit : "Unlimited"}
-
- ); - }, - }, - ]; - - const filterOptions: FilterOption[] = [ - { - name: "Team ID", - label: "Team ID", - isSearchable: true, - searchFn: async (searchText: string) => { - if (!allTeams || allTeams.length === 0) return []; - - const filteredTeams = allTeams.filter( - (team) => - team.team_id.toLowerCase().includes(searchText.toLowerCase()) || - (team.team_alias && team.team_alias.toLowerCase().includes(searchText.toLowerCase())), - ); - - return filteredTeams.map((team) => ({ - label: `${team.team_alias || team.team_id} (${team.team_id})`, - value: team.team_id, - })); - }, - }, - { - name: "Organization ID", - label: "Organization ID", - isSearchable: true, - searchFn: async (searchText: string) => { - if (!allOrganizations || allOrganizations.length === 0) return []; - - const filteredOrgs = allOrganizations.filter( - (org) => org.organization_id?.toLowerCase().includes(searchText.toLowerCase()) ?? false, - ); - - return filteredOrgs - .filter((org) => org.organization_id !== null && org.organization_id !== undefined) - .map((org) => ({ - label: `${org.organization_id || "Unknown"} (${org.organization_id})`, - value: org.organization_id as string, - })); - }, - }, - { - name: "Key Alias", - label: "Key Alias", - isSearchable: true, - searchFn: async (searchText) => { - const filteredKeyAliases = allKeyAliases.filter((key) => { - return key.toLowerCase().includes(searchText.toLowerCase()); - }); - - return filteredKeyAliases.map((key) => { - return { - label: key, - value: key, - }; - }); - }, - }, - { - name: "User ID", - label: "User ID", - isSearchable: false, - }, - { - name: "Key Hash", - label: "Key Hash", - isSearchable: false, - }, - ]; - - console.log(`keys: ${JSON.stringify(keys)}`); - - const table = useReactTable({ - data: filteredKeys, - columns: columns.filter((col) => col.id !== "expander"), - state: { - sorting, - }, - onSortingChange: (updaterOrValue) => { - const newSorting = typeof updaterOrValue === "function" ? updaterOrValue(sorting) : updaterOrValue; - console.log(`newSorting: ${JSON.stringify(newSorting)}`); - setSorting(newSorting); - if (newSorting && newSorting.length > 0) { - const sortState = newSorting[0]; - const sortBy = sortState.id; - const sortOrder = sortState.desc ? "desc" : "asc"; - console.log(`sortBy: ${sortBy}, sortOrder: ${sortOrder}`); - handleFilterChange({ - ...filters, - "Sort By": sortBy, - "Sort Order": sortOrder, - }); - onSortChange?.(sortBy, sortOrder); - } - }, - getCoreRowModel: getCoreRowModel(), - getSortedRowModel: getSortedRowModel(), - enableSorting: true, - manualSorting: false, - }); - - // Update local sorting state when currentSort prop changes - React.useEffect(() => { - if (currentSort) { - setSorting([ - { - id: currentSort.sortBy, - desc: currentSort.sortOrder === "desc", - }, - ]); - } - }, [currentSort]); - - return ( -
- {selectedKeyId ? ( - setSelectedKeyId(null)} - keyData={filteredKeys.find((k) => k.token === selectedKeyId)} - onKeyDataUpdate={(updatedKeyData) => { - setKeys((keys) => - keys.map((key) => { - if (key.token === updatedKeyData.token) { - return updateExistingKeys(key, updatedKeyData); - } - return key; - }), - ); - if (refresh) refresh(); // Minimal fix: refresh the full key list after an update - }} - onDelete={() => { - setKeys((keys) => keys.filter((key) => key.token !== selectedKeyId)); - if (refresh) refresh(); // Minimal fix: refresh the full key list after a delete - }} - accessToken={accessToken} - userID={userID} - userRole={userRole} - teams={allTeams} - premiumUser={premiumUser} - setAccessToken={setAccessToken} - /> - ) : ( -
-
- -
- -
- - Showing{" "} - {isLoading - ? "..." - : `${(pagination.currentPage - 1) * pageSize + 1} - ${Math.min(pagination.currentPage * pageSize, pagination.totalCount)}`}{" "} - of {isLoading ? "..." : pagination.totalCount} results - - -
- - Page {isLoading ? "..." : pagination.currentPage} of {isLoading ? "..." : pagination.totalPages} - - - - - -
-
-
-
-
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - -
-
- {header.isPlaceholder - ? null - : flexRender(header.column.columnDef.header, header.getContext())} -
- {header.id !== "actions" && ( -
- {header.column.getIsSorted() ? ( - { - asc: , - desc: , - }[header.column.getIsSorted() as string] - ) : ( - - )} -
- )} -
-
- ))} -
- ))} -
- - {isLoading ? ( - - -
-

🚅 Loading keys...

-
-
-
- ) : filteredKeys.length > 0 ? ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - 3 ? "px-0" : ""}`} - > - {flexRender(cell.column.columnDef.cell, cell.getContext())} - - ))} - - )) - ) : ( - - -
-

No keys found

-
-
-
- )} -
-
-
-
-
-
- )} -
- ); -}; - -export default VirtualKeysTable; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts deleted file mode 100644 index ac174a554e..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/hooks/useFilterLogic.ts +++ /dev/null @@ -1,189 +0,0 @@ -import { useCallback, useEffect, useState, useRef } from "react"; -import { useQuery } from "@tanstack/react-query"; -import { debounce } from "lodash"; -import { KeyResponse, Team } from "@/components/key_team_helpers/key_list"; -import { keyListCall, Organization } from "@/components/networking"; -import { defaultPageSize } from "@/components/constants"; -import { fetchAllKeyAliases, fetchAllOrganizations, fetchAllTeams } from "@/components/key_team_helpers/filter_helpers"; - -export interface FilterState { - "Team ID": string; - "Organization ID": string; - "Key Alias": string; - [key: string]: string; - "User ID": string; - "Sort By": string; - "Sort Order": string; -} - -export function useFilterLogic({ - keys, - teams, - organizations, - accessToken, -}: { - keys: KeyResponse[]; - teams: Team[] | null; - organizations: Organization[] | null; - accessToken: string | null; -}) { - const defaultFilters: FilterState = { - "Team ID": "", - "Organization ID": "", - "Key Alias": "", - "User ID": "", - "Sort By": "created_at", - "Sort Order": "desc", - }; - const [filters, setFilters] = useState(defaultFilters); - const [allTeams, setAllTeams] = useState(teams || []); - const [allOrganizations, setAllOrganizations] = useState(organizations || []); - const [filteredKeys, setFilteredKeys] = useState(keys); - const lastSearchTimestamp = useRef(0); - const debouncedSearch = useCallback( - debounce(async (filters: FilterState) => { - if (!accessToken) { - return; - } - - const currentTimestamp = Date.now(); - lastSearchTimestamp.current = currentTimestamp; - - try { - // Make the API call using userListCall with all filter parameters - const data = await keyListCall( - accessToken, - filters["Organization ID"] || null, - filters["Team ID"] || null, - filters["Key Alias"] || null, - filters["User ID"] || null, - filters["Key Hash"] || null, - 1, // Reset to first page when searching - defaultPageSize, - filters["Sort By"] || null, - filters["Sort Order"] || null, - ); - - // Only update state if this is the most recent search - if (currentTimestamp === lastSearchTimestamp.current) { - if (data) { - setFilteredKeys(data.keys); - console.log("called from debouncedSearch filters:", JSON.stringify(filters)); - console.log("called from debouncedSearch data:", JSON.stringify(data)); - } - } - } catch (error) { - console.error("Error searching users:", error); - } - }, 300), - [accessToken], - ); - // Apply filters to keys whenever keys or filters change - useEffect(() => { - if (!keys) { - setFilteredKeys([]); - return; - } - - let result = [...keys]; - - // Apply Team ID filter - if (filters["Team ID"]) { - result = result.filter((key) => key.team_id === filters["Team ID"]); - } - - // Apply Organization ID filter - if (filters["Organization ID"]) { - result = result.filter((key) => key.organization_id === filters["Organization ID"]); - } - - setFilteredKeys(result); - }, [keys, filters]); - - // Fetch all data for filters when component mounts - useEffect(() => { - const loadAllFilterData = async () => { - // Load all teams - no organization filter needed here - const teamsData = await fetchAllTeams(accessToken); - if (teamsData.length > 0) { - setAllTeams(teamsData); - } - - // Load all organizations - const orgsData = await fetchAllOrganizations(accessToken); - if (orgsData.length > 0) { - setAllOrganizations(orgsData); - } - }; - - if (accessToken) { - loadAllFilterData(); - } - }, [accessToken]); - - const queryAllKeysQuery = useQuery({ - queryKey: ["allKeys"], - queryFn: async () => { - if (!accessToken) throw new Error("Access token required"); - return await fetchAllKeyAliases(accessToken); - }, - enabled: !!accessToken, - }); - const allKeyAliases = queryAllKeysQuery.data || []; - - // Update teams and organizations when props change - useEffect(() => { - if (teams && teams.length > 0) { - setAllTeams((prevTeams) => { - // Only update if we don't already have a larger set of teams - return prevTeams.length < teams.length ? teams : prevTeams; - }); - } - }, [teams]); - - useEffect(() => { - if (organizations && organizations.length > 0) { - setAllOrganizations((prevOrgs) => { - // Only update if we don't already have a larger set of organizations - return prevOrgs.length < organizations.length ? organizations : prevOrgs; - }); - } - }, [organizations]); - - const handleFilterChange = (newFilters: Record) => { - // Update filters state - setFilters({ - "Team ID": newFilters["Team ID"] || "", - "Organization ID": newFilters["Organization ID"] || "", - "Key Alias": newFilters["Key Alias"] || "", - "User ID": newFilters["User ID"] || "", - "Sort By": newFilters["Sort By"] || "created_at", - "Sort Order": newFilters["Sort Order"] || "desc", - }); - - // Fetch keys based on new filters - const updatedFilters = { - ...filters, - ...newFilters, - }; - debouncedSearch(updatedFilters); - }; - - const handleFilterReset = () => { - // Reset filters state - setFilters(defaultFilters); - - // Reset selections - debouncedSearch(defaultFilters); - }; - - return { - filters, - filteredKeys, - allKeyAliases, - allTeams, - allOrganizations, - handleFilterChange, - handleFilterReset, - }; -} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/page.tsx index 611d92f1a3..56f780b296 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/virtual-keys/page.tsx @@ -1,16 +1,18 @@ "use client"; -import VirtualKeysTable from "@/app/(dashboard)/virtual-keys/components/VirtualKeysTable/VirtualKeysTable"; import { useState } from "react"; -import useKeyList from "@/components/key_team_helpers/key_list"; +import useKeyList, { KeyResponse } from "@/components/key_team_helpers/key_list"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { Col, Grid } from "@tremor/react"; -import CreateKey from "@/app/(dashboard)/virtual-keys/components/CreateKey"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; +import UserDashboard from "@/components/user_dashboard"; +import useTeams from "@/app/(dashboard)/hooks/useTeams"; +import { Organization } from "@/components/networking"; const VirtualKeysPage = () => { - const { accessToken, userRole } = useAuthorized(); + const { accessToken, userRole, userId, premiumUser, userEmail } = useAuthorized(); + const { teams, setTeams } = useTeams(); const [createClicked, setCreateClicked] = useState(false); + const [organizations, setOrganizations] = useState([]); const queryClient = new QueryClient(); @@ -28,20 +30,21 @@ const VirtualKeysPage = () => { return ( -
- - - - {}} - organizations={null} - /> - - -
+ {}} + setUserEmail={() => {}} + setTeams={setTeams} + setKeys={setKeys} + premiumUser={premiumUser} + organizations={organizations} + addKey={addKey} + createClicked={createClicked} + />
); }; diff --git a/ui/litellm-dashboard/src/components/templates/view_key_table.tsx b/ui/litellm-dashboard/src/components/templates/view_key_table.tsx index d146d5ba79..86903d5553 100644 --- a/ui/litellm-dashboard/src/components/templates/view_key_table.tsx +++ b/ui/litellm-dashboard/src/components/templates/view_key_table.tsx @@ -90,7 +90,7 @@ interface ViewKeyTableProps { selectedTeam: Team | null; setSelectedTeam: React.Dispatch>; data: KeyResponse[] | null; - setData: React.Dispatch>; + setData: (keys: KeyResponse[]) => void; teams: Team[] | null; premiumUser: boolean; currentOrg: Organization | null; @@ -135,13 +135,6 @@ interface CombinedLimits { [key: string]: CombinedLimit; // Index signature allowing string keys } -/** - * ───────────────────────────────────────────────────────────────────────── - * @deprecated - * This component is being DEPRECATED in favor of src/app/(dashboard)/virtual-keys/components/VirtualKeysTable/ - * Please contribute to the new refactor. - * ───────────────────────────────────────────────────────────────────────── - */ const ViewKeyTable: React.FC = ({ userID, userRole, diff --git a/ui/litellm-dashboard/src/components/user_dashboard.tsx b/ui/litellm-dashboard/src/components/user_dashboard.tsx index b6470e4952..4d98b37a8f 100644 --- a/ui/litellm-dashboard/src/components/user_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/user_dashboard.tsx @@ -20,11 +20,12 @@ import ViewUserTeam from "./view_user_team"; import DashboardTeam from "./dashboard_default_team"; import Onboarding from "../app/onboarding/page"; import { useSearchParams, useRouter } from "next/navigation"; -import { Team } from "./key_team_helpers/key_list"; +import { KeyResponse, Team } from "./key_team_helpers/key_list"; import { jwtDecode } from "jwt-decode"; import { Typography } from "antd"; import { clearTokenCookies } from "@/utils/cookieUtils"; import { clearMCPAuthTokens } from "./mcp_tools/mcp_auth_storage"; +import { Setter } from "@/types"; export interface ProxySettings { PROXY_BASE_URL: string | null; @@ -56,7 +57,7 @@ interface UserDashboardProps { setUserRole: React.Dispatch>; setUserEmail: React.Dispatch>; setTeams: React.Dispatch>; - setKeys: React.Dispatch>; + setKeys: (keys: KeyResponse[]) => void; premiumUser: boolean; organizations: Organization[] | null; addKey: (data: any) => void; diff --git a/ui/litellm-dashboard/src/components/view_users.tsx b/ui/litellm-dashboard/src/components/view_users.tsx index 19479ce21a..7fcb7f54b8 100644 --- a/ui/litellm-dashboard/src/components/view_users.tsx +++ b/ui/litellm-dashboard/src/components/view_users.tsx @@ -30,6 +30,8 @@ import { updateExistingKeys } from "@/utils/dataUtils"; import { useDebouncedState } from "@tanstack/react-pacer/debouncer"; import { isAdminRole } from "@/utils/roles"; import NotificationsManager from "./molecules/notifications_manager"; +import { Setter } from "@/types"; +import { KeyResponse } from "@/components/key_team_helpers/key_list"; interface ViewUserDashboardProps { accessToken: string | null; From c97495c5d9f9a7356230f4bff6fb4c50a7467f82 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 8 Oct 2025 17:39:42 -0700 Subject: [PATCH 26/48] docs(mcp.md): document new allow/disallow tool parameters functionality --- docs/my-website/docs/mcp.md | 115 +++++++++++++++++++++++++- litellm/proxy/_new_secret_config.yaml | 33 ++++++-- 2 files changed, 138 insertions(+), 10 deletions(-) diff --git a/docs/my-website/docs/mcp.md b/docs/my-website/docs/mcp.md index 9365b0a554..bb0759598a 100644 --- a/docs/my-website/docs/mcp.md +++ b/docs/my-website/docs/mcp.md @@ -246,7 +246,7 @@ litellm_settings: -## MCP Tool Filtering +## Allow/Disallow MCP Tools Control which tools are available from your MCP servers. You can either allow only specific tools or block dangerous ones. @@ -306,6 +306,119 @@ mcp_servers: - If you specify both `allowed_tools` and `disallowed_tools`, the allowed list takes priority - Tool names are case-sensitive +--- + +## Allow/Disallow MCP Tool Parameters + +Control which parameters are allowed for specific MCP tools using the `allowed_params` configuration. This provides fine-grained control over tool usage by restricting the parameters that can be passed to each tool. + +### Configuration + +`allowed_params` is a dictionary that maps tool names to lists of allowed parameter names. When configured, only the specified parameters will be accepted for that tool - any other parameters will be rejected with a 403 error. + +```yaml title="config.yaml with allowed_params" showLineNumbers +mcp_servers: + deepwiki_mcp: + url: https://mcp.deepwiki.com/mcp + transport: "http" + auth_type: "none" + allowed_params: + # Tool name: list of allowed parameters + read_wiki_contents: ["status"] + + my_api_mcp: + url: "https://my-api-server.com" + auth_type: "api_key" + auth_value: "my-key" + allowed_params: + # Using unprefixed tool name + getpetbyid: ["status"] + # Using prefixed tool name (both formats work) + my_api_mcp-findpetsbystatus: ["status", "limit"] + # Another tool with multiple allowed params + create_issue: ["title", "body", "labels"] +``` + +### How It Works + +1. **Tool-specific filtering**: Each tool can have its own list of allowed parameters +2. **Flexible naming**: Tool names can be specified with or without the server prefix (e.g., both `"getpetbyid"` and `"my_api_mcp-getpetbyid"` work) +3. **Whitelist approach**: Only parameters in the allowed list are permitted +4. **Unlisted tools**: If `allowed_params` is not set, all parameters are allowed +5. **Error handling**: Requests with disallowed parameters receive a 403 error with details about which parameters are allowed + +### Example Request Behavior + +With the configuration above, here's how requests would be handled: + +**✅ Allowed Request:** +```json +{ + "tool": "read_wiki_contents", + "arguments": { + "status": "active" + } +} +``` + +**❌ Rejected Request:** +```json +{ + "tool": "read_wiki_contents", + "arguments": { + "status": "active", + "limit": 10 // This parameter is not allowed + } +} +``` + +**Error Response:** +```json +{ + "error": "Parameters ['limit'] are not allowed for tool read_wiki_contents. Allowed parameters: ['status']. Contact proxy admin to allow these parameters." +} +``` + +### Use Cases + +- **Security**: Prevent users from accessing sensitive parameters or dangerous operations +- **Cost control**: Restrict expensive parameters (e.g., limiting result counts) +- **Compliance**: Enforce parameter usage policies for regulatory requirements +- **Staged rollouts**: Gradually enable parameters as tools are tested +- **Multi-tenant isolation**: Different parameter access for different user groups + +### Combining with Tool Filtering + +`allowed_params` works alongside `allowed_tools` and `disallowed_tools` for complete control: + +```yaml title="Combined filtering example" showLineNumbers +mcp_servers: + github_mcp: + url: "https://api.githubcopilot.com/mcp" + auth_type: oauth2 + authorization_url: https://github.com/login/oauth/authorize + token_url: https://github.com/login/oauth/access_token + client_id: os.environ/GITHUB_OAUTH_CLIENT_ID + client_secret: os.environ/GITHUB_OAUTH_CLIENT_SECRET + scopes: ["public_repo", "user:email"] + # Only allow specific tools + allowed_tools: ["create_issue", "list_issues", "search_issues"] + # Block dangerous operations + disallowed_tools: ["delete_repo"] + # Restrict parameters per tool + allowed_params: + create_issue: ["title", "body", "labels"] + list_issues: ["state", "sort", "perPage"] + search_issues: ["query", "sort", "order", "perPage"] +``` + +This configuration ensures that: +1. Only the three listed tools are available +2. The `delete_repo` tool is explicitly blocked +3. Each tool can only use its specified parameters + +--- + ## MCP Server Access Control LiteLLM Proxy provides two methods for controlling access to specific MCP servers: diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yaml index ff68684416..996df3d3f5 100644 --- a/litellm/proxy/_new_secret_config.yaml +++ b/litellm/proxy/_new_secret_config.yaml @@ -17,15 +17,30 @@ model_list: api_key: dummy mcp_servers: - github_mcp: - url: "https://api.githubcopilot.com/mcp" - auth_type: oauth2 - authorization_url: https://github.com/login/oauth/authorize - token_url: https://github.com/login/oauth/access_token - client_id: os.environ/GITHUB_OAUTH_CLIENT_ID - client_secret: os.environ/GITHUB_OAUTH_CLIENT_SECRET - scopes: ["public_repo", "user:email"] - + deepwiki_mcp: + url: https://mcp.deepwiki.com/mcp + transport: "http" + auth_type: "none" + allowed_params: + read_wiki_contents: ["status"] + + # my_api_mcp: + # url: "http://0.0.0.0:8090" + # spec_path: "/Users/krrishdholakia/Documents/temp_py_folder/example_openapi.json" + # auth_type: none + # allowed_tools: ["getpetbyid", "my_api_mcp-findpetsbystatus"] + # # Configure allowed parameters per tool + # # Key: tool name (with or without prefix) + # # Value: list of allowed parameter names + # allowed_params: + # # Using unprefixed tool name + # "getpetbyid": ["status"] + # # Using prefixed tool name (both formats work) + # "my_api_mcp-findpetsbystatus": ["status", "limit"] + # # Example: allow only specific params for another tool + # # "another_tool": ["param1", "param2"] + + litellm_settings: callbacks: ["prometheus"] custom_prometheus_metadata_labels: ["metadata.initiative", "metadata.business-unit"] From 3beb4a0797baee8694804b02aaa171be312ba1de Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Wed, 8 Oct 2025 17:54:48 -0700 Subject: [PATCH 27/48] added reload to base URL when FF is turned off --- .../src/app/(dashboard)/layout.tsx | 2 +- ui/litellm-dashboard/src/app/page.tsx | 1 - .../src/hooks/useFeatureFlags.tsx | 25 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx index 3d38a7362b..68ab361356 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx @@ -63,7 +63,7 @@ export default function Layout({ children }: { children: React.ReactNode }) { />
- +
{children}
diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index ceee52399e..cefa680fc8 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -23,7 +23,6 @@ import ModelHubTable from "@/components/model_hub_table"; import NewUsagePage from "@/components/new_usage"; import APIRef from "@/components/api_ref"; import ChatUI from "@/components/chat_ui/ChatUI"; -import Sidebar from "@/components/leftnav"; import Usage from "@/components/usage"; import CacheDashboard from "@/components/cache_dashboard"; import { getUiConfig, proxyBaseUrl, setGlobalLitellmHeaderName } from "@/components/networking"; diff --git a/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx b/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx index f1914f463a..d3d676d2d2 100644 --- a/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx +++ b/ui/litellm-dashboard/src/hooks/useFeatureFlags.tsx @@ -1,5 +1,13 @@ "use client"; + +const getBasePath = () => { + const raw = process.env.NEXT_PUBLIC_BASE_URL ?? ""; + const trimmed = raw.replace(/^\/+|\/+$/g, ""); // strip leading/trailing slashes + return trimmed ? `/${trimmed}/` : "/"; // ensure trailing slash +}; + import React, { createContext, useContext, useEffect, useState } from "react"; +import { useRouter } from "next/navigation"; // ⟵ add this type Flags = { refactoredUIFlag: boolean; @@ -48,6 +56,8 @@ function writeFlagSafely(v: boolean) { } export const FeatureFlagsProvider = ({ children }: { children: React.ReactNode }) => { + const router = useRouter(); // ⟵ add this + // Lazy init reads from localStorage only on the client const [refactoredUIFlag, setRefactoredUIFlagState] = useState(() => readFlagSafely()); @@ -73,6 +83,21 @@ export const FeatureFlagsProvider = ({ children }: { children: React.ReactNode } return () => window.removeEventListener("storage", onStorage); }, []); + // Redirect to base path the moment the flag is OFF. + useEffect(() => { + if (refactoredUIFlag) return; // only act when turned off + + const base = getBasePath(); + const normalize = (p: string) => (p.endsWith("/") ? p : p + "/"); + const current = normalize(window.location.pathname); + + // Avoid a redirect loop if we're already at the base path. + if (current !== base) { + // Replace so the "off" redirect doesn't pollute history. + router.replace(base); + } + }, [refactoredUIFlag, router]); + return ( {children} ); From ff4eda0ea67730da3363f2d151decb9ee3ce4e9c Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Wed, 8 Oct 2025 18:00:15 -0700 Subject: [PATCH 28/48] removed unscoped changes (will be added later) --- .../components/modals/CreateUserModal.tsx | 346 ------------------ .../src/components/leftnav.tsx | 41 +-- 2 files changed, 18 insertions(+), 369 deletions(-) delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx diff --git a/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx b/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx deleted file mode 100644 index be3ea48bf2..0000000000 --- a/ui/litellm-dashboard/src/app/(dashboard)/components/modals/CreateUserModal.tsx +++ /dev/null @@ -1,346 +0,0 @@ -"use client"; - -// TODO: refactor -import React, { useState, useEffect } from "react"; -import { Button, Modal, Form, Input, message, Select, InputNumber, Select as Select2 } from "antd"; -import { - Button as Button2, - Text, - TextInput, - SelectItem, - Accordion, - AccordionHeader, - AccordionBody, - Title, -} from "@tremor/react"; -import NotificationsManager from "@/components/molecules/notifications_manager"; -const { Option } = Select; -import { Tooltip } from "antd"; -import { InfoCircleOutlined } from "@ant-design/icons"; -import { useQueryClient } from "@tanstack/react-query"; -import OnboardingModal, { InvitationLink } from "@/components/onboarding_link"; -import { - getProxyBaseUrl, - getProxyUISettings, - invitationCreateCall, - modelAvailableCall, - Team, - userCreateCall, -} from "@/components/networking"; -import { getModelDisplayName } from "@/components/key_team_helpers/fetch_available_models_team_key"; -import BulkCreateUsersButton from "@/components/bulk_create_users_button"; -import useTeams from "@/app/(dashboard)/hooks/useTeams"; -import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; - -// Helper function to generate UUID compatible across all environments -const generateUUID = (): string => { - if (typeof crypto !== "undefined" && crypto.randomUUID) { - return crypto.randomUUID(); - } - // Fallback UUID generation for environments without crypto.randomUUID - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { - const r = (Math.random() * 16) | 0; - const v = c == "x" ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); -}; - -interface CreateUserModalProps { - possibleUIRoles: null | Record>; - onUserCreated?: (userId: string) => void; - isEmbedded?: boolean; -} - -interface UISettings { - PROXY_BASE_URL: string | null; - PROXY_LOGOUT_URL: string | null; - DEFAULT_TEAM_DISABLED: boolean; - SSO_ENABLED: boolean; -} - -const CreateUserModal: React.FC = ({ possibleUIRoles, onUserCreated, isEmbedded = false }) => { - const { userId: userID, accessToken } = useAuthorized(); - const queryClient = useQueryClient(); - const [uiSettings, setUISettings] = useState(null); - const [form] = Form.useForm(); - const [isModalVisible, setIsModalVisible] = useState(false); - const [apiuser, setApiuser] = useState(false); - const [userModels, setUserModels] = useState([]); - const [isInvitationLinkModalVisible, setIsInvitationLinkModalVisible] = useState(false); - const [invitationLinkData, setInvitationLinkData] = useState(null); - const [baseUrl, setBaseUrl] = useState(null); - const { teams } = useTeams(); - - // get all models - useEffect(() => { - const fetchData = async () => { - try { - const userRole = "any"; // You may need to get the user role dynamically - const modelDataResponse = await modelAvailableCall(accessToken, userID, userRole); - // Assuming modelDataResponse.data contains an array of model objects with a 'model_name' property - const availableModels = []; - for (let i = 0; i < modelDataResponse.data.length; i++) { - const model = modelDataResponse.data[i]; - availableModels.push(model.id); - } - console.log("Model data response:", modelDataResponse.data); - console.log("Available models:", availableModels); - - // Assuming modelDataResponse.data contains an array of model names - setUserModels(availableModels); - - // get ui settings - const uiSettingsResponse = await getProxyUISettings(accessToken); - console.log("uiSettingsResponse:", uiSettingsResponse); - - setUISettings(uiSettingsResponse); - } catch (error) { - console.error("Error fetching model data:", error); - } - }; - - setBaseUrl(getProxyBaseUrl()); - - fetchData(); // Call the function to fetch model data when the component mounts - }, []); // Empty dependency array to run only once - - const handleOk = () => { - setIsModalVisible(false); - form.resetFields(); - }; - - const handleCancel = () => { - setIsModalVisible(false); - setApiuser(false); - form.resetFields(); - }; - - const handleCreate = async (formValues: { user_id: string; models?: string[]; user_role: string }) => { - try { - NotificationsManager.info("Making API Call"); - if (!isEmbedded) { - setIsModalVisible(true); - } - if ((!formValues.models || formValues.models.length === 0) && formValues.user_role !== "proxy_admin") { - console.log("formValues.user_role", formValues.user_role); - // If models is empty or undefined, set it to "no-default-models" - formValues.models = ["no-default-models"]; - } - console.log("formValues in create user:", formValues); - const response = await userCreateCall(accessToken, null, formValues); - await queryClient.invalidateQueries({ queryKey: ["userList"] }); - console.log("user create Response:", response); - setApiuser(true); - const user_id = response.data?.user_id || response.user_id; - - // Call the callback if provided (for embedded mode) - if (onUserCreated && isEmbedded) { - onUserCreated(user_id); - form.resetFields(); - return; // Skip the invitation flow when embedded - } - - // only do invite link flow if sso is not enabled - if (!uiSettings?.SSO_ENABLED) { - invitationCreateCall(accessToken, user_id).then((data) => { - data.has_user_setup_sso = false; - setInvitationLinkData(data); - setIsInvitationLinkModalVisible(true); - }); - } else { - // create an InvitationLink Object for this user for the SSO flow - // for SSO the invite link is the proxy base url since the User just needs to login - const invitationLink: InvitationLink = { - id: generateUUID(), // Generate a unique ID - user_id: user_id, - is_accepted: false, - accepted_at: null, - expires_at: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // Set expiry to 7 days from now - created_at: new Date(), - created_by: userID, // Assuming userID is the current user creating the invitation - updated_at: new Date(), - updated_by: userID, - has_user_setup_sso: true, - }; - setInvitationLinkData(invitationLink); - setIsInvitationLinkModalVisible(true); - } - - NotificationsManager.success("API user Created"); - form.resetFields(); - localStorage.removeItem("userData" + userID); - } catch (error: any) { - const errorMessage = error.response?.data?.detail || error?.message || "Error creating the user"; - NotificationsManager.fromBackend(errorMessage); - console.error("Error creating the user:", error); - } - }; - - // Modify the return statement to handle embedded mode - if (isEmbedded) { - return ( -
- - - - - - {possibleUIRoles && - Object.entries(possibleUIRoles).map(([role, { ui_label, description }]) => ( - -
- {ui_label}{" "} -

- {description} -

-
-
- ))} -
-
- - - - - - - - -
- -
-
- ); - } - - // Original return for standalone mode - return ( -
- setIsModalVisible(true)}> - + Invite User - - - - Create a User who can own keys -
- - - - - Global Proxy Role{" "} - - - - - } - name="user_role" - > - - {possibleUIRoles && - Object.entries(possibleUIRoles).map(([role, { ui_label, description }]) => ( - -
- {ui_label}{" "} -

- {description} -

-
-
- ))} -
-
- - - - - - - - - - - Personal Key Creation - - - - Models{" "} - - - - - } - name="models" - help="Models user has access to, outside of team scope." - > - - - All Proxy Models - - {userModels.map((model) => ( - - {getModelDisplayName(model)} - - ))} - - - - -
- -
-
-
- {apiuser && ( - - )} -
- ); -}; - -export default CreateUserModal; diff --git a/ui/litellm-dashboard/src/components/leftnav.tsx b/ui/litellm-dashboard/src/components/leftnav.tsx index a0d8d162c6..e47691d3bb 100644 --- a/ui/litellm-dashboard/src/components/leftnav.tsx +++ b/ui/litellm-dashboard/src/components/leftnav.tsx @@ -1,4 +1,8 @@ import { Layout, Menu } from "antd"; +import Link from "next/link"; +import { List } from "postcss/lib/list"; +import { Text, Button } from "@tremor/react"; +import { useState } from "react"; import { KeyOutlined, PlayCircleOutlined, @@ -56,17 +60,6 @@ interface MenuItem { icon?: React.ReactNode; } -/** ---------- Base URL helpers ---------- */ -/** - * Normalizes NEXT_PUBLIC_BASE_URL to either "/" or "/ui/" (always with a trailing slash). - * Supported env values: "" or "ui/". - */ -const getBasePath = () => { - const raw = process.env.NEXT_PUBLIC_BASE_URL ?? ""; - const trimmed = raw.replace(/^\/+|\/+$/g, ""); // strip leading/trailing slashes - return trimmed ? `/${trimmed}/` : "/"; // ensure trailing slash -}; - const Sidebar: React.FC = ({ accessToken, setPage, userRole, defaultSelectedKey, collapsed = false }) => { // Note: If a menu item does not have a role, it is visible to all roles. const menuItems: MenuItem[] = [ @@ -225,7 +218,6 @@ const Sidebar: React.FC = ({ accessToken, setPage, userRole, defau ], }, ]; - // Find the menu item that matches the default page, including in submenus const findMenuItemKey = (page: string): string => { // Check top-level items @@ -260,15 +252,6 @@ const Sidebar: React.FC = ({ accessToken, setPage, userRole, defau return true; }); - // Centralized navigation that prefixes the base path ("/" or "/ui/") - const goTo = (page: string) => { - const base = getBasePath(); // "/" or "/ui/" - const newSearchParams = new URLSearchParams(window.location.search); - newSearchParams.set("page", page); - window.history.pushState(null, "", `${base}?${newSearchParams.toString()}`); // e.g. "/ui/?page=..." - setPage(page); - }; - return ( = ({ accessToken, setPage, userRole, defau key: child.key, icon: child.icon, label: child.label, - onClick: () => goTo(child.page), + onClick: () => { + const newSearchParams = new URLSearchParams(window.location.search); + newSearchParams.set("page", child.page); + window.history.pushState(null, "", `?${newSearchParams.toString()}`); + setPage(child.page); + }, })), - onClick: !item.children ? () => goTo(item.page) : undefined, + onClick: !item.children + ? () => { + const newSearchParams = new URLSearchParams(window.location.search); + newSearchParams.set("page", item.page); + window.history.pushState(null, "", `?${newSearchParams.toString()}`); + setPage(item.page); + } + : undefined, }))} /> From 4bebb576116754039a78f9dda35ed60b65fe91c9 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Wed, 8 Oct 2025 18:28:10 -0700 Subject: [PATCH 29/48] moved test to test_litellm --- tests/proxy_unit_tests/test_proxy_utils.py | 67 ------------------- tests/test_litellm/proxy/test_proxy_utils.py | 68 ++++++++++++++++++++ 2 files changed, 68 insertions(+), 67 deletions(-) diff --git a/tests/proxy_unit_tests/test_proxy_utils.py b/tests/proxy_unit_tests/test_proxy_utils.py index 9b01f21c58..4ac54b7780 100644 --- a/tests/proxy_unit_tests/test_proxy_utils.py +++ b/tests/proxy_unit_tests/test_proxy_utils.py @@ -1029,73 +1029,6 @@ def test_update_config_fields(): assert team_config["langfuse_secret"] == "my-fake-secret" -def test_update_config_fields_deep_merge_db_wins(): - from litellm.proxy.proxy_server import ProxyConfig - - proxy_config = ProxyConfig() - - current_config = { - "router_settings": { - "routing_mode": "cost_optimized", - "model_group_alias": { - # Existing alias with older model + different hidden flag - "claude-sonnet-4": { - "model": "claude-sonnet-4-20240219", - "hidden": True, - }, - # An extra alias that should remain untouched unless DB overrides it - "legacy-sonnet": { - "model": "claude-2.1", - "hidden": True, - }, - }, - } - } - - db_param_value = { - "model_group_alias": { - # Conflict: DB should win (both 'model' and 'hidden') - "claude-sonnet-4": { - "model": "claude-sonnet-4-20250514", - "hidden": False, - }, - # New alias to be added by the merge - "claude-sonnet-latest": { - "model": "claude-sonnet-4-20250514", - "hidden": True, - }, - # Demonstrate that None values from DB are skipped (preserve existing) - "legacy-sonnet": { - "hidden": None # should not clobber current True - }, - } - } - - updated = proxy_config._update_config_fields( - current_config=current_config, - param_name="router_settings", - db_param_value=db_param_value, - ) - - rs = updated["router_settings"] - aliases = rs["model_group_alias"] - - # DB wins on conflicts (deep) for existing alias - assert aliases["claude-sonnet-4"]["model"] == "claude-sonnet-4-20250514" - assert aliases["claude-sonnet-4"]["hidden"] is False - - # New alias introduced by DB is present with its values - assert "claude-sonnet-latest" in aliases - assert aliases["claude-sonnet-latest"]["model"] == "claude-sonnet-4-20250514" - assert aliases["claude-sonnet-latest"]["hidden"] is True - - # None in DB does not overwrite existing values - assert aliases["legacy-sonnet"]["model"] == "claude-2.1" - assert aliases["legacy-sonnet"]["hidden"] is True - - # Unrelated router_settings keys are preserved - assert rs["routing_mode"] == "cost_optimized" - def test_update_config_fields_default_internal_user_params(monkeypatch): from litellm.proxy.proxy_server import ProxyConfig diff --git a/tests/test_litellm/proxy/test_proxy_utils.py b/tests/test_litellm/proxy/test_proxy_utils.py index 6997ac6527..89e410af2c 100644 --- a/tests/test_litellm/proxy/test_proxy_utils.py +++ b/tests/test_litellm/proxy/test_proxy_utils.py @@ -19,6 +19,74 @@ from unittest.mock import MagicMock from litellm.proxy.utils import get_custom_url +def test_update_config_fields_deep_merge_db_wins(): + from litellm.proxy.proxy_server import ProxyConfig + + proxy_config = ProxyConfig() + + current_config = { + "router_settings": { + "routing_mode": "cost_optimized", + "model_group_alias": { + # Existing alias with older model + different hidden flag + "claude-sonnet-4": { + "model": "claude-sonnet-4-20240219", + "hidden": True, + }, + # An extra alias that should remain untouched unless DB overrides it + "legacy-sonnet": { + "model": "claude-2.1", + "hidden": True, + }, + }, + } + } + + db_param_value = { + "model_group_alias": { + # Conflict: DB should win (both 'model' and 'hidden') + "claude-sonnet-4": { + "model": "claude-sonnet-4-20250514", + "hidden": False, + }, + # New alias to be added by the merge + "claude-sonnet-latest": { + "model": "claude-sonnet-4-20250514", + "hidden": True, + }, + # Demonstrate that None values from DB are skipped (preserve existing) + "legacy-sonnet": { + "hidden": None # should not clobber current True + }, + } + } + + updated = proxy_config._update_config_fields( + current_config=current_config, + param_name="router_settings", + db_param_value=db_param_value, + ) + + rs = updated["router_settings"] + aliases = rs["model_group_alias"] + + # DB wins on conflicts (deep) for existing alias + assert aliases["claude-sonnet-4"]["model"] == "claude-sonnet-4-20250514" + assert aliases["claude-sonnet-4"]["hidden"] is False + + # New alias introduced by DB is present with its values + assert "claude-sonnet-latest" in aliases + assert aliases["claude-sonnet-latest"]["model"] == "claude-sonnet-4-20250514" + assert aliases["claude-sonnet-latest"]["hidden"] is True + + # None in DB does not overwrite existing values + assert aliases["legacy-sonnet"]["model"] == "claude-2.1" + assert aliases["legacy-sonnet"]["hidden"] is True + + # Unrelated router_settings keys are preserved + assert rs["routing_mode"] == "cost_optimized" + + def test_get_custom_url(monkeypatch): monkeypatch.setenv("SERVER_ROOT_PATH", "/litellm") custom_url = get_custom_url(request_base_url="http://0.0.0.0:4000", route="ui/") From 37fdb486d4e4a0278e38190e5f62ec0fc6b46abc Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 8 Oct 2025 19:06:19 -0700 Subject: [PATCH 30/48] refactor: comment out oauth error raising logic for now --- .../mcp_server/auth/user_api_key_auth_mcp.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py b/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py index 714f2c8746..20a632f167 100644 --- a/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py +++ b/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py @@ -114,16 +114,16 @@ class MCPRequestHandler: request.body = mock_body # type: ignore if ".well-known" in str(request.url): # public routes validated_user_api_key_auth = UserAPIKeyAuth() - elif litellm_api_key == "": - from fastapi import HTTPException + # elif litellm_api_key == "": + # from fastapi import HTTPException - raise HTTPException( - status_code=401, - detail="LiteLLM API key is missing. Please add it or use OAuth authentication.", - headers={ - "WWW-Authenticate": f'Bearer resource_metadata=f"{request.base_url}/.well-known/oauth-protected-resource"', - }, - ) + # raise HTTPException( + # status_code=401, + # detail="LiteLLM API key is missing. Please add it or use OAuth authentication.", + # headers={ + # "WWW-Authenticate": f'Bearer resource_metadata=f"{request.base_url}/.well-known/oauth-protected-resource"', + # }, + # ) else: validated_user_api_key_auth = await user_api_key_auth( api_key=litellm_api_key, request=request From 5be198248bc11fc29e93aac8bc164a5a9f057a41 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 8 Oct 2025 19:07:11 -0700 Subject: [PATCH 31/48] fix: fix linting error --- .../_experimental/mcp_server/auth/user_api_key_auth_mcp.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py b/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py index 20a632f167..e77ad11fae 100644 --- a/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py +++ b/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py @@ -5,12 +5,7 @@ from starlette.requests import Request from starlette.types import Scope from litellm._logging import verbose_logger -from litellm.proxy._types import ( - LiteLLM_TeamTable, - LitellmUserRoles, - SpecialHeaders, - UserAPIKeyAuth, -) +from litellm.proxy._types import LiteLLM_TeamTable, SpecialHeaders, UserAPIKeyAuth from litellm.proxy.auth.user_api_key_auth import user_api_key_auth From e2b7b05774ba4403f9a8c2efa12d65b348b07919 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 8 Oct 2025 19:16:22 -0700 Subject: [PATCH 32/48] docs(mcp.md): document new openapi to mcp tool support --- docs/my-website/docs/mcp.md | 195 ++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) diff --git a/docs/my-website/docs/mcp.md b/docs/my-website/docs/mcp.md index 9365b0a554..462306e961 100644 --- a/docs/my-website/docs/mcp.md +++ b/docs/my-website/docs/mcp.md @@ -246,6 +246,201 @@ litellm_settings: +## Converting OpenAPI Specs to MCP Servers + +LiteLLM can automatically convert OpenAPI specifications into MCP servers, allowing you to expose any REST API as MCP tools. This is useful when you have existing APIs with OpenAPI/Swagger documentation and want to make them available as MCP tools. + +### Benefits + +- **Rapid Integration**: Convert existing APIs to MCP tools without writing custom MCP server code +- **Automatic Tool Generation**: LiteLLM automatically generates MCP tools from your OpenAPI spec +- **Unified Interface**: Use the same MCP interface for both native MCP servers and OpenAPI-based APIs +- **Easy Testing**: Test and iterate on API integrations quickly + +### Configuration + +Add your OpenAPI-based MCP server to your `config.yaml`: + +```yaml title="config.yaml - OpenAPI to MCP" showLineNumbers +model_list: + - model_name: gpt-4o + litellm_params: + model: openai/gpt-4o + api_key: sk-xxxxxxx + +mcp_servers: + # OpenAPI Spec Example - Petstore API + petstore_mcp: + url: "https://petstore.swagger.io/v2" + spec_path: "/path/to/openapi.json" + auth_type: "none" + + # OpenAPI Spec with API Key Authentication + my_api_mcp: + url: "http://0.0.0.0:8090" + spec_path: "/path/to/openapi.json" + auth_type: "api_key" + auth_value: "your-api-key-here" + + # OpenAPI Spec with Bearer Token + secured_api_mcp: + url: "https://api.example.com" + spec_path: "/path/to/openapi.json" + auth_type: "bearer_token" + auth_value: "your-bearer-token" +``` + +### Configuration Parameters + +| Parameter | Required | Description | +|-----------|----------|-------------| +| `url` | Yes | The base URL of your API endpoint | +| `spec_path` | Yes | Path or URL to your OpenAPI specification file (JSON or YAML) | +| `auth_type` | No | Authentication type: `none`, `api_key`, `bearer_token`, `basic`, `authorization` | +| `auth_value` | No | Authentication value (required if `auth_type` is set) | +| `description` | No | Optional description for the MCP server | +| `allowed_tools` | No | List of specific tools to allow (see [MCP Tool Filtering](#mcp-tool-filtering)) | +| `disallowed_tools` | No | List of specific tools to block (see [MCP Tool Filtering](#mcp-tool-filtering)) | + +### Usage Example + +Once configured, you can use the OpenAPI-based MCP server just like any other MCP server: + + + + +```python title="Using OpenAPI-based MCP Server" showLineNumbers +from fastmcp import Client +import asyncio + +# Standard MCP configuration +config = { + "mcpServers": { + "petstore": { + "url": "http://localhost:4000/petstore_mcp/mcp", + "headers": { + "x-litellm-api-key": "Bearer sk-1234" + } + } + } +} + +# Create a client that connects to the server +client = Client(config) + +async def main(): + async with client: + # List available tools generated from OpenAPI spec + tools = await client.list_tools() + print(f"Available tools: {[tool.name for tool in tools]}") + + # Example: Get a pet by ID (from Petstore API) + response = await client.call_tool( + name="getpetbyid", + arguments={"petId": "1"} + ) + print(f"Response:\n{response}\n") + + # Example: Find pets by status + response = await client.call_tool( + name="findpetsbystatus", + arguments={"status": "available"} + ) + print(f"Response:\n{response}\n") + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + + +```json title="Cursor MCP Configuration for OpenAPI Server" showLineNumbers +{ + "mcpServers": { + "Petstore": { + "url": "http://localhost:4000/petstore_mcp/mcp", + "headers": { + "x-litellm-api-key": "Bearer $LITELLM_API_KEY" + } + } + } +} +``` + + + + + +```bash title="Using OpenAPI MCP Server with OpenAI" showLineNumbers +curl --location 'https://api.openai.com/v1/responses' \ +--header 'Content-Type: application/json' \ +--header "Authorization: Bearer $OPENAI_API_KEY" \ +--data '{ + "model": "gpt-4o", + "tools": [ + { + "type": "mcp", + "server_label": "petstore", + "server_url": "http://localhost:4000/petstore_mcp/mcp", + "require_approval": "never", + "headers": { + "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY" + } + } + ], + "input": "Find all available pets in the petstore", + "tool_choice": "required" +}' +``` + + + + +### How It Works + +1. **Spec Loading**: LiteLLM loads your OpenAPI specification from the provided `spec_path` +2. **Tool Generation**: Each API endpoint in the spec becomes an MCP tool +3. **Parameter Mapping**: OpenAPI parameters are automatically mapped to MCP tool parameters +4. **Request Handling**: When a tool is called, LiteLLM converts the MCP request to the appropriate HTTP request +5. **Response Translation**: API responses are converted back to MCP format + +### OpenAPI Spec Requirements + +Your OpenAPI specification should follow standard OpenAPI/Swagger conventions: +- **Supported versions**: OpenAPI 3.0.x, OpenAPI 3.1.x, Swagger 2.0 +- **Required fields**: `paths`, `info` sections should be properly defined +- **Operation IDs**: Each operation should have a unique `operationId` (this becomes the tool name) +- **Parameters**: Request parameters should be properly documented with types and descriptions + +### Example OpenAPI Spec Structure + +```yaml title="sample-openapi.yaml" showLineNumbers +openapi: 3.0.0 +info: + title: My API + version: 1.0.0 +paths: + /pets/{petId}: + get: + operationId: getPetById + summary: Get a pet by ID + parameters: + - name: petId + in: path + required: true + schema: + type: integer + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object +``` + ## MCP Tool Filtering Control which tools are available from your MCP servers. You can either allow only specific tools or block dangerous ones. From 169c1f0f217f07916dbc13ec1e4e686b5306248b Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Wed, 8 Oct 2025 19:24:16 -0700 Subject: [PATCH 33/48] moved test to test_proxy_server --- tests/test_litellm/proxy/test_proxy_server.py | 68 +++++++++++++++++++ tests/test_litellm/proxy/test_proxy_utils.py | 68 ------------------- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/tests/test_litellm/proxy/test_proxy_server.py b/tests/test_litellm/proxy/test_proxy_server.py index 43e3e2ad0c..21930d116d 100644 --- a/tests/test_litellm/proxy/test_proxy_server.py +++ b/tests/test_litellm/proxy/test_proxy_server.py @@ -126,6 +126,74 @@ async def test_initialize_scheduled_jobs_credentials(monkeypatch): assert len(mock_scheduler_calls) > 0 +def test_update_config_fields_deep_merge_db_wins(): + from litellm.proxy.proxy_server import ProxyConfig + + proxy_config = ProxyConfig() + + current_config = { + "router_settings": { + "routing_mode": "cost_optimized", + "model_group_alias": { + # Existing alias with older model + different hidden flag + "claude-sonnet-4": { + "model": "claude-sonnet-4-20240219", + "hidden": True, + }, + # An extra alias that should remain untouched unless DB overrides it + "legacy-sonnet": { + "model": "claude-2.1", + "hidden": True, + }, + }, + } + } + + db_param_value = { + "model_group_alias": { + # Conflict: DB should win (both 'model' and 'hidden') + "claude-sonnet-4": { + "model": "claude-sonnet-4-20250514", + "hidden": False, + }, + # New alias to be added by the merge + "claude-sonnet-latest": { + "model": "claude-sonnet-4-20250514", + "hidden": True, + }, + # Demonstrate that None values from DB are skipped (preserve existing) + "legacy-sonnet": { + "hidden": None # should not clobber current True + }, + } + } + + updated = proxy_config._update_config_fields( + current_config=current_config, + param_name="router_settings", + db_param_value=db_param_value, + ) + + rs = updated["router_settings"] + aliases = rs["model_group_alias"] + + # DB wins on conflicts (deep) for existing alias + assert aliases["claude-sonnet-4"]["model"] == "claude-sonnet-4-20250514" + assert aliases["claude-sonnet-4"]["hidden"] is False + + # New alias introduced by DB is present with its values + assert "claude-sonnet-latest" in aliases + assert aliases["claude-sonnet-latest"]["model"] == "claude-sonnet-4-20250514" + assert aliases["claude-sonnet-latest"]["hidden"] is True + + # None in DB does not overwrite existing values + assert aliases["legacy-sonnet"]["model"] == "claude-2.1" + assert aliases["legacy-sonnet"]["hidden"] is True + + # Unrelated router_settings keys are preserved + assert rs["routing_mode"] == "cost_optimized" + + # Mock Prisma class MockPrisma: def __init__(self, database_url=None, proxy_logging_obj=None, http_client=None): diff --git a/tests/test_litellm/proxy/test_proxy_utils.py b/tests/test_litellm/proxy/test_proxy_utils.py index 89e410af2c..6997ac6527 100644 --- a/tests/test_litellm/proxy/test_proxy_utils.py +++ b/tests/test_litellm/proxy/test_proxy_utils.py @@ -19,74 +19,6 @@ from unittest.mock import MagicMock from litellm.proxy.utils import get_custom_url -def test_update_config_fields_deep_merge_db_wins(): - from litellm.proxy.proxy_server import ProxyConfig - - proxy_config = ProxyConfig() - - current_config = { - "router_settings": { - "routing_mode": "cost_optimized", - "model_group_alias": { - # Existing alias with older model + different hidden flag - "claude-sonnet-4": { - "model": "claude-sonnet-4-20240219", - "hidden": True, - }, - # An extra alias that should remain untouched unless DB overrides it - "legacy-sonnet": { - "model": "claude-2.1", - "hidden": True, - }, - }, - } - } - - db_param_value = { - "model_group_alias": { - # Conflict: DB should win (both 'model' and 'hidden') - "claude-sonnet-4": { - "model": "claude-sonnet-4-20250514", - "hidden": False, - }, - # New alias to be added by the merge - "claude-sonnet-latest": { - "model": "claude-sonnet-4-20250514", - "hidden": True, - }, - # Demonstrate that None values from DB are skipped (preserve existing) - "legacy-sonnet": { - "hidden": None # should not clobber current True - }, - } - } - - updated = proxy_config._update_config_fields( - current_config=current_config, - param_name="router_settings", - db_param_value=db_param_value, - ) - - rs = updated["router_settings"] - aliases = rs["model_group_alias"] - - # DB wins on conflicts (deep) for existing alias - assert aliases["claude-sonnet-4"]["model"] == "claude-sonnet-4-20250514" - assert aliases["claude-sonnet-4"]["hidden"] is False - - # New alias introduced by DB is present with its values - assert "claude-sonnet-latest" in aliases - assert aliases["claude-sonnet-latest"]["model"] == "claude-sonnet-4-20250514" - assert aliases["claude-sonnet-latest"]["hidden"] is True - - # None in DB does not overwrite existing values - assert aliases["legacy-sonnet"]["model"] == "claude-2.1" - assert aliases["legacy-sonnet"]["hidden"] is True - - # Unrelated router_settings keys are preserved - assert rs["routing_mode"] == "cost_optimized" - - def test_get_custom_url(monkeypatch): monkeypatch.setenv("SERVER_ROOT_PATH", "/litellm") custom_url = get_custom_url(request_base_url="http://0.0.0.0:4000", route="ui/") From 95e71b31a82d2e6947f2dd8b649e011911c37704 Mon Sep 17 00:00:00 2001 From: Achintya Rajan Date: Wed, 8 Oct 2025 19:25:54 -0700 Subject: [PATCH 34/48] Update test_proxy_utils.py --- tests/proxy_unit_tests/test_proxy_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/proxy_unit_tests/test_proxy_utils.py b/tests/proxy_unit_tests/test_proxy_utils.py index 4ac54b7780..34a8a9daf8 100644 --- a/tests/proxy_unit_tests/test_proxy_utils.py +++ b/tests/proxy_unit_tests/test_proxy_utils.py @@ -1029,7 +1029,6 @@ def test_update_config_fields(): assert team_config["langfuse_secret"] == "my-fake-secret" - def test_update_config_fields_default_internal_user_params(monkeypatch): from litellm.proxy.proxy_server import ProxyConfig From 763d2f8ccdd8412dbe6d4ac0e136d9ac34dcd4c0 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Wed, 8 Oct 2025 19:57:33 -0700 Subject: [PATCH 35/48] UI new build --- .../static/0NP4pGCTzzyECenXO-S3V/_buildManifest.js | 1 - .../_next/static/chunks/1039-1031e149b66e294d.js | 1 + .../_next/static/chunks/1052-80a465c977e6b146.js | 1 + .../_next/static/chunks/1160-3efb81c958413447.js | 1 + .../_next/static/chunks/117-6a9f6a591033d4a0.js | 2 -- .../_next/static/chunks/1223-de5e7e4f043a5233.js | 1 + .../_next/static/chunks/1264-2979d95e0b56a75c.js | 1 + .../_next/static/chunks/1307-6b882871684ce94c.js | 1 + .../static/chunks/13b76428-e1bf383848c17260.js | 1 + .../static/chunks/13b76428-ebdf3012af0e4489.js | 1 - .../_next/static/chunks/1487-ada9ecf7dd9bca97.js | 1 + .../_next/static/chunks/1491-80fe911f18f4631c.js | 1 + .../_next/static/chunks/1526-8e2976ed10cb2fa0.js | 1 + .../_next/static/chunks/1529-e0933e3af843b646.js | 1 + .../_next/static/chunks/162-b79fa8ec9408cd55.js | 1 - .../_next/static/chunks/1633-0db2561cf68d80bc.js | 1 + .../out/_next/static/chunks/17-782feb91c41095ca.js | 1 + .../_next/static/chunks/1739-5149135b6e98ac40.js | 1 + .../_next/static/chunks/2004-946c4fd2a52c86d0.js | 1 + .../_next/static/chunks/2019-d4e12fe6a3ca4e25.js | 1 + .../_next/static/chunks/2052-68db39dea49a676f.js | 1 + .../_next/static/chunks/2117-2da5ec8fad6a6c25.js | 2 ++ .../_next/static/chunks/2162-947823f263cd4e0b.js | 1 + .../_next/static/chunks/2202-563a3700a73a4a11.js | 1 + .../_next/static/chunks/226-81daaf8cff08ccfe.js | 1 + .../_next/static/chunks/2284-4cbc9a7f33eb7c89.js | 1 + .../_next/static/chunks/2344-169e12738d6439ab.js | 1 + .../_next/static/chunks/2417-b28f330f82bf4a82.js | 1 + .../_next/static/chunks/2525-13b137f40949dcf1.js | 4 ++++ .../_next/static/chunks/2662-51eb8b1bec576f6d.js | 1 + .../_next/static/chunks/2842-3febfc5e0bb91eff.js | 1 + .../_next/static/chunks/2926-b5dcad9f62f5e2b1.js | 1 + .../_next/static/chunks/293-a7c1c04c415a418e.js | 1 + .../static/chunks/3014691f-702e24806fe9cec4.js | 1 + .../static/chunks/3014691f-b7b79b78e27792f3.js | 1 - .../_next/static/chunks/313-0025fb08e386c4b8.js | 12 ------------ .../_next/static/chunks/3202-10bb7b948f3a8eb2.js | 1 + .../_next/static/chunks/3250-3256164511237d25.js | 1 + .../_next/static/chunks/3298-8d1992a5407c2cae.js | 1 + .../_next/static/chunks/3603-b101c17ea3d68f19.js | 1 + .../_next/static/chunks/3669-cbf664b1e9c58f8a.js | 1 + .../_next/static/chunks/3709-b17db86e0ab325d2.js | 1 + .../_next/static/chunks/3752-53808701995a5f10.js | 1 + .../_next/static/chunks/3801-4bb3b8116c02dad5.js | 1 + .../_next/static/chunks/3866-e3419825a249263f.js | 1 + .../_next/static/chunks/4292-5c3ab7c3b62e1965.js | 1 + .../_next/static/chunks/4365-a008db87ace8b7cb.js | 1 + .../_next/static/chunks/4696-f31deddc1ce81a6b.js | 1 + .../_next/static/chunks/4851-fbdd7aec2937c09d.js | 1 + .../out/_next/static/chunks/49-036448f42c39b97c.js | 1 - .../_next/static/chunks/4924-e47559a81a4aa31c.js | 1 + .../out/_next/static/chunks/50-d0da2dd7acce2eb9.js | 1 - .../_next/static/chunks/5079-a43d5cc0d7429256.js | 1 + .../_next/static/chunks/5096-4ef058eb8abce1d7.js | 1 + .../_next/static/chunks/5105-eb18802ec448789d.js | 1 + .../_next/static/chunks/5188-0e9d5e6db19ac9e6.js | 1 + .../_next/static/chunks/521-d97d355792d44830.js | 4 ---- .../_next/static/chunks/527-d9b7316e990a0539.js | 1 + .../_next/static/chunks/5319-43bd4ee5bb7e50d1.js | 1 + .../_next/static/chunks/5809-33437b27a2ac76d5.js | 1 + .../_next/static/chunks/5830-47ce1a4897188f14.js | 1 + .../_next/static/chunks/603-4d26e1c19f911024.js | 1 + .../_next/static/chunks/6433-c9b3a95c5de0b59f.js | 8 ++++++++ .../_next/static/chunks/6494-7124dea6b90175e7.js | 1 + .../_next/static/chunks/6836-e30124a71aafae62.js | 1 + .../_next/static/chunks/6925-5f3f11523497a729.js | 1 + .../_next/static/chunks/7155-f019e996be6de8e3.js | 1 + .../_next/static/chunks/7281-41cef56aa2b3df92.js | 1 + .../_next/static/chunks/7382-c293a81095a18d6c.js | 1 + .../_next/static/chunks/7406-8dbad47afbc571f1.js | 1 + .../_next/static/chunks/773-da80cf7b30837a84.js | 1 + .../_next/static/chunks/7851-62c5dbe52d2b953b.js | 1 + .../_next/static/chunks/7906-11071e9e2e7b8318.js | 1 + .../_next/static/chunks/7908-07a76cfe29c543c9.js | 1 + .../_next/static/chunks/8049-0a4ef0c3396390d0.js | 1 + .../_next/static/chunks/8098-3da3212991542668.js | 1 + .../_next/static/chunks/8143-44b491eb039c1a37.js | 1 + .../_next/static/chunks/8347-0845abae9a2a5d9e.js | 1 + .../_next/static/chunks/851-7416960163d4d982.js | 1 - .../_next/static/chunks/866-9e1803a09e9ae8da.js | 1 - .../_next/static/chunks/874-eeddfa04bd1a3b05.js | 1 + .../_next/static/chunks/8791-b95bd7fdd710a85d.js | 1 + .../_next/static/chunks/8806-85c2bcba4ca300e2.js | 1 + .../_next/static/chunks/901-34706ce91c6b582c.js | 1 + .../_next/static/chunks/9011-0769cb78a6e5f233.js | 1 + .../_next/static/chunks/9165-2a738a73d0d5f1d1.js | 1 + .../_next/static/chunks/9429-2cac017dd355dcd2.js | 1 + .../_next/static/chunks/9632-e6fd89cdaacd24b7.js | 1 + .../_next/static/chunks/9678-c633432ec1f8c65a.js | 1 + .../_next/static/chunks/9775-ac7313139c5f089d.js | 1 + .../_next/static/chunks/9820-b0722f821c1af1ee.js | 1 + .../_next/static/chunks/9888-a0a2120c93674b5e.js | 5 +++++ .../api-reference/page-65279b0256b88937.js | 1 + .../api-playground/page-a9a2313f4a4f5576.js | 1 + .../experimental/budgets/page-3f76f4d2f9e30bdd.js | 1 + .../experimental/caching/page-732ff8bc946077b5.js | 1 + .../old-usage/page-8f20fa1eb19068a7.js | 1 + .../experimental/prompts/page-8e0ff8f340793dfe.js | 1 + .../tag-management/page-bf54d2148954d39f.js | 1 + .../guardrails/page-332f6053a8a0dea0.js | 1 + .../app/(dashboard)/layout-356bfe32246db9cb.js | 1 + .../app/(dashboard)/logs/page-135a51c055a86dd3.js | 1 + .../(dashboard)/model-hub/page-9270d71fdee2c6d6.js | 1 + .../models-and-endpoints/page-62f85a79b1034b41.js | 1 + .../organizations/page-563ec8240873e36a.js | 1 + .../admin-settings/page-e306d985ab7d00d2.js | 1 + .../logging-and-alerts/page-28149e3c38e3f6c2.js | 1 + .../router-settings/page-378c964d8cbd1546.js | 1 + .../settings/ui-theme/page-946a86d088852793.js | 1 + .../app/(dashboard)/teams/page-f166a0ffc3b6a64c.js | 1 + .../(dashboard)/test-key/page-7f4c63c9185a0cc2.js | 1 + .../tools/mcp-servers/page-419df96d4d884fcc.js | 1 + .../tools/vector-stores/page-fd022e06e573a86a.js | 1 + .../app/(dashboard)/usage/page-6445839d3be55d3e.js | 1 + .../app/(dashboard)/users/page-b642eac5bc03b5e3.js | 1 + .../virtual-keys/page-b0b9794fef6314e4.js | 1 + .../chunks/app/_not-found/page-3b0daafcbe368586.js | 1 - .../chunks/app/_not-found/page-8fcbb38fcc17683b.js | 1 + .../static/chunks/app/layout-b4b61d636c5d2baf.js | 1 + .../static/chunks/app/layout-df4939b4f2ec37d7.js | 1 - .../chunks/app/model_hub/page-72f15aece1cca2fe.js | 1 + .../chunks/app/model_hub/page-d7915f579b770030.js | 1 - .../app/model_hub_table/page-09d61dd24d86b94d.js | 1 + .../app/model_hub_table/page-2f23c22a47b20607.js | 1 - .../chunks/app/onboarding/page-79017a4c39acd336.js | 1 - .../chunks/app/onboarding/page-dc50fce870d9ba1b.js | 1 + .../static/chunks/app/page-570a9fabe3b6be98.js | 1 - .../static/chunks/app/page-b9dc1b5637bfda99.js | 1 + .../static/chunks/fd9d1056-205af899b895cbac.js | 1 - .../static/chunks/fd9d1056-64e84c4092e0c5d7.js | 1 + .../static/chunks/framework-08aa667e5202eed8.js | 1 + .../static/chunks/framework-b370f160bb96059c.js | 1 - ...d370c92406567cc.js => main-a93cf31c84027372.js} | 2 +- .../static/chunks/main-app-77a6ca3c04ee9adf.js | 1 + .../static/chunks/main-app-bb35cb240fbb9dca.js | 1 - .../static/chunks/pages/_app-15e2daefa259f0b5.js | 1 - .../static/chunks/pages/_app-3c9ca398d360b709.js | 1 + .../static/chunks/pages/_error-28b803cb2479b966.js | 1 - .../static/chunks/pages/_error-cf5ca766ac8f493f.js | 1 + ...aae3231a8df1.js => webpack-db32e14ed3b4a921.js} | 2 +- .../static/rUJALQkuIpGgNwKsXlWEH/_buildManifest.js | 1 + .../_ssgManifest.js | 0 litellm/proxy/_experimental/out/api-reference.html | 1 + litellm/proxy/_experimental/out/api-reference.txt | 14 ++++++++++++++ .../out/experimental/api-playground.html | 1 + .../out/experimental/api-playground.txt | 14 ++++++++++++++ .../_experimental/out/experimental/budgets.html | 1 + .../_experimental/out/experimental/budgets.txt | 14 ++++++++++++++ .../_experimental/out/experimental/caching.html | 1 + .../_experimental/out/experimental/caching.txt | 14 ++++++++++++++ .../_experimental/out/experimental/old-usage.html | 1 + .../_experimental/out/experimental/old-usage.txt | 14 ++++++++++++++ .../_experimental/out/experimental/prompts.html | 1 + .../_experimental/out/experimental/prompts.txt | 14 ++++++++++++++ .../out/experimental/tag-management.html | 1 + .../out/experimental/tag-management.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/guardrails.html | 1 + litellm/proxy/_experimental/out/guardrails.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/index.html | 2 +- litellm/proxy/_experimental/out/index.txt | 11 ++++++----- litellm/proxy/_experimental/out/logs.html | 1 + litellm/proxy/_experimental/out/logs.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/model-hub.html | 1 + litellm/proxy/_experimental/out/model-hub.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/model_hub.txt | 7 ++++--- .../proxy/_experimental/out/model_hub_table.html | 1 + .../proxy/_experimental/out/model_hub_table.txt | 7 ++++--- .../_experimental/out/model_hub_table/index.html | 1 - .../_experimental/out/models-and-endpoints.html | 1 + .../_experimental/out/models-and-endpoints.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/onboarding.html | 1 + litellm/proxy/_experimental/out/onboarding.txt | 7 ++++--- litellm/proxy/_experimental/out/organizations.html | 1 + litellm/proxy/_experimental/out/organizations.txt | 14 ++++++++++++++ .../_experimental/out/settings/admin-settings.html | 1 + .../_experimental/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 + .../_experimental/out/settings/router-settings.txt | 14 ++++++++++++++ .../proxy/_experimental/out/settings/ui-theme.html | 1 + .../proxy/_experimental/out/settings/ui-theme.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/teams.html | 1 + litellm/proxy/_experimental/out/teams.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/test-key.html | 1 + litellm/proxy/_experimental/out/test-key.txt | 14 ++++++++++++++ .../proxy/_experimental/out/tools/mcp-servers.html | 1 + .../proxy/_experimental/out/tools/mcp-servers.txt | 14 ++++++++++++++ .../_experimental/out/tools/vector-stores.html | 1 + .../_experimental/out/tools/vector-stores.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/usage.html | 1 + litellm/proxy/_experimental/out/usage.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/users.html | 1 + litellm/proxy/_experimental/out/users.txt | 14 ++++++++++++++ litellm/proxy/_experimental/out/virtual-keys.html | 1 + litellm/proxy/_experimental/out/virtual-keys.txt | 14 ++++++++++++++ 196 files changed, 500 insertions(+), 55 deletions(-) delete mode 100644 litellm/proxy/_experimental/out/_next/static/0NP4pGCTzzyECenXO-S3V/_buildManifest.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1039-1031e149b66e294d.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1052-80a465c977e6b146.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1160-3efb81c958413447.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/117-6a9f6a591033d4a0.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1223-de5e7e4f043a5233.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1264-2979d95e0b56a75c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1307-6b882871684ce94c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/13b76428-e1bf383848c17260.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/13b76428-ebdf3012af0e4489.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1487-ada9ecf7dd9bca97.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1491-80fe911f18f4631c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1526-8e2976ed10cb2fa0.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1529-e0933e3af843b646.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/162-b79fa8ec9408cd55.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1633-0db2561cf68d80bc.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/17-782feb91c41095ca.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1739-5149135b6e98ac40.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2004-946c4fd2a52c86d0.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2019-d4e12fe6a3ca4e25.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2052-68db39dea49a676f.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2117-2da5ec8fad6a6c25.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2162-947823f263cd4e0b.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2202-563a3700a73a4a11.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/226-81daaf8cff08ccfe.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2284-4cbc9a7f33eb7c89.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2344-169e12738d6439ab.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2417-b28f330f82bf4a82.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2525-13b137f40949dcf1.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2662-51eb8b1bec576f6d.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2842-3febfc5e0bb91eff.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2926-b5dcad9f62f5e2b1.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/293-a7c1c04c415a418e.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3014691f-702e24806fe9cec4.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3014691f-b7b79b78e27792f3.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/313-0025fb08e386c4b8.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3202-10bb7b948f3a8eb2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3250-3256164511237d25.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3298-8d1992a5407c2cae.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3603-b101c17ea3d68f19.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3669-cbf664b1e9c58f8a.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3709-b17db86e0ab325d2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3752-53808701995a5f10.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3801-4bb3b8116c02dad5.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3866-e3419825a249263f.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4292-5c3ab7c3b62e1965.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4365-a008db87ace8b7cb.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4696-f31deddc1ce81a6b.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4851-fbdd7aec2937c09d.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/49-036448f42c39b97c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4924-e47559a81a4aa31c.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/50-d0da2dd7acce2eb9.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5079-a43d5cc0d7429256.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5096-4ef058eb8abce1d7.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5105-eb18802ec448789d.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5188-0e9d5e6db19ac9e6.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/521-d97d355792d44830.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/527-d9b7316e990a0539.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5319-43bd4ee5bb7e50d1.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5809-33437b27a2ac76d5.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5830-47ce1a4897188f14.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/603-4d26e1c19f911024.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6433-c9b3a95c5de0b59f.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6494-7124dea6b90175e7.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6836-e30124a71aafae62.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6925-5f3f11523497a729.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7155-f019e996be6de8e3.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7281-41cef56aa2b3df92.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7382-c293a81095a18d6c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7406-8dbad47afbc571f1.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/773-da80cf7b30837a84.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7851-62c5dbe52d2b953b.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7906-11071e9e2e7b8318.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7908-07a76cfe29c543c9.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8049-0a4ef0c3396390d0.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8098-3da3212991542668.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8143-44b491eb039c1a37.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8347-0845abae9a2a5d9e.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/851-7416960163d4d982.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/866-9e1803a09e9ae8da.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/874-eeddfa04bd1a3b05.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8791-b95bd7fdd710a85d.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8806-85c2bcba4ca300e2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/901-34706ce91c6b582c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9011-0769cb78a6e5f233.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9165-2a738a73d0d5f1d1.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9429-2cac017dd355dcd2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9632-e6fd89cdaacd24b7.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9678-c633432ec1f8c65a.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9775-ac7313139c5f089d.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9820-b0722f821c1af1ee.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9888-a0a2120c93674b5e.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-65279b0256b88937.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-a9a2313f4a4f5576.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/page-3f76f4d2f9e30bdd.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/page-732ff8bc946077b5.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-8f20fa1eb19068a7.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-8e0ff8f340793dfe.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-bf54d2148954d39f.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/page-332f6053a8a0dea0.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-356bfe32246db9cb.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-135a51c055a86dd3.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-9270d71fdee2c6d6.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-62f85a79b1034b41.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-563ec8240873e36a.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-e306d985ab7d00d2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-28149e3c38e3f6c2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/page-378c964d8cbd1546.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/page-946a86d088852793.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-f166a0ffc3b6a64c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-7f4c63c9185a0cc2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-419df96d4d884fcc.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-fd022e06e573a86a.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-6445839d3be55d3e.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-b642eac5bc03b5e3.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-b0b9794fef6314e4.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/_not-found/page-3b0daafcbe368586.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/_not-found/page-8fcbb38fcc17683b.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/layout-b4b61d636c5d2baf.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/layout-df4939b4f2ec37d7.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-72f15aece1cca2fe.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-d7915f579b770030.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-09d61dd24d86b94d.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-2f23c22a47b20607.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-79017a4c39acd336.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-dc50fce870d9ba1b.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-570a9fabe3b6be98.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-b9dc1b5637bfda99.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/fd9d1056-205af899b895cbac.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/fd9d1056-64e84c4092e0c5d7.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/framework-08aa667e5202eed8.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/framework-b370f160bb96059c.js rename litellm/proxy/_experimental/out/_next/static/chunks/{main-ad370c92406567cc.js => main-a93cf31c84027372.js} (67%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/main-app-77a6ca3c04ee9adf.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/main-app-bb35cb240fbb9dca.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/pages/_app-15e2daefa259f0b5.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/pages/_app-3c9ca398d360b709.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/pages/_error-28b803cb2479b966.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js rename litellm/proxy/_experimental/out/_next/static/chunks/{webpack-a426aae3231a8df1.js => webpack-db32e14ed3b4a921.js} (76%) create mode 100644 litellm/proxy/_experimental/out/_next/static/rUJALQkuIpGgNwKsXlWEH/_buildManifest.js rename litellm/proxy/_experimental/out/_next/static/{0NP4pGCTzzyECenXO-S3V => rUJALQkuIpGgNwKsXlWEH}/_ssgManifest.js (100%) create mode 100644 litellm/proxy/_experimental/out/api-reference.html create mode 100644 litellm/proxy/_experimental/out/api-reference.txt create mode 100644 litellm/proxy/_experimental/out/experimental/api-playground.html create mode 100644 litellm/proxy/_experimental/out/experimental/api-playground.txt create mode 100644 litellm/proxy/_experimental/out/experimental/budgets.html create mode 100644 litellm/proxy/_experimental/out/experimental/budgets.txt create mode 100644 litellm/proxy/_experimental/out/experimental/caching.html create mode 100644 litellm/proxy/_experimental/out/experimental/caching.txt create mode 100644 litellm/proxy/_experimental/out/experimental/old-usage.html create mode 100644 litellm/proxy/_experimental/out/experimental/old-usage.txt create mode 100644 litellm/proxy/_experimental/out/experimental/prompts.html create mode 100644 litellm/proxy/_experimental/out/experimental/prompts.txt create mode 100644 litellm/proxy/_experimental/out/experimental/tag-management.html create mode 100644 litellm/proxy/_experimental/out/experimental/tag-management.txt create mode 100644 litellm/proxy/_experimental/out/guardrails.html create mode 100644 litellm/proxy/_experimental/out/guardrails.txt create mode 100644 litellm/proxy/_experimental/out/logs.html create mode 100644 litellm/proxy/_experimental/out/logs.txt create mode 100644 litellm/proxy/_experimental/out/model-hub.html create mode 100644 litellm/proxy/_experimental/out/model-hub.txt create mode 100644 litellm/proxy/_experimental/out/model_hub_table.html delete mode 100644 litellm/proxy/_experimental/out/model_hub_table/index.html create mode 100644 litellm/proxy/_experimental/out/models-and-endpoints.html create mode 100644 litellm/proxy/_experimental/out/models-and-endpoints.txt create mode 100644 litellm/proxy/_experimental/out/onboarding.html create mode 100644 litellm/proxy/_experimental/out/organizations.html create mode 100644 litellm/proxy/_experimental/out/organizations.txt create mode 100644 litellm/proxy/_experimental/out/settings/admin-settings.html create mode 100644 litellm/proxy/_experimental/out/settings/admin-settings.txt create mode 100644 litellm/proxy/_experimental/out/settings/logging-and-alerts.html create mode 100644 litellm/proxy/_experimental/out/settings/logging-and-alerts.txt create mode 100644 litellm/proxy/_experimental/out/settings/router-settings.html create mode 100644 litellm/proxy/_experimental/out/settings/router-settings.txt create mode 100644 litellm/proxy/_experimental/out/settings/ui-theme.html create mode 100644 litellm/proxy/_experimental/out/settings/ui-theme.txt create mode 100644 litellm/proxy/_experimental/out/teams.html create mode 100644 litellm/proxy/_experimental/out/teams.txt create mode 100644 litellm/proxy/_experimental/out/test-key.html create mode 100644 litellm/proxy/_experimental/out/test-key.txt create mode 100644 litellm/proxy/_experimental/out/tools/mcp-servers.html create mode 100644 litellm/proxy/_experimental/out/tools/mcp-servers.txt create mode 100644 litellm/proxy/_experimental/out/tools/vector-stores.html create mode 100644 litellm/proxy/_experimental/out/tools/vector-stores.txt create mode 100644 litellm/proxy/_experimental/out/usage.html create mode 100644 litellm/proxy/_experimental/out/usage.txt create mode 100644 litellm/proxy/_experimental/out/users.html create mode 100644 litellm/proxy/_experimental/out/users.txt create mode 100644 litellm/proxy/_experimental/out/virtual-keys.html create mode 100644 litellm/proxy/_experimental/out/virtual-keys.txt diff --git a/litellm/proxy/_experimental/out/_next/static/0NP4pGCTzzyECenXO-S3V/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/0NP4pGCTzzyECenXO-S3V/_buildManifest.js deleted file mode 100644 index 96ded068de..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/0NP4pGCTzzyECenXO-S3V/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-28b803cb2479b966.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1039-1031e149b66e294d.js b/litellm/proxy/_experimental/out/_next/static/chunks/1039-1031e149b66e294d.js new file mode 100644 index 0000000000..74c9c3d33c --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1039-1031e149b66e294d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1039],{41649:function(e,t,n){n.d(t,{Z:function(){return f}});var r=n(5853),a=n(2265),o=n(1526),l=n(7084),i=n(26898),c=n(97324),s=n(1153);let d={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"}},u={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"}},p=(0,s.fn)("Badge"),f=a.forwardRef((e,t)=>{let{color:n,icon:f,size:m=l.u8.SM,tooltip:g,className:h,children:b}=e,v=(0,r._T)(e,["color","icon","size","tooltip","className","children"]),x=f||null,{tooltipProps:w,getReferenceProps:k}=(0,o.l)();return a.createElement("span",Object.assign({ref:(0,s.lq)([t,w.refs.setReference]),className:(0,c.q)(p("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-full",n?(0,c.q)((0,s.bM)(n,i.K.background).bgColor,(0,s.bM)(n,i.K.text).textColor,"bg-opacity-20 dark:bg-opacity-25"):(0,c.q)("bg-tremor-brand-muted text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted dark:text-dark-tremor-brand-emphasis"),d[m].paddingX,d[m].paddingY,d[m].fontSize,h)},k,v),a.createElement(o.Z,Object.assign({text:g},w)),x?a.createElement(x,{className:(0,c.q)(p("icon"),"shrink-0 -ml-1 mr-1.5",u[m].height,u[m].width)}):null,a.createElement("p",{className:(0,c.q)(p("text"),"text-sm whitespace-nowrap")},b))});f.displayName="Badge"},30150:function(e,t,n){n.d(t,{Z:function(){return p}});var r=n(5853),a=n(2265);let o=e=>{var t=(0,r._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),a.createElement("path",{d:"M12 4v16m8-8H4"}))},l=e=>{var t=(0,r._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),a.createElement("path",{d:"M20 12H4"}))};var i=n(97324),c=n(1153),s=n(69262);let d="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",u="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",p=a.forwardRef((e,t)=>{let{onSubmit:n,enableStepper:p=!0,disabled:f,onValueChange:m,onChange:g}=e,h=(0,r._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),b=(0,a.useRef)(null),[v,x]=a.useState(!1),w=a.useCallback(()=>{x(!0)},[]),k=a.useCallback(()=>{x(!1)},[]),[y,E]=a.useState(!1),S=a.useCallback(()=>{E(!0)},[]),C=a.useCallback(()=>{E(!1)},[]);return a.createElement(s.Z,Object.assign({type:"number",ref:(0,c.lq)([b,t]),disabled:f,makeInputClassName:(0,c.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=b.current)||void 0===t?void 0:t.value;null==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&S()},onKeyUp:e=>{"ArrowDown"===e.key&&k(),"ArrowUp"===e.key&&C()},onChange:e=>{f||(null==m||m(parseFloat(e.target.value)),null==g||g(e))},stepper:p?a.createElement("div",{className:(0,i.q)("flex justify-center align-middle")},a.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;f||(null===(e=b.current)||void 0===e||e.stepDown(),null===(t=b.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,i.q)(!f&&u,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},a.createElement(l,{"data-testid":"step-down",className:(v?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),a.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;f||(null===(e=b.current)||void 0===e||e.stepUp(),null===(t=b.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,i.q)(!f&&u,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},a.createElement(o,{"data-testid":"step-up",className:(y?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},h))});p.displayName="NumberInput"},87452:function(e,t,n){n.d(t,{Z:function(){return u},r:function(){return d}});var r=n(5853),a=n(21886);n(42698),n(64016);var o=n(8710);n(33232);var l=n(97324),i=n(1153),c=n(2265);let s=(0,i.fn)("Accordion"),d=(0,c.createContext)({isOpen:!1}),u=c.forwardRef((e,t)=>{var n;let{defaultOpen:i=!1,children:u,className:p}=e,f=(0,r._T)(e,["defaultOpen","children","className"]),m=null!==(n=(0,c.useContext)(o.Z))&&void 0!==n?n:(0,l.q)("rounded-tremor-default border");return c.createElement(a.p,Object.assign({as:"div",ref:t,className:(0,l.q)(s("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",m,p),defaultOpen:i},f),e=>{let{open:t}=e;return c.createElement(d.Provider,{value:{isOpen:t}},u)})});u.displayName="Accordion"},88829:function(e,t,n){n.d(t,{Z:function(){return c}});var r=n(5853),a=n(2265),o=n(21886),l=n(97324);let i=(0,n(1153).fn)("AccordionBody"),c=a.forwardRef((e,t)=>{let{children:n,className:c}=e,s=(0,r._T)(e,["children","className"]);return a.createElement(o.p.Panel,Object.assign({ref:t,className:(0,l.q)(i("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",c)},s),n)});c.displayName="AccordionBody"},72208:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(5853),a=n(2265),o=n(21886);let l=e=>{var t=(0,r._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var i=n(87452),c=n(97324);let s=(0,n(1153).fn)("AccordionHeader"),d=a.forwardRef((e,t)=>{let{children:n,className:d}=e,u=(0,r._T)(e,["children","className"]),{isOpen:p}=(0,a.useContext)(i.r);return a.createElement(o.p.Button,Object.assign({ref:t,className:(0,c.q)(s("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",d)},u),a.createElement("div",{className:(0,c.q)(s("children"),"flex flex-1 text-inherit mr-4")},n),a.createElement("div",null,a.createElement(l,{className:(0,c.q)(s("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",p?"transition-all":"transition-all -rotate-180")})))});d.displayName="AccordionHeader"},23496:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(2265),a=n(36760),o=n.n(a),l=n(71744),i=n(352),c=n(12918),s=n(80669),d=n(3104);let u=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:a,textPaddingInline:o,orientationMargin:l,verticalMarginInline:s}=e;return{[t]:Object.assign(Object.assign({},(0,c.Wf)(e)),{borderBlockStart:"".concat((0,i.bf)(a)," solid ").concat(r),"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:s,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:"".concat((0,i.bf)(a)," solid ").concat(r)},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:"".concat((0,i.bf)(e.dividerHorizontalGutterMargin)," 0")},["&-horizontal".concat(t,"-with-text")]:{display:"flex",alignItems:"center",margin:"".concat((0,i.bf)(e.dividerHorizontalWithTextGutterMargin)," 0"),color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:"0 ".concat(r),"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:"".concat((0,i.bf)(a)," solid transparent"),borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},["&-horizontal".concat(t,"-with-text-left")]:{"&::before":{width:"calc(".concat(l," * 100%)")},"&::after":{width:"calc(100% - ".concat(l," * 100%)")}},["&-horizontal".concat(t,"-with-text-right")]:{"&::before":{width:"calc(100% - ".concat(l," * 100%)")},"&::after":{width:"calc(".concat(l," * 100%)")}},["".concat(t,"-inner-text")]:{display:"inline-block",paddingBlock:0,paddingInline:o},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:"".concat((0,i.bf)(a)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dashed")]:{"&::before, &::after":{borderStyle:"dashed none none"}},["&-vertical".concat(t,"-dashed")]:{borderInlineStartWidth:a,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},["&-plain".concat(t,"-with-text")]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},["&-horizontal".concat(t,"-with-text-left").concat(t,"-no-default-orientation-margin-left")]:{"&::before":{width:0},"&::after":{width:"100%"},["".concat(t,"-inner-text")]:{paddingInlineStart:n}},["&-horizontal".concat(t,"-with-text-right").concat(t,"-no-default-orientation-margin-right")]:{"&::before":{width:"100%"},"&::after":{width:0},["".concat(t,"-inner-text")]:{paddingInlineEnd:n}}})}};var p=(0,s.I$)("Divider",e=>[u((0,d.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0}))],e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},m=e=>{let{getPrefixCls:t,direction:n,divider:a}=r.useContext(l.E_),{prefixCls:i,type:c="horizontal",orientation:s="center",orientationMargin:d,className:u,rootClassName:m,children:g,dashed:h,plain:b,style:v}=e,x=f(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),w=t("divider",i),[k,y,E]=p(w),S=s.length>0?"-".concat(s):s,C=!!g,I="left"===s&&null!=d,N="right"===s&&null!=d,O=o()(w,null==a?void 0:a.className,y,E,"".concat(w,"-").concat(c),{["".concat(w,"-with-text")]:C,["".concat(w,"-with-text").concat(S)]:C,["".concat(w,"-dashed")]:!!h,["".concat(w,"-plain")]:!!b,["".concat(w,"-rtl")]:"rtl"===n,["".concat(w,"-no-default-orientation-margin-left")]:I,["".concat(w,"-no-default-orientation-margin-right")]:N},u,m),P=r.useMemo(()=>"number"==typeof d?d:/^\d+$/.test(d)?Number(d):d,[d]),D=Object.assign(Object.assign({},I&&{marginLeft:P}),N&&{marginRight:P});return k(r.createElement("div",Object.assign({className:O,style:Object.assign(Object.assign({},null==a?void 0:a.style),v)},x,{role:"separator"}),g&&"vertical"!==c&&r.createElement("span",{className:"".concat(w,"-inner-text"),style:D},g)))}},21886:function(e,t,n){let r,a;n.d(t,{p:function(){return O}});var o,l=n(2265),i=n(13323),c=n(17684),s=n(80004),d=n(93689),u=n(37863),p=n(47634),f=n(24536),m=n(40293),g=n(27847);let h=null!=(o=l.startTransition)?o:function(e){e()};var b=n(37388),v=((r=v||{})[r.Open=0]="Open",r[r.Closed=1]="Closed",r),x=((a=x||{})[a.ToggleDisclosure=0]="ToggleDisclosure",a[a.CloseDisclosure=1]="CloseDisclosure",a[a.SetButtonId=2]="SetButtonId",a[a.SetPanelId=3]="SetPanelId",a[a.LinkPanel=4]="LinkPanel",a[a.UnlinkPanel=5]="UnlinkPanel",a);let w={0:e=>({...e,disclosureState:(0,f.E)(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},4:e=>!0===e.linkedPanel?e:{...e,linkedPanel:!0},5:e=>!1===e.linkedPanel?e:{...e,linkedPanel:!1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},k=(0,l.createContext)(null);function y(e){let t=(0,l.useContext)(k);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,y),t}return t}k.displayName="DisclosureContext";let E=(0,l.createContext)(null);E.displayName="DisclosureAPIContext";let S=(0,l.createContext)(null);function C(e,t){return(0,f.E)(t.type,w,e,t)}S.displayName="DisclosurePanelContext";let I=l.Fragment,N=g.AN.RenderStrategy|g.AN.Static,O=Object.assign((0,g.yV)(function(e,t){let{defaultOpen:n=!1,...r}=e,a=(0,l.useRef)(null),o=(0,d.T)(t,(0,d.h)(e=>{a.current=e},void 0===e.as||e.as===l.Fragment)),c=(0,l.useRef)(null),s=(0,l.useRef)(null),p=(0,l.useReducer)(C,{disclosureState:n?0:1,linkedPanel:!1,buttonRef:s,panelRef:c,buttonId:null,panelId:null}),[{disclosureState:h,buttonId:b},v]=p,x=(0,i.z)(e=>{v({type:1});let t=(0,m.r)(a);if(!t||!b)return;let n=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(b):t.getElementById(b);null==n||n.focus()}),w=(0,l.useMemo)(()=>({close:x}),[x]),y=(0,l.useMemo)(()=>({open:0===h,close:x}),[h,x]);return l.createElement(k.Provider,{value:p},l.createElement(E.Provider,{value:w},l.createElement(u.up,{value:(0,f.E)(h,{0:u.ZM.Open,1:u.ZM.Closed})},(0,g.sY)({ourProps:{ref:o},theirProps:r,slot:y,defaultTag:I,name:"Disclosure"}))))}),{Button:(0,g.yV)(function(e,t){let n=(0,c.M)(),{id:r="headlessui-disclosure-button-".concat(n),...a}=e,[o,u]=y("Disclosure.Button"),f=(0,l.useContext)(S),m=null!==f&&f===o.panelId,h=(0,l.useRef)(null),v=(0,d.T)(h,t,m?null:o.buttonRef),x=(0,g.Y2)();(0,l.useEffect)(()=>{if(!m)return u({type:2,buttonId:r}),()=>{u({type:2,buttonId:null})}},[r,u,m]);let w=(0,i.z)(e=>{var t;if(m){if(1===o.disclosureState)return;switch(e.key){case b.R.Space:case b.R.Enter:e.preventDefault(),e.stopPropagation(),u({type:0}),null==(t=o.buttonRef.current)||t.focus()}}else switch(e.key){case b.R.Space:case b.R.Enter:e.preventDefault(),e.stopPropagation(),u({type:0})}}),k=(0,i.z)(e=>{e.key===b.R.Space&&e.preventDefault()}),E=(0,i.z)(t=>{var n;(0,p.P)(t.currentTarget)||e.disabled||(m?(u({type:0}),null==(n=o.buttonRef.current)||n.focus()):u({type:0}))}),C=(0,l.useMemo)(()=>({open:0===o.disclosureState}),[o]),I=(0,s.f)(e,h),N=m?{ref:v,type:I,onKeyDown:w,onClick:E}:{ref:v,id:r,type:I,"aria-expanded":0===o.disclosureState,"aria-controls":o.linkedPanel?o.panelId:void 0,onKeyDown:w,onKeyUp:k,onClick:E};return(0,g.sY)({mergeRefs:x,ourProps:N,theirProps:a,slot:C,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,g.yV)(function(e,t){let n=(0,c.M)(),{id:r="headlessui-disclosure-panel-".concat(n),...a}=e,[o,i]=y("Disclosure.Panel"),{close:s}=function e(t){let n=(0,l.useContext)(E);if(null===n){let n=Error("<".concat(t," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(n,e),n}return n}("Disclosure.Panel"),p=(0,g.Y2)(),f=(0,d.T)(t,o.panelRef,e=>{h(()=>i({type:e?4:5}))});(0,l.useEffect)(()=>(i({type:3,panelId:r}),()=>{i({type:3,panelId:null})}),[r,i]);let m=(0,u.oJ)(),b=null!==m?(m&u.ZM.Open)===u.ZM.Open:0===o.disclosureState,v=(0,l.useMemo)(()=>({open:0===o.disclosureState,close:s}),[o,s]);return l.createElement(S.Provider,{value:o.panelId},(0,g.sY)({mergeRefs:p,ourProps:{ref:f,id:r},theirProps:a,slot:v,defaultTag:"div",features:N,visible:b,name:"Disclosure.Panel"}))})})},86462:function(e,t,n){var r=n(2265);let a=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:"M19 9l-7 7-7-7"}))});t.Z=a},23628:function(e,t,n){var r=n(2265);let a=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:"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"}))});t.Z=a}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1052-80a465c977e6b146.js b/litellm/proxy/_experimental/out/_next/static/chunks/1052-80a465c977e6b146.js new file mode 100644 index 0000000000..d760fa17b6 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1052-80a465c977e6b146.js @@ -0,0 +1 @@ +"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/litellm/proxy/_experimental/out/_next/static/chunks/1160-3efb81c958413447.js b/litellm/proxy/_experimental/out/_next/static/chunks/1160-3efb81c958413447.js new file mode 100644 index 0000000000..2a26d9fe08 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1160-3efb81c958413447.js @@ -0,0 +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 diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/117-6a9f6a591033d4a0.js b/litellm/proxy/_experimental/out/_next/static/chunks/117-6a9f6a591033d4a0.js deleted file mode 100644 index 54b5be8263..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/117-6a9f6a591033d4a0.js +++ /dev/null @@ -1,2 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[117],{65157:function(e,t){"use strict";function n(){return""}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return n}})},91572:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}),"canParse"in URL||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch(e){return!1}})},1634:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return u}});let r=n(68498),o=n(33068);function u(e,t){return(0,o.normalizePathTrailingSlash)((0,r.addPathPrefix)(e,""))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75266:function(e,t){"use strict";function n(e){var t,n;t=self.__next_s,n=()=>{e()},t&&t.length?t.reduce((e,t)=>{let[n,r]=t;return e.then(()=>new Promise((e,t)=>{let o=document.createElement("script");if(r)for(let e in r)"children"!==e&&o.setAttribute(e,r[e]);n?(o.src=n,o.onload=()=>e(),o.onerror=t):r&&(o.innerHTML=r.children,setTimeout(e)),document.head.appendChild(o)}))},Promise.resolve()).catch(e=>{console.error(e)}).then(()=>{n()}):n()}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"appBootstrap",{enumerable:!0,get:function(){return n}}),window.next={version:"14.2.32",appDir:!0},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},83079:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callServer",{enumerable:!0,get:function(){return o}});let r=n(12846);async function o(e,t){let n=(0,r.getServerActionDispatcher)();if(!n)throw Error("Invariant: missing action dispatcher.");return new Promise((r,o)=>{n({actionId:e,actionArgs:t,resolve:r,reject:o})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},92304:function(e,t,n){"use strict";let r,o;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hydrate",{enumerable:!0,get:function(){return x}});let u=n(47043),l=n(53099),a=n(57437);n(91572);let i=u._(n(34040)),c=l._(n(2265)),s=n(6671),f=n(48701),d=u._(n(61404)),p=n(83079),h=n(89721),y=n(2103);n(70647);let _=window.console.error;window.console.error=function(){for(var e=arguments.length,t=Array(e),n=0;n{if((0,h.isNextRouterError)(e.error)){e.preventDefault();return}});let v=document,b=new TextEncoder,g=!1,m=!1,R=null;function P(e){if(0===e[0])r=[];else if(1===e[0]){if(!r)throw Error("Unexpected server data: missing bootstrap script.");o?o.enqueue(b.encode(e[1])):r.push(e[1])}else 2===e[0]&&(R=e[1])}let j=function(){o&&!m&&(o.close(),m=!0,r=void 0),g=!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",j,!1):j();let O=self.__next_f=self.__next_f||[];O.forEach(P),O.push=P;let S=new ReadableStream({start(e){r&&(r.forEach(t=>{e.enqueue(b.encode(t))}),g&&!m&&(e.close(),m=!0,r=void 0)),o=e}}),E=(0,s.createFromReadableStream)(S,{callServer:p.callServer});function w(){return(0,c.use)(E)}let T=c.default.StrictMode;function M(e){let{children:t}=e;return t}function x(){let e=(0,y.createMutableActionQueue)(),t=(0,a.jsx)(T,{children:(0,a.jsx)(f.HeadManagerContext.Provider,{value:{appDir:!0},children:(0,a.jsx)(y.ActionQueueContext.Provider,{value:e,children:(0,a.jsx)(M,{children:(0,a.jsx)(w,{})})})})}),n=window.__next_root_layout_missing_tags,r=!!(null==n?void 0:n.length),o={onRecoverableError:d.default};"__next_error__"===document.documentElement.id||r?i.default.createRoot(v,o).render(t):c.default.startTransition(()=>i.default.hydrateRoot(v,t,{...o,formState:R}))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54278:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(19506),(0,n(75266).appBootstrap)(()=>{let{hydrate:e}=n(92304);n(12846),n(4707),e()}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},19506:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(65157);{let e=n.u;n.u=function(){for(var t=arguments.length,n=Array(t),r=0;r(l(function(){var e;let t=document.getElementsByName(u)[0];if(null==t?void 0:null==(e=t.shadowRoot)?void 0:e.childNodes[0])return t.shadowRoot.childNodes[0];{let e=document.createElement(u);e.style.cssText="position:absolute";let t=document.createElement("div");return t.ariaLive="assertive",t.id="__next-route-announcer__",t.role="alert",t.style.cssText="position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal",e.attachShadow({mode:"open"}).appendChild(t),document.body.appendChild(e),t}}()),()=>{let e=document.getElementsByTagName(u)[0];(null==e?void 0:e.isConnected)&&document.body.removeChild(e)}),[]);let[a,i]=(0,r.useState)(""),c=(0,r.useRef)();return(0,r.useEffect)(()=>{let e="";if(document.title)e=document.title;else{let t=document.querySelector("h1");t&&(e=t.innerText||t.textContent||"")}void 0!==c.current&&c.current!==e&&i(e),c.current=e},[t]),n?(0,o.createPortal)(a,n):null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6866:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION:function(){return r},FLIGHT_PARAMETERS:function(){return i},NEXT_DID_POSTPONE_HEADER:function(){return s},NEXT_ROUTER_PREFETCH_HEADER:function(){return u},NEXT_ROUTER_STATE_TREE:function(){return o},NEXT_RSC_UNION_QUERY:function(){return c},NEXT_URL:function(){return l},RSC_CONTENT_TYPE_HEADER:function(){return a},RSC_HEADER:function(){return n}});let n="RSC",r="Next-Action",o="Next-Router-State-Tree",u="Next-Router-Prefetch",l="Next-Url",a="text/x-component",i=[[n],[o],[u]],c="_rsc",s="x-nextjs-postponed";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},12846:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createEmptyCacheNode:function(){return C},default:function(){return I},getServerActionDispatcher:function(){return E},urlToUrlWithoutFlightMarker:function(){return T}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(61956),a=n(24673),i=n(33456),c=n(79060),s=n(47744),f=n(61060),d=n(82952),p=n(86146),h=n(1634),y=n(6495),_=n(4123),v=n(39320),b=n(38137),g=n(6866),m=n(35076),R=n(11283),P=n(84541),j="undefined"==typeof window,O=j?null:new Map,S=null;function E(){return S}let w={};function T(e){let t=new URL(e,location.origin);if(t.searchParams.delete(g.NEXT_RSC_UNION_QUERY),t.pathname.endsWith(".txt")){let{pathname:e}=t,n=e.endsWith("/index.txt")?10:4;t.pathname=e.slice(0,-n)}return t}function M(e){return e.origin!==window.location.origin}function x(e){let{appRouterState:t,sync:n}=e;return(0,u.useInsertionEffect)(()=>{let{tree:e,pushRef:r,canonicalUrl:o}=t,u={...r.preserveCustomHistoryState?window.history.state:{},__NA:!0,__PRIVATE_NEXTJS_INTERNALS_TREE:e};r.pendingPush&&(0,i.createHrefFromUrl)(new URL(window.location.href))!==o?(r.pendingPush=!1,window.history.pushState(u,"",o)):window.history.replaceState(u,"",o),n(t)},[t,n]),null}function C(){return{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null}}function A(e){null==e&&(e={});let t=window.history.state,n=null==t?void 0:t.__NA;n&&(e.__NA=n);let r=null==t?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;return r&&(e.__PRIVATE_NEXTJS_INTERNALS_TREE=r),e}function N(e){let{headCacheNode:t}=e,n=null!==t?t.head:null,r=null!==t?t.prefetchHead:null,o=null!==r?r:n;return(0,u.useDeferredValue)(n,o)}function D(e){let t,{buildId:n,initialHead:r,initialTree:i,urlParts:f,initialSeedData:g,couldBeIntercepted:E,assetPrefix:T,missingSlots:C}=e,D=(0,u.useMemo)(()=>(0,d.createInitialRouterState)({buildId:n,initialSeedData:g,urlParts:f,initialTree:i,initialParallelRoutes:O,location:j?null:window.location,initialHead:r,couldBeIntercepted:E}),[n,g,f,i,r,E]),[I,U,k]=(0,s.useReducerWithReduxDevtools)(D);(0,u.useEffect)(()=>{O=null},[]);let{canonicalUrl:F}=(0,s.useUnwrapState)(I),{searchParams:L,pathname:H}=(0,u.useMemo)(()=>{let e=new URL(F,"undefined"==typeof window?"http://n":window.location.href);return{searchParams:e.searchParams,pathname:(0,R.hasBasePath)(e.pathname)?(0,m.removeBasePath)(e.pathname):e.pathname}},[F]),$=(0,u.useCallback)(e=>{let{previousTree:t,serverResponse:n}=e;(0,u.startTransition)(()=>{U({type:a.ACTION_SERVER_PATCH,previousTree:t,serverResponse:n})})},[U]),G=(0,u.useCallback)((e,t,n)=>{let r=new URL((0,h.addBasePath)(e),location.href);return U({type:a.ACTION_NAVIGATE,url:r,isExternalUrl:M(r),locationSearch:location.search,shouldScroll:null==n||n,navigateType:t})},[U]);S=(0,u.useCallback)(e=>{(0,u.startTransition)(()=>{U({...e,type:a.ACTION_SERVER_ACTION})})},[U]);let z=(0,u.useMemo)(()=>({back:()=>window.history.back(),forward:()=>window.history.forward(),prefetch:(e,t)=>{let n;if(!(0,p.isBot)(window.navigator.userAgent)){try{n=new URL((0,h.addBasePath)(e),window.location.href)}catch(t){throw Error("Cannot prefetch '"+e+"' because it cannot be converted to a URL.")}M(n)||(0,u.startTransition)(()=>{var e;U({type:a.ACTION_PREFETCH,url:n,kind:null!=(e=null==t?void 0:t.kind)?e:a.PrefetchKind.FULL})})}},replace:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;G(e,"replace",null==(n=t.scroll)||n)})},push:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;G(e,"push",null==(n=t.scroll)||n)})},refresh:()=>{(0,u.startTransition)(()=>{U({type:a.ACTION_REFRESH,origin:window.location.origin})})},fastRefresh:()=>{throw Error("fastRefresh can only be used in development mode. Please use refresh instead.")}}),[U,G]);(0,u.useEffect)(()=>{window.next&&(window.next.router=z)},[z]),(0,u.useEffect)(()=>{function e(e){var t;e.persisted&&(null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE)&&(w.pendingMpaPath=void 0,U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE}))}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[U]);let{pushRef:B}=(0,s.useUnwrapState)(I);if(B.mpaNavigation){if(w.pendingMpaPath!==F){let e=window.location;B.pendingPush?e.assign(F):e.replace(F),w.pendingMpaPath=F}(0,u.use)(b.unresolvedThenable)}(0,u.useEffect)(()=>{let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history),n=e=>{var t;let n=window.location.href,r=null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(null!=e?e:n,n),tree:r})})};window.history.pushState=function(t,r,o){return(null==t?void 0:t.__NA)||(null==t?void 0:t._N)||(t=A(t),o&&n(o)),e(t,r,o)},window.history.replaceState=function(e,r,o){return(null==e?void 0:e.__NA)||(null==e?void 0:e._N)||(e=A(e),o&&n(o)),t(e,r,o)};let r=e=>{let{state:t}=e;if(t){if(!t.__NA){window.location.reload();return}(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:t.__PRIVATE_NEXTJS_INTERNALS_TREE})})}};return window.addEventListener("popstate",r),()=>{window.history.pushState=e,window.history.replaceState=t,window.removeEventListener("popstate",r)}},[U]);let{cache:W,tree:K,nextUrl:V,focusAndScrollRef:Y}=(0,s.useUnwrapState)(I),X=(0,u.useMemo)(()=>(0,v.findHeadInCache)(W,K[1]),[W,K]),q=(0,u.useMemo)(()=>(function e(t,n){for(let r of(void 0===n&&(n={}),Object.values(t[1]))){let t=r[0],o=Array.isArray(t),u=o?t[1]:t;!u||u.startsWith(P.PAGE_SEGMENT_KEY)||(o&&("c"===t[2]||"oc"===t[2])?n[t[0]]=t[1].split("/"):o&&(n[t[0]]=t[1]),n=e(r,n))}return n})(K),[K]);if(null!==X){let[e,n]=X;t=(0,o.jsx)(N,{headCacheNode:e},n)}else t=null;let J=(0,o.jsxs)(_.RedirectBoundary,{children:[t,W.rsc,(0,o.jsx)(y.AppRouterAnnouncer,{tree:K})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(x,{appRouterState:(0,s.useUnwrapState)(I),sync:k}),(0,o.jsx)(c.PathParamsContext.Provider,{value:q,children:(0,o.jsx)(c.PathnameContext.Provider,{value:H,children:(0,o.jsx)(c.SearchParamsContext.Provider,{value:L,children:(0,o.jsx)(l.GlobalLayoutRouterContext.Provider,{value:{buildId:n,changeByServerResponse:$,tree:K,focusAndScrollRef:Y,nextUrl:V},children:(0,o.jsx)(l.AppRouterContext.Provider,{value:z,children:(0,o.jsx)(l.LayoutRouterContext.Provider,{value:{childNodes:W.parallelRoutes,tree:K,url:F,loading:W.loading},children:J})})})})})})]})}function I(e){let{globalErrorComponent:t,...n}=e;return(0,o.jsx)(f.ErrorBoundary,{errorComponent:t,children:(0,o.jsx)(D,{...n})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"bailoutToClientRendering",{enumerable:!0,get:function(){return u}});let r=n(18993),o=n(51845);function u(e){let t=o.staticGenerationAsyncStorage.getStore();if((null==t||!t.forceStatic)&&(null==t?void 0:t.isStaticGeneration))throw new r.BailoutToCSRError(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},19107:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ClientPageRoot",{enumerable:!0,get:function(){return u}});let r=n(57437),o=n(54535);function u(e){let{Component:t,props:n}=e;return n.searchParams=(0,o.createDynamicallyTrackedSearchParams)(n.searchParams||{}),(0,r.jsx)(t,{...n})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61060:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ErrorBoundary:function(){return h},ErrorBoundaryHandler:function(){return f},GlobalError:function(){return d},default:function(){return p}});let r=n(47043),o=n(57437),u=r._(n(2265)),l=n(35475),a=n(89721),i=n(51845),c={error:{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"},text:{fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"}};function s(e){let{error:t}=e,n=i.staticGenerationAsyncStorage.getStore();if((null==n?void 0:n.isRevalidate)||(null==n?void 0:n.isStaticGeneration))throw console.error(t),t;return null}class f extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isNextRouterError)(e))throw e;return{error:e}}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){return this.state.error?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s,{error:this.state.error}),this.props.errorStyles,this.props.errorScripts,(0,o.jsx)(this.props.errorComponent,{error:this.state.error,reset:this.reset})]}):this.props.children}constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null,previousPathname:this.props.pathname}}}function d(e){let{error:t}=e,n=null==t?void 0:t.digest;return(0,o.jsxs)("html",{id:"__next_error__",children:[(0,o.jsx)("head",{}),(0,o.jsxs)("body",{children:[(0,o.jsx)(s,{error:t}),(0,o.jsx)("div",{style:c.error,children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{style:c.text,children:"Application error: a "+(n?"server":"client")+"-side exception has occurred (see the "+(n?"server logs":"browser console")+" for more information)."}),n?(0,o.jsx)("p",{style:c.text,children:"Digest: "+n}):null]})})]})]})}let p=d;function h(e){let{errorComponent:t,errorStyles:n,errorScripts:r,children:u}=e,a=(0,l.usePathname)();return t?(0,o.jsx)(f,{pathname:a,errorComponent:t,errorStyles:n,errorScripts:r,children:u}):(0,o.jsx)(o.Fragment,{children:u})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},46177:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DynamicServerError:function(){return r},isDynamicServerError:function(){return o}});let n="DYNAMIC_SERVER_USAGE";class r extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},89721:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNextRouterError",{enumerable:!0,get:function(){return u}});let r=n(98200),o=n(88968);function u(e){return e&&e.digest&&((0,o.isRedirectError)(e)||(0,r.isNotFoundError)(e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4707:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return S}});let r=n(47043),o=n(53099),u=n(57437),l=o._(n(2265)),a=r._(n(54887)),i=n(61956),c=n(44848),s=n(38137),f=n(61060),d=n(76015),p=n(7092),h=n(4123),y=n(80),_=n(73171),v=n(78505),b=n(28077),g=["bottom","height","left","right","top","width","x","y"];function m(e,t){let n=e.getBoundingClientRect();return n.top>=0&&n.top<=t}class R extends l.default.Component{componentDidMount(){this.handlePotentialScroll()}componentDidUpdate(){this.props.focusAndScrollRef.apply&&this.handlePotentialScroll()}render(){return this.props.children}constructor(...e){super(...e),this.handlePotentialScroll=()=>{let{focusAndScrollRef:e,segmentPath:t}=this.props;if(e.apply){var n;if(0!==e.segmentPaths.length&&!e.segmentPaths.some(e=>t.every((t,n)=>(0,d.matchSegment)(t,e[n]))))return;let r=null,o=e.hashFragment;if(o&&(r="top"===o?document.body:null!=(n=document.getElementById(o))?n:document.getElementsByName(o)[0]),r||(r="undefined"==typeof window?null:a.default.findDOMNode(this)),!(r instanceof Element))return;for(;!(r instanceof HTMLElement)||function(e){if(["sticky","fixed"].includes(getComputedStyle(e).position))return!0;let t=e.getBoundingClientRect();return g.every(e=>0===t[e])}(r);){if(null===r.nextElementSibling)return;r=r.nextElementSibling}e.apply=!1,e.hashFragment=null,e.segmentPaths=[],(0,p.handleSmoothScroll)(()=>{if(o){r.scrollIntoView();return}let e=document.documentElement,t=e.clientHeight;!m(r,t)&&(e.scrollTop=0,m(r,t)||r.scrollIntoView())},{dontForceLayout:!0,onlyHashChange:e.onlyHashChange}),e.onlyHashChange=!1,r.focus()}}}}function P(e){let{segmentPath:t,children:n}=e,r=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!r)throw Error("invariant global layout router not mounted");return(0,u.jsx)(R,{segmentPath:t,focusAndScrollRef:r.focusAndScrollRef,children:n})}function j(e){let{parallelRouterKey:t,url:n,childNodes:r,segmentPath:o,tree:a,cacheKey:f}=e,p=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!p)throw Error("invariant global layout router not mounted");let{buildId:h,changeByServerResponse:y,tree:_}=p,v=r.get(f);if(void 0===v){let e={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};v=e,r.set(f,e)}let g=null!==v.prefetchRsc?v.prefetchRsc:v.rsc,m=(0,l.useDeferredValue)(v.rsc,g),R="object"==typeof m&&null!==m&&"function"==typeof m.then?(0,l.use)(m):m;if(!R){let e=v.lazyData;if(null===e){let t=function e(t,n){if(t){let[r,o]=t,u=2===t.length;if((0,d.matchSegment)(n[0],r)&&n[1].hasOwnProperty(o)){if(u){let t=e(void 0,n[1][o]);return[n[0],{...n[1],[o]:[t[0],t[1],t[2],"refetch"]}]}return[n[0],{...n[1],[o]:e(t.slice(2),n[1][o])}]}}return n}(["",...o],_),r=(0,b.hasInterceptionRouteInCurrentTree)(_);v.lazyData=e=(0,c.fetchServerResponse)(new URL(n,location.origin),t,r?p.nextUrl:null,h),v.lazyDataResolved=!1}let t=(0,l.use)(e);v.lazyDataResolved||(setTimeout(()=>{(0,l.startTransition)(()=>{y({previousTree:_,serverResponse:t})})}),v.lazyDataResolved=!0),(0,l.use)(s.unresolvedThenable)}return(0,u.jsx)(i.LayoutRouterContext.Provider,{value:{tree:a[1][t],childNodes:v.parallelRoutes,url:n,loading:v.loading},children:R})}function O(e){let{children:t,hasLoading:n,loading:r,loadingStyles:o,loadingScripts:a}=e;return n?(0,u.jsx)(l.Suspense,{fallback:(0,u.jsxs)(u.Fragment,{children:[o,a,r]}),children:t}):(0,u.jsx)(u.Fragment,{children:t})}function S(e){let{parallelRouterKey:t,segmentPath:n,error:r,errorStyles:o,errorScripts:a,templateStyles:c,templateScripts:s,template:d,notFound:p,notFoundStyles:b}=e,g=(0,l.useContext)(i.LayoutRouterContext);if(!g)throw Error("invariant expected layout router to be mounted");let{childNodes:m,tree:R,url:S,loading:E}=g,w=m.get(t);w||(w=new Map,m.set(t,w));let T=R[1][t][0],M=(0,_.getSegmentValue)(T),x=[T];return(0,u.jsx)(u.Fragment,{children:x.map(e=>{let l=(0,_.getSegmentValue)(e),g=(0,v.createRouterCacheKey)(e);return(0,u.jsxs)(i.TemplateContext.Provider,{value:(0,u.jsx)(P,{segmentPath:n,children:(0,u.jsx)(f.ErrorBoundary,{errorComponent:r,errorStyles:o,errorScripts:a,children:(0,u.jsx)(O,{hasLoading:!!E,loading:null==E?void 0:E[0],loadingStyles:null==E?void 0:E[1],loadingScripts:null==E?void 0:E[2],children:(0,u.jsx)(y.NotFoundBoundary,{notFound:p,notFoundStyles:b,children:(0,u.jsx)(h.RedirectBoundary,{children:(0,u.jsx)(j,{parallelRouterKey:t,url:S,tree:R,childNodes:w,segmentPath:n,cacheKey:g,isActive:M===l})})})})})}),children:[c,s,d]},(0,v.createRouterCacheKey)(e,!0))})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},76015:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{canSegmentBeOverridden:function(){return u},matchSegment:function(){return o}});let r=n(87417),o=(e,t)=>"string"==typeof e?"string"==typeof t&&e===t:"string"!=typeof t&&e[0]===t[0]&&e[1]===t[1],u=(e,t)=>{var n;return!Array.isArray(e)&&!!Array.isArray(t)&&(null==(n=(0,r.getSegmentParam)(e))?void 0:n.param)===t[0]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35475:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return i.ReadonlyURLSearchParams},RedirectType:function(){return i.RedirectType},ServerInsertedHTMLContext:function(){return c.ServerInsertedHTMLContext},notFound:function(){return i.notFound},permanentRedirect:function(){return i.permanentRedirect},redirect:function(){return i.redirect},useParams:function(){return p},usePathname:function(){return f},useRouter:function(){return d},useSearchParams:function(){return s},useSelectedLayoutSegment:function(){return y},useSelectedLayoutSegments:function(){return h},useServerInsertedHTML:function(){return c.useServerInsertedHTML}});let r=n(2265),o=n(61956),u=n(79060),l=n(73171),a=n(84541),i=n(52646),c=n(55501);function s(){let e=(0,r.useContext)(u.SearchParamsContext),t=(0,r.useMemo)(()=>e?new i.ReadonlyURLSearchParams(e):null,[e]);if("undefined"==typeof window){let{bailoutToClientRendering:e}=n(96149);e("useSearchParams()")}return t}function f(){return(0,r.useContext)(u.PathnameContext)}function d(){let e=(0,r.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function p(){return(0,r.useContext)(u.PathParamsContext)}function h(e){void 0===e&&(e="children");let t=(0,r.useContext)(o.LayoutRouterContext);return t?function e(t,n,r,o){let u;if(void 0===r&&(r=!0),void 0===o&&(o=[]),r)u=t[1][n];else{var i;let e=t[1];u=null!=(i=e.children)?i:Object.values(e)[0]}if(!u)return o;let c=u[0],s=(0,l.getSegmentValue)(c);return!s||s.startsWith(a.PAGE_SEGMENT_KEY)?o:(o.push(s),e(u,n,!1,o))}(t.tree,e):null}function y(e){void 0===e&&(e="children");let t=h(e);if(!t||0===t.length)return null;let n="children"===e?t[0]:t[t.length-1];return n===a.DEFAULT_SEGMENT_KEY?null:n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52646:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return l},RedirectType:function(){return r.RedirectType},notFound:function(){return o.notFound},permanentRedirect:function(){return r.permanentRedirect},redirect:function(){return r.redirect}});let r=n(88968),o=n(98200);class u extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class l extends URLSearchParams{append(){throw new u}delete(){throw new u}set(){throw new u}sort(){throw new u}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NotFoundBoundary",{enumerable:!0,get:function(){return s}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(35475),a=n(98200);n(31765);let i=n(61956);class c extends u.default.Component{componentDidCatch(){}static getDerivedStateFromError(e){if((0,a.isNotFoundError)(e))return{notFoundTriggered:!0};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.notFoundTriggered?{notFoundTriggered:!1,previousPathname:e.pathname}:{notFoundTriggered:t.notFoundTriggered,previousPathname:e.pathname}}render(){return this.state.notFoundTriggered?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("meta",{name:"robots",content:"noindex"}),!1,this.props.notFoundStyles,this.props.notFound]}):this.props.children}constructor(e){super(e),this.state={notFoundTriggered:!!e.asNotFound,previousPathname:e.pathname}}}function s(e){let{notFound:t,notFoundStyles:n,asNotFound:r,children:a}=e,s=(0,l.usePathname)(),f=(0,u.useContext)(i.MissingSlotContext);return t?(0,o.jsx)(c,{pathname:s,notFound:t,notFoundStyles:n,asNotFound:r,missingSlots:f,children:a}):(0,o.jsx)(o.Fragment,{children:a})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},98200:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{isNotFoundError:function(){return o},notFound:function(){return r}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29744:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PromiseQueue",{enumerable:!0,get:function(){return c}});let r=n(2522),o=n(90675);var u=o._("_maxConcurrency"),l=o._("_runningCount"),a=o._("_queue"),i=o._("_processNext");class c{enqueue(e){let t,n;let o=new Promise((e,r)=>{t=e,n=r}),u=async()=>{try{r._(this,l)[l]++;let n=await e();t(n)}catch(e){n(e)}finally{r._(this,l)[l]--,r._(this,i)[i]()}};return r._(this,a)[a].push({promiseFn:o,task:u}),r._(this,i)[i](),o}bump(e){let t=r._(this,a)[a].findIndex(t=>t.promiseFn===e);if(t>-1){let e=r._(this,a)[a].splice(t,1)[0];r._(this,a)[a].unshift(e),r._(this,i)[i](!0)}}constructor(e=5){Object.defineProperty(this,i,{value:s}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),r._(this,u)[u]=e,r._(this,l)[l]=0,r._(this,a)[a]=[]}}function s(e){if(void 0===e&&(e=!1),(r._(this,l)[l]0){var t;null==(t=r._(this,a)[a].shift())||t.task()}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4123:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectBoundary:function(){return s},RedirectErrorBoundary:function(){return c}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(35475),a=n(88968);function i(e){let{redirect:t,reset:n,redirectType:r}=e,o=(0,l.useRouter)();return(0,u.useEffect)(()=>{u.default.startTransition(()=>{r===a.RedirectType.push?o.push(t,{}):o.replace(t,{}),n()})},[t,r,n,o]),null}class c extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isRedirectError)(e))return{redirect:(0,a.getURLFromRedirectError)(e),redirectType:(0,a.getRedirectTypeFromError)(e)};throw e}render(){let{redirect:e,redirectType:t}=this.state;return null!==e&&null!==t?(0,o.jsx)(i,{redirect:e,redirectType:t,reset:()=>this.setState({redirect:null})}):this.props.children}constructor(e){super(e),this.state={redirect:null,redirectType:null}}}function s(e){let{children:t}=e,n=(0,l.useRouter)();return(0,o.jsx)(c,{router:n,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5001:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return n}}),(r=n||(n={}))[r.SeeOther=303]="SeeOther",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},88968:function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return c},getRedirectStatusCodeFromError:function(){return y},getRedirectTypeFromError:function(){return h},getURLFromRedirectError:function(){return p},isRedirectError:function(){return d},permanentRedirect:function(){return f},redirect:function(){return s}});let u=n(20544),l=n(90295),a=n(5001),i="NEXT_REDIRECT";function c(e,t,n){void 0===n&&(n=a.RedirectStatusCode.TemporaryRedirect);let r=Error(i);r.digest=i+";"+t+";"+e+";"+n+";";let o=u.requestAsyncStorage.getStore();return o&&(r.mutableCookies=o.mutableCookies),r}function s(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.TemporaryRedirect)}function f(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.PermanentRedirect)}function d(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,n,r,o]=e.digest.split(";",4),u=Number(o);return t===i&&("replace"===n||"push"===n)&&"string"==typeof r&&!isNaN(u)&&u in a.RedirectStatusCode}function p(e){return d(e)?e.digest.split(";",3)[2]:null}function h(e){if(!d(e))throw Error("Not a redirect error");return e.digest.split(";",2)[1]}function y(e){if(!d(e))throw Error("Not a redirect error");return Number(e.digest.split(";",4)[3])}(o=r||(r={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(61956);function a(){let e=(0,u.useContext)(l.TemplateContext);return(0,o.jsx)(o.Fragment,{children:e})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20544:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getExpectedRequestStore:function(){return o},requestAsyncStorage:function(){return r.requestAsyncStorage}});let r=n(25575);function o(e){let t=r.requestAsyncStorage.getStore();if(t)return t;throw Error("`"+e+"` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},22356:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyFlightData",{enumerable:!0,get:function(){return u}});let r=n(27420),o=n(92576);function u(e,t,n,u){let[l,a,i]=n.slice(-3);if(null===a)return!1;if(3===n.length){let n=a[2],o=a[3];t.loading=o,t.rsc=n,t.prefetchRsc=null,(0,r.fillLazyItemsTillLeafWithHead)(t,e,l,a,i,u)}else t.rsc=e.rsc,t.prefetchRsc=e.prefetchRsc,t.parallelRoutes=new Map(e.parallelRoutes),t.loading=e.loading,(0,o.fillCacheWithNewSubTreeData)(t,e,n,u);return!0}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81935:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyRouterStatePatchToTree",{enumerable:!0,get:function(){return function e(t,n,r,a){let i;let[c,s,f,d,p]=n;if(1===t.length){let e=l(n,r,t);return(0,u.addRefreshMarkerToActiveParallelSegments)(e,a),e}let[h,y]=t;if(!(0,o.matchSegment)(h,c))return null;if(2===t.length)i=l(s[y],r,t);else if(null===(i=e(t.slice(2),s[y],r,a)))return null;let _=[t[0],{...s,[y]:i},f,d];return p&&(_[4]=!0),(0,u.addRefreshMarkerToActiveParallelSegments)(_,a),_}}});let r=n(84541),o=n(76015),u=n(50232);function l(e,t,n){let[u,a]=e,[i,c]=t;if(i===r.DEFAULT_SEGMENT_KEY&&u!==r.DEFAULT_SEGMENT_KEY)return e;if((0,o.matchSegment)(u,i)){let t={};for(let e in a)void 0!==c[e]?t[e]=l(a[e],c[e],n):t[e]=a[e];for(let e in c)t[e]||(t[e]=c[e]);let r=[u,t];return e[2]&&(r[2]=e[2]),e[3]&&(r[3]=e[3]),e[4]&&(r[4]=e[4]),r}return t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65556:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clearCacheNodeDataForSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l),s=t.parallelRoutes.get(l);s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s));let f=null==c?void 0:c.get(i),d=s.get(i);if(u){d&&d.lazyData&&d!==f||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}if(!d||!f){d||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}return d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved,loading:d.loading},s.set(i,d)),e(d,f,o.slice(2))}}});let r=n(78505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5410:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{computeChangedPath:function(){return s},extractPathFromFlightRouterState:function(){return c}});let r=n(91182),o=n(84541),u=n(76015),l=e=>"/"===e[0]?e.slice(1):e,a=e=>"string"==typeof e?"children"===e?"":e:e[1];function i(e){return e.reduce((e,t)=>""===(t=l(t))||(0,o.isGroupSegment)(t)?e:e+"/"+t,"")||"/"}function c(e){var t;let n=Array.isArray(e[0])?e[0][1]:e[0];if(n===o.DEFAULT_SEGMENT_KEY||r.INTERCEPTION_ROUTE_MARKERS.some(e=>n.startsWith(e)))return;if(n.startsWith(o.PAGE_SEGMENT_KEY))return"";let u=[a(n)],l=null!=(t=e[1])?t:{},s=l.children?c(l.children):void 0;if(void 0!==s)u.push(s);else for(let[e,t]of Object.entries(l)){if("children"===e)continue;let n=c(t);void 0!==n&&u.push(n)}return i(u)}function s(e,t){let n=function e(t,n){let[o,l]=t,[i,s]=n,f=a(o),d=a(i);if(r.INTERCEPTION_ROUTE_MARKERS.some(e=>f.startsWith(e)||d.startsWith(e)))return"";if(!(0,u.matchSegment)(o,i)){var p;return null!=(p=c(n))?p:""}for(let t in l)if(s[t]){let n=e(l[t],s[t]);if(null!==n)return a(i)+"/"+n}return null}(e,t);return null==n||"/"===n?n:i(n.split("/"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},33456:function(e,t){"use strict";function n(e,t){return void 0===t&&(t=!0),e.pathname+e.search+(t?e.hash:"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createHrefFromUrl",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82952:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createInitialRouterState",{enumerable:!0,get:function(){return c}});let r=n(33456),o=n(27420),u=n(5410),l=n(60305),a=n(24673),i=n(50232);function c(e){var t;let{buildId:n,initialTree:c,initialSeedData:s,urlParts:f,initialParallelRoutes:d,location:p,initialHead:h,couldBeIntercepted:y}=e,_=f.join("/"),v=!p,b={lazyData:null,rsc:s[2],prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:v?new Map:d,lazyDataResolved:!1,loading:s[3]},g=p?(0,r.createHrefFromUrl)(p):_;(0,i.addRefreshMarkerToActiveParallelSegments)(c,g);let m=new Map;(null===d||0===d.size)&&(0,o.fillLazyItemsTillLeafWithHead)(b,void 0,c,s,h);let R={buildId:n,tree:c,cache:b,prefetchCache:m,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:{apply:!1,onlyHashChange:!1,hashFragment:null,segmentPaths:[]},canonicalUrl:g,nextUrl:null!=(t=(0,u.extractPathFromFlightRouterState)(c)||(null==p?void 0:p.pathname))?t:null};if(p){let e=new URL(""+p.pathname+p.search,p.origin),t=[["",c,null,null]];(0,l.createPrefetchCacheEntryForInitialLoad)({url:e,kind:a.PrefetchKind.AUTO,data:[t,void 0,!1,y],tree:R.tree,prefetchCache:R.prefetchCache,nextUrl:R.nextUrl})}return R}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},78505:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRouterCacheKey",{enumerable:!0,get:function(){return o}});let r=n(84541);function o(e,t){return(void 0===t&&(t=!1),Array.isArray(e))?e[0]+"|"+e[1]+"|"+e[2]:t&&e.startsWith(r.PAGE_SEGMENT_KEY)?r.PAGE_SEGMENT_KEY:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44848:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fetchServerResponse",{enumerable:!0,get:function(){return s}});let r=n(6866),o=n(12846),u=n(83079),l=n(24673),a=n(37207),{createFromFetch:i}=n(6671);function c(e){return[(0,o.urlToUrlWithoutFlightMarker)(e).toString(),void 0,!1,!1]}async function s(e,t,n,s,f){let d={[r.RSC_HEADER]:"1",[r.NEXT_ROUTER_STATE_TREE]:encodeURIComponent(JSON.stringify(t))};f===l.PrefetchKind.AUTO&&(d[r.NEXT_ROUTER_PREFETCH_HEADER]="1"),n&&(d[r.NEXT_URL]=n);let p=(0,a.hexHash)([d[r.NEXT_ROUTER_PREFETCH_HEADER]||"0",d[r.NEXT_ROUTER_STATE_TREE],d[r.NEXT_URL]].join(","));try{var h;let t=new URL(e);t.pathname.endsWith("/")?t.pathname+="index.txt":t.pathname+=".txt",t.searchParams.set(r.NEXT_RSC_UNION_QUERY,p);let n=await fetch(t,{credentials:"same-origin",headers:d}),l=(0,o.urlToUrlWithoutFlightMarker)(n.url),a=n.redirected?l:void 0,f=n.headers.get("content-type")||"",y=!!n.headers.get(r.NEXT_DID_POSTPONE_HEADER),_=!!(null==(h=n.headers.get("vary"))?void 0:h.includes(r.NEXT_URL)),v=f===r.RSC_CONTENT_TYPE_HEADER;if(v||(v=f.startsWith("text/plain")),!v||!n.ok)return e.hash&&(l.hash=e.hash),c(l.toString());let[b,g]=await i(Promise.resolve(n),{callServer:u.callServer});if(s!==b)return c(n.url);return[g,a,y,_]}catch(t){return console.error("Failed to fetch RSC payload for "+e+". Falling back to browser navigation.",t),[e.toString(),void 0,!1,!1]}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},92576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillCacheWithNewSubTreeData",{enumerable:!0,get:function(){return function e(t,n,l,a){let i=l.length<=5,[c,s]=l,f=(0,u.createRouterCacheKey)(s),d=n.parallelRoutes.get(c);if(!d)return;let p=t.parallelRoutes.get(c);p&&p!==d||(p=new Map(d),t.parallelRoutes.set(c,p));let h=d.get(f),y=p.get(f);if(i){if(!y||!y.lazyData||y===h){let e=l[3];y={lazyData:null,rsc:e[2],prefetchRsc:null,head:null,prefetchHead:null,loading:e[3],parallelRoutes:h?new Map(h.parallelRoutes):new Map,lazyDataResolved:!1},h&&(0,r.invalidateCacheByRouterState)(y,h,l[2]),(0,o.fillLazyItemsTillLeafWithHead)(y,h,l[2],e,l[4],a),p.set(f,y)}return}y&&h&&(y===h&&(y={lazyData:y.lazyData,rsc:y.rsc,prefetchRsc:y.prefetchRsc,head:y.head,prefetchHead:y.prefetchHead,parallelRoutes:new Map(y.parallelRoutes),lazyDataResolved:!1,loading:y.loading},p.set(f,y)),e(y,h,l.slice(2),a))}}});let r=n(94377),o=n(27420),u=n(78505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},27420:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillLazyItemsTillLeafWithHead",{enumerable:!0,get:function(){return function e(t,n,u,l,a,i){if(0===Object.keys(u[1]).length){t.head=a;return}for(let c in u[1]){let s;let f=u[1][c],d=f[0],p=(0,r.createRouterCacheKey)(d),h=null!==l&&void 0!==l[1][c]?l[1][c]:null;if(n){let r=n.parallelRoutes.get(c);if(r){let n;let u=(null==i?void 0:i.kind)==="auto"&&i.status===o.PrefetchCacheEntryStatus.reusable,l=new Map(r),s=l.get(p);n=null!==h?{lazyData:null,rsc:h[2],prefetchRsc:null,head:null,prefetchHead:null,loading:h[3],parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1}:u&&s?{lazyData:s.lazyData,rsc:s.rsc,prefetchRsc:s.prefetchRsc,head:s.head,prefetchHead:s.prefetchHead,parallelRoutes:new Map(s.parallelRoutes),lazyDataResolved:s.lazyDataResolved,loading:s.loading}:{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1,loading:null},l.set(p,n),e(n,s,f,h||null,a,i),t.parallelRoutes.set(c,l);continue}}if(null!==h){let e=h[2],t=h[3];s={lazyData:null,rsc:e,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:t}}else s={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};let y=t.parallelRoutes.get(c);y?y.set(p,s):t.parallelRoutes.set(c,new Map([[p,s]])),e(s,void 0,f,h,a,i)}}}});let r=n(78505),o=n(24673);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44510:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleMutable",{enumerable:!0,get:function(){return u}});let r=n(5410);function o(e){return void 0!==e}function u(e,t){var n,u,l;let a=null==(u=t.shouldScroll)||u,i=e.nextUrl;if(o(t.patchedTree)){let n=(0,r.computeChangedPath)(e.tree,t.patchedTree);n?i=n:i||(i=e.canonicalUrl)}return{buildId:e.buildId,canonicalUrl:o(t.canonicalUrl)?t.canonicalUrl===e.canonicalUrl?e.canonicalUrl:t.canonicalUrl:e.canonicalUrl,pushRef:{pendingPush:o(t.pendingPush)?t.pendingPush:e.pushRef.pendingPush,mpaNavigation:o(t.mpaNavigation)?t.mpaNavigation:e.pushRef.mpaNavigation,preserveCustomHistoryState:o(t.preserveCustomHistoryState)?t.preserveCustomHistoryState:e.pushRef.preserveCustomHistoryState},focusAndScrollRef:{apply:!!a&&(!!o(null==t?void 0:t.scrollableSegments)||e.focusAndScrollRef.apply),onlyHashChange:!!t.hashFragment&&e.canonicalUrl.split("#",1)[0]===(null==(n=t.canonicalUrl)?void 0:n.split("#",1)[0]),hashFragment:a?t.hashFragment&&""!==t.hashFragment?decodeURIComponent(t.hashFragment.slice(1)):e.focusAndScrollRef.hashFragment:null,segmentPaths:a?null!=(l=null==t?void 0:t.scrollableSegments)?l:e.focusAndScrollRef.segmentPaths:[]},cache:t.cache?t.cache:e.cache,prefetchCache:t.prefetchCache?t.prefetchCache:e.prefetchCache,tree:o(t.patchedTree)?t.patchedTree:e.tree,nextUrl:i}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77831:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSegmentMismatch",{enumerable:!0,get:function(){return o}});let r=n(95967);function o(e,t,n){return(0,r.handleExternalUrl)(e,{},e.canonicalUrl,!0)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77058:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheBelowFlightSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l);if(!c)return;let s=t.parallelRoutes.get(l);if(s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s)),u){s.delete(i);return}let f=c.get(i),d=s.get(i);d&&f&&(d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved},s.set(i,d)),e(d,f,o.slice(2)))}}});let r=n(78505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},94377:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheByRouterState",{enumerable:!0,get:function(){return o}});let r=n(78505);function o(e,t,n){for(let o in n[1]){let u=n[1][o][0],l=(0,r.createRouterCacheKey)(u),a=t.parallelRoutes.get(o);if(a){let t=new Map(a);t.delete(l),e.parallelRoutes.set(o,t)}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63237:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNavigatingToNewRootLayout",{enumerable:!0,get:function(){return function e(t,n){let r=t[0],o=n[0];if(Array.isArray(r)&&Array.isArray(o)){if(r[0]!==o[0]||r[2]!==o[2])return!0}else if(r!==o)return!0;if(t[4])return!n[4];if(n[4])return!0;let u=Object.values(t[1])[0],l=Object.values(n[1])[0];return!u||!l||e(u,l)}}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},56118:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{abortTask:function(){return c},listenForDynamicRequest:function(){return a},updateCacheNodeOnNavigation:function(){return function e(t,n,a,c,s){let f=n[1],d=a[1],p=c[1],h=t.parallelRoutes,y=new Map(h),_={},v=null;for(let t in d){let n;let a=d[t],c=f[t],b=h.get(t),g=p[t],m=a[0],R=(0,u.createRouterCacheKey)(m),P=void 0!==c?c[0]:void 0,j=void 0!==b?b.get(R):void 0;if(null!==(n=m===r.PAGE_SEGMENT_KEY?l(a,void 0!==g?g:null,s):m===r.DEFAULT_SEGMENT_KEY?void 0!==c?{route:c,node:null,children:null}:l(a,void 0!==g?g:null,s):void 0!==P&&(0,o.matchSegment)(m,P)&&void 0!==j&&void 0!==c?null!=g?e(j,c,a,g,s):function(e){let t=i(e,null,null);return{route:e,node:t,children:null}}(a):l(a,void 0!==g?g:null,s))){null===v&&(v=new Map),v.set(t,n);let e=n.node;if(null!==e){let n=new Map(b);n.set(R,e),y.set(t,n)}_[t]=n.route}else _[t]=a}if(null===v)return null;let b={lazyData:null,rsc:t.rsc,prefetchRsc:t.prefetchRsc,head:t.head,prefetchHead:t.prefetchHead,loading:t.loading,parallelRoutes:y,lazyDataResolved:!1};return{route:function(e,t){let n=[e[0],t];return 2 in e&&(n[2]=e[2]),3 in e&&(n[3]=e[3]),4 in e&&(n[4]=e[4]),n}(a,_),node:b,children:v}}},updateCacheNodeOnPopstateRestoration:function(){return function e(t,n){let r=n[1],o=t.parallelRoutes,l=new Map(o);for(let t in r){let n=r[t],a=n[0],i=(0,u.createRouterCacheKey)(a),c=o.get(t);if(void 0!==c){let r=c.get(i);if(void 0!==r){let o=e(r,n),u=new Map(c);u.set(i,o),l.set(t,u)}}}let a=t.rsc,i=d(a)&&"pending"===a.status;return{lazyData:null,rsc:a,head:t.head,prefetchHead:i?t.prefetchHead:null,prefetchRsc:i?t.prefetchRsc:null,loading:i?t.loading:null,parallelRoutes:l,lazyDataResolved:!1}}}});let r=n(84541),o=n(76015),u=n(78505);function l(e,t,n){let r=i(e,t,n);return{route:e,node:r,children:null}}function a(e,t){t.then(t=>{for(let n of t[0]){let t=n.slice(0,-3),r=n[n.length-3],l=n[n.length-2],a=n[n.length-1];"string"!=typeof t&&function(e,t,n,r,l){let a=e;for(let e=0;e{c(e,t)})}function i(e,t,n){let r=e[1],o=null!==t?t[1]:null,l=new Map;for(let e in r){let t=r[e],a=null!==o?o[e]:null,c=t[0],s=(0,u.createRouterCacheKey)(c),f=i(t,void 0===a?null:a,n),d=new Map;d.set(s,f),l.set(e,d)}let a=0===l.size,c=null!==t?t[2]:null,s=null!==t?t[3]:null;return{lazyData:null,parallelRoutes:l,prefetchRsc:void 0!==c?c:null,prefetchHead:a?n:null,loading:void 0!==s?s:null,rsc:p(),head:a?p():null,lazyDataResolved:!1}}function c(e,t){let n=e.node;if(null===n)return;let r=e.children;if(null===r)s(e.route,n,t);else for(let e of r.values())c(e,t);e.node=null}function s(e,t,n){let r=e[1],o=t.parallelRoutes;for(let e in r){let t=r[e],l=o.get(e);if(void 0===l)continue;let a=t[0],i=(0,u.createRouterCacheKey)(a),c=l.get(i);void 0!==c&&s(t,c,n)}let l=t.rsc;d(l)&&(null===n?l.resolve(null):l.reject(n));let a=t.head;d(a)&&a.resolve(null)}let f=Symbol();function d(e){return e&&e.tag===f}function p(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.status="pending",n.resolve=t=>{"pending"===n.status&&(n.status="fulfilled",n.value=t,e(t))},n.reject=e=>{"pending"===n.status&&(n.status="rejected",n.reason=e,t(e))},n.tag=f,n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},60305:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createPrefetchCacheEntryForInitialLoad:function(){return c},getOrCreatePrefetchCacheEntry:function(){return i},prunePrefetchCache:function(){return f}});let r=n(33456),o=n(44848),u=n(24673),l=n(24819);function a(e,t){let n=(0,r.createHrefFromUrl)(e,!1);return t?t+"%"+n:n}function i(e){let t,{url:n,nextUrl:r,tree:o,buildId:l,prefetchCache:i,kind:c}=e,f=a(n,r),d=i.get(f);if(d)t=d;else{let e=a(n),r=i.get(e);r&&(t=r)}return t?(t.status=h(t),t.kind!==u.PrefetchKind.FULL&&c===u.PrefetchKind.FULL)?s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:null!=c?c:u.PrefetchKind.TEMPORARY}):(c&&t.kind===u.PrefetchKind.TEMPORARY&&(t.kind=c),t):s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:c||u.PrefetchKind.TEMPORARY})}function c(e){let{nextUrl:t,tree:n,prefetchCache:r,url:o,kind:l,data:i}=e,[,,,c]=i,s=c?a(o,t):a(o),f={treeAtTimeOfPrefetch:n,data:Promise.resolve(i),kind:l,prefetchTime:Date.now(),lastUsedTime:Date.now(),key:s,status:u.PrefetchCacheEntryStatus.fresh};return r.set(s,f),f}function s(e){let{url:t,kind:n,tree:r,nextUrl:i,buildId:c,prefetchCache:s}=e,f=a(t),d=l.prefetchQueue.enqueue(()=>(0,o.fetchServerResponse)(t,r,i,c,n).then(e=>{let[,,,n]=e;return n&&function(e){let{url:t,nextUrl:n,prefetchCache:r}=e,o=a(t),u=r.get(o);if(!u)return;let l=a(t,n);r.set(l,u),r.delete(o)}({url:t,nextUrl:i,prefetchCache:s}),e})),p={treeAtTimeOfPrefetch:r,data:d,kind:n,prefetchTime:Date.now(),lastUsedTime:null,key:f,status:u.PrefetchCacheEntryStatus.fresh};return s.set(f,p),p}function f(e){for(let[t,n]of e)h(n)===u.PrefetchCacheEntryStatus.expired&&e.delete(t)}let d=1e3*Number("30"),p=1e3*Number("300");function h(e){let{kind:t,prefetchTime:n,lastUsedTime:r}=e;return Date.now()<(null!=r?r:n)+d?r?u.PrefetchCacheEntryStatus.reusable:u.PrefetchCacheEntryStatus.fresh:"auto"===t&&Date.now(){let[n,f]=t,h=!1;if(S.lastUsedTime||(S.lastUsedTime=Date.now(),h=!0),"string"==typeof n)return _(e,R,n,O);if(document.getElementById("__next-page-redirect"))return _(e,R,j,O);let b=e.tree,g=e.cache,w=[];for(let t of n){let n=t.slice(0,-4),r=t.slice(-3)[0],c=["",...n],f=(0,u.applyRouterStatePatchToTree)(c,b,r,j);if(null===f&&(f=(0,u.applyRouterStatePatchToTree)(c,E,r,j)),null!==f){if((0,a.isNavigatingToNewRootLayout)(b,f))return _(e,R,j,O);let u=(0,d.createEmptyCacheNode)(),m=!1;for(let e of(S.status!==i.PrefetchCacheEntryStatus.stale||h?m=(0,s.applyFlightData)(g,u,t,S):(m=function(e,t,n,r){let o=!1;for(let u of(e.rsc=t.rsc,e.prefetchRsc=t.prefetchRsc,e.loading=t.loading,e.parallelRoutes=new Map(t.parallelRoutes),v(r).map(e=>[...n,...e])))(0,y.clearCacheNodeDataForSegmentPath)(e,t,u),o=!0;return o}(u,g,n,r),S.lastUsedTime=Date.now()),(0,l.shouldHardNavigate)(c,b)?(u.rsc=g.rsc,u.prefetchRsc=g.prefetchRsc,(0,o.invalidateCacheBelowFlightSegmentPath)(u,g,n),R.cache=u):m&&(R.cache=u,g=u),b=f,v(r))){let t=[...n,...e];t[t.length-1]!==p.DEFAULT_SEGMENT_KEY&&w.push(t)}}}return R.patchedTree=b,R.canonicalUrl=f?(0,r.createHrefFromUrl)(f):j,R.pendingPush=O,R.scrollableSegments=w,R.hashFragment=P,R.shouldScroll=m,(0,c.handleMutable)(e,R)},()=>e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},24819:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{prefetchQueue:function(){return l},prefetchReducer:function(){return a}});let r=n(6866),o=n(29744),u=n(60305),l=new o.PromiseQueue(5);function a(e,t){(0,u.prunePrefetchCache)(e.prefetchCache);let{url:n}=t;return n.searchParams.delete(r.NEXT_RSC_UNION_QUERY),(0,u.getOrCreatePrefetchCacheEntry)({url:n,nextUrl:e.nextUrl,prefetchCache:e.prefetchCache,kind:t.kind,tree:e.tree,buildId:e.buildId}),e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},99601:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"refreshReducer",{enumerable:!0,get:function(){return h}});let r=n(44848),o=n(33456),u=n(81935),l=n(63237),a=n(95967),i=n(44510),c=n(27420),s=n(12846),f=n(77831),d=n(28077),p=n(50232);function h(e,t){let{origin:n}=t,h={},y=e.canonicalUrl,_=e.tree;h.preserveCustomHistoryState=!1;let v=(0,s.createEmptyCacheNode)(),b=(0,d.hasInterceptionRouteInCurrentTree)(e.tree);return v.lazyData=(0,r.fetchServerResponse)(new URL(y,n),[_[0],_[1],_[2],"refetch"],b?e.nextUrl:null,e.buildId),v.lazyData.then(async n=>{let[r,s]=n;if("string"==typeof r)return(0,a.handleExternalUrl)(e,h,r,e.pushRef.pendingPush);for(let n of(v.lazyData=null,r)){if(3!==n.length)return console.log("REFRESH FAILED"),e;let[r]=n,i=(0,u.applyRouterStatePatchToTree)([""],_,r,e.canonicalUrl);if(null===i)return(0,f.handleSegmentMismatch)(e,t,r);if((0,l.isNavigatingToNewRootLayout)(_,i))return(0,a.handleExternalUrl)(e,h,y,e.pushRef.pendingPush);let d=s?(0,o.createHrefFromUrl)(s):void 0;s&&(h.canonicalUrl=d);let[g,m]=n.slice(-2);if(null!==g){let e=g[2];v.rsc=e,v.prefetchRsc=null,(0,c.fillLazyItemsTillLeafWithHead)(v,void 0,r,g,m),h.prefetchCache=new Map}await (0,p.refreshInactiveParallelSegments)({state:e,updatedTree:i,updatedCache:v,includeNextUrl:b,canonicalUrl:h.canonicalUrl||e.canonicalUrl}),h.cache=v,h.patchedTree=i,h.canonicalUrl=y,_=i}return(0,i.handleMutable)(e,h)},()=>e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77784:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"restoreReducer",{enumerable:!0,get:function(){return u}});let r=n(33456),o=n(5410);function u(e,t){var n;let{url:u,tree:l}=t,a=(0,r.createHrefFromUrl)(u),i=l||e.tree,c=e.cache;return{buildId:e.buildId,canonicalUrl:a,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:e.focusAndScrollRef,cache:c,prefetchCache:e.prefetchCache,tree:i,nextUrl:null!=(n=(0,o.extractPathFromFlightRouterState)(i))?n:u.pathname}}n(56118),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},13722:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverActionReducer",{enumerable:!0,get:function(){return g}});let r=n(83079),o=n(6866),u=n(1634),l=n(33456),a=n(95967),i=n(81935),c=n(63237),s=n(44510),f=n(27420),d=n(12846),p=n(28077),h=n(77831),y=n(50232),{createFromFetch:_,encodeReply:v}=n(6671);async function b(e,t,n){let l,{actionId:a,actionArgs:i}=n,c=await v(i),s=await fetch("",{method:"POST",headers:{Accept:o.RSC_CONTENT_TYPE_HEADER,[o.ACTION]:a,[o.NEXT_ROUTER_STATE_TREE]:encodeURIComponent(JSON.stringify(e.tree)),...t?{[o.NEXT_URL]:t}:{}},body:c}),f=s.headers.get("x-action-redirect");try{let e=JSON.parse(s.headers.get("x-action-revalidated")||"[[],0,0]");l={paths:e[0]||[],tag:!!e[1],cookie:e[2]}}catch(e){l={paths:[],tag:!1,cookie:!1}}let d=f?new URL((0,u.addBasePath)(f),new URL(e.canonicalUrl,window.location.href)):void 0;if(s.headers.get("content-type")===o.RSC_CONTENT_TYPE_HEADER){let e=await _(Promise.resolve(s),{callServer:r.callServer});if(f){let[,t]=null!=e?e:[];return{actionFlightData:t,redirectLocation:d,revalidatedParts:l}}let[t,[,n]]=null!=e?e:[];return{actionResult:t,actionFlightData:n,redirectLocation:d,revalidatedParts:l}}return{redirectLocation:d,revalidatedParts:l}}function g(e,t){let{resolve:n,reject:r}=t,o={},u=e.canonicalUrl,_=e.tree;o.preserveCustomHistoryState=!1;let v=e.nextUrl&&(0,p.hasInterceptionRouteInCurrentTree)(e.tree)?e.nextUrl:null;return o.inFlightServerAction=b(e,v,t),o.inFlightServerAction.then(async r=>{let{actionResult:p,actionFlightData:b,redirectLocation:g}=r;if(g&&(e.pushRef.pendingPush=!0,o.pendingPush=!0),!b)return(n(p),g)?(0,a.handleExternalUrl)(e,o,g.href,e.pushRef.pendingPush):e;if("string"==typeof b)return(0,a.handleExternalUrl)(e,o,b,e.pushRef.pendingPush);if(o.inFlightServerAction=null,g){let e=(0,l.createHrefFromUrl)(g,!1);o.canonicalUrl=e}for(let n of b){if(3!==n.length)return console.log("SERVER ACTION APPLY FAILED"),e;let[r]=n,s=(0,i.applyRouterStatePatchToTree)([""],_,r,g?(0,l.createHrefFromUrl)(g):e.canonicalUrl);if(null===s)return(0,h.handleSegmentMismatch)(e,t,r);if((0,c.isNavigatingToNewRootLayout)(_,s))return(0,a.handleExternalUrl)(e,o,u,e.pushRef.pendingPush);let[p,b]=n.slice(-2),m=null!==p?p[2]:null;if(null!==m){let t=(0,d.createEmptyCacheNode)();t.rsc=m,t.prefetchRsc=null,(0,f.fillLazyItemsTillLeafWithHead)(t,void 0,r,p,b),await (0,y.refreshInactiveParallelSegments)({state:e,updatedTree:s,updatedCache:t,includeNextUrl:!!v,canonicalUrl:o.canonicalUrl||e.canonicalUrl}),o.cache=t,o.prefetchCache=new Map}o.patchedTree=s,_=s}return n(p),(0,s.handleMutable)(e,o)},t=>(r(t),e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},68448:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverPatchReducer",{enumerable:!0,get:function(){return f}});let r=n(33456),o=n(81935),u=n(63237),l=n(95967),a=n(22356),i=n(44510),c=n(12846),s=n(77831);function f(e,t){let{serverResponse:n}=t,[f,d]=n,p={};if(p.preserveCustomHistoryState=!1,"string"==typeof f)return(0,l.handleExternalUrl)(e,p,f,e.pushRef.pendingPush);let h=e.tree,y=e.cache;for(let n of f){let i=n.slice(0,-4),[f]=n.slice(-3,-2),_=(0,o.applyRouterStatePatchToTree)(["",...i],h,f,e.canonicalUrl);if(null===_)return(0,s.handleSegmentMismatch)(e,t,f);if((0,u.isNavigatingToNewRootLayout)(h,_))return(0,l.handleExternalUrl)(e,p,e.canonicalUrl,e.pushRef.pendingPush);let v=d?(0,r.createHrefFromUrl)(d):void 0;v&&(p.canonicalUrl=v);let b=(0,c.createEmptyCacheNode)();(0,a.applyFlightData)(y,b,n),p.patchedTree=_,p.cache=b,y=b,h=_}return(0,i.handleMutable)(e,p)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},50232:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{addRefreshMarkerToActiveParallelSegments:function(){return function e(t,n){let[r,o,,l]=t;for(let a in r.includes(u.PAGE_SEGMENT_KEY)&&"refresh"!==l&&(t[2]=n,t[3]="refresh"),o)e(o[a],n)}},refreshInactiveParallelSegments:function(){return l}});let r=n(22356),o=n(44848),u=n(84541);async function l(e){let t=new Set;await a({...e,rootTree:e.updatedTree,fetchedSegments:t})}async function a(e){let{state:t,updatedTree:n,updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c=n,canonicalUrl:s}=e,[,f,d,p]=n,h=[];if(d&&d!==s&&"refresh"===p&&!i.has(d)){i.add(d);let e=(0,o.fetchServerResponse)(new URL(d,location.origin),[c[0],c[1],c[2],"refetch"],l?t.nextUrl:null,t.buildId).then(e=>{let t=e[0];if("string"!=typeof t)for(let e of t)(0,r.applyFlightData)(u,u,e)});h.push(e)}for(let e in f){let n=a({state:t,updatedTree:f[e],updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c,canonicalUrl:s});h.push(n)}await Promise.all(h)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},24673:function(e,t){"use strict";var n,r,o,u;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION_FAST_REFRESH:function(){return f},ACTION_NAVIGATE:function(){return a},ACTION_PREFETCH:function(){return s},ACTION_REFRESH:function(){return l},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return d},ACTION_SERVER_PATCH:function(){return c},PrefetchCacheEntryStatus:function(){return r},PrefetchKind:function(){return n},isThenable:function(){return p}});let l="refresh",a="navigate",i="restore",c="server-patch",s="prefetch",f="fast-refresh",d="server-action";function p(e){return e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}(o=n||(n={})).AUTO="auto",o.FULL="full",o.TEMPORARY="temporary",(u=r||(r={})).fresh="fresh",u.reusable="reusable",u.expired="expired",u.stale="stale",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},91450:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reducer",{enumerable:!0,get:function(){return f}});let r=n(24673),o=n(95967),u=n(68448),l=n(77784),a=n(99601),i=n(24819),c=n(44529),s=n(13722),f="undefined"==typeof window?function(e,t){return e}:function(e,t){switch(t.type){case r.ACTION_NAVIGATE:return(0,o.navigateReducer)(e,t);case r.ACTION_SERVER_PATCH:return(0,u.serverPatchReducer)(e,t);case r.ACTION_RESTORE:return(0,l.restoreReducer)(e,t);case r.ACTION_REFRESH:return(0,a.refreshReducer)(e,t);case r.ACTION_FAST_REFRESH:return(0,c.fastRefreshReducer)(e,t);case r.ACTION_PREFETCH:return(0,i.prefetchReducer)(e,t);case r.ACTION_SERVER_ACTION:return(0,s.serverActionReducer)(e,t);default:throw Error("Unknown action")}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53728:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"shouldHardNavigate",{enumerable:!0,get:function(){return function e(t,n){let[o,u]=n,[l,a]=t;return(0,r.matchSegment)(l,o)?!(t.length<=2)&&e(t.slice(2),u[a]):!!Array.isArray(l)}}});let r=n(76015);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54535:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createDynamicallyTrackedSearchParams:function(){return a},createUntrackedSearchParams:function(){return l}});let r=n(51845),o=n(86999),u=n(30650);function l(e){let t=r.staticGenerationAsyncStorage.getStore();return t&&t.forceStatic?{}:e}function a(e){let t=r.staticGenerationAsyncStorage.getStore();return t?t.forceStatic?{}:t.isStaticGeneration||t.dynamicShouldError?new Proxy({},{get:(e,n,r)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),u.ReflectAdapter.get(e,n,r)),has:(e,n)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),Reflect.has(e,n)),ownKeys:e=>((0,o.trackDynamicDataAccessed)(t,"searchParams"),Reflect.ownKeys(e))}):e:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51845:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r.staticGenerationAsyncStorage}});let r=n(20030);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36864:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{StaticGenBailoutError:function(){return r},isStaticGenBailoutError:function(){return o}});let n="NEXT_STATIC_GEN_BAILOUT";class r extends Error{constructor(...e){super(...e),this.code=n}}function o(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38137:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unresolvedThenable",{enumerable:!0,get:function(){return n}});let n={then:()=>{}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},47744:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{useReducerWithReduxDevtools:function(){return i},useUnwrapState:function(){return a}});let r=n(53099)._(n(2265)),o=n(24673),u=n(2103);function l(e){if(e instanceof Map){let t={};for(let[n,r]of e.entries()){if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r._bundlerConfig){t[n]="FlightData";continue}}t[n]=l(r)}return t}if("object"==typeof e&&null!==e){let t={};for(let n in e){let r=e[n];if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r.hasOwnProperty("_bundlerConfig")){t[n]="FlightData";continue}}t[n]=l(r)}return t}return Array.isArray(e)?e.map(l):e}function a(e){return(0,o.isThenable)(e)?(0,r.use)(e):e}let i="undefined"!=typeof window?function(e){let[t,n]=r.default.useState(e),o=(0,r.useContext)(u.ActionQueueContext);if(!o)throw Error("Invariant: Missing ActionQueueContext");let a=(0,r.useRef)(),i=(0,r.useRef)();return(0,r.useEffect)(()=>{if(!a.current&&!1!==i.current){if(void 0===i.current&&void 0===window.__REDUX_DEVTOOLS_EXTENSION__){i.current=!1;return}return a.current=window.__REDUX_DEVTOOLS_EXTENSION__.connect({instanceId:8e3,name:"next-router"}),a.current&&(a.current.init(l(e)),o&&(o.devToolsInstance=a.current)),()=>{a.current=void 0}}},[e,o]),[t,(0,r.useCallback)(t=>{o.state||(o.state=e),o.dispatch(t,n)},[o,e]),(0,r.useCallback)(e=>{a.current&&a.current.send({type:"RENDER_SYNC"},l(e))},[])]}:function(e){return[e,()=>{},()=>{}]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11283:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return o}});let r=n(10580);function o(e){return(0,r.pathHasPrefix)(e,"")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},33068:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return u}});let r=n(26674),o=n(63381),u=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:n,hash:u}=(0,o.parsePath)(e);return""+(0,r.removeTrailingSlash)(t)+n+u};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(18993);function o(e){let t="function"==typeof reportError?reportError:e=>{window.console.error(e)};(0,r.isBailoutToCSRError)(e)||t(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35076:function(e,t,n){"use strict";function r(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeBasePath",{enumerable:!0,get:function(){return r}}),n(11283),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},12010:function(e,t){"use strict";function n(e,t){var n=e.length;for(e.push(t);0>>1,o=e[r];if(0>>1;ru(i,n))cu(s,i)?(e[r]=s,e[c]=n,r=c):(e[r]=i,e[a]=n,r=a);else if(cu(s,n))e[r]=s,e[c]=n,r=c;else break}}return t}function u(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var l,a=performance;t.unstable_now=function(){return a.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var s=[],f=[],d=1,p=null,h=3,y=!1,_=!1,v=!1,b="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,m="undefined"!=typeof setImmediate?setImmediate:null;function R(e){for(var t=r(f);null!==t;){if(null===t.callback)o(f);else if(t.startTime<=e)o(f),t.sortIndex=t.expirationTime,n(s,t);else break;t=r(f)}}function P(e){if(v=!1,R(e),!_){if(null!==r(s))_=!0,C();else{var t=r(f);null!==t&&A(P,t.startTime-e)}}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var j=!1,O=-1,S=5,E=-1;function w(){return!(t.unstable_now()-Ee&&w());){var a=p.callback;if("function"==typeof a){p.callback=null,h=p.priorityLevel;var i=a(p.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof i){p.callback=i,R(e),n=!0;break t}p===r(s)&&o(s),R(e)}else o(s);p=r(s)}if(null!==p)n=!0;else{var c=r(f);null!==c&&A(P,c.startTime-e),n=!1}}break e}finally{p=null,h=u,y=!1}n=void 0}}finally{n?l():j=!1}}}if("function"==typeof m)l=function(){m(T)};else if("undefined"!=typeof MessageChannel){var M=new MessageChannel,x=M.port2;M.port1.onmessage=T,l=function(){x.postMessage(null)}}else l=function(){b(T,0)};function C(){j||(j=!0,l())}function A(e,n){O=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){_||y||(_=!0,C())},t.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=u,n(f,e),null===r(s)&&e===r(f)&&(v?(g(O),O=-1):v=!0,A(P,u-l))):(e.sortIndex=a,n(s,e),_||y||(_=!0,C())),e},t.unstable_shouldYield=w,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},71767:function(e,t,n){"use strict";e.exports=n(12010)},60934:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getPathname:function(){return r},isFullStringUrl:function(){return o},parseUrl:function(){return u}});let n="http://n";function r(e){return new URL(e,n).pathname}function o(e){return/https?:\/\//.test(e)}function u(e){let t;try{t=new URL(e,n)}catch{}return t}},86999:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{Postpone:function(){return d},createPostponedAbortSignal:function(){return b},createPrerenderState:function(){return c},formatDynamicAPIAccesses:function(){return _},markCurrentScopeAsDynamic:function(){return s},trackDynamicDataAccessed:function(){return f},trackDynamicFetch:function(){return p},usedDynamicAPIs:function(){return y}});let o=(r=n(2265))&&r.__esModule?r:{default:r},u=n(46177),l=n(36864),a=n(60934),i="function"==typeof o.default.unstable_postpone;function c(e){return{isDebugSkeleton:e,dynamicAccesses:[]}}function s(e,t){let n=(0,a.getPathname)(e.urlPathname);if(!e.isUnstableCacheCallback){if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}}function f(e,t){let n=(0,a.getPathname)(e.urlPathname);if(e.isUnstableCacheCallback)throw Error(`Route ${n} used "${t}" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "${t}" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}function d({reason:e,prerenderState:t,pathname:n}){h(t,e,n)}function p(e,t){e.prerenderState&&h(e.prerenderState,t,e.urlPathname)}function h(e,t,n){v();let r=`Route ${n} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;e.dynamicAccesses.push({stack:e.isDebugSkeleton?Error().stack:void 0,expression:t}),o.default.unstable_postpone(r)}function y(e){return e.dynamicAccesses.length>0}function _(e){return e.dynamicAccesses.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" ()")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}: -${t}`))}function v(){if(!i)throw Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js")}function b(e){v();let t=new AbortController;try{o.default.unstable_postpone(e)}catch(e){t.abort(e)}return t.signal}},87417:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentParam",{enumerable:!0,get:function(){return o}});let r=n(91182);function o(e){let t=r.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t));return(t&&(e=e.slice(t.length)),e.startsWith("[[...")&&e.endsWith("]]"))?{type:"optional-catchall",param:e.slice(5,-2)}:e.startsWith("[...")&&e.endsWith("]")?{type:t?"catchall-intercepted":"catchall",param:e.slice(4,-1)}:e.startsWith("[")&&e.endsWith("]")?{type:t?"dynamic-intercepted":"dynamic",param:e.slice(1,-1)}:null}},70647:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HMR_ACTIONS_SENT_TO_BROWSER",{enumerable:!0,get:function(){return n}}),(r=n||(n={})).ADDED_PAGE="addedPage",r.REMOVED_PAGE="removedPage",r.RELOAD_PAGE="reloadPage",r.SERVER_COMPONENT_CHANGES="serverComponentChanges",r.MIDDLEWARE_CHANGES="middlewareChanges",r.CLIENT_CHANGES="clientChanges",r.SERVER_ONLY_CHANGES="serverOnlyChanges",r.SYNC="sync",r.BUILT="built",r.BUILDING="building",r.DEV_PAGES_MANIFEST_UPDATE="devPagesManifestUpdate",r.TURBOPACK_MESSAGE="turbopack-message",r.SERVER_ERROR="serverError",r.TURBOPACK_CONNECTED="turbopack-connected"},91182:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return o},extractInterceptionRouteInformation:function(){return l},isInterceptionRouteAppPath:function(){return u}});let r=n(20926),o=["(..)(..)","(.)","(..)","(...)"];function u(e){return void 0!==e.split("/").find(e=>o.find(t=>e.startsWith(t)))}function l(e){let t,n,u;for(let r of e.split("/"))if(n=o.find(e=>r.startsWith(e))){[t,u]=e.split(n,2);break}if(!t||!n||!u)throw Error(`Invalid interception route: ${e}. Must be in the format //(..|...|..)(..)/`);switch(t=(0,r.normalizeAppPath)(t),n){case"(.)":u="/"===t?`/${u}`:t+"/"+u;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);u=t.split("/").slice(0,-1).concat(u).join("/");break;case"(...)":u="/"+u;break;case"(..)(..)":let l=t.split("/");if(l.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);u=l.slice(0,-2).concat(u).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:u}}},30650:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,n){let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}static set(e,t,n,r){return Reflect.set(e,t,n,r)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},61956:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return l},LayoutRouterContext:function(){return u},MissingSlotContext:function(){return i},TemplateContext:function(){return a}});let r=n(47043)._(n(2265)),o=r.default.createContext(null),u=r.default.createContext(null),l=r.default.createContext(null),a=r.default.createContext(null),i=r.default.createContext(new Set)},37207:function(e,t){"use strict";function n(e){let t=5381;for(let n=0;n>>0}function r(e){return n(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{djb2Hash:function(){return n},hexHash:function(){return r}})},48701:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});let r=n(47043)._(n(2265)).default.createContext({})},79060:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PathParamsContext:function(){return l},PathnameContext:function(){return u},SearchParamsContext:function(){return o}});let r=n(2265),o=(0,r.createContext)(null),u=(0,r.createContext)(null),l=(0,r.createContext)(null)},18993:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{BailoutToCSRError:function(){return r},isBailoutToCSRError:function(){return o}});let n="BAILOUT_TO_CLIENT_SIDE_RENDERING";class r extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}},78162:function(e,t){"use strict";function n(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return n}})},2103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ActionQueueContext:function(){return a},createMutableActionQueue:function(){return s}});let r=n(53099),o=n(24673),u=n(91450),l=r._(n(2265)),a=l.default.createContext(null);function i(e,t){null!==e.pending&&(e.pending=e.pending.next,null!==e.pending?c({actionQueue:e,action:e.pending,setState:t}):e.needsRefresh&&(e.needsRefresh=!1,e.dispatch({type:o.ACTION_REFRESH,origin:window.location.origin},t)))}async function c(e){let{actionQueue:t,action:n,setState:r}=e,u=t.state;if(!u)throw Error("Invariant: Router state not initialized");t.pending=n;let l=n.payload,a=t.action(u,l);function c(e){n.discarded||(t.state=e,t.devToolsInstance&&t.devToolsInstance.send(l,e),i(t,r),n.resolve(e))}(0,o.isThenable)(a)?a.then(c,e=>{i(t,r),n.reject(e)}):c(a)}function s(){let e={state:null,dispatch:(t,n)=>(function(e,t,n){let r={resolve:n,reject:()=>{}};if(t.type!==o.ACTION_RESTORE){let e=new Promise((e,t)=>{r={resolve:e,reject:t}});(0,l.startTransition)(()=>{n(e)})}let u={payload:t,next:null,resolve:r.resolve,reject:r.reject};null===e.pending?(e.last=u,c({actionQueue:e,action:u,setState:n})):t.type===o.ACTION_NAVIGATE||t.type===o.ACTION_RESTORE?(e.pending.discarded=!0,e.last=u,e.pending.payload.type===o.ACTION_SERVER_ACTION&&(e.needsRefresh=!0),c({actionQueue:e,action:u,setState:n})):(null!==e.last&&(e.last.next=u),e.last=u)})(e,t,n),action:async(e,t)=>{if(null===e)throw Error("Invariant: Router state not initialized");return(0,u.reducer)(e,t)},pending:null,last:null};return e}},68498:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return o}});let r=n(63381);function o(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:n,query:o,hash:u}=(0,r.parsePath)(e);return""+t+n+o+u}},20926:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{normalizeAppPath:function(){return u},normalizeRscURL:function(){return l}});let r=n(78162),o=n(84541);function u(e){return(0,r.ensureLeadingSlash)(e.split("/").reduce((e,t,n,r)=>!t||(0,o.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&n===r.length-1?e:e+"/"+t,""))}function l(e){return e.replace(/\.rsc($|\?)/,"$1")}},7092:function(e,t){"use strict";function n(e,t){if(void 0===t&&(t={}),t.onlyHashChange){e();return}let n=document.documentElement,r=n.style.scrollBehavior;n.style.scrollBehavior="auto",t.dontForceLayout||n.getClientRects(),e(),n.style.scrollBehavior=r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return n}})},86146:function(e,t){"use strict";function n(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return n}})},63381:function(e,t){"use strict";function n(e){let t=e.indexOf("#"),n=e.indexOf("?"),r=n>-1&&(t<0||n-1?{pathname:e.substring(0,r?n:t),query:r?e.substring(n,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return n}})},10580:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return o}});let r=n(63381);function o(e,t){if("string"!=typeof e)return!1;let{pathname:n}=(0,r.parsePath)(e);return n===t||n.startsWith(t+"/")}},26674:function(e,t){"use strict";function n(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return n}})},84541:function(e,t){"use strict";function n(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return n}});let r="__PAGE__",o="__DEFAULT__"},55501:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return o},useServerInsertedHTML:function(){return u}});let r=n(53099)._(n(2265)),o=r.default.createContext(null);function u(e){let t=(0,r.useContext)(o);t&&t(e)}},31765:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},47149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(54832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54832:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAsyncLocalStorage",{enumerable:!0,get:function(){return u}});let n=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}}let o=globalThis.AsyncLocalStorage;function u(){return o?new o:new r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},25575:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"requestAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(54832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20030:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(54832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},34040:function(e,t,n){"use strict";var r=n(54887);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},54887:function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(84417)},97950:function(e,t,n){"use strict";var r=n(54887),o={stream:!0},u=new Map;function l(e){var t=n(e);return"function"!=typeof t.then||"fulfilled"===t.status?null:(t.then(function(e){t.status="fulfilled",t.value=e},function(e){t.status="rejected",t.reason=e}),t)}function a(){}var i=new Map,c=n.u;n.u=function(e){var t=i.get(e);return void 0!==t?t:c(e)};var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,f=Symbol.for("react.element"),d=Symbol.for("react.lazy"),p=Symbol.iterator,h=Array.isArray,y=Object.getPrototypeOf,_=Object.prototype,v=new WeakMap;function b(e,t,n,r){this.status=e,this.value=t,this.reason=n,this._response=r}function g(e){switch(e.status){case"resolved_model":E(e);break;case"resolved_module":w(e)}switch(e.status){case"fulfilled":return e.value;case"pending":case"blocked":case"cyclic":throw e;default:throw e.reason}}function m(e,t){for(var n=0;nh?(_=h,h=3,p++):(_=0,h=3);continue;case 2:44===(m=d[p++])?h=4:v=v<<4|(96d.length&&(m=-1)}var O=d.byteOffset+p;if(-1{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/litellm/proxy/_experimental/out/_next/static/chunks/1264-2979d95e0b56a75c.js b/litellm/proxy/_experimental/out/_next/static/chunks/1264-2979d95e0b56a75c.js new file mode 100644 index 0000000000..fd249f9de9 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1264-2979d95e0b56a75c.js @@ -0,0 +1 @@ +"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/litellm/proxy/_experimental/out/_next/static/chunks/1307-6b882871684ce94c.js b/litellm/proxy/_experimental/out/_next/static/chunks/1307-6b882871684ce94c.js new file mode 100644 index 0000000000..40149428ca --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1307-6b882871684ce94c.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(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/13b76428-e1bf383848c17260.js b/litellm/proxy/_experimental/out/_next/static/chunks/13b76428-e1bf383848c17260.js new file mode 100644 index 0000000000..76cea35732 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/13b76428-e1bf383848c17260.js @@ -0,0 +1 @@ +(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/litellm/proxy/_experimental/out/_next/static/chunks/13b76428-ebdf3012af0e4489.js b/litellm/proxy/_experimental/out/_next/static/chunks/13b76428-ebdf3012af0e4489.js deleted file mode 100644 index 307379053b..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/13b76428-ebdf3012af0e4489.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[990],{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]],e3=[["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/]],e6=/^\/?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=e3.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"),t3=t1("m"),t6=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=t3,n_.asHours=t6,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/litellm/proxy/_experimental/out/_next/static/chunks/1487-ada9ecf7dd9bca97.js b/litellm/proxy/_experimental/out/_next/static/chunks/1487-ada9ecf7dd9bca97.js new file mode 100644 index 0000000000..dddce2ff9a --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1487-ada9ecf7dd9bca97.js @@ -0,0 +1 @@ +"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/litellm/proxy/_experimental/out/_next/static/chunks/1491-80fe911f18f4631c.js b/litellm/proxy/_experimental/out/_next/static/chunks/1491-80fe911f18f4631c.js new file mode 100644 index 0000000000..f2f6a5f9bd --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1491-80fe911f18f4631c.js @@ -0,0 +1 @@ +(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