Merge pull request #11 from CJackHwang/codex/fix-vercel-deployment-adapt-issue-ota5s1

Stop committing WebUI build artifacts; add Vercel build + cache headers; remove committed static/admin files
This commit is contained in:
CJACK. authored and GitHub committed 2026-02-04 20:21:34 +08:00
commit aa032540dc
13 files changed
+60 -623

No files matched your search

-76
View File
@@ -1,76 +0,0 @@
# 自动构建 WebUI 并提交构建产物
# 触发条件:webui 目录下的文件变更
name: Build WebUI
on:
push:
branches:
- main
paths:
- 'webui/**'
- '.github/workflows/build-webui.yml'
pull_request:
branches:
- main
paths:
- 'webui/**'
# 允许手动触发
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# 只在主仓库运行,避免 fork 仓库运行
if: github.repository == 'CJackHwang/ds2api'
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: webui/package-lock.json
- name: Install dependencies
working-directory: webui
run: npm ci
- name: Build WebUI
working-directory: webui
run: npm run build
- name: Check for changes
id: check_changes
run: |
git add static/admin
if git diff --staged --quiet; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.check_changes.outputs.changed == 'true' && github.event_name == 'push'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "chore: auto-build WebUI [skip ci]"
git push
- name: Upload build artifacts (for PR review)
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: webui-build
path: static/admin
retention-days: 7
+2
View File
@@ -64,6 +64,8 @@ pnpm-lock.yaml
*.tsbuildinfo
.cache/
.parcel-cache/
static/admin/*
!static/admin/.gitkeep
# Environment
.env.local
+5 -3
View File
@@ -131,8 +131,9 @@ WebUI 开发服务器会启动在 `http://localhost:5173`,并自动代理 API
WebUI 构建产物位于 `static/admin/` 目录。
**自动构建(推荐)**:
- 当 `webui/` 目录下的文件变更并推送到 `main` 分支时,GitHub Actions 会自动构建并提交产物
- PR 合并时会自动触发构建
- 当前由 Vercel 在部署时执行 WebUI 构建(见 `vercel.json` 的 `buildCommand`)
- GitHub Actions 的 WebUI 自动构建流程已关闭
- `static/admin/` 构建产物不再提交到仓库
**手动构建**:
```bash
@@ -145,7 +146,7 @@ npm install
npm run build
```
> **贡献者注意**:修改 WebUI 后无需手动构建,CI 会自动处理。
> **贡献者注意**:修改 WebUI 后无需手动构建,Vercel 部署会自动构建。
---
@@ -153,6 +154,7 @@ npm run build
Docker 部署采用**零侵入、解耦设计**:
- Dockerfile 仅执行标准 Python 项目操作,不硬编码任何项目特定配置
- 构建镜像时会一并构建 WebUI(便于非 Vercel 部署直接访问管理面板)
- 所有配置通过环境变量和 `.env` 文件管理
- **主代码更新时只需重新构建镜像,无需修改 Docker 配置**
+13
View File
@@ -2,6 +2,16 @@
# 采用极简、零侵入设计,所有配置通过环境变量传递
# 主代码更新时只需重新构建镜像,无需修改 Dockerfile
FROM node:20 AS webui-builder
WORKDIR /app/webui
COPY webui/package.json webui/package-lock.json ./
RUN npm ci
COPY webui ./
RUN npm run build
FROM python:3.11-slim
WORKDIR /app
@@ -13,6 +23,9 @@ RUN pip install --no-cache-dir -r requirements.txt
# 复制整个项目(保留原始目录结构)
COPY . .
# 拷贝 WebUI 构建产物(非 Vercel / Docker 部署可直接使用)
COPY --from=webui-builder /app/static/admin /app/static/admin
# 暴露服务端口
EXPOSE 5001
+1 -140
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
"""Admin 账号管理模块 - 账号验证和测试"""
"""Admin 账号管理模块 - 账号测试与导入"""
import asyncio
import json
import base64
@@ -24,145 +24,6 @@ from .auth import verify_admin
router = APIRouter()
# ----------------------------------------------------------------------
# 账号验证
# ----------------------------------------------------------------------
async def validate_single_account(account: dict) -> dict:
"""验证单个账号的有效性"""
acc_id = get_account_identifier(account)
result = {
"account": acc_id,
"valid": False,
"has_token": bool(account.get("token", "").strip()),
"message": "",
}
def _is_token_invalid(status_code: int, data: dict) -> bool:
msg = (data.get("msg") or data.get("message") or "").lower()
code = data.get("code")
return status_code in {401, 403} or code in {40001, 40002, 40003} or "token" in msg or "unauthorized" in msg
def _create_session(token: str) -> dict:
headers = {**BASE_HEADERS, "authorization": f"Bearer {token}"}
try:
session_resp = cffi_requests.post(
DEEPSEEK_CREATE_SESSION_URL,
headers=headers,
json={"agent": "chat"},
impersonate="safari15_3",
timeout=15,
)
except Exception as e:
return {"success": False, "message": f"请求异常: {e}", "status_code": 0, "data": {}}
try:
data = session_resp.json()
except Exception:
data = {}
finally:
session_resp.close()
if session_resp.status_code == 200 and data.get("code") == 0:
return {
"success": True,
"session_id": data.get("data", {}).get("biz_data", {}).get("id"),
"status_code": session_resp.status_code,
"data": data,
}
return {
"success": False,
"message": data.get("msg") or f"HTTP {session_resp.status_code}",
"status_code": session_resp.status_code,
"data": data,
}
try:
token = account.get("token", "").strip()
if token:
session_result = _create_session(token)
if session_result["success"]:
result["valid"] = True
result["message"] = "Token 有效"
return result
if _is_token_invalid(session_result["status_code"], session_result["data"]):
token = ""
account["token"] = ""
if not token:
try:
login_deepseek_via_account(account)
token = account.get("token", "").strip()
session_result = _create_session(token)
if session_result["success"]:
result["valid"] = True
result["has_token"] = True
result["message"] = "登录成功并验证通过"
else:
result["message"] = f"登录成功但验证失败: {session_result['message']}"
except Exception as e:
result["valid"] = False
result["message"] = f"登录失败: {str(e)}"
except Exception as e:
result["message"] = f"验证出错: {str(e)}"
return result
@router.post("/accounts/validate")
async def validate_account(request: Request, _: bool = Depends(verify_admin)):
"""验证单个账号"""
data = await request.json()
identifier = data.get("identifier", "").strip()
if not identifier:
raise HTTPException(status_code=400, detail="需要账号标识(email 或 mobile)")
account = None
for acc in CONFIG.get("accounts", []):
if acc.get("email") == identifier or acc.get("mobile") == identifier:
account = acc
break
if not account:
raise HTTPException(status_code=404, detail="账号不存在")
result = await validate_single_account(account)
if result["valid"] and result["has_token"]:
save_config(CONFIG)
return JSONResponse(content=result)
@router.post("/accounts/validate-all")
async def validate_all_accounts(_: bool = Depends(verify_admin)):
"""批量验证所有账号"""
accounts = CONFIG.get("accounts", [])
if not accounts:
return JSONResponse(content={
"total": 0, "valid": 0, "invalid": 0, "results": [],
})
results = []
valid_count = 0
for acc in accounts:
result = await validate_single_account(acc)
results.append(result)
if result["valid"]:
valid_count += 1
await asyncio.sleep(0.5)
save_config(CONFIG)
return JSONResponse(content={
"total": len(accounts),
"valid": valid_count,
"invalid": len(accounts) - valid_count,
"results": results,
})
# ----------------------------------------------------------------------
# 账号 API 测试
# ----------------------------------------------------------------------
+8 -3
View File
@@ -290,14 +290,19 @@ async def webui(request: Request, path: str = ""):
if path and "." in path:
file_path = os.path.join(STATIC_ADMIN_DIR, path)
if os.path.isfile(file_path):
return FileResponse(file_path)
cache_control = "public, max-age=31536000, immutable"
if path.startswith("assets/"):
headers = {"Cache-Control": cache_control}
else:
headers = {"Cache-Control": "no-store, must-revalidate"}
return FileResponse(file_path, headers=headers)
return HTMLResponse(content="Not Found", status_code=404)
# 否则返回 index.html(SPA 路由)
index_path = os.path.join(STATIC_ADMIN_DIR, "index.html")
if os.path.isfile(index_path):
return FileResponse(index_path)
headers = {"Cache-Control": "no-store, must-revalidate"}
return FileResponse(index_path, headers=headers)
return HTMLResponse(content="index.html not found", status_code=404)
+5
View File
@@ -18,5 +18,10 @@ fi
echo "🏗️ Running build..."
npm run build
if [ ! -f "../static/admin/index.html" ]; then
echo "❌ WebUI build failed: static/admin/index.html not found"
exit 1
fi
echo "✅ WebUI built successfully!"
echo "📁 Output: static/admin/"
+1
View File
@@ -0,0 +1 @@
-1
View File
@@ -1 +0,0 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relLine truncated
-272
View File
@@ -1,272 +0,0 @@
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function $d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eu={exports:{}},bl={},tu={exports:{}},D={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Nr=Symbol.for("react.element"),Fd=Symbol.for("react.portal"),Ad=Symbol.for("react.fragment"),Ud=Symbol.for("react.strict_mode"),Bd=Symbol.for("react.profiler"),Vd=Symbol.for("react.provider"),Hd=Symbol.for("react.context"),Wd=Symbol.for("react.forward_ref"),Qd=Symbol.for("react.suspense"),Kd=Symbol.for("react.memo"),Jd=Symbol.for("react.lazy"),Ti=Symbol.iterator;function Yd(e){return e===null||typeof e!="object"?null:(e=Ti&&e[Ti]||e["@@iterator"],typeof e=="function"?e:null)}var nu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ru=Object.assign,lu={};function Ln(e,t,n){this.props=e,this.context=t,this.refs=lu,this.updater=n||nu}Ln.prototype.isReactComponent={};Ln.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ln.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ou(){}ou.prototype=Ln.prototype;function Rs(e,t,n){this.props=e,this.context=t,this.refs=lu,this.updater=n||nu}var Ls=Rs.prototype=new ou;Ls.constructor=Rs;ru(Ls,Ln.prototype);Ls.isPureReactComponent=!0;var zi=Array.isArray,su=Object.prototype.hasOwnProperty,Ts={current:null},iu={key:!0,ref:!0,__self:!0,__source:!0};function au(e,t,n){var r,l={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)su.call(t,r)&&!iu.hasOwnProperty(r)&&(l[r]=t[r]);var i=arguments.length-2;if(i===1)l.children=n;else if(1<i){for(var u=Array(i),c=0;c<i;c++)u[c]=arguments[c+2];l.children=u}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)l[r]===void 0&&(l[r]=i[r]);return{$$typeof:Nr,type:e,key:o,ref:s,props:l,_owner:Ts.current}}function Gd(e,t){return{$$typeof:Nr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function zs(e){return typeof e=="object"&&e!==null&&e.$$typeof===Nr}function Xd(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Oi=/\/+/g;function to(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Xd(""+e.key):t.toString(36)}function Yr(e,t,n,r,l){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Nr:case Fd:s=!0}}if(s)return s=e,l=l(s),e=r===""?"."+to(s,0):r,zi(l)?(n="",e!=null&&(n=e.replace(Oi,"$&/")+"/"),Yr(l,t,n,"",function(c){return c})):l!=null&&(zs(l)&&(l=Gd(l,n+(!l.key||s&&s.key===l.key?"":(""+l.key).replace(Oi,"$&/")+"/")+e)),t.push(l)),1;if(s=0,r=r===""?".":r+":",zi(e))for(var i=0;i<e.length;i++){o=e[i];var u=r+to(o,i);s+=Yr(o,t,n,u,l)}else if(u=Yd(e),typeof u=="function")for(e=u.call(e),i=0;!(o=e.next()).done;)o=o.value,u=r+to(o,i++),s+=Yr(o,t,n,u,l);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Tr(e,t,n){if(e==null)return e;var r=[],l=0;return Yr(e,r,"","",function(o){return t.call(n,o,l++)}),r}function Zd(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ge={current:null},Gr={transition:null},qd={ReactCurrentDispatcher:ge,ReactCurrentBatchConfig:Gr,ReactCurrentOwner:Ts};function uu(){throw Error("act(...) is not supported in production builds of React.")}D.Children={map:Tr,forEach:function(e,t,n){Tr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Tr(e,function(){t++}),t},toArray:function(e){return Tr(e,function(t){return t})||[]},only:function(e){if(!zs(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};D.Component=Ln;D.Fragment=Ad;D.Profiler=Bd;D.PureComponent=Rs;D.StrictMode=Ud;D.Suspense=Qd;D.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qd;D.act=uu;D.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ru({},e.props),l=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=Ts.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(u in t)su.call(t,u)&&!iu.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&i!==void 0?i[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){i=Array(u);for(var c=0;c<u;c++)i[c]=arguments[c+2];r.children=i}return{$$typeof:Nr,type:e.type,key:l,ref:o,props:r,_owner:s}};D.createContext=function(e){return e={$$typeof:Hd,_currentValue:e,_currentValue2:e,_threadCount:0,ProviderLine truncated
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var tf=g,nf=Symbol.for("react.element"),rf=Symbol.for("react.fragment"),lf=Object.prototype.hasOwnProperty,of=tf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,sf={key:!0,ref:!0,__self:!0,__source:!0};function cu(e,t,n){var r,l={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)lf.call(t,r)&&!sf.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:nf,type:e,key:o,ref:s,props:l,_owner:of.current}}bl.Fragment=rf;bl.jsx=cu;bl.jsxs=cu;eu.exports=bl;var a=eu.exports,zo={},du={exports:{}},Re={},fu={exports:{}},pu={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(L,E){var z=L.length;L.push(E);e:for(;0<z;){var U=z-1>>>1,W=L[U];if(0<l(W,E))L[U]=E,L[z]=W,z=U;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var E=L[0],z=L.pop();if(z!==E){L[0]=z;e:for(var U=0,W=L.length,xe=W>>>1;U<xe;){var me=2*(U+1)-1,vt=L[me],C=me+1,I=L[C];if(0>l(vt,z))C<W&&0>l(I,vt)?(L[U]=I,L[C]=z,U=C):(L[U]=vt,L[me]=z,U=me);else if(C<W&&0>l(I,z))L[U]=I,L[C]=z,U=C;else break e}}return E}function l(L,E){var z=L.sortIndex-E.sortIndex;return z!==0?z:L.id-E.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,i=s.now();e.unstable_now=function(){return s.now()-i}}var u=[],c=[],y=1,p=null,h=3,v=!1,x=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(L){for(var E=n(c);E!==null;){if(E.callback===null)r(c);else if(E.startTime<=L)r(c),E.sortIndex=E.expirationTime,t(u,E);else break;E=n(c)}}function k(L){if(w=!1,m(L),!x)if(n(u)!==null)x=!0,yt(S);else{var E=n(c);E!==null&&gt(k,E.startTime-L)}}function S(L,E){x=!1,w&&(w=!1,f(P),P=-1),v=!0;var z=h;try{for(m(E),p=n(u);p!==null&&(!(p.expirationTime>E)||L&&!pe());){var U=p.callback;if(typeof U=="function"){p.callback=null,h=p.priorityLevel;var W=U(p.expirationTime<=E);E=e.unstable_now(),typeof W=="function"?p.callback=W:p===n(u)&&r(u),m(E)}else r(u);p=n(u)}if(p!==null)var xe=!0;else{var me=n(c);me!==null&&gt(k,me.startTime-E),xe=!1}return xe}finally{p=null,h=z,v=!1}}var _=!1,R=null,P=-1,b=5,O=-1;function pe(){return!(e.unstable_now()-O<b)}function oe(){if(R!==null){var L=e.unstable_now();O=L;var E=!0;try{E=R(!0,L)}finally{E?Je():(_=!1,R=null)}}else _=!1}var Je;if(typeof d=="function")Je=function(){d(oe)};else if(typeof MessageChannel<"u"){var At=new MessageChannel,tn=At.port2;At.port1.onmessage=oe,Je=function(){tn.postMessage(null)}}else Je=function(){N(oe,0)};function yt(L){R=L,_||(_=!0,Je())}function gt(L,E){P=N(function(){L(e.unstable_now())},E)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){x||v||(x=!0,yt(S))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(L){switch(h){case 1:case 2:case 3:var E=3;break;default:E=h}var z=h;h=E;try{return L()}finally{h=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,E){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var z=h;h=L;try{return E()}finally{h=z}},e.unstable_scheduleCallback=function(L,E,z){var U=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?U+z:U):z=U,L){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=z+W,L={id:y++,callback:E,priorityLevel:L,startTime:z,expirationTime:W,sortIndex:-1},z>U?(L.sortIndex=z,t(c,L),n(u)===null&&L===n(c)&&(w?(f(P),P=-1):w=!0,gt(k,z-U))):(L.sortIndex=W,t(u,L),x||v||(x=!0,yt(S))),L},e.unstable_shouldYield=pe,e.unstable_wrapCallback=function(L){var E=h;return function(){var z=h;h=E;try{return L.apply(this,arguments)}finally{h=z}}}})(pu);fu.exports=pu;var af=fu.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var uf=g,Pe=af;function j(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var mu=new Set,lr={};function qt(e,t){Sn(e,t),Sn(e+"Capture",t)}function Sn(e,t){for(lr[e]=t,e=0;e<t.length;e++)mu.add(t[e])}var ut=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oo=Object.prototype.hasOwnProperty,cf=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ii={},Di={};function df(e){return Oo.call(Di,e)?!0:Oo.call(Ii,e)?!1:cf.test(e)?Di[e]=!0:(Ii[e]=!0,!1)}function ff(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function pf(e,t,n,r){if(t===null||typeof t>"u"||ff(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ve(e,t,n,r,l,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ae[e]=new ve(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ae[t]=new ve(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ae[e]=new ve(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ae[e]=new ve(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ae[e]=new ve(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ae[e]=new ve(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ae[e]=new ve(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ae[e]=new ve(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ae[e]=new ve(e,5,!1,e.toLowerCase(),null,!1,!1)});var Os=/[\-:]([a-z])/g;function Is(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Os,Is);ae[t]=new ve(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Os,Is);ae[t]=new ve(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Os,Is);ae[t]=new ve(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ae[e]=new ve(e,1,!1,e.toLowerCase(),null,!1,!1)});ae.xlinkHref=new ve("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ae[e]=new ve(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ds(e,t,n,r){var l=ae.hasOwnProperty(t)?ae[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!==" Line truncated
`+no+e}var ro=!1;function lo(e,t){if(!e||ro)return"";ro=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
`),o=r.stack.split(`
`),s=l.length-1,i=o.length-1;1<=s&&0<=i&&l[s]!==o[i];)i--;for(;1<=s&&0<=i;s--,i--)if(l[s]!==o[i]){if(s!==1||i!==1)do if(s--,i--,0>i||l[s]!==o[i]){var u=`
`+l[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=i);break}}}finally{ro=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wn(e):""}function mf(e){switch(e.tag){case 5:return Wn(e.type);case 16:return Wn("Lazy");case 13:return Wn("Suspense");case 19:return Wn("SuspenseList");case 0:case 2:case 15:return e=lo(e.type,!1),e;case 11:return e=lo(e.type.render,!1),e;case 1:return e=lo(e.type,!0),e;default:return""}}function Mo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case on:return"Fragment";case ln:return"Portal";case Io:return"Profiler";case bs:return"StrictMode";case Do:return"Suspense";case bo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yu:return(e.displayName||"Context")+".Consumer";case hu:return(e._context.displayName||"Context")+".Provider";case Ms:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $s:return t=e.displayName||null,t!==null?t:Mo(e.type)||"Memo";case kt:t=e._payload,e=e._init;try{return Mo(e(t))}catch{}}return null}function hf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Mo(t);case 8:return t===bs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Dt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yf(e){var t=vu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Or(e){e._valueTracker||(e._valueTracker=yf(e))}function xu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ul(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $o(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Mi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Dt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function wu(e,t){t=t.checked,t!=null&&Ds(e,"checked",t,!1)}function Fo(e,t){wu(e,t);var n=Dt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ao(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ao(e,t.type,Dt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $i(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ao(e,t,n){(t!=="number"||ul(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qn=Array.isArray;function gn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Dt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Uo(e,t){if(t.dang Line truncated
`).replace(Cp,"")}function Ur(e,t,n){if(t=ia(t),ia(e)!==t&&n)throw Error(j(425))}function gl(){}var es=null,ts=null;function ns(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var rs=typeof setTimeout=="function"?setTimeout:void 0,_p=typeof clearTimeout=="function"?clearTimeout:void 0,aa=typeof Promise=="function"?Promise:void 0,Pp=typeof queueMicrotask=="function"?queueMicrotask:typeof aa<"u"?function(e){return aa.resolve(null).then(e).catch(Rp)}:rs;function Rp(e){setTimeout(function(){throw e})}function vo(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),ur(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);ur(t)}function Lt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ua(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var zn=Math.random().toString(36).slice(2),Xe="__reactFiber$"+zn,mr="__reactProps$"+zn,ct="__reactContainer$"+zn,ls="__reactEvents$"+zn,Lp="__reactListeners$"+zn,Tp="__reactHandles$"+zn;function Vt(e){var t=e[Xe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[Xe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ua(e);e!==null;){if(n=e[Xe])return n;e=ua(e)}return t}e=n,n=e.parentNode}return null}function Er(e){return e=e[Xe]||e[ct],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(j(33))}function Ul(e){return e[mr]||null}var os=[],dn=-1;function $t(e){return{current:e}}function H(e){0>dn||(e.current=os[dn],os[dn]=null,dn--)}function B(e,t){dn++,os[dn]=e.current,e.current=t}var bt={},fe=$t(bt),Ne=$t(!1),Jt=bt;function jn(e,t){var n=e.type.contextTypes;if(!n)return bt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Se(e){return e=e.childContextTypes,e!=null}function vl(){H(Ne),H(fe)}function ca(e,t,n){if(fe.current!==bt)throw Error(j(168));B(fe,t),B(Ne,n)}function ac(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(j(108,hf(e)||"Unknown",l));return G({},n,r)}function xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bt,Jt=fe.current,B(fe,e),B(Ne,Ne.current),!0}function da(e,t,n){var r=e.stateNode;if(!r)throw Error(j(169));n?(e=ac(e,t,Jt),r.__reactInternalMemoizedMergedChildContext=e,H(Ne),H(fe),B(fe,e)):H(Ne),B(Ne,n)}var lt=null,Bl=!1,xo=!1;function uc(e){lt===null?lt=[e]:lt.push(e)}function zp(e){Bl=!0,uc(e)}function Ft(){if(!xo&&lt!==null){xo=!0;var e=0,t=A;try{var n=lt;for(A=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}lt=null,Bl=!1}catch(l){throw lt!==null&&(lt=lt.slice(e+1)),Iu(As,Ft),l}finally{A=t,xo=!1}}return null}var fn=[],pn=0,wl=null,kl=0,Oe=[],Ie=0,Yt=null,ot=1,st="";function Ut(e,t){fn[pn++]=kl,fn[pn++]=wl,wl=e,kl=t}function cc(e,t,n){Oe[Ie++]=ot,Oe[Ie++]=st,Oe[Ie++]=Yt,Yt=e;var r=ot;e=st;var l=32-He(r)-1;r&=~(1<<l),n+=1;var o=32-He(t)+l;if(30<o){var s=l-l%5;o=(r&(1<<s)-1).toString(32),r>>=s,l-=s,ot=1<<32-He(t)+l|n<<l|r,st=o+e}else ot=1<<o|n<<l|r,st=e}function Ys(e){e.return!==null&&(Ut(e,1),cc(e,1,0))}function Gs(e){for(;e===wl;)wl=fn[--pn],fn[pn]=null,kl=fn[--pn],fn[pn]=null;for(;e===Yt;)Yt=Oe[--Ie],Oe[Ie]=null,st=Oe[--Ie],Oe[Ie]=null,ot=Oe[--Ie],Oe[Ie]=null}var _e=null,Ce=null,Q=!1,Ve=null;function dc(e,t){var n=De(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function fa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,_e=e,Ce=Lt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_e=e,Ce=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Yt!==null?{id:ot,overflow:st}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=De(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,_e=e,Ce=null,!0):!1;default:return!1}}function ss(e){return(e.mode&1)!==0&&(e.flags&128)===0}function is(e){if(Q){var t=Ce;if(t){var n=t;if(!fa(e,t)){if(ss(e))throw Error(j(418));t=Lt(n.nextSibling);var r=_e;t&&fa(e,t)?dc(r,n):(e.flags=e.flags&-4097|2,Q=!1,_e=e)}}else{if(ss(e))throw Error(j(418));e.flags=e.flags&-4097|2,Q=!1,_e=e}}}function pa(e){for(e=e.return;e!==null&&e.t Line truncated
Error generating stack: `+o.message+`
`+o.stack}return{value:e,source:t,stack:l,digest:null}}function jo(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ds(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Up=typeof WeakMap=="function"?WeakMap:Map;function $c(e,t,n){n=it(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Rl||(Rl=!0,ks=r),ds(e,t)},n}function Fc(e,t,n){n=it(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){ds(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ds(e,t),typeof r!="function"&&(zt===null?zt=new Set([this]):zt.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function ka(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Up;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=tm.bind(null,e,t,n),t.then(e,e))}function Na(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Sa(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=it(-1,1),t.tag=2,Tt(n,t,1))),n.lanes|=1),e)}var Bp=mt.ReactCurrentOwner,ke=!1;function he(e,t,n,r){t.child=e===null?mc(t,null,n,r):Cn(t,e.child,n,r)}function ja(e,t,n,r,l){n=n.render;var o=t.ref;return kn(t,l),r=ii(e,t,n,r,o,l),n=ai(),e!==null&&!ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ft(e,t,l)):(Q&&n&&Ys(t),t.flags|=1,he(e,t,r,l),t.child)}function Ea(e,t,n,r,l){if(e===null){var o=n.type;return typeof o=="function"&&!vi(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Ac(e,t,o,r,l)):(e=sl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&l)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:dr,n(s,r)&&e.ref===t.ref)return ft(e,t,l)}return t.flags|=1,e=It(o,r),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,n,r,l){if(e!==null){var o=e.memoizedProps;if(dr(o,r)&&e.ref===t.ref)if(ke=!1,t.pendingProps=r=o,(e.lanes&l)!==0)e.flags&131072&&(ke=!0);else return t.lanes=e.lanes,ft(e,t,l)}return fs(e,t,n,r,l)}function Uc(e,t,n){var r=t.pendingProps,l=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},B(yn,Ee),Ee|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,B(yn,Ee),Ee|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,B(yn,Ee),Ee|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,B(yn,Ee),Ee|=r;return he(e,t,l,n),t.child}function Bc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function fs(e,t,n,r,l){var o=Se(n)?Jt:fe.current;return o=jn(t,o),kn(t,l),n=ii(e,t,n,r,o,l),r=ai(),e!==null&&!ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ft(e,t,l)):(Q&&r&&Ys(t),t.flags|=1,he(e,t,n,l),t.child)}function Ca(e,t,n,r,l){if(Se(n)){var o=!0;xl(t)}else o=!1;if(kn(t,l),t.stateNode===null)rl(e,t),Mc(t,n,r),cs(t,n,r,l),r=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var u=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Me(c):(c=Se(n)?Jt:fe.current,c=jn(t,c));var y=n.getDerivedStateFromProps,p=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==r||u!==c)&&wa(t,s,r,c),Nt=!1;var h=t.memoizedState;s.state=h,jl(t,r,s,l),u=t.memoizedState,i!==r||h!==u||Ne.current||Nt?(typeof y=="function"&&(us(t,n,y,r),u=t.memoizedState),(i=Nt||xa(t,n,i,r,h,u,c))?(p||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=c,r=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,yc(e,t),i=t.memoizedProps,c=t.type===t.elementType?i:Ue(t.type,i),s.props=c,p=t.pendingProps,h=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=Me(u):(u=Se(n)?Jt:fe.current,u=jn(t,u));var v=n.getDerivedStateFromProps;(y=typeof v=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==p||h!==u)&&wa(t,s,r,u),Nt=!1,h=t.memoizedState,s.state=h,jl(t,r,s,l);var x=t.memoizedState;i Line truncated
* react-router v7.13.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/var Aa="popstate";function pm(e={}){function t(r,l){let{pathname:o,search:s,hash:i}=r.location;return Es("",{pathname:o,search:s,hash:i},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:kr(l)}return hm(t,n,null,e)}function K(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ke(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mm(){return Math.random().toString(36).substring(2,10)}function Ua(e,t){return{usr:e.state,key:e.key,idx:t}}function Es(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?On(t):t,state:n,key:t&&t.key||r||mm()}}function kr({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function On(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function hm(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,s=l.history,i="POP",u=null,c=y();c==null&&(c=0,s.replaceState({...s.state,idx:c},""));function y(){return(s.state||{idx:null}).idx}function p(){i="POP";let N=y(),f=N==null?null:N-c;c=N,u&&u({action:i,location:w.location,delta:f})}function h(N,f){i="PUSH";let d=Es(w.location,N,f);c=y()+1;let m=Ua(d,c),k=w.createHref(d);try{s.pushState(m,"",k)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;l.location.assign(k)}o&&u&&u({action:i,location:w.location,delta:1})}function v(N,f){i="REPLACE";let d=Es(w.location,N,f);c=y();let m=Ua(d,c),k=w.createHref(d);s.replaceState(m,"",k),o&&u&&u({action:i,location:w.location,delta:0})}function x(N){return ym(N)}let w={get action(){return i},get location(){return e(l,s)},listen(N){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Aa,p),u=N,()=>{l.removeEventListener(Aa,p),u=null}},createHref(N){return t(l,N)},createURL:x,encodeLocation(N){let f=x(N);return{pathname:f.pathname,search:f.search,hash:f.hash}},push:h,replace:v,go(N){return s.go(N)}};return w}function ym(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),K(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:kr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function fd(e,t,n="/"){return gm(e,t,n,!1)}function gm(e,t,n,r){let l=typeof t=="string"?On(t):t,o=pt(l.pathname||"/",n);if(o==null)return null;let s=pd(e);vm(s);let i=null;for(let u=0;i==null&&u<s.length;++u){let c=Rm(o);i=_m(s[u],c,r)}return i}function pd(e,t=[],n=[],r="",l=!1){let o=(s,i,u=l,c)=>{let y={relativePath:c===void 0?s.path||"":c,caseSensitive:s.caseSensitive===!0,childrenIndex:i,route:s};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&u)return;K(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let p=at([r,y.relativePath]),h=n.concat(y);s.children&&s.children.length>0&&(K(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),pd(s.children,t,h,p,u)),!(s.path==null&&!s.index)&&t.push({path:p,score:Em(p,s.index),routesMeta:h})};return e.forEach((s,i)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))o(s,i);else for(let c of md(s.path))o(s,i,!0,c)}),t}function md(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let s=md(r.join("/")),i=[];return i.push(...s.map(u=>u===""?o:[o,u].join("/"))),l&&i.push(...s),i.map(u=>e.startsWith("/")&&u===""?"/":u)}function vm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Cm(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var xm=/^:[\w-]+$/,wm=3,km=2,Nm=1,Sm=10,jm=-2,Ba=e=>e==="*";function Em(e,t){let n=e.split("/"),r=n.length;return n.some(Ba)&&(r+=jm),t&&(r+=km),n.filter(l=>!Ba(l)).reduce((l,o)=>l+(xm.test(o)?wm:o===""?Nm:Sm),r)}function Cm(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function _m(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",s=[];for(let i=0;i<r.length;++i){let u=r[i],c=i===r.length-1,y=o==="/"?t:t.slice(o.length)||"/",p=Ol({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},y),h=u.route;if(!p&&c&&n&&!r[r.length-1].route.index&&(p=Ol({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},y)),!p)return null;Object.assign(l,p.params),s.push({params:l,pathname:at([o,p.pathname]),pathnameBase:Om(at([o,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(o=at([o,p.pathnameBase]))}return s}function Ol(e,t){typeof e=="string"&&(e={path:e,c Line truncated
Please change the parent <Route path="${m}"> to <Route path="${m==="/"?"*":`${m}/*`}">.`)}let h=ht(),v;if(t){let m=typeof t=="string"?On(t):t;K(y==="/"||((d=m.pathname)==null?void 0:d.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${m.pathname}" was given in the \`location\` prop.`),v=m}else v=h;let x=v.pathname||"/",w=x;if(y!=="/"){let m=y.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(m.length).join("/")}let N=fd(e,{pathname:w});Ke(p||N!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Ke(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let f=eh(N&&N.map(m=>Object.assign({},m,{params:Object.assign({},u,m.params),pathname:at([y,o.encodeLocation?o.encodeLocation(m.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?y:at([y,o.encodeLocation?o.encodeLocation(m.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathnameBase])})),s,n,r,l);return t&&f?g.createElement(_r.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},f):f}function Gm(){let e=oh(),t=Mm(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:l},n):null,s)}var Xm=g.createElement(Gm,null),Sd=class extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Qm(e.digest);n&&(e=n)}let t=e!==void 0?g.createElement(et.Provider,{value:this.props.routeContext},g.createElement(Ei.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(Zm,{error:e},t):t}};Sd.contextType=Am;var Ro=new WeakMap;function Zm({children:e,error:t}){let{basename:n}=g.useContext(Te);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Wm(t.digest);if(r){let l=Ro.get(t);if(l)throw l;let o=yd(r.location,n);if(hd&&!Ro.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw Ro.set(t,s),s}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function qm({routeContext:e,match:t,children:n}){let r=g.useContext(In);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(et.Provider,{value:e},n)}function eh(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=n==null?void 0:n.errors;if(s!=null){let y=o.findIndex(p=>p.route.id&&(s==null?void 0:s[p.route.id])!==void 0);K(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,y+1))}let i=!1,u=-1;if(n)for(let y=0;y<o.length;y++){let p=o[y];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=y),p.route.id){let{loaderData:h,errors:v}=n,x=p.route.loader&&!h.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||Line truncated
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ld=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hh=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wh=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qa=e=>{const t=Wh(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Qh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kh=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jh=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:o,iconNode:s,...i},u)=>g.createElement("svg",{ref:u,...Qh,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ld("lucide",l),...!o&&!Kh(i)&&{"aria-hidden":"true"},...i},[...s.map(([c,y])=>g.createElement(c,y)),...Array.isArray(o)?o:[o]]));/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const M=(e,t)=>{const n=g.forwardRef(({className:r,...l},o)=>g.createElement(Jh,{ref:o,iconNode:t,className:Ld(`lucide-${Hh(Qa(e))}`,`lucide-${e}`,r),...l}));return n.displayName=Qa(e),n};/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yh=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Td=M("arrow-right",Yh);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gh=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Xh=M("bot",Gh);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Zh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Il=M("check",Zh);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qh=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ka=M("chevron-down",qh);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ey=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Dl=M("circle-check",ey);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ty=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ny=M("circle-x",ty);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ry=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],zd=M("cloud",ry);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ly=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Od=M("copy",ly);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oy=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],sy=M("cpu",oy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iy=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],ay=M("download",iy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uy=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ja=M("external-link",uy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cy=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],dy=M("file-code",cy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],py=M("info",fy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const my=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],hy=M("key",my);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yy=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Ya=M("layout-dashboard",yy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gy=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],vy=M("loader-circle",gy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xy=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],wy=M("lock",xy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ky=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Ny=M("log-out",ky);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sy=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],jy=M("menu",Sy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ey=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Cy=M("message-square",Ey);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _y=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Py=M("play",_y);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ry=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ga=M("plus",Ry);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ly=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Xa=M("search",Ly);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ty=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],zy=M("send",Ty);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Oy=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Id=M("server",Oy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Iy=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Dd=M("shield-check",Iy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Dy=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],by=M("square",Dy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const My=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],$y=M("terminal",My);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fy=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Za=M("trash-2",Fy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ay=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Uy=M("triangle-alert",Ay);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const By=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],bd=M("upload",By);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vy=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Hy=M("user",Vy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wy=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Qy=M("users",Wy);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ky=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ps=M("x",Ky);/**
* @license lucide-react v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jy=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Yy=M("zap",Jy);function Md(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=Md(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ee(){for(var e,t,n=0,r="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Md(e))&&(r&&(r+=" "),r+=t);return r}function Gy({config:e,onRefresh:t,onMessage:n,authFetch:r}){var W,xe,me,vt;const[l,o]=g.useState(!1),[s,i]=g.useState(!1),[u,c]=g.useState(""),[y,p]=g.useState(null),[h,v]=g.useState({email:"",mobile:"",password:""}),[x,w]=g.useState(!1),[N,f]=g.useState({}),[d,m]=g.useState(!1),[k,S]=g.useState({}),[_,R]=g.useState(!1),[P,b]=g.useState({current:0,total:0,results:[]}),[O,pe]=g.useState(null),oe=r||fetch,Je=async()=>{try{const C=await oe("/admin/queue/status");if(C.ok){const I=await C.json();pe(I)}}catch(C){console.error("Failed to fetch queue status:",C)}};g.useEffect(()=>{Je();const C=setInterval(Je,5e3);return()=>clearInterval(C)},[]);const At=async()=>{if(u.trim()){w(!0);try{const C=await oe("/admin/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:u.trim()})});if(C.ok)n("success","API 密钥添加成功"),c(""),o(!1),t();else{const I=await C.json();n("error",I.detail||"Failed to add")}}catch{n("error","网络错误")}finally{w(!1)}}},tn=async C=>{if(confirm("确定要删除此 API 密钥吗?"))try{(await oe(`/admin/keys/${encodeURIComponent(C)}`,{method:"DELETE"})).ok?(n("success","Deleted successfully"),t()):n("error","Delete failed")}catch{n("error","Network error")}},yt=async()=>{if(!h.password||!h.email&&!h.mobile){n("error","Password and Email/Mobile are required");return}w(!0);try{const C=await oe("/admin/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});if(C.ok)n("success","账号添加成功"),v({email:"",mobile:"",password:""}),i(!1),t();else{const I=await C.json();n("error",I.detail||"Failed to add")}}catch{n("error","网络错误")}finally{w(!1)}},gt=async C=>{if(confirm("确定要删除此账号吗?"))try{(await oe(`/admin/accounts/${encodeURIComponent(C)}`,{method:"DELETE"})).ok?(n("success","Deleted successfully"),t()):n("error","Delete failed")}catch{n("error","Network error")}},L=async C=>{f(I=>({...I,[C]:!0}));try{const F=await(await oe("/admin/accounts/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:C})})).json();n(F.valid?"success":"error",`${C}: ${F.message}`),t()}catch(I){n("error","Validation failed: "+I.message)}finally{f(I=>({...I,[C]:!1}))}},E=async()=>{if(!confirm("校验所有账号?这可能需要一些时间。"))return;const C=e.accounts||[];if(C.length===0)return;m(!0),b({current:0,total:C.length,results:[]});let I=0;const F=[];for(let Fe=0;Fe<C.length;Fe++){const xt=C[Fe],tt=xt.email||xt.mobile;try{const ze=await(await oe("/admin/accounts/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:tt})})).json();F.push({id:tt,success:ze.valid,message:ze.message}),ze.valid&&I++}catch(nt){F.push({id:tt,success:!1,message:nt.message})}b({current:Fe+1,total:C.length,results:[...F]})}n("success",`Completed: ${I}/${C.length} valid`),t(),m(!1)},z=async C=>{S(I=>({...I,[C]:!0}));try{const F=await(await oe("/admin/accounts/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:C})})).json();n(F.success?"success":"error",`${C}: ${F.success?`Success (${F.response_time}ms)`:F.message}`),t()}catch(I){n("error","Test failed: "+I.message)}finally{S(I=>({...I,[C]:!1}))}},U=async()=>{if(!confirm("测试所有账号的 API 连通性?"))return;const C=e.accounts||[];if(C.length===0)return;R(!0),b({current:0,total:C.length,results:[]});let I=0;const F=[];for(let Fe=0;Fe<C.length;Fe++){const xt=C[Fe],tt=xt.email||xt.mobile;try{const ze=await(await oe("/admin/accounts/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:tt})})).json();F.push({id:tt,success:ze.success,message:ze.message,time:ze.response_time}),ze.success&&I++}catch(nt){F.push({id:tt,success:!1,message:nt.message})}b({current:Fe+1,total:C.length,results:[...F]})}n("success",`Completed: ${I}/${C.length} available`),t(),R(!1)};return a.jsxs("div",{className:"space-y-6",children:[O&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-card border border-border rounded-xl p-4 flex flex-col justify-between shadow-sm relative overflow-hidden group",children:[a.jsx("div",{className:"absolute right-0 top-0 p-4 opacity-5 group-hover:opacity-10 transition-opacity",children:a.jsx(Dl,{className:"w-16 h-16"})}),a.jsx("p",{className:"text-xs font-medium text-muteLine truncated
`);I=xt.pop()||"";for(const tt of xt){const nt=tt.trim();if(!nt||!nt.startsWith("data: "))continue;const ze=nt.slice(6);if(ze!=="[DONE]")try{const Rr=JSON.parse(ze);console.log("[ApiTester] Parsed JSON:",Rr);const Lr=(W=Rr.choices)==null?void 0:W[0];if(Lr!=null&&Lr.delta){const nn=Lr.delta;console.log("[ApiTester] Delta:",nn),nn.reasoning_content&&d(eo=>eo+nn.reasoning_content),nn.content&&(console.log("[ApiTester] Content:",nn.content),N(eo=>eo+nn.content))}}catch(Rr){console.error("Invalid JSON hunk:",ze,Rr)}}}}catch(xe){xe.name==="AbortError"?t("info","已停止生成"):(t("error","网络错误: "+xe.message),h({error:xe.message,success:!1}))}finally{x(!1),k(!1),S.current=null}}},At=async()=>{if(c){x(!0),h(null);try{const E=await O("/admin/accounts/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:c,model:r,message:o})}),z=await E.json();h({success:z.success,status_code:E.status,response:z,account:c}),z.success?t("success",`${c}: 测试成功 (${z.response_time}ms)`):t("error",`${c}: ${z.message}`)}catch(E){t("error","网络错误: "+E.message),h({error:E.message})}finally{x(!1)}return}Je()};return a.jsxs("div",{className:"flex flex-col lg:grid lg:grid-cols-12 gap-6 h-[calc(100vh-140px)]",children:[a.jsx("div",{className:ee("lg:col-span-3 flex flex-col transition-all duration-300 ease-in-out z-20",P?"h-auto":"h-14 lg:h-full"),children:a.jsxs("div",{className:"bg-card border border-border rounded-xl flex flex-col h-full shadow-sm",children:[a.jsxs("button",{onClick:()=>b(!P),className:"lg:hidden flex items-center justify-between p-4 w-full bg-muted/20 hover:bg-muted/30 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2.5 font-medium text-sm text-foreground",children:[a.jsx("div",{className:"p-1.5 rounded-md bg-transparent text-foreground",children:a.jsx($y,{className:"w-4 h-4"})}),a.jsx("span",{children:"配置"})]}),a.jsx("div",{className:ee("transition-transform duration-300 text-muted-foreground",P?"rotate-180":""),children:a.jsx(Ka,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:ee("p-4 space-y-6 overflow-y-auto custom-scrollbar flex-1",!P&&"hidden lg:block"),children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx("label",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider ml-0.5",children:"模型"}),a.jsx("div",{className:"grid grid-cols-1 gap-2",children:Xy.map(E=>{const z=E.icon;return a.jsxs("button",{onClick:()=>l(E.id),className:ee("group relative flex items-start gap-3 p-3 rounded-lg border text-left transition-all duration-200",r===E.id?"bg-secondary border-primary/50 shadow-sm":"bg-transparent border-transparent hover:bg-muted"),children:[a.jsx("div",{className:ee("p-1.5 rounded-md shrink-0 transition-colors",r===E.id?E.color:"text-muted-foreground group-hover:text-foreground"),children:a.jsx(z,{className:"w-4 h-4"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:ee("font-medium text-sm",r===E.id?"text-foreground":"text-foreground/80"),children:E.name}),a.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:E.desc})]}),r===E.id&&a.jsx("div",{className:ee("absolute top-3 right-3",E.color),children:a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-current"})})]},E.id)})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider ml-0.5",children:"账号策略"}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full h-10 pl-3 pr-8 bg-secondary border border-border rounded-lg text-sm appearance-none focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring transition-all cursor-pointer hover:bg-muted",value:c,onChange:E=>y(E.target.value),children:[a.jsx("option",{value:"",className:"bg-popover text-popover-foreground",children:"🎲 随机切换 (支持流式预览)"}),pe.map((E,z)=>a.jsxs("option",{value:E.email||E.mobile,className:"bg-popover text-popover-foreground",children:["👤 ",E.email||E.mobile]},z))]}),a.jsx(Ka,{className:"absolute right-2.5 top-3 w-4 h-4 text-muted-foreground pointer-events-none"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider ml-0.5",children:"API 密钥 (可选)"}),a.jsx("input",{type:"password",className:"w-full h-10 px-3 bg-muted/30 border border-border rounded-lg text-sm font-mono placeholder:text-muted-foreground/40 focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring transition-all",placeholder:(tn=e.keys)!=null&&tn[0]?`默认: ...${e.keys[0].slice(-6)}`:"输入自定义密钥",value:i,onChange:E=>u(E.target.value)})]})]})]})}),a.jsxs("div",{className:"lg:col-span-9 flex flex-col bg-card border border-border rounded-xl shadow-sm overflow-hidden min-h-0 flex-1 relative",children:[a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 lg:p-6 space-y-8 custom-scr Line truncated
"keys": ["your-api-key"],
"accounts": [
{"email": "...", "password": "...", "token": ""}
]
}`,spellCheck:!1})}),i&&a.jsx("div",{className:ee("p-4 border-t",i.imported_keys||i.imported_accounts?"bg-emerald-500/10 border-emerald-500/20":"bg-destructive/10 border-destructive/20"),children:a.jsxs("div",{className:"flex items-start gap-3",children:[i.imported_keys||i.imported_accounts?a.jsx(Il,{className:"w-5 h-5 text-emerald-500 mt-0.5"}):a.jsx(Uy,{className:"w-5 h-5 text-destructive mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:ee("font-medium",i.imported_keys||i.imported_accounts?"text-emerald-500":"text-destructive"),children:"导入操作已完成"}),a.jsxs("p",{className:"text-sm opacity-80 mt-1",children:["成功导入了 ",i.imported_keys," 个 API 密钥,并更新了 ",i.imported_accounts," 个账号。"]})]})]})})]})]})}function eg({onMessage:e,authFetch:t}){const[n,r]=g.useState(""),[l,o]=g.useState(""),[s,i]=g.useState(""),[u,c]=g.useState(!1),[y,p]=g.useState(null),[h,v]=g.useState(null),x=t||fetch;g.useEffect(()=>{(async()=>{try{const f=await x("/admin/vercel/config");if(f.ok){const d=await f.json();v(d),d.project_id&&o(d.project_id),d.team_id&&i(d.team_id)}}catch(f){console.error("Failed to load preconfig:",f)}})()},[]);const w=async()=>{const N=h!=null&&h.has_token&&!n?"__USE_PRECONFIG__":n;if(!N&&!(h!=null&&h.has_token)){e("error","需要 Vercel 访问令牌");return}if(!l){e("error","需要项目 ID");return}c(!0),p(null);try{const f=await x("/admin/vercel/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({vercel_token:N,project_id:l,team_id:s||void 0})}),d=await f.json();f.ok?(p({...d,success:!0}),e("success",d.message)):(p({...d,success:!1}),e("error",d.detail||"同步失败"))}catch{e("error","网络错误")}finally{c(!1)}};return a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 max-w-5xl mx-auto h-[calc(100vh-140px)]",children:[a.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-sm p-6 space-y-6",children:[a.jsxs("div",{className:"border-b border-border pb-6",children:[a.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[a.jsx(zd,{className:"w-6 h-6 text-primary"}),"Vercel 部署"]}),a.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"将当前密钥和账号配置直接同步到 Vercel 环境变量中。"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"text-sm font-medium flex items-center justify-between",children:["Vercel 访问令牌",a.jsxs("a",{href:"https://vercel.com/account/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline flex items-center gap-1",children:["获取令牌 ",a.jsx(Ja,{className:"w-3 h-3"})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"password",className:"w-full h-10 px-3 bg-background border border-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring transition-all pr-10",placeholder:h!=null&&h.has_token?"正在使用预配置的令牌":"输入 Vercel 访问令牌",value:n,onChange:N=>r(N.target.value)}),(h==null?void 0:h.has_token)&&!n&&a.jsx("div",{className:"absolute right-3 top-2.5 text-emerald-500",children:a.jsx(Dl,{className:"w-5 h-5"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium",children:"项目 ID"}),a.jsx("input",{type:"text",className:"w-full h-10 px-3 bg-background border border-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring transition-all",placeholder:"prj_xxxxxxxxxxxx or Project Name",value:l,onChange:N=>o(N.target.value)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"可在项目设置 (Project Settings) → 常规 (General) 中找到"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"text-sm font-medium flex items-center gap-2",children:["团队 ID ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"(可选)"})]}),a.jsx("input",{type:"text",className:"w-full h-10 px-3 bg-background border border-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring transition-all",placeholder:"team_xxxxxxxxxxxx",value:s,onChange:N=>i(N.target.value)})]})]}),a.jsxs("div",{className:"pt-4",children:[a.jsx("button",{onClick:w,disabled:u,className:"w-full flex items-center justify-center gap-2 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all font-medium text-sm shadow-sm hover:shadow-md disabled:opacity-50 disabled:shadow-none",children:u?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),"正在同步..."]}):a.jsxs("span",{className:"flex items-center gap-2",children:["同步并重新部署 ",a.jsx(Td,{className:"w-4 h-4"})]})}),a.jsx("p",{className:"text-xs text-center text-muted-foregrou Line truncated
-43
View File
@@ -1,43 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- SEO Meta Tags -->
<title>DS2API - DeepSeek API 管理面板</title>
<meta name="description" content="DS2API 管理面板 - 轻松管理 DeepSeek 账号、测试 API、同步 Vercel 配置" />
<meta name="keywords" content="DeepSeek, API, OpenAI, 管理面板, DS2API" />
<meta name="author" content="CJackHwang" />
<meta name="robots" content="noindex, nofollow" />
<!-- Open Graph / Social -->
<meta property="og:type" content="website" />
<meta property="og:title" content="DS2API - DeepSeek API 管理面板" />
<meta property="og:description" content="轻松管理 DeepSeek 账号、测试 API、同步 Vercel 配置" />
<meta property="og:site_name" content="DS2API" />
<!-- PWA / Mobile -->
<meta name="theme-color" content="#f59e0b" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="DS2API" />
<!-- Favicon - using data URI for orange-yellow gradient icon -->
<link rel="icon" type="image/svg+xml"
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23f59e0b'/%3E%3Cstop offset='100%25' stop-color='%23ef4444'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect rx='20' width='100' height='100' fill='url(%23g)'/%3E%3Ctext x='50' y='68' font-family='Arial,sans-serif' font-size='48' font-weight='bold' fill='white' text-anchor='middle'%3EDS%3C/text%3E%3C/svg%3E" />
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
<script type="module" crossorigin src="/admin/assets/index-cwfNH6yZ.js"></script>
<link rel="stylesheet" crossorigin href="/admin/assets/index-D9_KYhGM.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
+22 -7
View File
@@ -1,15 +1,30 @@
{
"version": 2,
"builds": [
"buildCommand": "bash scripts/build-webui.sh",
"rewrites": [
{
"src": "app.py",
"use": "@vercel/python"
"source": "/(.*)",
"destination": "/app.py"
}
],
"routes": [
"headers": [
{
"src": "/(.*)",
"dest": "app.py"
"source": "/admin/assets/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
},
{
"source": "/admin/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "no-store, must-revalidate"
}
]
}
]
}
}
+3 -78
View File
@@ -2,12 +2,8 @@ import { useState, useEffect } from 'react'
import {
Plus,
Trash2,
RefreshCw,
CheckCircle2,
AlertCircle,
Search,
Play,
MoreHorizontal,
X,
Server,
ShieldCheck,
@@ -23,8 +19,6 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch
const [copiedKey, setCopiedKey] = useState(null)
const [newAccount, setNewAccount] = useState({ email: '', mobile: '', password: '' })
const [loading, setLoading] = useState(false)
const [validating, setValidating] = useState({})
const [validatingAll, setValidatingAll] = useState(false)
const [testing, setTesting] = useState({})
const [testingAll, setTestingAll] = useState(false)
const [batchProgress, setBatchProgress] = useState({ current: 0, total: 0, results: [] })
@@ -133,60 +127,6 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch
}
}
const validateAccount = async (identifier) => {
setValidating(prev => ({ ...prev, [identifier]: true }))
try {
const res = await apiFetch('/admin/accounts/validate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ identifier }),
})
const data = await res.json()
onMessage(data.valid ? 'success' : 'error', `${identifier}: ${data.message}`)
onRefresh()
} catch (e) {
onMessage('error', 'Validation failed: ' + e.message)
} finally {
setValidating(prev => ({ ...prev, [identifier]: false }))
}
}
const validateAllAccounts = async () => {
if (!confirm('校验所有账号?这可能需要一些时间。')) return
const accounts = config.accounts || []
if (accounts.length === 0) return
setValidatingAll(true)
setBatchProgress({ current: 0, total: accounts.length, results: [] })
let validCount = 0
const results = []
for (let i = 0; i < accounts.length; i++) {
const acc = accounts[i]
const id = acc.email || acc.mobile
try {
const res = await apiFetch('/admin/accounts/validate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ identifier: id }),
})
const data = await res.json()
results.push({ id, success: data.valid, message: data.message })
if (data.valid) validCount++
} catch (e) {
results.push({ id, success: false, message: e.message })
}
setBatchProgress({ current: i + 1, total: accounts.length, results: [...results] })
}
onMessage('success', `Completed: ${validCount}/${accounts.length} valid`)
onRefresh()
setValidatingAll(false)
}
const testAccount = async (identifier) => {
setTesting(prev => ({ ...prev, [identifier]: true }))
try {
@@ -347,20 +287,12 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch
<div className="flex flex-wrap gap-2">
<button
onClick={testAllAccounts}
disabled={testingAll || validatingAll || !config.accounts?.length}
disabled={testingAll || !config.accounts?.length}
className="flex items-center px-3 py-2 bg-secondary text-secondary-foreground rounded-lg hover:bg-secondary/80 transition-colors text-xs font-medium border border-border disabled:opacity-50"
>
{testingAll ? <span className="animate-spin mr-2">⟳</span> : <Play className="w-3 h-3 mr-2" />}
测试全部
</button>
<button
onClick={validateAllAccounts}
disabled={validatingAll || testingAll || !config.accounts?.length}
className="flex items-center px-3 py-2 bg-secondary text-secondary-foreground rounded-lg hover:bg-secondary/80 transition-colors text-xs font-medium border border-border disabled:opacity-50"
>
{validatingAll ? <span className="animate-spin mr-2">⟳</span> : <CheckCircle2 className="w-3 h-3 mr-2" />}
校验全部
</button>
<button
onClick={() => setShowAddAccount(true)}
className="flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors font-medium text-sm shadow-sm"
@@ -372,10 +304,10 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch
</div>
{/* Batch Progress */}
{(testingAll || validatingAll) && batchProgress.total > 0 && (
{testingAll && batchProgress.total > 0 && (
<div className="p-4 border-b border-border bg-muted/30">
<div className="flex items-center justify-between text-sm mb-2">
<span className="font-medium">{testingAll ? '正在测试所有账号...' : '正在校验所有账号...'}</span>
<span className="font-medium">正在测试所有账号...</span>
<span className="text-muted-foreground">{batchProgress.current} / {batchProgress.total}</span>
</div>
<div className="w-full bg-muted rounded-full h-2 overflow-hidden mb-4">
@@ -430,13 +362,6 @@ export default function AccountManager({ config, onRefresh, onMessage, authFetch
>
{testing[id] ? '正在测试...' : '测试'}
</button>
<button
onClick={() => validateAccount(id)}
disabled={validating[id]}
className="px-2 lg:px-3 py-1 lg:py-1.5 text-[10px] lg:text-xs font-medium border border-border rounded-md hover:bg-secondary transition-colors disabled:opacity-50"
>
{validating[id] ? '正在校验...' : '校验'}
</button>
<button
onClick={() => deleteAccount(id)}
className="p-1 lg:p-1.5 text-muted-foreground hover:text-destructive hover:bg-destructive/10 rounded-md transition-colors"